sykpcomposer 0.0.36 → 0.0.38
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/dist/assets/icons/3-columns.svg +3 -0
- package/dist/assets/icons/LICENSE.md +5 -0
- package/dist/assets/icons/add-sign.svg +3 -0
- package/dist/assets/icons/arrow-clockwise.svg +1 -0
- package/dist/assets/icons/arrow-counterclockwise.svg +1 -0
- package/dist/assets/icons/bg-color.svg +1 -0
- package/dist/assets/icons/camera.svg +1 -0
- package/dist/assets/icons/card-checklist.svg +1 -0
- package/dist/assets/icons/caret-right-fill.svg +1 -0
- package/dist/assets/icons/chat-left-text.svg +1 -0
- package/dist/assets/icons/chat-right-dots.svg +1 -0
- package/dist/assets/icons/chat-right-text.svg +1 -0
- package/dist/assets/icons/chat-right.svg +1 -0
- package/dist/assets/icons/chat-square-quote.svg +1 -0
- package/dist/assets/icons/chevron-down.svg +1 -0
- package/dist/assets/icons/clipboard.svg +1 -0
- package/dist/assets/icons/close.svg +1 -0
- package/dist/assets/icons/code.svg +1 -0
- package/dist/assets/icons/comments.svg +1 -0
- package/dist/assets/icons/copy.svg +1 -0
- package/dist/assets/icons/diagram-2.svg +1 -0
- package/dist/assets/icons/download.svg +1 -0
- package/dist/assets/icons/draggable-block-menu.svg +1 -0
- package/dist/assets/icons/dropdown-more.svg +1 -0
- package/dist/assets/icons/figma.svg +1 -0
- package/dist/assets/icons/file-earmark-text.svg +4 -0
- package/dist/assets/icons/file-image.svg +1 -0
- package/dist/assets/icons/filetype-gif.svg +1 -0
- package/dist/assets/icons/font-color.svg +1 -0
- package/dist/assets/icons/font-family.svg +1 -0
- package/dist/assets/icons/gear.svg +1 -0
- package/dist/assets/icons/horizontal-rule.svg +1 -0
- package/dist/assets/icons/indent.svg +1 -0
- package/dist/assets/icons/journal-code.svg +1 -0
- package/dist/assets/icons/journal-text.svg +1 -0
- package/dist/assets/icons/justify.svg +1 -0
- package/dist/assets/icons/link.svg +1 -0
- package/dist/assets/icons/list-ol.svg +1 -0
- package/dist/assets/icons/list-ul.svg +1 -0
- package/dist/assets/icons/lock-fill.svg +1 -0
- package/dist/assets/icons/lock.svg +1 -0
- package/dist/assets/icons/markdown.svg +1 -0
- package/dist/assets/icons/mic.svg +1 -0
- package/dist/assets/icons/minus-sign.svg +3 -0
- package/dist/assets/icons/outdent.svg +1 -0
- package/dist/assets/icons/paint-bucket.svg +1 -0
- package/dist/assets/icons/palette.svg +1 -0
- package/dist/assets/icons/pencil-fill.svg +1 -0
- package/dist/assets/icons/plug-fill.svg +1 -0
- package/dist/assets/icons/plug.svg +1 -0
- package/dist/assets/icons/plus-slash-minus.svg +1 -0
- package/dist/assets/icons/plus.svg +1 -0
- package/dist/assets/icons/prettier-error.svg +1 -0
- package/dist/assets/icons/prettier.svg +1 -0
- package/dist/assets/icons/scissors.svg +3 -0
- package/dist/assets/icons/send.svg +1 -0
- package/dist/assets/icons/square-check.svg +1 -0
- package/dist/assets/icons/sticky.svg +1 -0
- package/dist/assets/icons/success-alt.svg +1 -0
- package/dist/assets/icons/success.svg +1 -0
- package/dist/assets/icons/table.svg +1 -0
- package/dist/assets/icons/text-center.svg +1 -0
- package/dist/assets/icons/text-left.svg +1 -0
- package/dist/assets/icons/text-paragraph.svg +1 -0
- package/dist/assets/icons/text-right.svg +1 -0
- package/dist/assets/icons/trash.svg +1 -0
- package/dist/assets/icons/trash3.svg +1 -0
- package/dist/assets/icons/tweet.svg +1 -0
- package/dist/assets/icons/type-bold.svg +1 -0
- package/dist/assets/icons/type-h1.svg +1 -0
- package/dist/assets/icons/type-h2.svg +1 -0
- package/dist/assets/icons/type-h3.svg +1 -0
- package/dist/assets/icons/type-h4.svg +1 -0
- package/dist/assets/icons/type-h5.svg +1 -0
- package/dist/assets/icons/type-h6.svg +1 -0
- package/dist/assets/icons/type-italic.svg +1 -0
- package/dist/assets/icons/type-strikethrough.svg +1 -0
- package/dist/assets/icons/type-subscript.svg +1 -0
- package/dist/assets/icons/type-superscript.svg +1 -0
- package/dist/assets/icons/type-underline.svg +1 -0
- package/dist/assets/icons/upload.svg +1 -0
- package/dist/assets/icons/user.svg +1 -0
- package/dist/assets/icons/youtube.svg +1 -0
- package/dist/index.es.js +3114 -3105
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +42 -42
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/Editor.d.ts +2 -1
- package/dist/src/components/plugins/fontSize.d.ts +3 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(function(bo,St){typeof exports=="object"&&typeof module<"u"?St(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],St):(bo=typeof globalThis<"u"?globalThis:bo||self,St(bo.ViteButton={},bo.React,bo.ReactDOM))})(this,function(bo,St,oo){"use strict";var
|
|
1
|
+
(function(bo,St){typeof exports=="object"&&typeof module<"u"?St(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],St):(bo=typeof globalThis<"u"?globalThis:bo||self,St(bo.ViteButton={},bo.React,bo.ReactDOM))})(this,function(bo,St,oo){"use strict";var YF=Object.defineProperty;var XF=(bo,St,oo)=>St in bo?YF(bo,St,{enumerable:!0,configurable:!0,writable:!0,value:oo}):bo[St]=oo;var kf=(bo,St,oo)=>(XF(bo,typeof St!="symbol"?St+"":St,oo),oo);function __(c){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const n in c)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(c,n);Object.defineProperty(t,n,e.get?e:{enumerable:!0,get:()=>c[n]})}}return t.default=c,Object.freeze(t)}const gn=__(St),wN=__(oo);function SN(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}function CN(c){if(c.__esModule)return c;var t=c.default;if(typeof t=="function"){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(c).forEach(function(e){var s=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(n,e,s.get?s:{enumerable:!0,get:function(){return c[e]}})}),n}var om={exports:{}},Rl={};/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|
|
5
|
-
*/var im,
|
|
5
|
+
*/var im,x_;function w_(){if(x_)return im;x_=1;var c=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function e(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function s(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var u=Object.getOwnPropertyNames(o).map(function(f){return o[f]});if(u.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(f){a[f]=f}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return im=s()?Object.assign:function(r,o){for(var i,u=e(r),a,f=1;f<arguments.length;f++){i=Object(arguments[f]);for(var l in i)t.call(i,l)&&(u[l]=i[l]);if(c){a=c(i);for(var d=0;d<a.length;d++)n.call(i,a[d])&&(u[a[d]]=i[a[d]])}}return u},im}/** @license React v17.0.2
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/var
|
|
12
|
+
*/var S_;function EN(){if(S_)return Rl;S_=1,w_();var c=St,t=60103;if(Rl.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var n=Symbol.for;t=n("react.element"),Rl.Fragment=n("react.fragment")}var e=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,r={key:!0,ref:!0,__self:!0,__source:!0};function o(i,u,a){var f,l={},d=null,p=null;a!==void 0&&(d=""+a),u.key!==void 0&&(d=""+u.key),u.ref!==void 0&&(p=u.ref);for(f in u)s.call(u,f)&&!r.hasOwnProperty(f)&&(l[f]=u[f]);if(i&&i.defaultProps)for(f in u=i.defaultProps,u)l[f]===void 0&&(l[f]=u[f]);return{$$typeof:t,type:i,key:d,ref:p,props:l,_owner:e.current}}return Rl.jsx=o,Rl.jsxs=o,Rl}var sm={};/** @license React v17.0.2
|
|
13
13
|
* react-jsx-runtime.development.js
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var
|
|
19
|
+
*/var C_;function ON(){return C_||(C_=1,function(c){process.env.NODE_ENV!=="production"&&function(){var t=St,n=w_(),e=60103,s=60106;c.Fragment=60107;var r=60108,o=60114,i=60109,u=60110,a=60112,f=60113,l=60120,d=60115,p=60116,h=60121,m=60122,g=60117,y=60129,b=60131;if(typeof Symbol=="function"&&Symbol.for){var v=Symbol.for;e=v("react.element"),s=v("react.portal"),c.Fragment=v("react.fragment"),r=v("react.strict_mode"),o=v("react.profiler"),i=v("react.provider"),u=v("react.context"),a=v("react.forward_ref"),f=v("react.suspense"),l=v("react.suspense_list"),d=v("react.memo"),p=v("react.lazy"),h=v("react.block"),m=v("react.server.block"),g=v("react.fundamental"),v("react.scope"),v("react.opaque.id"),y=v("react.debug_trace_mode"),v("react.offscreen"),b=v("react.legacy_hidden")}var _=typeof Symbol=="function"&&Symbol.iterator,w="@@iterator";function x(Ne){if(Ne===null||typeof Ne!="object")return null;var lt=_&&Ne[_]||Ne[w];return typeof lt=="function"?lt:null}var S=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(Ne){{for(var lt=arguments.length,pt=new Array(lt>1?lt-1:0),wt=1;wt<lt;wt++)pt[wt-1]=arguments[wt];O("error",Ne,pt)}}function O(Ne,lt,pt){{var wt=S.ReactDebugCurrentFrame,Nt=wt.getStackAddendum();Nt!==""&&(lt+="%s",pt=pt.concat([Nt]));var Re=pt.map(function(ze){return""+ze});Re.unshift("Warning: "+lt),Function.prototype.apply.call(console[Ne],console,Re)}}var j=!1;function A(Ne){return!!(typeof Ne=="string"||typeof Ne=="function"||Ne===c.Fragment||Ne===o||Ne===y||Ne===r||Ne===f||Ne===l||Ne===b||j||typeof Ne=="object"&&Ne!==null&&(Ne.$$typeof===p||Ne.$$typeof===d||Ne.$$typeof===i||Ne.$$typeof===u||Ne.$$typeof===a||Ne.$$typeof===g||Ne.$$typeof===h||Ne[0]===m))}function T(Ne,lt,pt){var wt=lt.displayName||lt.name||"";return Ne.displayName||(wt!==""?pt+"("+wt+")":pt)}function I(Ne){return Ne.displayName||"Context"}function k(Ne){if(Ne==null)return null;if(typeof Ne.tag=="number"&&E("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof Ne=="function")return Ne.displayName||Ne.name||null;if(typeof Ne=="string")return Ne;switch(Ne){case c.Fragment:return"Fragment";case s:return"Portal";case o:return"Profiler";case r:return"StrictMode";case f:return"Suspense";case l:return"SuspenseList"}if(typeof Ne=="object")switch(Ne.$$typeof){case u:var lt=Ne;return I(lt)+".Consumer";case i:var pt=Ne;return I(pt._context)+".Provider";case a:return T(Ne,Ne.render,"ForwardRef");case d:return k(Ne.type);case h:return k(Ne._render);case p:{var wt=Ne,Nt=wt._payload,Re=wt._init;try{return k(Re(Nt))}catch{return null}}}return null}var $=0,H,U,D,W,J,M,z;function V(){}V.__reactDisabledLog=!0;function G(){{if($===0){H=console.log,U=console.info,D=console.warn,W=console.error,J=console.group,M=console.groupCollapsed,z=console.groupEnd;var Ne={configurable:!0,enumerable:!0,value:V,writable:!0};Object.defineProperties(console,{info:Ne,log:Ne,warn:Ne,error:Ne,group:Ne,groupCollapsed:Ne,groupEnd:Ne})}$++}}function F(){{if($--,$===0){var Ne={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:n({},Ne,{value:H}),info:n({},Ne,{value:U}),warn:n({},Ne,{value:D}),error:n({},Ne,{value:W}),group:n({},Ne,{value:J}),groupCollapsed:n({},Ne,{value:M}),groupEnd:n({},Ne,{value:z})})}$<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=S.ReactCurrentDispatcher,N;function R(Ne,lt,pt){{if(N===void 0)try{throw Error()}catch(Nt){var wt=Nt.stack.trim().match(/\n( *(at )?)/);N=wt&&wt[1]||""}return`
|
|
20
20
|
`+N+Ne}}var L=!1,B;{var Y=typeof WeakMap=="function"?WeakMap:Map;B=new Y}function X(Ne,lt){if(!Ne||L)return"";{var pt=B.get(Ne);if(pt!==void 0)return pt}var wt;L=!0;var Nt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Re;Re=K.current,K.current=null,G();try{if(lt){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(kt){wt=kt}Reflect.construct(Ne,[],ze)}else{try{ze.call()}catch(kt){wt=kt}Ne.call(ze.prototype)}}else{try{throw Error()}catch(kt){wt=kt}Ne()}}catch(kt){if(kt&&wt&&typeof kt.stack=="string"){for(var ct=kt.stack.split(`
|
|
21
21
|
`),be=wt.stack.split(`
|
|
22
22
|
`),fe=ct.length-1,xe=be.length-1;fe>=1&&xe>=0&&ct[fe]!==be[xe];)xe--;for(;fe>=1&&xe>=0;fe--,xe--)if(ct[fe]!==be[xe]){if(fe!==1||xe!==1)do if(fe--,xe--,xe<0||ct[fe]!==be[xe]){var Be=`
|
|
@@ -26,37 +26,37 @@ Check the render method of \``+Ne+"`."}return""}}function Ze(Ne){{if(Ne!==void 0
|
|
|
26
26
|
|
|
27
27
|
Check your code at `+lt+":"+pt+"."}return""}}var _t={};function Oe(Ne){{var lt=Qe();if(!lt){var pt=typeof Ne=="string"?Ne:Ne.displayName||Ne.name;pt&&(lt=`
|
|
28
28
|
|
|
29
|
-
Check the top-level render call using <`+pt+">.")}return lt}}function tt(Ne,lt){{if(!Ne._store||Ne._store.validated||Ne.key!=null)return;Ne._store.validated=!0;var pt=Oe(lt);if(_t[pt])return;_t[pt]=!0;var wt="";Ne&&Ne._owner&&Ne._owner!==Pe.current&&(wt=" It was passed a child from "+k(Ne._owner.type)+"."),de(Ne),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',pt,wt),de(null)}}function gt(Ne,lt){{if(typeof Ne!="object")return;if(Array.isArray(Ne))for(var pt=0;pt<Ne.length;pt++){var wt=Ne[pt];We(wt)&&tt(wt,lt)}else if(We(Ne))Ne._store&&(Ne._store.validated=!0);else if(Ne){var Nt=x(Ne);if(typeof Nt=="function"&&Nt!==Ne.entries)for(var Re=Nt.call(Ne),ze;!(ze=Re.next()).done;)We(ze.value)&&tt(ze.value,lt)}}}function $t(Ne){{var lt=Ne.type;if(lt==null||typeof lt=="string")return;var pt;if(typeof lt=="function")pt=lt.propTypes;else if(typeof lt=="object"&&(lt.$$typeof===a||lt.$$typeof===d))pt=lt.propTypes;else return;if(pt){var wt=k(lt);ce(pt,Ne.props,"prop",wt,Ne)}else if(lt.PropTypes!==void 0&&!Fe){Fe=!0;var Nt=k(lt);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Nt||"Unknown")}typeof lt.getDefaultProps=="function"&&!lt.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ut(Ne){{for(var lt=Object.keys(Ne.props),pt=0;pt<lt.length;pt++){var wt=lt[pt];if(wt!=="children"&&wt!=="key"){de(Ne),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",wt),de(null);break}}Ne.ref!==null&&(de(Ne),E("Invalid attribute `ref` supplied to `React.Fragment`."),de(null))}}function Jt(Ne,lt,pt,wt,Nt,Re){{var ze=A(Ne);if(!ze){var ct="";(Ne===void 0||typeof Ne=="object"&&Ne!==null&&Object.keys(Ne).length===0)&&(ct+=" 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 be=Ze(Nt);be?ct+=be:ct+=Qe();var fe;Ne===null?fe="null":Array.isArray(Ne)?fe="array":Ne!==void 0&&Ne.$$typeof===e?(fe="<"+(k(Ne.type)||"Unknown")+" />",ct=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof Ne,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,ct)}var xe=Ce(Ne,lt,pt,Nt,Re);if(xe==null)return xe;if(ze){var Be=lt.children;if(Be!==void 0)if(wt)if(Array.isArray(Be)){for(var dt=0;dt<Be.length;dt++)gt(Be[dt],Ne);Object.freeze&&Object.freeze(Be)}else E("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 gt(Be,Ne)}return Ne===c.Fragment?Ut(xe):$t(xe),xe}}function Ht(Ne,lt,pt){return Jt(Ne,lt,pt,!0)}function jt(Ne,lt,pt){return Jt(Ne,lt,pt,!1)}var qt=jt,Tn=Ht;c.jsx=qt,c.jsxs=Tn}()}(sm)),sm}process.env.NODE_ENV==="production"?om.exports=
|
|
29
|
+
Check the top-level render call using <`+pt+">.")}return lt}}function tt(Ne,lt){{if(!Ne._store||Ne._store.validated||Ne.key!=null)return;Ne._store.validated=!0;var pt=Oe(lt);if(_t[pt])return;_t[pt]=!0;var wt="";Ne&&Ne._owner&&Ne._owner!==Pe.current&&(wt=" It was passed a child from "+k(Ne._owner.type)+"."),de(Ne),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',pt,wt),de(null)}}function gt(Ne,lt){{if(typeof Ne!="object")return;if(Array.isArray(Ne))for(var pt=0;pt<Ne.length;pt++){var wt=Ne[pt];We(wt)&&tt(wt,lt)}else if(We(Ne))Ne._store&&(Ne._store.validated=!0);else if(Ne){var Nt=x(Ne);if(typeof Nt=="function"&&Nt!==Ne.entries)for(var Re=Nt.call(Ne),ze;!(ze=Re.next()).done;)We(ze.value)&&tt(ze.value,lt)}}}function $t(Ne){{var lt=Ne.type;if(lt==null||typeof lt=="string")return;var pt;if(typeof lt=="function")pt=lt.propTypes;else if(typeof lt=="object"&&(lt.$$typeof===a||lt.$$typeof===d))pt=lt.propTypes;else return;if(pt){var wt=k(lt);ce(pt,Ne.props,"prop",wt,Ne)}else if(lt.PropTypes!==void 0&&!Fe){Fe=!0;var Nt=k(lt);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Nt||"Unknown")}typeof lt.getDefaultProps=="function"&&!lt.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ut(Ne){{for(var lt=Object.keys(Ne.props),pt=0;pt<lt.length;pt++){var wt=lt[pt];if(wt!=="children"&&wt!=="key"){de(Ne),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",wt),de(null);break}}Ne.ref!==null&&(de(Ne),E("Invalid attribute `ref` supplied to `React.Fragment`."),de(null))}}function Jt(Ne,lt,pt,wt,Nt,Re){{var ze=A(Ne);if(!ze){var ct="";(Ne===void 0||typeof Ne=="object"&&Ne!==null&&Object.keys(Ne).length===0)&&(ct+=" 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 be=Ze(Nt);be?ct+=be:ct+=Qe();var fe;Ne===null?fe="null":Array.isArray(Ne)?fe="array":Ne!==void 0&&Ne.$$typeof===e?(fe="<"+(k(Ne.type)||"Unknown")+" />",ct=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof Ne,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,ct)}var xe=Ce(Ne,lt,pt,Nt,Re);if(xe==null)return xe;if(ze){var Be=lt.children;if(Be!==void 0)if(wt)if(Array.isArray(Be)){for(var dt=0;dt<Be.length;dt++)gt(Be[dt],Ne);Object.freeze&&Object.freeze(Be)}else E("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 gt(Be,Ne)}return Ne===c.Fragment?Ut(xe):$t(xe),xe}}function Ht(Ne,lt,pt){return Jt(Ne,lt,pt,!0)}function jt(Ne,lt,pt){return Jt(Ne,lt,pt,!1)}var qt=jt,Tn=Ht;c.jsx=qt,c.jsxs=Tn}()}(sm)),sm}process.env.NODE_ENV==="production"?om.exports=EN():om.exports=ON();var mn=om.exports;function bn(c){return{type:c}}const Af=bn("SELECTION_CHANGE_COMMAND"),TN=bn("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),E_=bn("CLICK_COMMAND"),Su=bn("DELETE_CHARACTER_COMMAND"),Cu=bn("INSERT_LINE_BREAK_COMMAND"),am=bn("INSERT_PARAGRAPH_COMMAND"),jl=bn("CONTROLLED_TEXT_INSERTION_COMMAND"),lm=bn("PASTE_COMMAND"),cm=bn("REMOVE_TEXT_COMMAND"),Eu=bn("DELETE_WORD_COMMAND"),Ou=bn("DELETE_LINE_COMMAND"),Ns=bn("FORMAT_TEXT_COMMAND"),um=bn("UNDO_COMMAND"),dm=bn("REDO_COMMAND"),O_=bn("KEYDOWN_COMMAND"),T_=bn("KEY_ARROW_RIGHT_COMMAND"),N_=bn("MOVE_TO_END"),k_=bn("KEY_ARROW_LEFT_COMMAND"),A_=bn("MOVE_TO_START"),P_=bn("KEY_ARROW_UP_COMMAND"),M_=bn("KEY_ARROW_DOWN_COMMAND"),Pf=bn("KEY_ENTER_COMMAND"),I_=bn("KEY_SPACE_COMMAND"),R_=bn("KEY_BACKSPACE_COMMAND"),j_=bn("KEY_ESCAPE_COMMAND"),D_=bn("KEY_DELETE_COMMAND"),L_=bn("KEY_TAB_COMMAND"),NN=bn("INSERT_TAB_COMMAND"),kN=bn("INDENT_CONTENT_COMMAND"),AN=bn("OUTDENT_CONTENT_COMMAND"),B_=bn("DROP_COMMAND"),PN=bn("FORMAT_ELEMENT_COMMAND"),F_=bn("DRAGSTART_COMMAND"),$_=bn("DRAGOVER_COMMAND"),z_=bn("DRAGEND_COMMAND"),fm=bn("COPY_COMMAND"),pm=bn("CUT_COMMAND"),hm=bn("SELECT_ALL_COMMAND"),MN=bn("CLEAR_EDITOR_COMMAND"),IN=bn("CLEAR_HISTORY_COMMAND"),RN=bn("CAN_REDO_COMMAND"),jN=bn("CAN_UNDO_COMMAND"),U_=bn("FOCUS_COMMAND"),H_=bn("BLUR_COMMAND"),K_=bn("KEY_MODIFIER_COMMAND"),ti=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DN=ti&&"documentMode"in document?document.documentMode:null,ni=ti&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ks=ti&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Mf=ti&&"InputEvent"in window&&!DN?"getTargetRanges"in new window.InputEvent("input"):!1,gm=ti&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),If=ti&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,LN=ti&&/Android/.test(navigator.userAgent),W_=ti&&/^(?=.*Chrome).*/i.test(navigator.userAgent),BN=ti&&LN&&W_,mm=ti&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!W_,Tu=1,As=3,ja=0,q_=1,Dl=2,J_=0,ym=1,bm=2,vm=1,_m=2,Rf=4,jf=8,xm=16,wm=32,Sm=64,Cm=128,FN=vm|_m|Rf|jf|xm|wm|Sm|Cm,Em=1,Df=2,Om=1,Tm=2,Nm=3,km=4,Am=5,Pm=6,V_=" ",Lf=gm||If||mm?V_:"",Gi=`
|
|
30
30
|
|
|
31
|
-
`,zN=ks?G_:Lf,Y_="֑-߿יִ-﷽ﹰ-ﻼ",X_="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",UN=new RegExp("^[^"+X_+"]*["+Y_+"]"),HN=new RegExp("^[^"+Y_+"]*["+X_+"]"),Ps={bold:vm,code:xm,highlight:Cm,italic:_m,strikethrough:Rf,subscript:wm,superscript:Sm,underline:jf},KN={directionless:Em,unmergeable:Df},Z_={center:Tm,end:Pm,justify:km,left:Om,right:Nm,start:Am},WN={[Tm]:"center",[Pm]:"end",[km]:"justify",[Om]:"left",[Nm]:"right",[Am]:"start"},qN={normal:V_,segmented:bm,token:ym},JN={[V_]:"normal",[bm]:"segmented",[ym]:"token"};function Bf(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const VN=100;let Mm=!1,Im=0;function GN(){return Mm}function YN(c){Im=c.timeStamp}function XN(c){Im===0&&Wf(c).addEventListener("textInput",YN,!0)}function Rm(c,t,n){return t.__lexicalLineBreak===c||c[`__lexicalKey_${n._key}`]!==void 0}function ZN(c){return c.getEditorState().read(()=>{const t=Jn();return t!==null?t.clone():null})}function QN(c,t,n){const e=_i(n._window);let s=null,r=null;e!==null&&e.anchorNode===c&&(s=e.anchorOffset,r=e.focusOffset);const o=c.nodeValue;o!==null&&zm(t,o,s,r,!1)}function ek(c,t,n){if(vn(c)){const e=c.anchor.getNode();if(e.is(n)&&c.format!==e.getFormat())return!1}return t.nodeType===As&&n.isAttached()}function Q_(c,t,n){Mm=!0;const e=performance.now()-Im>VN;try{ko(c,()=>{const s=Jn()||ZN(c),r=new Map,o=c.getRootElement(),i=c._editorState,u=c._blockCursorElement;let a=!1,f="";for(let d=0;d<t.length;d++){const p=t[d],h=p.type,m=p.target;let g=ku(m,i);if(!(g===null&&m!==o||dr(g))){if(h==="characterData")e&&rn(g)&&ek(s,m,g)&&QN(m,g,c);else if(h==="childList"){a=!0;const y=p.addedNodes;for(let _=0;_<y.length;_++){const w=y[_],x=l1(w),S=w.parentNode;if(S!=null&&w!==u&&x===null&&(w.nodeName!=="BR"||!Rm(w,S,c))){if(ks){const E=w.innerText||w.nodeValue;E&&(f+=E)}S.removeChild(w)}}const b=p.removedNodes,v=b.length;if(v>0){let _=0;for(let w=0;w<v;w++){const x=b[w];(x.nodeName==="BR"&&Rm(x,m,c)||u===x)&&(m.appendChild(x),_++)}v!==_&&(m===o&&(g=d1(i)),r.set(m,g))}}}}if(r.size>0)for(const[d,p]of r)if(At(p)){const h=p.getChildrenKeys();let m=d.firstChild;for(let g=0;g<h.length;g++){const y=h[g],b=c.getElementByKey(y);b!==null&&(m==null?(d.appendChild(b),m=b):m!==b&&d.replaceChild(b,m),m=m.nextSibling)}}else rn(p)&&p.markDirty();const l=n.takeRecords();if(l.length>0){for(let d=0;d<l.length;d++){const p=l[d],h=p.addedNodes,m=p.target;for(let g=0;g<h.length;g++){const y=h[g],b=y.parentNode;b!=null&&y.nodeName==="BR"&&!Rm(y,m,c)&&b.removeChild(y)}}n.takeRecords()}s!==null&&(a&&(s.dirty=!0,vi(s)),ks&&x1(c)&&s.insertRawText(f))})}finally{Mm=!1}}function e1(c){const t=c._observer;if(t!==null){const n=t.takeRecords();Q_(c,n,t)}}function t1(c){XN(c),c._observer=new MutationObserver((t,n)=>{Q_(c,t,n)})}function n1(c,t){const n=c.__mode,e=c.__format,s=c.__style,r=t.__mode,o=t.__format,i=t.__style;return(n===null||n===r)&&(e===null||e===o)&&(s===null||s===i)}function r1(c,t){const n=c.mergeWithSibling(t),e=Xn()._normalizedNodes;return e.add(c.__key),e.add(t.__key),n}function o1(c){let t=c;if(t.__text===""&&t.isSimpleText()&&!t.isUnmergeable()){t.remove();return}let n;for(;(n=t.getPreviousSibling())!==null&&rn(n)&&n.isSimpleText()&&!n.isUnmergeable();)if(n.__text==="")n.remove();else if(n1(n,t)){t=r1(n,t);break}else break;let e;for(;(e=t.getNextSibling())!==null&&rn(e)&&e.isSimpleText()&&!e.isUnmergeable();)if(e.__text==="")e.remove();else if(n1(t,e)){t=r1(t,e);break}else break}function i1(c){return s1(c.anchor),s1(c.focus),c}function s1(c){for(;c.type==="element";){const t=c.getNode(),n=c.offset;let e,s;if(n===t.getChildrenSize()?(e=t.getChildAtIndex(n-1),s=!0):(e=t.getChildAtIndex(n),s=!1),rn(e)){c.set(e.__key,s?e.getTextContentSize():0,"text");break}else if(!At(e))break;c.set(e.__key,s?e.getChildrenSize():0,"element")}}let tk=1;function nk(){return""+tk++}function rk(c,t){const n=c._nodes.get(t);if(n===void 0)throw Error(`registeredNode: Type ${t} not found`);return n}const ok=typeof queueMicrotask=="function"?queueMicrotask:c=>{Promise.resolve().then(c)};function ik(c){return dr(ku(c))}function jm(c){const t=document.activeElement;if(t===null)return!1;const n=t.nodeName;return dr(ku(c))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&t.__lexicalEditor==null)}function Nu(c,t,n){const e=c.getRootElement();try{return e!==null&&e.contains(t)&&e.contains(n)&&t!==null&&!jm(t)&&Dm(t)===c}catch{return!1}}function Dm(c){let t=c;for(;t!=null;){const n=t.__lexicalEditor;if(n!=null)return n;t=Hf(t)}return null}function sk(c){return UN.test(c)?"rtl":HN.test(c)?"ltr":null}function Lm(c){return c.isToken()||c.isSegmented()}function ak(c){return c.nodeType===As}function Ff(c){let t=c;for(;t!=null;){if(ak(t))return t;t=t.firstChild}return null}function Bm(c,t,n){const e=Ps[t];if(n!==null&&(c&e)===(n&e))return c;let s=c^e;return t==="subscript"?s&=~Ps.superscript:t==="superscript"&&(s&=~Ps.subscript),s}function lk(c){return rn(c)||Fa(c)||dr(c)}function a1(c,t){if(t!=null){c.__key=t;return}Jr(),lx();const n=Xn(),e=xi(),s=nk();e._nodeMap.set(s,c),At(c)?n._dirtyElements.set(s,!0):n._dirtyLeaves.add(s),n._cloneNotNeeded.add(s),n._dirtyType=J_,c.__key=s}function ck(c,t,n){let e=c;for(;e!==null;){if(n.has(e))return;const s=t.get(e);if(s===void 0)break;n.set(e,!1),e=s.__parent}}function Da(c){const t=c.getParent();if(t!==null){const n=c.getWritable(),e=t.getWritable(),s=c.getPreviousSibling(),r=c.getNextSibling();if(s===null)if(r!==null){const o=r.getWritable();e.__first=r.__key,o.__prev=null}else e.__first=null;else{const o=s.getWritable();if(r!==null){const i=r.getWritable();i.__prev=o.__key,o.__next=i.__key}else o.__next=null;n.__prev=null}if(r===null)if(s!==null){const o=s.getWritable();e.__last=s.__key,o.__next=null}else e.__last=null;else{const o=r.getWritable();if(s!==null){const i=s.getWritable();i.__next=o.__key,o.__prev=i.__key}else o.__prev=null;n.__next=null}e.__size--,n.__parent=null}}function $f(c){lx();const t=c.getLatest(),n=t.__parent,e=xi(),s=Xn(),r=e._nodeMap,o=s._dirtyElements;n!==null&&ck(n,r,o);const i=t.__key;s._dirtyType=J_,At(c)?o.set(i,!0):s._dirtyLeaves.add(i)}function uk(c){const t=c.getPreviousSibling(),n=c.getNextSibling();t!==null&&$f(t),n!==null&&$f(n)}function Mr(c){Jr();const t=Xn(),n=t._compositionKey;if(c!==n){if(t._compositionKey=c,n!==null){const e=qr(n);e!==null&&e.getWritable()}if(c!==null){const e=qr(c);e!==null&&e.getWritable()}}}function Ms(){return Kl()?null:Xn()._compositionKey}function qr(c,t){const e=(t||xi())._nodeMap.get(c);return e===void 0?null:e}function l1(c,t){const n=Xn(),e=c[`__lexicalKey_${n._key}`];return e!==void 0?qr(e,t):null}function ku(c,t){let n=c;for(;n!=null;){const e=l1(n,t);if(e!==null)return e;n=Hf(n)}return null}function c1(c){const t=c._decorators,n=Object.assign({},t);return c._pendingDecorators=n,n}function u1(c){return c.read(()=>No().getTextContent())}function dk(c,t){ko(c,()=>{const n=xi();if(n.isEmpty())return;if(t==="root"){No().markDirty();return}const e=n._nodeMap;for(const[,s]of e)s.markDirty()},c._pendingEditorState===null?{tag:"history-merge"}:void 0)}function No(){return d1(xi())}function d1(c){return c._nodeMap.get("root")}function vi(c){Jr();const t=xi();if(c!==null){if(Object.isFrozen(c))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");c.dirty=!0,c.setCachedNodes(null)}t._selection=c}function fk(){Jr();const c=Xn();e1(c)}function Ll(c){const t=Xn(),n=pk(c,t);if(n===null){const e=t.getRootElement();return c===e?qr("root"):null}return qr(n)}function f1(c,t){return t?c.getTextContentSize():0}function pk(c,t){let n=c;for(;n!=null;){const e=n[`__lexicalKey_${t._key}`];if(e!==void 0)return e;n=Hf(n)}return null}function p1(c){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(c)}function Fm(c){const t=[];let n=c;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function h1(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function g1(c){return c.nodeType===As?c.nodeValue:null}function $m(c,t,n){const e=_i(t._window);if(e===null)return;const s=e.anchorNode;let{anchorOffset:r,focusOffset:o}=e;if(s!==null){let i=g1(s);const u=ku(s);if(i!==null&&rn(u)){if(i===Lf&&n){const a=n.length;i=n,r=a,o=a}i!==null&&zm(u,i,r,o,c)}}}function zm(c,t,n,e,s){let r=c;if(r.isAttached()&&(s||!r.isDirty())){const o=r.isComposing();let i=t;(o||s)&&t[t.length-1]===Lf&&(i=t.slice(0,-1));const u=r.getTextContent();if(s||i!==u){if(i===""){if(Mr(null),!gm&&!If&&!mm){const m=Xn();setTimeout(()=>{m.update(()=>{r.isAttached()&&r.remove()})},20)}else r.remove();return}const a=r.getParent(),f=Hl(),l=r.getTextContentSize(),d=Ms(),p=r.getKey();if(r.isToken()||d!==null&&p===d&&!o||vn(f)&&(a!==null&&!a.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===c.__key&&f.anchor.offset===0&&!r.canInsertTextBefore()&&!o||f.focus.key===c.__key&&f.focus.offset===l&&!r.canInsertTextAfter()&&!o)){r.markDirty();return}const h=Jn();if(!vn(h)||n===null||e===null){r.setTextContent(i);return}if(h.setTextNodeRange(r,n,r,e),r.isSegmented()){const m=r.getTextContent(),g=$r(m);r.replace(g),r=g}r.setTextContent(i)}}}function hk(c){const t=c.getPreviousSibling();return(rn(t)||At(t)&&t.isInline())&&!t.canInsertTextAfter()}function gk(c,t){if(t.isSegmented())return!0;if(!c.isCollapsed())return!1;const n=c.anchor.offset,e=t.getParentOrThrow(),s=t.isToken();return n===0?!t.canInsertTextBefore()||!e.canInsertTextBefore()||s||hk(t):n===t.getTextContentSize()?!t.canInsertTextAfter()||!e.canInsertTextAfter()||s:!1}function mk(c,t,n,e){return c===9&&!t&&!n&&!e}function yk(c,t,n,e){return c===66&&!t&&Au(n,e)}function bk(c,t,n,e){return c===73&&!t&&Au(n,e)}function vk(c,t,n,e){return c===85&&!t&&Au(n,e)}function _k(c,t){return b1(c)&&!t}function xk(c,t){return b1(c)&&t}function wk(c,t){return ni&&t&&c===79}function Sk(c,t,n){return Pu(c)&&(ni?t:n)}function Ck(c,t,n){return Mu(c)&&(ni?t:n)}function Ek(c,t){return ni&&t&&Pu(c)}function Ok(c,t){return ni&&t&&Mu(c)}function Tk(c,t,n,e){return ni?t||n?!1:Pu(c)||c===72&&e:e||t||n?!1:Pu(c)}function Nk(c,t,n,e,s){return ni?n||e||s?!1:Mu(c)||c===68&&t:t||e||s?!1:Mu(c)}function kk(c,t,n,e){return c===90&&!t&&Au(n,e)}function Ak(c,t,n,e){return ni?c===90&&n&&t:c===89&&e||c===90&&e&&t}function Pk(c,t,n,e){return t?!1:c===67?ni?n:e:!1}function Mk(c,t,n,e){return t?!1:c===88?ni?n:e:!1}function m1(c){return c===37}function y1(c){return c===39}function Ik(c){return c===38}function Rk(c){return c===40}function jk(c,t,n,e){return m1(c)&&!t&&!e&&!n}function Dk(c,t,n,e,s){return m1(c)&&!e&&!n&&(t||s)}function Lk(c,t,n,e){return y1(c)&&!t&&!e&&!n}function Bk(c,t,n,e,s){return y1(c)&&!e&&!n&&(t||s)}function Fk(c,t,n){return Ik(c)&&!t&&!n}function $k(c,t,n){return Rk(c)&&!t&&!n}function zk(c,t,n,e){return c||t||n||e}function Uk(c){return c===32}function Au(c,t){return ni?c:t}function b1(c){return c===13}function Pu(c){return c===8}function Hk(c){return c===27}function Mu(c){return c===46}function v1(c,t,n){return c===65&&Au(t,n)}function Kk(){const c=No(),t=c.select(0,c.getChildrenSize());vi(i1(t))}function Iu(c,t){c.__lexicalClassNameCache===void 0&&(c.__lexicalClassNameCache={});const n=c.__lexicalClassNameCache,e=n[t];if(e!==void 0)return e;const s=c[t];if(typeof s=="string"){const r=Bf(s);return n[t]=r,r}return s}function Um(c,t,n,e,s){if(n.size===0)return;const r=e.__type,o=e.__key,i=t.get(r);if(i===void 0)throw Error(`Type ${r} not in registeredNodes`);const u=i.klass;let a=c.get(u);a===void 0&&(a=new Map,c.set(u,a));const f=a.get(o),l=f==="destroyed"&&s==="created";(f===void 0||l)&&a.set(o,l?"updated":s)}function Wk(c){const t=xi(),n=t._readOnly,e=c.getType(),s=t._nodeMap,r=[];for(const[,o]of s)o instanceof c&&o.__type===e&&(n||o.isAttached())&&r.push(o);return r}function _1(c,t,n){const e=c.getParent();let s=n,r=c;return e!==null&&(t&&n===0?(s=r.getIndexWithinParent(),r=e):!t&&n===r.getChildrenSize()&&(s=r.getIndexWithinParent()+1,r=e)),r.getChildAtIndex(t?s-1:s)}function Hm(c,t){const n=c.offset;if(c.type==="element"){const e=c.getNode();return _1(e,t,n)}else{const e=c.getNode();if(t&&n===0||!t&&n===e.getTextContentSize()){const s=t?e.getPreviousSibling():e.getNextSibling();return s===null?_1(e.getParentOrThrow(),t,e.getIndexWithinParent()+(t?0:1)):s}}return null}function x1(c){const t=Wf(c).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Yt(c,t,n){return px(c,t,n)}function zf(c){return!Ao(c)&&!c.isLastChild()&&!c.isInline()}function Uf(c,t){const n=c._keyToDOMMap.get(t);if(n===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${t}`);return n}function Hf(c){const t=c.assignedSlot||c.parentElement;return t!==null&&t.nodeType===11?t.host:t}function qk(c,t,n){const e=n.ownerDocument,s=e.defaultView;if(s===null)return;let{top:r,bottom:o}=t,i=0,u=0,a=n;for(;a!==null;){const f=a===e.body;if(f)i=0,u=Wf(c).innerHeight;else{const d=a.getBoundingClientRect();i=d.top,u=d.bottom}let l=0;if(r<i?l=-(i-r):o>u&&(l=o-u),l!==0)if(f)s.scrollBy(0,l);else{const d=a.scrollTop;a.scrollTop+=l;const p=a.scrollTop-d;r-=p,o-=p}if(f)break;a=Hf(a)}}function Jk(c){return Xn()._updateTags.has(c)}function Vk(c){Jr(),Xn()._updateTags.add(c)}function Gk(c){const t=Jn();if(!vn(t)||!At(c))return t;const{anchor:n,focus:e}=t,s=n.getNode(),r=e.getNode();return Kf(s,c)&&n.set(c.__key,0,"element"),Kf(r,c)&&e.set(c.__key,0,"element"),t}function Kf(c,t){let n=c.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Yk(c){const t=c.ownerDocument;return t&&t.defaultView||null}function Wf(c){const t=c._window;if(t===null)throw Error("window object not found");return t}function Xk(c){return At(c)&&c.isInline()||dr(c)&&c.isInline()}function w1(c){let t=c.getParentOrThrow();for(;t!==null;){if(Is(t))return t;t=t.getParentOrThrow()}return t}function Is(c){return Ao(c)||At(c)&&c.isShadowRoot()}function S1(c){const t=c.constructor.clone(c);return a1(t,null),t}function Ru(c){const t=Xn(),n=c.constructor.getType(),e=t._nodes.get(n);if(e===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 s=e.replace;if(s!==null){const r=s(c);if(!(r instanceof c.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return r}return c}function Km(c,t){const n=c.getParent();if(Ao(n)&&!At(t)&&!dr(t))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Zk(c){const t=c.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let e=t.blockCursor;if(e!==void 0){if(typeof e=="string"){const s=Bf(e);e=t.blockCursor=s}e!==void 0&&n.classList.add(...e)}return n}function Wm(c){return(dr(c)||At(c)&&!c.canBeEmpty())&&!c.isInline()}function qm(c,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const e=c.parentElement;e!==null&&e.removeChild(c)}function Qk(c,t,n){let e=c._blockCursorElement;if(vn(n)&&n.isCollapsed()&&n.anchor.type==="element"&&t.contains(document.activeElement)){const s=n.anchor,r=s.getNode(),o=s.offset,i=r.getChildrenSize();let u=!1,a=null;if(o===i){const f=r.getChildAtIndex(o-1);Wm(f)&&(u=!0)}else{const f=r.getChildAtIndex(o);if(Wm(f)){const l=f.getPreviousSibling();(l===null||Wm(l))&&(u=!0,a=c.getElementByKey(f.__key))}}if(u){const f=c.getElementByKey(r.__key);e===null&&(c._blockCursorElement=e=Zk(c._config)),t.style.caretColor="transparent",a===null?f.appendChild(e):f.insertBefore(e,a);return}}e!==null&&qm(e,c,t)}function _i(c){return ti?(c||window).getSelection():null}function eA(c,t){let n=c.getChildAtIndex(t);if(n==null&&(n=c),Is(c))throw Error("Can not call $splitNode() on root element");const e=o=>{const i=o.getParentOrThrow(),u=Is(i),a=o===n&&!u?o:S1(o);if(u){if(!(At(o)&&At(a)))throw Error("Children of a root must be ElementNode");return o.insertAfter(a),[o,a,a]}else{const[f,l,d]=e(i),p=o.getNextSiblings();return d.append(a,...p),[f,l,a]}},[s,r]=e(n);return[s,r]}function tA(c){return qf(c)&&c.tagName==="A"}function qf(c){return c.nodeType===1}function Bl(c){if(dr(c)&&!c.isInline())return!0;if(!At(c)||Is(c))return!1;const t=c.getFirstChild(),n=t===null||Fa(t)||rn(t)||t.isInline();return!c.isInline()&&c.canBeEmpty()!==!1&&n}function Jm(c,t){let n=c;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function nA(){return Xn()}function rA(c,t){const n=c._decorators;let s=c._pendingDecorators||n;const r=t._nodeMap;let o;for(o in s)r.has(o)||(s===n&&(s=c1(c)),delete s[o])}function C1(c,t,n,e,s,r){let o=c.getFirstChild();for(;o!==null;){const i=o.__key;o.__parent===t&&(At(o)&&C1(o,i,n,e,s,r),n.has(i)||r.delete(i),s.push(i)),o=o.getNextSibling()}}function oA(c,t,n,e){const s=c._nodeMap,r=t._nodeMap,o=[];for(const[i]of e){const u=r.get(i);u!==void 0&&(u.isAttached()||(At(u)&&C1(u,i,s,r,o,e),s.has(i)||e.delete(i),o.push(i)))}for(const i of o)r.delete(i);for(const i of n){const u=r.get(i);u!==void 0&&!u.isAttached()&&(s.has(i)||n.delete(i),r.delete(i))}}let Tr="",io="",Yi="",Rs,so,ju,E1=!1,Vm=!1,Jf,Vf=null,Gm,Ym,La,js,Xm,Du;function Gf(c,t){const n=La.get(c);if(t!==null){const e=t0(c);e.parentNode===t&&t.removeChild(e)}if(js.has(c)||so._keyToDOMMap.delete(c),At(n)){const e=Xf(n,La);Zm(e,0,e.length-1,null)}n!==void 0&&Um(Du,ju,Jf,n,"destroyed")}function Zm(c,t,n,e){let s=t;for(;s<=n;++s){const r=c[s];r!==void 0&&Gf(r,e)}}function Ba(c,t){c.setProperty("text-align",t)}const iA="40px";function O1(c,t){const n=Rs.theme.indent;if(typeof n=="string"){const s=c.classList.contains(n);t>0&&!s?c.classList.add(n):t<1&&s&&c.classList.remove(n)}const e=getComputedStyle(c).getPropertyValue("--lexical-indent-base-value")||iA;c.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${e})`)}function T1(c,t){const n=c.style;t===0?Ba(n,""):t===Om?Ba(n,"left"):t===Tm?Ba(n,"center"):t===Nm?Ba(n,"right"):t===km?Ba(n,"justify"):t===Am?Ba(n,"start"):t===Pm&&Ba(n,"end")}function Yf(c,t,n){const e=js.get(c);if(e===void 0)throw Error("createNode: node does not exist in nodeMap");const s=e.createDOM(Rs,so);if(fA(c,s,so),rn(e)?s.setAttribute("data-lexical-text","true"):dr(e)&&s.setAttribute("data-lexical-decorator","true"),At(e)){const r=e.__indent,o=e.__size;if(r!==0&&O1(s,r),o!==0){const u=o-1,a=Xf(e,js);sA(a,u,e,s)}const i=e.__format;i!==0&&T1(s,i),e.isInline()||k1(null,e,s),zf(e)&&(Tr+=Gi,Yi+=Gi)}else{const r=e.getTextContent();if(dr(e)){const o=e.decorate(so,Rs);o!==null&&P1(c,o),s.contentEditable="false"}else rn(e)&&(e.isDirectionless()||(io+=r));Tr+=r,Yi+=r}if(t!==null)if(n!=null)t.insertBefore(s,n);else{const r=t.__lexicalLineBreak;r!=null?t.insertBefore(s,r):t.appendChild(s)}return Object.freeze(e),Um(Du,ju,Jf,e,"created"),s}function sA(c,t,n,e){const s=io;io="",Qm(c,n,0,t,e,null),A1(n,e),io=s}function Qm(c,t,n,e,s,r){const o=Tr;Tr="";let i=n;for(;i<=e;++i)Yf(c[i],s,r);zf(t)&&(Tr+=Gi),s.__lexicalTextContent=Tr,Tr=o+Tr}function N1(c,t){const n=t.get(c);return Fa(n)||dr(n)&&n.isInline()}function k1(c,t,n){const e=c!==null&&(c.__size===0||N1(c.__last,La)),s=t.__size===0||N1(t.__last,js);if(e){if(!s){const r=n.__lexicalLineBreak;r!=null&&n.removeChild(r),n.__lexicalLineBreak=null}}else if(s){const r=document.createElement("br");n.__lexicalLineBreak=r,n.appendChild(r)}}function A1(c,t){const n=t.__lexicalDirTextContent,e=t.__lexicalDir;if(n!==io||e!==Vf){const s=io==="",r=s?Vf:sk(io);if(r!==e){const o=t.classList,i=Rs.theme;let u=e!==null?i[e]:void 0,a=r!==null?i[r]:void 0;if(u!==void 0){if(typeof u=="string"){const f=Bf(u);u=i[e]=f}o.remove(...u)}if(r===null||s&&r==="ltr")t.removeAttribute("dir");else{if(a!==void 0){if(typeof a=="string"){const f=Bf(a);a=i[r]=f}a!==void 0&&o.add(...a)}t.dir=r}if(!Vm){const f=c.getWritable();f.__dir=r}}Vf=r,t.__lexicalDirTextContent=io,t.__lexicalDir=r}}function aA(c,t,n){const e=io;io="",lA(c,t,n),A1(t,n),io=e}function Xf(c,t){const n=[];let e=c.__first;for(;e!==null;){const s=t.get(e);if(s===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");n.push(e),e=s.__next}return n}function lA(c,t,n){const e=Tr,s=c.__size,r=t.__size;if(Tr="",s===1&&r===1){const o=c.__first,i=t.__first;if(o===i)Lu(o,n);else{const u=t0(o),a=Yf(i,null,null);n.replaceChild(a,u),Gf(o,null)}}else{const o=Xf(c,La),i=Xf(t,js);if(s===0)r!==0&&Qm(i,t,0,r-1,n,null);else if(r===0){if(s!==0){const a=n.__lexicalLineBreak==null;Zm(o,0,s-1,a?null:n),a&&(n.textContent="")}}else uA(t,o,i,s,r,n)}zf(t)&&(Tr+=Gi),n.__lexicalTextContent=Tr,Tr=e+Tr}function Lu(c,t){const n=La.get(c);let e=js.get(c);if(n===void 0||e===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const s=E1||Ym.has(c)||Gm.has(c),r=Uf(so,c);if(n===e&&!s){if(At(n)){const o=r.__lexicalTextContent;o!==void 0&&(Tr+=o,Yi+=o);const i=r.__lexicalDirTextContent;i!==void 0&&(io+=i)}else{const o=n.getTextContent();rn(n)&&!n.isDirectionless()&&(io+=o),Yi+=o,Tr+=o}return r}if(n!==e&&s&&Um(Du,ju,Jf,e,"updated"),e.updateDOM(n,r,Rs)){const o=Yf(c,null,null);if(t===null)throw Error("reconcileNode: parentDOM is null");return t.replaceChild(o,r),Gf(c,null),o}if(At(n)&&At(e)){const o=e.__indent;o!==n.__indent&&O1(r,o);const i=e.__format;i!==n.__format&&T1(r,i),s&&(aA(n,e,r),!Ao(e)&&!e.isInline()&&k1(n,e,r)),zf(e)&&(Tr+=Gi,Yi+=Gi)}else{const o=e.getTextContent();if(dr(e)){const i=e.decorate(so,Rs);i!==null&&P1(c,i)}else rn(e)&&!e.isDirectionless()&&(io+=o);Tr+=o,Yi+=o}if(!Vm&&Ao(e)&&e.__cachedText!==Yi){const o=e.getWritable();o.__cachedText=Yi,e=o}return Object.freeze(e),r}function P1(c,t){let n=so._pendingDecorators;const e=so._decorators;if(n===null){if(e[c]===t)return;n=c1(so)}n[c]=t}function cA(c){return c.firstChild}function e0(c){let t=c.nextSibling;return t!==null&&t===so._blockCursorElement&&(t=t.nextSibling),t}function uA(c,t,n,e,s,r){const o=e-1,i=s-1;let u,a,f=cA(r),l=0,d=0;for(;l<=o&&d<=i;){const m=t[l],g=n[d];if(m===g)f=e0(Lu(g,r)),l++,d++;else{u===void 0&&(u=new Set(t)),a===void 0&&(a=new Set(n));const y=a.has(m),b=u.has(g);if(!y)f=e0(t0(m)),Gf(m,r),l++;else if(!b)Yf(g,r,f),d++;else{const v=Uf(so,g);v===f?f=e0(Lu(g,r)):(f!=null?r.insertBefore(v,f):r.appendChild(v),Lu(g,r)),l++,d++}}}const p=l>o,h=d>i;if(p&&!h){const m=n[i+1],g=m===void 0?null:so.getElementByKey(m);Qm(n,c,d,i,r,g)}else h&&!p&&Zm(t,l,o,r)}function dA(c,t,n,e,s,r){Tr="",Yi="",io="",E1=e===Dl,Vf=null,so=n,Rs=n._config,ju=n._nodes,Jf=so._listeners.mutation,Gm=s,Ym=r,La=c._nodeMap,js=t._nodeMap,Vm=t._readOnly,Xm=new Map(n._keyToDOMMap);const o=new Map;return Du=o,Lu("root",null),so=void 0,ju=void 0,Gm=void 0,Ym=void 0,La=void 0,js=void 0,Rs=void 0,Xm=void 0,Du=void 0,o}function fA(c,t,n){const e=n._keyToDOMMap;t["__lexicalKey_"+n._key]=c,e.set(c,t)}function t0(c){const t=Xm.get(c);if(t===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${c}`);return t}const Xi=Object.freeze({}),n0=30,r0=[["keydown",xA],["pointerdown",hA],["compositionstart",vA],["compositionend",_A],["input",bA],["click",pA],["cut",Xi],["copy",Xi],["dragstart",Xi],["dragover",Xi],["dragend",Xi],["paste",Xi],["focus",Xi],["blur",Xi],["drop",Xi]];Mf&&r0.push(["beforeinput",(c,t)=>yA(c,t)]);let Bu=0,M1=0,I1=0,Fl=null;const Zf=new WeakMap;let o0=!1,i0=!1,Fu=!1,$u=!1,R1=[0,"",0,"root",0];function j1(c,t,n,e,s){const r=c.anchor,o=c.focus,i=r.getNode(),u=Xn(),a=_i(u._window),f=a!==null?a.anchorNode:null,l=r.key,d=u.getElementByKey(l),p=n.length;return l!==o.key||!rn(i)||(!s&&(!Mf||I1<e+50)||i.isDirty()&&p<2||p1(n))&&r.offset!==o.offset&&!i.isComposing()||Lm(i)||i.isDirty()&&p>1||(s||!Mf)&&d!==null&&!i.isComposing()&&f!==Ff(d)||a!==null&&t!==null&&(!t.collapsed||t.startContainer!==a.anchorNode||t.startOffset!==a.anchorOffset)||i.getFormat()!==c.format||i.getStyle()!==c.style||gk(c,i)}function D1(c,t){return c!==null&&c.nodeValue!==null&&c.nodeType===As&&t!==0&&t!==c.nodeValue.length}function L1(c,t,n){const{anchorNode:e,anchorOffset:s,focusNode:r,focusOffset:o}=c;o0&&(o0=!1,D1(e,s)&&D1(r,o))||ko(t,()=>{if(!n){vi(null);return}if(!Nu(t,e,r))return;const i=Jn();if(vn(i)){const u=i.anchor,a=u.getNode();if(i.isCollapsed()){c.type==="Range"&&c.anchorNode===c.focusNode&&(i.dirty=!0);const f=Wf(t).event,l=f?f.timeStamp:performance.now(),[d,p,h,m,g]=R1,y=No(),b=t.isComposing()===!1&&y.getTextContent()==="";if(l<g+200&&u.offset===h&&u.key===m)i.format=d,i.style=p;else if(u.type==="text"){if(!rn(a))throw Error("Point.getNode() must return TextNode when type is text");i.format=a.getFormat(),i.style=a.getStyle()}else u.type==="element"&&!b&&(i.format=0,i.style="")}else{const f=u.key,d=i.focus.key,p=i.getNodes(),h=p.length,m=i.isBackward(),g=m?o:s,y=m?s:o,b=m?d:f,v=m?f:d;let _=$N,w=!1;for(let x=0;x<h;x++){const S=p[x],E=S.getTextContentSize();if(rn(S)&&E!==0&&!(x===0&&S.__key===b&&g===E||x===h-1&&S.__key===v&&y===0)&&(w=!0,_&=S.getFormat(),_===0))break}i.format=w?_:0}}Yt(t,Af,void 0)})}function pA(c,t){ko(t,()=>{const n=Jn(),e=_i(t._window),s=Hl();if(e){if(vn(n)){const r=n.anchor,o=r.getNode();if(r.type==="element"&&r.offset===0&&n.isCollapsed()&&!Ao(o)&&No().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&n.is(s))e.removeAllRanges(),n.dirty=!0;else if(c.detail===3&&!n.isCollapsed()){const u=n.focus.getNode();o!==u&&(At(o)?o.select(0):o.getParentOrThrow().select(0))}}else if(c.pointerType==="touch"){const r=e.anchorNode;if(r!==null){const o=r.nodeType;if(o===Tu||o===As){const i=p0(s,e,t,c);vi(i)}}}}Yt(t,O_,c)})}function hA(c,t){const n=c.target,e=c.pointerType;n instanceof Node&&e!=="touch"&&ko(t,()=>{ik(n)||(i0=!0)})}function B1(c){if(!c.getTargetRanges)return null;const t=c.getTargetRanges();return t.length===0?null:t[0]}function gA(c,t){return c!==t||At(c)||At(t)||!c.isToken()||!t.isToken()}function mA(c){return M1===229&&c<Bu+n0}function yA(c,t){const n=c.inputType,e=B1(c);n==="deleteCompositionText"||ks&&x1(t)||n!=="insertCompositionText"&&ko(t,()=>{const s=Jn();if(n==="deleteContentBackward"){if(s===null){const f=Hl();if(!vn(f))return;vi(f.clone())}if(vn(s)){const f=s.anchor.key===s.focus.key;if(mA(c.timeStamp)&&t.isComposing()&&f){if(Mr(null),Bu=0,setTimeout(()=>{ko(t,()=>{Mr(null)})},n0),vn(s)){const l=s.anchor.getNode();if(l.markDirty(),s.format=l.getFormat(),!rn(l))throw Error("Anchor node must be a TextNode");s.style=l.getStyle()}}else{Mr(null),c.preventDefault();const l=s.anchor.getNode().getTextContent(),d=s.anchor.offset===0&&s.focus.offset===l.length;FN&&f&&!d||Yt(t,Su,!0)}return}}if(!vn(s))return;const r=c.data;Fl!==null&&$m(!1,t,Fl),(!s.dirty||Fl!==null)&&s.isCollapsed()&&!Ao(s.anchor.getNode())&&e!==null&&s.applyDOMRange(e),Fl=null;const o=s.anchor,i=s.focus,u=o.getNode(),a=i.getNode();if(n==="insertText"||n==="insertTranspose"){if(r===`
|
|
32
|
-
`)c.preventDefault(),Yt(t,Cu,!1);else if(r===Gi)c.preventDefault(),Yt(t,am,void 0);else if(r==null&&c.dataTransfer){const f=c.dataTransfer.getData("text/plain");c.preventDefault(),s.insertRawText(f)}else r!=null&&
|
|
33
|
-
`){const e=Jn();if(vn(e)){const s=e.focus;e.anchor.set(s.key,s.offset,s.type),Yt(c,Pf,null);return}}}$m(!0,c,t)}function _A(c,t){ks?$u=!0:ko(t,()=>{s0(t,c.data)})}function xA(c,t){if(Bu=c.timeStamp,M1=c.keyCode,t.isComposing())return;const{keyCode:n,shiftKey:e,ctrlKey:s,metaKey:r,altKey:o}=c;if(!Yt(t,T_,c)){if(Lk(n,s,o,r))Yt(t,N_,c);else if(Bk(n,s,e,o,r))Yt(t,k_,c);else if(jk(n,s,o,r))Yt(t,A_,c);else if(Dk(n,s,e,o,r))Yt(t,P_,c);else if(Fk(n,s,r))Yt(t,M_,c);else if($k(n,s,r))Yt(t,I_,c);else if(xk(n,e))Fu=!0,Yt(t,Pf,c);else if(Uk(n))Yt(t,R_,c);else if(wk(n,s))c.preventDefault(),Fu=!0,Yt(t,Cu,!0);else if(_k(n,e))Fu=!1,Yt(t,Pf,c);else if(Tk(n,o,r,s))Pu(n)?Yt(t,j_,c):(c.preventDefault(),Yt(t,Su,!0));else if(Hk(n))Yt(t,D_,c);else if(Nk(n,s,e,o,r))Mu(n)?Yt(t,L_,c):(c.preventDefault(),Yt(t,Su,!1));else if(Sk(n,o,s))c.preventDefault(),Yt(t,Eu,!0);else if(Ck(n,o,s))c.preventDefault(),Yt(t,Eu,!1);else if(Ek(n,r))c.preventDefault(),Yt(t,Ou,!0);else if(Ok(n,r))c.preventDefault(),Yt(t,Ou,!1);else if(yk(n,o,r,s))c.preventDefault(),Yt(t,Ns,"bold");else if(vk(n,o,r,s))c.preventDefault(),Yt(t,Ns,"underline");else if(bk(n,o,r,s))c.preventDefault(),Yt(t,Ns,"italic");else if(mk(n,o,s,r))Yt(t,B_,c);else if(kk(n,e,r,s))c.preventDefault(),Yt(t,um,void 0);else if(Ak(n,e,r,s))c.preventDefault(),Yt(t,dm,void 0);else{const i=t._editorState._selection;Uu(i)?Pk(n,e,r,s)?(c.preventDefault(),Yt(t,fm,c)):Mk(n,e,r,s)?(c.preventDefault(),Yt(t,pm,c)):v1(n,r,s)&&(c.preventDefault(),Yt(t,hm,c)):!ks&&v1(n,r,s)&&(c.preventDefault(),Yt(t,hm,c))}zk(s,e,o,r)&&Yt(t,W_,c)}}function F1(c){let t=c.__lexicalEventHandles;return t===void 0&&(t=[],c.__lexicalEventHandles=t),t}const $l=new Map;function $1(c){const t=c.target,n=t==null?null:t.nodeType===9?t.defaultView:t.ownerDocument.defaultView,e=_i(n);if(e===null)return;const s=Dm(e.anchorNode);if(s===null)return;i0&&(i0=!1,ko(s,()=>{const f=Hl(),l=e.anchorNode;if(l===null)return;const d=l.nodeType;if(d!==Tu&&d!==As)return;const p=p0(f,e,s,c);vi(p)}));const r=Fm(s),o=r[r.length-1],i=o._key,u=$l.get(i),a=u||o;a!==s&&L1(e,a,!1),L1(e,s,!0),s!==o?$l.set(i,s):u&&$l.delete(i)}function z1(c){c._lexicalHandled=!0}function U1(c){return c._lexicalHandled===!0}function wA(c,t){const n=c.ownerDocument,e=Zf.get(n);e===void 0&&n.addEventListener("selectionchange",$1),Zf.set(n,e||0+1),c.__lexicalEditor=t;const s=F1(c);for(let r=0;r<r0.length;r++){const[o,i]=r0[r],u=typeof i=="function"?a=>{U1(a)||(z1(a),(t.isEditable()||o==="click")&&i(a,t))}:a=>{if(!U1(a)&&(z1(a),t.isEditable()))switch(o){case"cut":return Yt(t,pm,a);case"copy":return Yt(t,fm,a);case"paste":return Yt(t,lm,a);case"dragstart":return Yt(t,$_,a);case"dragover":return Yt(t,z_,a);case"dragend":return Yt(t,U_,a);case"focus":return Yt(t,H_,a);case"blur":return Yt(t,K_,a);case"drop":return Yt(t,F_,a)}};c.addEventListener(o,u),s.push(()=>{c.removeEventListener(o,u)})}}function SA(c){const t=c.ownerDocument,n=Zf.get(t);if(n===void 0)throw Error("Root element not registered");Zf.set(t,n-1),n===1&&t.removeEventListener("selectionchange",$1);const e=c.__lexicalEditor;e!=null&&(CA(e),c.__lexicalEditor=null);const s=F1(c);for(let r=0;r<s.length;r++)s[r]();c.__lexicalEventHandles=[]}function CA(c){if(c._parentEditor!==null){const t=Fm(c),e=t[t.length-1]._key;$l.get(e)===c&&$l.delete(e)}else $l.delete(c._key)}function EA(){o0=!0}function OA(c,t,n,e,s){R1=[c,t,n,e,s]}function a0(c,t,n){Jr();const e=c.__key,s=c.getParent();if(s===null)return;const r=Gk(c);let o=!1;if(vn(r)&&t){const i=r.anchor,u=r.focus;i.key===e&&(ip(i,c,s,c.getPreviousSibling(),c.getNextSibling()),o=!0),u.key===e&&(ip(u,c,s,c.getPreviousSibling(),c.getNextSibling()),o=!0)}else Uu(r)&&t&&c.isSelected()&&c.selectPrevious();if(vn(r)&&t&&!o){const i=c.getIndexWithinParent();Da(c),op(r,s,i,-1)}else Da(c);!n&&!Is(s)&&!s.canBeEmpty()&&s.isEmpty()&&a0(s,t),t&&Ao(s)&&s.isEmpty()&&s.selectEnd()}class Qf{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(t){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,a1(this,t),this.__type!=="root"&&(Jr(),TA(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=qr(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||Jn();if(n==null)return!1;const e=n.getNodes().some(s=>s.__key===this.__key);return rn(this)?e:vn(n)&&n.anchor.type==="element"&&n.focus.type==="element"&&n.anchor.key===n.focus.key&&n.anchor.offset===n.focus.offset?!1:e}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),e=0;for(;n!==null;){if(this.is(n))return e;e++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:qr(t)}getParentOrThrow(){const t=this.getParent();if(t===null)throw Error(`Expected node ${this.__key} to have a parent.`);return t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(Is(n)){if(!At(t))throw Error("Children of root nodes must be elements");return t}t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();if(t===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const n=this.getLatest().__prev;return n===null?null:qr(n)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let e=n.getFirstChild();for(;e!==null&&!e.is(this);)t.push(e),e=e.getNextSibling();return t}getNextSibling(){const n=this.getLatest().__next;return n===null?null:qr(n)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=this.getParents(),e=t.getParents();At(this)&&n.unshift(this),At(t)&&e.unshift(t);const s=n.length,r=e.length;if(s===0||r===0||n[s-1]!==e[r-1])return null;const o=new Set(e);for(let i=0;i<s;i++){const u=n[i];if(o.has(u))return u}return null}is(t){return t==null?!1:this.__key===t.__key}isBefore(t){if(this===t)return!1;if(t.isParentOf(this))return!0;if(this.isParentOf(t))return!1;const n=this.getCommonAncestor(t);let e=0,s=0,r=this;for(;;){const o=r.getParentOrThrow();if(o===n){e=r.getIndexWithinParent();break}r=o}for(r=t;;){const o=r.getParentOrThrow();if(o===n){s=r.getIndexWithinParent();break}r=o}return e<s}isParentOf(t){const n=this.__key;if(n===t.__key)return!1;let e=t;for(;e!==null;){if(e.__key===n)return!0;e=e.getParent()}return!1}getNodesBetween(t){const n=this.isBefore(t),e=[],s=new Set;let r=this;for(;r!==null;){const o=r.__key;if(s.has(o)||(s.add(o),e.push(r)),r===t)break;const i=At(r)?n?r.getFirstChild():r.getLastChild():null;if(i!==null){r=i;continue}const u=n?r.getNextSibling():r.getPreviousSibling();if(u!==null){r=u;continue}const a=r.getParentOrThrow();if(s.has(a.__key)||e.push(a),a===t)break;let f=null,l=a;do{if(l===null)throw Error("getNodesBetween: ancestor is null");if(f=n?l.getNextSibling():l.getPreviousSibling(),l=l.getParent(),l!==null)f===null&&!s.has(l.__key)&&e.push(l);else break}while(f===null);r=f}return n||e.reverse(),e}isDirty(){const n=Xn()._dirtyLeaves;return n!==null&&n.has(this.__key)}getLatest(){const t=qr(this.__key);if(t===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 t}getWritable(){Jr();const t=xi(),n=Xn(),e=t._nodeMap,s=this.__key,r=this.getLatest(),o=r.__parent,i=n._cloneNotNeeded,u=Jn();if(u!==null&&u.setCachedNodes(null),i.has(s))return $f(r),r;const f=r.constructor.clone(r);return f.__parent=o,f.__next=r.__next,f.__prev=r.__prev,At(r)&&At(f)?(f.__first=r.__first,f.__last=r.__last,f.__size=r.__size,f.__indent=r.__indent,f.__format=r.__format,f.__dir=r.__dir):rn(r)&&rn(f)&&(f.__format=r.__format,f.__style=r.__style,f.__mode=r.__mode,f.__detail=r.__detail),i.add(s),f.__key=s,$f(f),e.set(s,f),f}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){throw Error("createDOM: base method not extended")}updateDOM(t,n,e){throw Error("updateDOM: base method not extended")}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(t){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(t){a0(this,!0,t)}replace(t,n){Jr();let e=Jn();e!==null&&(e=e.clone()),Km(this,t);const s=this.getLatest(),r=this.__key,o=t.__key,i=t.getWritable(),u=this.getParentOrThrow().getWritable(),a=u.__size;Da(i);const f=s.getPreviousSibling(),l=s.getNextSibling(),d=s.__prev,p=s.__next,h=s.__parent;if(a0(s,!1,!0),f===null)u.__first=o;else{const m=f.getWritable();m.__next=o}if(i.__prev=d,l===null)u.__last=o;else{const m=l.getWritable();m.__prev=o}if(i.__next=p,i.__parent=h,u.__size=a,n){if(!(At(this)&&At(i)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(m=>{i.append(m)})}if(vn(e)){vi(e);const m=e.anchor,g=e.focus;m.key===r&&Y1(m,i),g.key===r&&Y1(g,i)}return Ms()===r&&Mr(o),i}insertAfter(t,n=!0){Jr(),Km(this,t);const e=this.getWritable(),s=t.getWritable(),r=s.getParent(),o=Jn();let i=!1,u=!1;if(r!==null){const p=t.getIndexWithinParent();if(Da(s),vn(o)){const h=r.__key,m=o.anchor,g=o.focus;i=m.type==="element"&&m.key===h&&m.offset===p+1,u=g.type==="element"&&g.key===h&&g.offset===p+1}}const a=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),l=s.__key,d=e.__next;if(a===null)f.__last=l;else{const p=a.getWritable();p.__prev=l}if(f.__size++,e.__next=l,s.__next=d,s.__prev=e.__key,s.__parent=e.__parent,n&&vn(o)){const p=this.getIndexWithinParent();op(o,f,p+1);const h=f.__key;i&&o.anchor.set(h,p+2,"element"),u&&o.focus.set(h,p+2,"element")}return t}insertBefore(t,n=!0){Jr(),Km(this,t);const e=this.getWritable(),s=t.getWritable(),r=s.__key;Da(s);const o=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),u=e.__prev,a=this.getIndexWithinParent();if(o===null)i.__first=r;else{const l=o.getWritable();l.__next=r}i.__size++,e.__prev=r,s.__prev=u,s.__next=e.__key,s.__parent=e.__parent;const f=Jn();if(n&&vn(f)){const l=this.getParentOrThrow();op(f,l,a)}return t}isParentRequired(){return!1}createParentElementNode(){return Zi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){Jr();const e=this.getPreviousSibling(),s=this.getParentOrThrow();if(e===null)return s.select(0,0);if(At(e))return e.select();if(!rn(e)){const r=e.getIndexWithinParent()+1;return s.select(r,r)}return e.select(t,n)}selectNext(t,n){Jr();const e=this.getNextSibling(),s=this.getParentOrThrow();if(e===null)return s.select();if(At(e))return e.select(0,0);if(!rn(e)){const r=e.getIndexWithinParent();return s.select(r,r)}return e.select(t,n)}markDirty(){this.getWritable()}}function TA(c,t){const n=Xn()._nodes.get(c);if(n===void 0)throw Error(`Create node: Attempted to create node ${t.name} that was not configured to be used on the editor.`);const e=n.klass;if(e!==t)throw Error(`Create node: Type ${c} in node ${t.name} does not match registered node ${e.name} with the same type`)}function NA(c,t,n){const e=n||t.getParentOrThrow().getLastChild();let s=t;const r=[t];for(;s!==e;){if(!s.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");s=s.getNextSibling(),r.push(s)}let o=c;for(const i of r)o=o.insertAfter(i)}let ep=class dN extends Qf{static getType(){return"linebreak"}static clone(t){return new dN(t.__key)}constructor(t){super(t)}getTextContent(){return`
|
|
34
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:t=>
|
|
31
|
+
`,$N=ks?V_:Lf,G_="֑-߿יִ-﷽ﹰ-ﻼ",Y_="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",zN=new RegExp("^[^"+Y_+"]*["+G_+"]"),UN=new RegExp("^[^"+G_+"]*["+Y_+"]"),Ps={bold:vm,code:xm,highlight:Cm,italic:_m,strikethrough:Rf,subscript:wm,superscript:Sm,underline:jf},HN={directionless:Em,unmergeable:Df},X_={center:Tm,end:Pm,justify:km,left:Om,right:Nm,start:Am},KN={[Tm]:"center",[Pm]:"end",[km]:"justify",[Om]:"left",[Nm]:"right",[Am]:"start"},WN={normal:J_,segmented:bm,token:ym},qN={[J_]:"normal",[bm]:"segmented",[ym]:"token"};function Bf(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const JN=100;let Mm=!1,Im=0;function VN(){return Mm}function GN(c){Im=c.timeStamp}function YN(c){Im===0&&Wf(c).addEventListener("textInput",GN,!0)}function Rm(c,t,n){return t.__lexicalLineBreak===c||c[`__lexicalKey_${n._key}`]!==void 0}function XN(c){return c.getEditorState().read(()=>{const t=Jn();return t!==null?t.clone():null})}function ZN(c,t,n){const e=_i(n._window);let s=null,r=null;e!==null&&e.anchorNode===c&&(s=e.anchorOffset,r=e.focusOffset);const o=c.nodeValue;o!==null&&zm(t,o,s,r,!1)}function QN(c,t,n){if(vn(c)){const e=c.anchor.getNode();if(e.is(n)&&c.format!==e.getFormat())return!1}return t.nodeType===As&&n.isAttached()}function Z_(c,t,n){Mm=!0;const e=performance.now()-Im>JN;try{ko(c,()=>{const s=Jn()||XN(c),r=new Map,o=c.getRootElement(),i=c._editorState,u=c._blockCursorElement;let a=!1,f="";for(let d=0;d<t.length;d++){const p=t[d],h=p.type,m=p.target;let g=ku(m,i);if(!(g===null&&m!==o||dr(g))){if(h==="characterData")e&&rn(g)&&QN(s,m,g)&&ZN(m,g,c);else if(h==="childList"){a=!0;const y=p.addedNodes;for(let _=0;_<y.length;_++){const w=y[_],x=a1(w),S=w.parentNode;if(S!=null&&w!==u&&x===null&&(w.nodeName!=="BR"||!Rm(w,S,c))){if(ks){const E=w.innerText||w.nodeValue;E&&(f+=E)}S.removeChild(w)}}const b=p.removedNodes,v=b.length;if(v>0){let _=0;for(let w=0;w<v;w++){const x=b[w];(x.nodeName==="BR"&&Rm(x,m,c)||u===x)&&(m.appendChild(x),_++)}v!==_&&(m===o&&(g=u1(i)),r.set(m,g))}}}}if(r.size>0)for(const[d,p]of r)if(At(p)){const h=p.getChildrenKeys();let m=d.firstChild;for(let g=0;g<h.length;g++){const y=h[g],b=c.getElementByKey(y);b!==null&&(m==null?(d.appendChild(b),m=b):m!==b&&d.replaceChild(b,m),m=m.nextSibling)}}else rn(p)&&p.markDirty();const l=n.takeRecords();if(l.length>0){for(let d=0;d<l.length;d++){const p=l[d],h=p.addedNodes,m=p.target;for(let g=0;g<h.length;g++){const y=h[g],b=y.parentNode;b!=null&&y.nodeName==="BR"&&!Rm(y,m,c)&&b.removeChild(y)}}n.takeRecords()}s!==null&&(a&&(s.dirty=!0,vi(s)),ks&&_1(c)&&s.insertRawText(f))})}finally{Mm=!1}}function Q_(c){const t=c._observer;if(t!==null){const n=t.takeRecords();Z_(c,n,t)}}function e1(c){YN(c),c._observer=new MutationObserver((t,n)=>{Z_(c,t,n)})}function t1(c,t){const n=c.__mode,e=c.__format,s=c.__style,r=t.__mode,o=t.__format,i=t.__style;return(n===null||n===r)&&(e===null||e===o)&&(s===null||s===i)}function n1(c,t){const n=c.mergeWithSibling(t),e=Xn()._normalizedNodes;return e.add(c.__key),e.add(t.__key),n}function r1(c){let t=c;if(t.__text===""&&t.isSimpleText()&&!t.isUnmergeable()){t.remove();return}let n;for(;(n=t.getPreviousSibling())!==null&&rn(n)&&n.isSimpleText()&&!n.isUnmergeable();)if(n.__text==="")n.remove();else if(t1(n,t)){t=n1(n,t);break}else break;let e;for(;(e=t.getNextSibling())!==null&&rn(e)&&e.isSimpleText()&&!e.isUnmergeable();)if(e.__text==="")e.remove();else if(t1(t,e)){t=n1(t,e);break}else break}function o1(c){return i1(c.anchor),i1(c.focus),c}function i1(c){for(;c.type==="element";){const t=c.getNode(),n=c.offset;let e,s;if(n===t.getChildrenSize()?(e=t.getChildAtIndex(n-1),s=!0):(e=t.getChildAtIndex(n),s=!1),rn(e)){c.set(e.__key,s?e.getTextContentSize():0,"text");break}else if(!At(e))break;c.set(e.__key,s?e.getChildrenSize():0,"element")}}let ek=1;function tk(){return""+ek++}function nk(c,t){const n=c._nodes.get(t);if(n===void 0)throw Error(`registeredNode: Type ${t} not found`);return n}const rk=typeof queueMicrotask=="function"?queueMicrotask:c=>{Promise.resolve().then(c)};function ok(c){return dr(ku(c))}function jm(c){const t=document.activeElement;if(t===null)return!1;const n=t.nodeName;return dr(ku(c))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&t.__lexicalEditor==null)}function Nu(c,t,n){const e=c.getRootElement();try{return e!==null&&e.contains(t)&&e.contains(n)&&t!==null&&!jm(t)&&Dm(t)===c}catch{return!1}}function Dm(c){let t=c;for(;t!=null;){const n=t.__lexicalEditor;if(n!=null)return n;t=Hf(t)}return null}function ik(c){return zN.test(c)?"rtl":UN.test(c)?"ltr":null}function Lm(c){return c.isToken()||c.isSegmented()}function sk(c){return c.nodeType===As}function Ff(c){let t=c;for(;t!=null;){if(sk(t))return t;t=t.firstChild}return null}function Bm(c,t,n){const e=Ps[t];if(n!==null&&(c&e)===(n&e))return c;let s=c^e;return t==="subscript"?s&=~Ps.superscript:t==="superscript"&&(s&=~Ps.subscript),s}function ak(c){return rn(c)||Fa(c)||dr(c)}function s1(c,t){if(t!=null){c.__key=t;return}Jr(),ax();const n=Xn(),e=xi(),s=tk();e._nodeMap.set(s,c),At(c)?n._dirtyElements.set(s,!0):n._dirtyLeaves.add(s),n._cloneNotNeeded.add(s),n._dirtyType=q_,c.__key=s}function lk(c,t,n){let e=c;for(;e!==null;){if(n.has(e))return;const s=t.get(e);if(s===void 0)break;n.set(e,!1),e=s.__parent}}function Da(c){const t=c.getParent();if(t!==null){const n=c.getWritable(),e=t.getWritable(),s=c.getPreviousSibling(),r=c.getNextSibling();if(s===null)if(r!==null){const o=r.getWritable();e.__first=r.__key,o.__prev=null}else e.__first=null;else{const o=s.getWritable();if(r!==null){const i=r.getWritable();i.__prev=o.__key,o.__next=i.__key}else o.__next=null;n.__prev=null}if(r===null)if(s!==null){const o=s.getWritable();e.__last=s.__key,o.__next=null}else e.__last=null;else{const o=r.getWritable();if(s!==null){const i=s.getWritable();i.__next=o.__key,o.__prev=i.__key}else o.__prev=null;n.__next=null}e.__size--,n.__parent=null}}function $f(c){ax();const t=c.getLatest(),n=t.__parent,e=xi(),s=Xn(),r=e._nodeMap,o=s._dirtyElements;n!==null&&lk(n,r,o);const i=t.__key;s._dirtyType=q_,At(c)?o.set(i,!0):s._dirtyLeaves.add(i)}function ck(c){const t=c.getPreviousSibling(),n=c.getNextSibling();t!==null&&$f(t),n!==null&&$f(n)}function Mr(c){Jr();const t=Xn(),n=t._compositionKey;if(c!==n){if(t._compositionKey=c,n!==null){const e=qr(n);e!==null&&e.getWritable()}if(c!==null){const e=qr(c);e!==null&&e.getWritable()}}}function Ms(){return Kl()?null:Xn()._compositionKey}function qr(c,t){const e=(t||xi())._nodeMap.get(c);return e===void 0?null:e}function a1(c,t){const n=Xn(),e=c[`__lexicalKey_${n._key}`];return e!==void 0?qr(e,t):null}function ku(c,t){let n=c;for(;n!=null;){const e=a1(n,t);if(e!==null)return e;n=Hf(n)}return null}function l1(c){const t=c._decorators,n=Object.assign({},t);return c._pendingDecorators=n,n}function c1(c){return c.read(()=>No().getTextContent())}function uk(c,t){ko(c,()=>{const n=xi();if(n.isEmpty())return;if(t==="root"){No().markDirty();return}const e=n._nodeMap;for(const[,s]of e)s.markDirty()},c._pendingEditorState===null?{tag:"history-merge"}:void 0)}function No(){return u1(xi())}function u1(c){return c._nodeMap.get("root")}function vi(c){Jr();const t=xi();if(c!==null){if(Object.isFrozen(c))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");c.dirty=!0,c.setCachedNodes(null)}t._selection=c}function dk(){Jr();const c=Xn();Q_(c)}function Ll(c){const t=Xn(),n=fk(c,t);if(n===null){const e=t.getRootElement();return c===e?qr("root"):null}return qr(n)}function d1(c,t){return t?c.getTextContentSize():0}function fk(c,t){let n=c;for(;n!=null;){const e=n[`__lexicalKey_${t._key}`];if(e!==void 0)return e;n=Hf(n)}return null}function f1(c){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(c)}function Fm(c){const t=[];let n=c;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function p1(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function h1(c){return c.nodeType===As?c.nodeValue:null}function $m(c,t,n){const e=_i(t._window);if(e===null)return;const s=e.anchorNode;let{anchorOffset:r,focusOffset:o}=e;if(s!==null){let i=h1(s);const u=ku(s);if(i!==null&&rn(u)){if(i===Lf&&n){const a=n.length;i=n,r=a,o=a}i!==null&&zm(u,i,r,o,c)}}}function zm(c,t,n,e,s){let r=c;if(r.isAttached()&&(s||!r.isDirty())){const o=r.isComposing();let i=t;(o||s)&&t[t.length-1]===Lf&&(i=t.slice(0,-1));const u=r.getTextContent();if(s||i!==u){if(i===""){if(Mr(null),!gm&&!If&&!mm){const m=Xn();setTimeout(()=>{m.update(()=>{r.isAttached()&&r.remove()})},20)}else r.remove();return}const a=r.getParent(),f=Hl(),l=r.getTextContentSize(),d=Ms(),p=r.getKey();if(r.isToken()||d!==null&&p===d&&!o||vn(f)&&(a!==null&&!a.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===c.__key&&f.anchor.offset===0&&!r.canInsertTextBefore()&&!o||f.focus.key===c.__key&&f.focus.offset===l&&!r.canInsertTextAfter()&&!o)){r.markDirty();return}const h=Jn();if(!vn(h)||n===null||e===null){r.setTextContent(i);return}if(h.setTextNodeRange(r,n,r,e),r.isSegmented()){const m=r.getTextContent(),g=$r(m);r.replace(g),r=g}r.setTextContent(i)}}}function pk(c){const t=c.getPreviousSibling();return(rn(t)||At(t)&&t.isInline())&&!t.canInsertTextAfter()}function hk(c,t){if(t.isSegmented())return!0;if(!c.isCollapsed())return!1;const n=c.anchor.offset,e=t.getParentOrThrow(),s=t.isToken();return n===0?!t.canInsertTextBefore()||!e.canInsertTextBefore()||s||pk(t):n===t.getTextContentSize()?!t.canInsertTextAfter()||!e.canInsertTextAfter()||s:!1}function gk(c,t,n,e){return c===9&&!t&&!n&&!e}function mk(c,t,n,e){return c===66&&!t&&Au(n,e)}function yk(c,t,n,e){return c===73&&!t&&Au(n,e)}function bk(c,t,n,e){return c===85&&!t&&Au(n,e)}function vk(c,t){return y1(c)&&!t}function _k(c,t){return y1(c)&&t}function xk(c,t){return ni&&t&&c===79}function wk(c,t,n){return Pu(c)&&(ni?t:n)}function Sk(c,t,n){return Mu(c)&&(ni?t:n)}function Ck(c,t){return ni&&t&&Pu(c)}function Ek(c,t){return ni&&t&&Mu(c)}function Ok(c,t,n,e){return ni?t||n?!1:Pu(c)||c===72&&e:e||t||n?!1:Pu(c)}function Tk(c,t,n,e,s){return ni?n||e||s?!1:Mu(c)||c===68&&t:t||e||s?!1:Mu(c)}function Nk(c,t,n,e){return c===90&&!t&&Au(n,e)}function kk(c,t,n,e){return ni?c===90&&n&&t:c===89&&e||c===90&&e&&t}function Ak(c,t,n,e){return t?!1:c===67?ni?n:e:!1}function Pk(c,t,n,e){return t?!1:c===88?ni?n:e:!1}function g1(c){return c===37}function m1(c){return c===39}function Mk(c){return c===38}function Ik(c){return c===40}function Rk(c,t,n,e){return g1(c)&&!t&&!e&&!n}function jk(c,t,n,e,s){return g1(c)&&!e&&!n&&(t||s)}function Dk(c,t,n,e){return m1(c)&&!t&&!e&&!n}function Lk(c,t,n,e,s){return m1(c)&&!e&&!n&&(t||s)}function Bk(c,t,n){return Mk(c)&&!t&&!n}function Fk(c,t,n){return Ik(c)&&!t&&!n}function $k(c,t,n,e){return c||t||n||e}function zk(c){return c===32}function Au(c,t){return ni?c:t}function y1(c){return c===13}function Pu(c){return c===8}function Uk(c){return c===27}function Mu(c){return c===46}function b1(c,t,n){return c===65&&Au(t,n)}function Hk(){const c=No(),t=c.select(0,c.getChildrenSize());vi(o1(t))}function Iu(c,t){c.__lexicalClassNameCache===void 0&&(c.__lexicalClassNameCache={});const n=c.__lexicalClassNameCache,e=n[t];if(e!==void 0)return e;const s=c[t];if(typeof s=="string"){const r=Bf(s);return n[t]=r,r}return s}function Um(c,t,n,e,s){if(n.size===0)return;const r=e.__type,o=e.__key,i=t.get(r);if(i===void 0)throw Error(`Type ${r} not in registeredNodes`);const u=i.klass;let a=c.get(u);a===void 0&&(a=new Map,c.set(u,a));const f=a.get(o),l=f==="destroyed"&&s==="created";(f===void 0||l)&&a.set(o,l?"updated":s)}function Kk(c){const t=xi(),n=t._readOnly,e=c.getType(),s=t._nodeMap,r=[];for(const[,o]of s)o instanceof c&&o.__type===e&&(n||o.isAttached())&&r.push(o);return r}function v1(c,t,n){const e=c.getParent();let s=n,r=c;return e!==null&&(t&&n===0?(s=r.getIndexWithinParent(),r=e):!t&&n===r.getChildrenSize()&&(s=r.getIndexWithinParent()+1,r=e)),r.getChildAtIndex(t?s-1:s)}function Hm(c,t){const n=c.offset;if(c.type==="element"){const e=c.getNode();return v1(e,t,n)}else{const e=c.getNode();if(t&&n===0||!t&&n===e.getTextContentSize()){const s=t?e.getPreviousSibling():e.getNextSibling();return s===null?v1(e.getParentOrThrow(),t,e.getIndexWithinParent()+(t?0:1)):s}}return null}function _1(c){const t=Wf(c).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Yt(c,t,n){return fx(c,t,n)}function zf(c){return!Ao(c)&&!c.isLastChild()&&!c.isInline()}function Uf(c,t){const n=c._keyToDOMMap.get(t);if(n===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${t}`);return n}function Hf(c){const t=c.assignedSlot||c.parentElement;return t!==null&&t.nodeType===11?t.host:t}function Wk(c,t,n){const e=n.ownerDocument,s=e.defaultView;if(s===null)return;let{top:r,bottom:o}=t,i=0,u=0,a=n;for(;a!==null;){const f=a===e.body;if(f)i=0,u=Wf(c).innerHeight;else{const d=a.getBoundingClientRect();i=d.top,u=d.bottom}let l=0;if(r<i?l=-(i-r):o>u&&(l=o-u),l!==0)if(f)s.scrollBy(0,l);else{const d=a.scrollTop;a.scrollTop+=l;const p=a.scrollTop-d;r-=p,o-=p}if(f)break;a=Hf(a)}}function qk(c){return Xn()._updateTags.has(c)}function Jk(c){Jr(),Xn()._updateTags.add(c)}function Vk(c){const t=Jn();if(!vn(t)||!At(c))return t;const{anchor:n,focus:e}=t,s=n.getNode(),r=e.getNode();return Kf(s,c)&&n.set(c.__key,0,"element"),Kf(r,c)&&e.set(c.__key,0,"element"),t}function Kf(c,t){let n=c.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Gk(c){const t=c.ownerDocument;return t&&t.defaultView||null}function Wf(c){const t=c._window;if(t===null)throw Error("window object not found");return t}function Yk(c){return At(c)&&c.isInline()||dr(c)&&c.isInline()}function x1(c){let t=c.getParentOrThrow();for(;t!==null;){if(Is(t))return t;t=t.getParentOrThrow()}return t}function Is(c){return Ao(c)||At(c)&&c.isShadowRoot()}function w1(c){const t=c.constructor.clone(c);return s1(t,null),t}function Ru(c){const t=Xn(),n=c.constructor.getType(),e=t._nodes.get(n);if(e===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 s=e.replace;if(s!==null){const r=s(c);if(!(r instanceof c.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return r}return c}function Km(c,t){const n=c.getParent();if(Ao(n)&&!At(t)&&!dr(t))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Xk(c){const t=c.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let e=t.blockCursor;if(e!==void 0){if(typeof e=="string"){const s=Bf(e);e=t.blockCursor=s}e!==void 0&&n.classList.add(...e)}return n}function Wm(c){return(dr(c)||At(c)&&!c.canBeEmpty())&&!c.isInline()}function qm(c,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const e=c.parentElement;e!==null&&e.removeChild(c)}function Zk(c,t,n){let e=c._blockCursorElement;if(vn(n)&&n.isCollapsed()&&n.anchor.type==="element"&&t.contains(document.activeElement)){const s=n.anchor,r=s.getNode(),o=s.offset,i=r.getChildrenSize();let u=!1,a=null;if(o===i){const f=r.getChildAtIndex(o-1);Wm(f)&&(u=!0)}else{const f=r.getChildAtIndex(o);if(Wm(f)){const l=f.getPreviousSibling();(l===null||Wm(l))&&(u=!0,a=c.getElementByKey(f.__key))}}if(u){const f=c.getElementByKey(r.__key);e===null&&(c._blockCursorElement=e=Xk(c._config)),t.style.caretColor="transparent",a===null?f.appendChild(e):f.insertBefore(e,a);return}}e!==null&&qm(e,c,t)}function _i(c){return ti?(c||window).getSelection():null}function Qk(c,t){let n=c.getChildAtIndex(t);if(n==null&&(n=c),Is(c))throw Error("Can not call $splitNode() on root element");const e=o=>{const i=o.getParentOrThrow(),u=Is(i),a=o===n&&!u?o:w1(o);if(u){if(!(At(o)&&At(a)))throw Error("Children of a root must be ElementNode");return o.insertAfter(a),[o,a,a]}else{const[f,l,d]=e(i),p=o.getNextSiblings();return d.append(a,...p),[f,l,a]}},[s,r]=e(n);return[s,r]}function eA(c){return qf(c)&&c.tagName==="A"}function qf(c){return c.nodeType===1}function Bl(c){if(dr(c)&&!c.isInline())return!0;if(!At(c)||Is(c))return!1;const t=c.getFirstChild(),n=t===null||Fa(t)||rn(t)||t.isInline();return!c.isInline()&&c.canBeEmpty()!==!1&&n}function Jm(c,t){let n=c;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function tA(){return Xn()}function nA(c,t){const n=c._decorators;let s=c._pendingDecorators||n;const r=t._nodeMap;let o;for(o in s)r.has(o)||(s===n&&(s=l1(c)),delete s[o])}function S1(c,t,n,e,s,r){let o=c.getFirstChild();for(;o!==null;){const i=o.__key;o.__parent===t&&(At(o)&&S1(o,i,n,e,s,r),n.has(i)||r.delete(i),s.push(i)),o=o.getNextSibling()}}function rA(c,t,n,e){const s=c._nodeMap,r=t._nodeMap,o=[];for(const[i]of e){const u=r.get(i);u!==void 0&&(u.isAttached()||(At(u)&&S1(u,i,s,r,o,e),s.has(i)||e.delete(i),o.push(i)))}for(const i of o)r.delete(i);for(const i of n){const u=r.get(i);u!==void 0&&!u.isAttached()&&(s.has(i)||n.delete(i),r.delete(i))}}let Tr="",io="",Yi="",Rs,so,ju,C1=!1,Vm=!1,Jf,Vf=null,Gm,Ym,La,js,Xm,Du;function Gf(c,t){const n=La.get(c);if(t!==null){const e=t0(c);e.parentNode===t&&t.removeChild(e)}if(js.has(c)||so._keyToDOMMap.delete(c),At(n)){const e=Xf(n,La);Zm(e,0,e.length-1,null)}n!==void 0&&Um(Du,ju,Jf,n,"destroyed")}function Zm(c,t,n,e){let s=t;for(;s<=n;++s){const r=c[s];r!==void 0&&Gf(r,e)}}function Ba(c,t){c.setProperty("text-align",t)}const oA="40px";function E1(c,t){const n=Rs.theme.indent;if(typeof n=="string"){const s=c.classList.contains(n);t>0&&!s?c.classList.add(n):t<1&&s&&c.classList.remove(n)}const e=getComputedStyle(c).getPropertyValue("--lexical-indent-base-value")||oA;c.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${e})`)}function O1(c,t){const n=c.style;t===0?Ba(n,""):t===Om?Ba(n,"left"):t===Tm?Ba(n,"center"):t===Nm?Ba(n,"right"):t===km?Ba(n,"justify"):t===Am?Ba(n,"start"):t===Pm&&Ba(n,"end")}function Yf(c,t,n){const e=js.get(c);if(e===void 0)throw Error("createNode: node does not exist in nodeMap");const s=e.createDOM(Rs,so);if(dA(c,s,so),rn(e)?s.setAttribute("data-lexical-text","true"):dr(e)&&s.setAttribute("data-lexical-decorator","true"),At(e)){const r=e.__indent,o=e.__size;if(r!==0&&E1(s,r),o!==0){const u=o-1,a=Xf(e,js);iA(a,u,e,s)}const i=e.__format;i!==0&&O1(s,i),e.isInline()||N1(null,e,s),zf(e)&&(Tr+=Gi,Yi+=Gi)}else{const r=e.getTextContent();if(dr(e)){const o=e.decorate(so,Rs);o!==null&&A1(c,o),s.contentEditable="false"}else rn(e)&&(e.isDirectionless()||(io+=r));Tr+=r,Yi+=r}if(t!==null)if(n!=null)t.insertBefore(s,n);else{const r=t.__lexicalLineBreak;r!=null?t.insertBefore(s,r):t.appendChild(s)}return Object.freeze(e),Um(Du,ju,Jf,e,"created"),s}function iA(c,t,n,e){const s=io;io="",Qm(c,n,0,t,e,null),k1(n,e),io=s}function Qm(c,t,n,e,s,r){const o=Tr;Tr="";let i=n;for(;i<=e;++i)Yf(c[i],s,r);zf(t)&&(Tr+=Gi),s.__lexicalTextContent=Tr,Tr=o+Tr}function T1(c,t){const n=t.get(c);return Fa(n)||dr(n)&&n.isInline()}function N1(c,t,n){const e=c!==null&&(c.__size===0||T1(c.__last,La)),s=t.__size===0||T1(t.__last,js);if(e){if(!s){const r=n.__lexicalLineBreak;r!=null&&n.removeChild(r),n.__lexicalLineBreak=null}}else if(s){const r=document.createElement("br");n.__lexicalLineBreak=r,n.appendChild(r)}}function k1(c,t){const n=t.__lexicalDirTextContent,e=t.__lexicalDir;if(n!==io||e!==Vf){const s=io==="",r=s?Vf:ik(io);if(r!==e){const o=t.classList,i=Rs.theme;let u=e!==null?i[e]:void 0,a=r!==null?i[r]:void 0;if(u!==void 0){if(typeof u=="string"){const f=Bf(u);u=i[e]=f}o.remove(...u)}if(r===null||s&&r==="ltr")t.removeAttribute("dir");else{if(a!==void 0){if(typeof a=="string"){const f=Bf(a);a=i[r]=f}a!==void 0&&o.add(...a)}t.dir=r}if(!Vm){const f=c.getWritable();f.__dir=r}}Vf=r,t.__lexicalDirTextContent=io,t.__lexicalDir=r}}function sA(c,t,n){const e=io;io="",aA(c,t,n),k1(t,n),io=e}function Xf(c,t){const n=[];let e=c.__first;for(;e!==null;){const s=t.get(e);if(s===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");n.push(e),e=s.__next}return n}function aA(c,t,n){const e=Tr,s=c.__size,r=t.__size;if(Tr="",s===1&&r===1){const o=c.__first,i=t.__first;if(o===i)Lu(o,n);else{const u=t0(o),a=Yf(i,null,null);n.replaceChild(a,u),Gf(o,null)}}else{const o=Xf(c,La),i=Xf(t,js);if(s===0)r!==0&&Qm(i,t,0,r-1,n,null);else if(r===0){if(s!==0){const a=n.__lexicalLineBreak==null;Zm(o,0,s-1,a?null:n),a&&(n.textContent="")}}else cA(t,o,i,s,r,n)}zf(t)&&(Tr+=Gi),n.__lexicalTextContent=Tr,Tr=e+Tr}function Lu(c,t){const n=La.get(c);let e=js.get(c);if(n===void 0||e===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const s=C1||Ym.has(c)||Gm.has(c),r=Uf(so,c);if(n===e&&!s){if(At(n)){const o=r.__lexicalTextContent;o!==void 0&&(Tr+=o,Yi+=o);const i=r.__lexicalDirTextContent;i!==void 0&&(io+=i)}else{const o=n.getTextContent();rn(n)&&!n.isDirectionless()&&(io+=o),Yi+=o,Tr+=o}return r}if(n!==e&&s&&Um(Du,ju,Jf,e,"updated"),e.updateDOM(n,r,Rs)){const o=Yf(c,null,null);if(t===null)throw Error("reconcileNode: parentDOM is null");return t.replaceChild(o,r),Gf(c,null),o}if(At(n)&&At(e)){const o=e.__indent;o!==n.__indent&&E1(r,o);const i=e.__format;i!==n.__format&&O1(r,i),s&&(sA(n,e,r),!Ao(e)&&!e.isInline()&&N1(n,e,r)),zf(e)&&(Tr+=Gi,Yi+=Gi)}else{const o=e.getTextContent();if(dr(e)){const i=e.decorate(so,Rs);i!==null&&A1(c,i)}else rn(e)&&!e.isDirectionless()&&(io+=o);Tr+=o,Yi+=o}if(!Vm&&Ao(e)&&e.__cachedText!==Yi){const o=e.getWritable();o.__cachedText=Yi,e=o}return Object.freeze(e),r}function A1(c,t){let n=so._pendingDecorators;const e=so._decorators;if(n===null){if(e[c]===t)return;n=l1(so)}n[c]=t}function lA(c){return c.firstChild}function e0(c){let t=c.nextSibling;return t!==null&&t===so._blockCursorElement&&(t=t.nextSibling),t}function cA(c,t,n,e,s,r){const o=e-1,i=s-1;let u,a,f=lA(r),l=0,d=0;for(;l<=o&&d<=i;){const m=t[l],g=n[d];if(m===g)f=e0(Lu(g,r)),l++,d++;else{u===void 0&&(u=new Set(t)),a===void 0&&(a=new Set(n));const y=a.has(m),b=u.has(g);if(!y)f=e0(t0(m)),Gf(m,r),l++;else if(!b)Yf(g,r,f),d++;else{const v=Uf(so,g);v===f?f=e0(Lu(g,r)):(f!=null?r.insertBefore(v,f):r.appendChild(v),Lu(g,r)),l++,d++}}}const p=l>o,h=d>i;if(p&&!h){const m=n[i+1],g=m===void 0?null:so.getElementByKey(m);Qm(n,c,d,i,r,g)}else h&&!p&&Zm(t,l,o,r)}function uA(c,t,n,e,s,r){Tr="",Yi="",io="",C1=e===Dl,Vf=null,so=n,Rs=n._config,ju=n._nodes,Jf=so._listeners.mutation,Gm=s,Ym=r,La=c._nodeMap,js=t._nodeMap,Vm=t._readOnly,Xm=new Map(n._keyToDOMMap);const o=new Map;return Du=o,Lu("root",null),so=void 0,ju=void 0,Gm=void 0,Ym=void 0,La=void 0,js=void 0,Rs=void 0,Xm=void 0,Du=void 0,o}function dA(c,t,n){const e=n._keyToDOMMap;t["__lexicalKey_"+n._key]=c,e.set(c,t)}function t0(c){const t=Xm.get(c);if(t===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${c}`);return t}const Xi=Object.freeze({}),n0=30,r0=[["keydown",_A],["pointerdown",pA],["compositionstart",bA],["compositionend",vA],["input",yA],["click",fA],["cut",Xi],["copy",Xi],["dragstart",Xi],["dragover",Xi],["dragend",Xi],["paste",Xi],["focus",Xi],["blur",Xi],["drop",Xi]];Mf&&r0.push(["beforeinput",(c,t)=>mA(c,t)]);let Bu=0,P1=0,M1=0,Fl=null;const Zf=new WeakMap;let o0=!1,i0=!1,Fu=!1,$u=!1,I1=[0,"",0,"root",0];function R1(c,t,n,e,s){const r=c.anchor,o=c.focus,i=r.getNode(),u=Xn(),a=_i(u._window),f=a!==null?a.anchorNode:null,l=r.key,d=u.getElementByKey(l),p=n.length;return l!==o.key||!rn(i)||(!s&&(!Mf||M1<e+50)||i.isDirty()&&p<2||f1(n))&&r.offset!==o.offset&&!i.isComposing()||Lm(i)||i.isDirty()&&p>1||(s||!Mf)&&d!==null&&!i.isComposing()&&f!==Ff(d)||a!==null&&t!==null&&(!t.collapsed||t.startContainer!==a.anchorNode||t.startOffset!==a.anchorOffset)||i.getFormat()!==c.format||i.getStyle()!==c.style||hk(c,i)}function j1(c,t){return c!==null&&c.nodeValue!==null&&c.nodeType===As&&t!==0&&t!==c.nodeValue.length}function D1(c,t,n){const{anchorNode:e,anchorOffset:s,focusNode:r,focusOffset:o}=c;o0&&(o0=!1,j1(e,s)&&j1(r,o))||ko(t,()=>{if(!n){vi(null);return}if(!Nu(t,e,r))return;const i=Jn();if(vn(i)){const u=i.anchor,a=u.getNode();if(i.isCollapsed()){c.type==="Range"&&c.anchorNode===c.focusNode&&(i.dirty=!0);const f=Wf(t).event,l=f?f.timeStamp:performance.now(),[d,p,h,m,g]=I1,y=No(),b=t.isComposing()===!1&&y.getTextContent()==="";if(l<g+200&&u.offset===h&&u.key===m)i.format=d,i.style=p;else if(u.type==="text"){if(!rn(a))throw Error("Point.getNode() must return TextNode when type is text");i.format=a.getFormat(),i.style=a.getStyle()}else u.type==="element"&&!b&&(i.format=0,i.style="")}else{const f=u.key,d=i.focus.key,p=i.getNodes(),h=p.length,m=i.isBackward(),g=m?o:s,y=m?s:o,b=m?d:f,v=m?f:d;let _=FN,w=!1;for(let x=0;x<h;x++){const S=p[x],E=S.getTextContentSize();if(rn(S)&&E!==0&&!(x===0&&S.__key===b&&g===E||x===h-1&&S.__key===v&&y===0)&&(w=!0,_&=S.getFormat(),_===0))break}i.format=w?_:0}}Yt(t,Af,void 0)})}function fA(c,t){ko(t,()=>{const n=Jn(),e=_i(t._window),s=Hl();if(e){if(vn(n)){const r=n.anchor,o=r.getNode();if(r.type==="element"&&r.offset===0&&n.isCollapsed()&&!Ao(o)&&No().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&n.is(s))e.removeAllRanges(),n.dirty=!0;else if(c.detail===3&&!n.isCollapsed()){const u=n.focus.getNode();o!==u&&(At(o)?o.select(0):o.getParentOrThrow().select(0))}}else if(c.pointerType==="touch"){const r=e.anchorNode;if(r!==null){const o=r.nodeType;if(o===Tu||o===As){const i=p0(s,e,t,c);vi(i)}}}}Yt(t,E_,c)})}function pA(c,t){const n=c.target,e=c.pointerType;n instanceof Node&&e!=="touch"&&ko(t,()=>{ok(n)||(i0=!0)})}function L1(c){if(!c.getTargetRanges)return null;const t=c.getTargetRanges();return t.length===0?null:t[0]}function hA(c,t){return c!==t||At(c)||At(t)||!c.isToken()||!t.isToken()}function gA(c){return P1===229&&c<Bu+n0}function mA(c,t){const n=c.inputType,e=L1(c);n==="deleteCompositionText"||ks&&_1(t)||n!=="insertCompositionText"&&ko(t,()=>{const s=Jn();if(n==="deleteContentBackward"){if(s===null){const f=Hl();if(!vn(f))return;vi(f.clone())}if(vn(s)){const f=s.anchor.key===s.focus.key;if(gA(c.timeStamp)&&t.isComposing()&&f){if(Mr(null),Bu=0,setTimeout(()=>{ko(t,()=>{Mr(null)})},n0),vn(s)){const l=s.anchor.getNode();if(l.markDirty(),s.format=l.getFormat(),!rn(l))throw Error("Anchor node must be a TextNode");s.style=l.getStyle()}}else{Mr(null),c.preventDefault();const l=s.anchor.getNode().getTextContent(),d=s.anchor.offset===0&&s.focus.offset===l.length;BN&&f&&!d||Yt(t,Su,!0)}return}}if(!vn(s))return;const r=c.data;Fl!==null&&$m(!1,t,Fl),(!s.dirty||Fl!==null)&&s.isCollapsed()&&!Ao(s.anchor.getNode())&&e!==null&&s.applyDOMRange(e),Fl=null;const o=s.anchor,i=s.focus,u=o.getNode(),a=i.getNode();if(n==="insertText"||n==="insertTranspose"){if(r===`
|
|
32
|
+
`)c.preventDefault(),Yt(t,Cu,!1);else if(r===Gi)c.preventDefault(),Yt(t,am,void 0);else if(r==null&&c.dataTransfer){const f=c.dataTransfer.getData("text/plain");c.preventDefault(),s.insertRawText(f)}else r!=null&&R1(s,e,r,c.timeStamp,!0)?(c.preventDefault(),Yt(t,jl,r)):Fl=r;M1=c.timeStamp;return}switch(c.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{Yt(t,jl,c);break}case"insertFromComposition":{Mr(null),Yt(t,jl,c);break}case"insertLineBreak":{Mr(null),Yt(t,Cu,!1);break}case"insertParagraph":{Mr(null),Fu&&!If?(Fu=!1,Yt(t,Cu,!1)):Yt(t,am,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{Yt(t,lm,c);break}case"deleteByComposition":{hA(u,a)&&Yt(t,cm,c);break}case"deleteByDrag":case"deleteByCut":{Yt(t,cm,c);break}case"deleteContent":{Yt(t,Su,!1);break}case"deleteWordBackward":{Yt(t,Eu,!0);break}case"deleteWordForward":{Yt(t,Eu,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{Yt(t,Ou,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{Yt(t,Ou,!1);break}case"formatStrikeThrough":{Yt(t,Ns,"strikethrough");break}case"formatBold":{Yt(t,Ns,"bold");break}case"formatItalic":{Yt(t,Ns,"italic");break}case"formatUnderline":{Yt(t,Ns,"underline");break}case"historyUndo":{Yt(t,um,void 0);break}case"historyRedo":{Yt(t,dm,void 0);break}}})}function yA(c,t){c.stopPropagation(),ko(t,()=>{const n=Jn(),e=c.data,s=L1(c);if(e!=null&&vn(n)&&R1(n,s,e,c.timeStamp,!1)){$u&&(s0(t,e),$u=!1);const r=n.anchor,o=r.getNode(),i=_i(t._window);if(i===null)return;const u=r.offset;(!Mf||n.isCollapsed()||!rn(o)||i.anchorNode===null||o.getTextContent().slice(0,u)+e+o.getTextContent().slice(u+n.focus.offset)!==h1(i.anchorNode))&&Yt(t,jl,e);const a=e.length;ks&&a>1&&c.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=a),!gm&&!If&&!mm&&t.isComposing()&&(Bu=0,Mr(null))}else $m(!1,t,e!==null?e:void 0),$u&&(s0(t,e||void 0),$u=!1);dk()}),Fl=null}function bA(c,t){ko(t,()=>{const n=Jn();if(vn(n)&&!t.isComposing()){const e=n.anchor,s=n.anchor.getNode();Mr(e.key),(c.timeStamp<Bu+n0||e.type==="element"||!n.isCollapsed()||s.getFormat()!==n.format||rn(s)&&s.getStyle()!==n.style)&&Yt(t,jl,$N)}})}function s0(c,t){const n=c._compositionKey;if(Mr(null),n!==null&&t!=null){if(t===""){const e=qr(n),s=Ff(c.getElementByKey(n));s!==null&&s.nodeValue!==null&&rn(e)&&zm(e,s.nodeValue,null,null,!0);return}if(t[t.length-1]===`
|
|
33
|
+
`){const e=Jn();if(vn(e)){const s=e.focus;e.anchor.set(s.key,s.offset,s.type),Yt(c,Pf,null);return}}}$m(!0,c,t)}function vA(c,t){ks?$u=!0:ko(t,()=>{s0(t,c.data)})}function _A(c,t){if(Bu=c.timeStamp,P1=c.keyCode,t.isComposing())return;const{keyCode:n,shiftKey:e,ctrlKey:s,metaKey:r,altKey:o}=c;if(!Yt(t,O_,c)){if(Dk(n,s,o,r))Yt(t,T_,c);else if(Lk(n,s,e,o,r))Yt(t,N_,c);else if(Rk(n,s,o,r))Yt(t,k_,c);else if(jk(n,s,e,o,r))Yt(t,A_,c);else if(Bk(n,s,r))Yt(t,P_,c);else if(Fk(n,s,r))Yt(t,M_,c);else if(_k(n,e))Fu=!0,Yt(t,Pf,c);else if(zk(n))Yt(t,I_,c);else if(xk(n,s))c.preventDefault(),Fu=!0,Yt(t,Cu,!0);else if(vk(n,e))Fu=!1,Yt(t,Pf,c);else if(Ok(n,o,r,s))Pu(n)?Yt(t,R_,c):(c.preventDefault(),Yt(t,Su,!0));else if(Uk(n))Yt(t,j_,c);else if(Tk(n,s,e,o,r))Mu(n)?Yt(t,D_,c):(c.preventDefault(),Yt(t,Su,!1));else if(wk(n,o,s))c.preventDefault(),Yt(t,Eu,!0);else if(Sk(n,o,s))c.preventDefault(),Yt(t,Eu,!1);else if(Ck(n,r))c.preventDefault(),Yt(t,Ou,!0);else if(Ek(n,r))c.preventDefault(),Yt(t,Ou,!1);else if(mk(n,o,r,s))c.preventDefault(),Yt(t,Ns,"bold");else if(bk(n,o,r,s))c.preventDefault(),Yt(t,Ns,"underline");else if(yk(n,o,r,s))c.preventDefault(),Yt(t,Ns,"italic");else if(gk(n,o,s,r))Yt(t,L_,c);else if(Nk(n,e,r,s))c.preventDefault(),Yt(t,um,void 0);else if(kk(n,e,r,s))c.preventDefault(),Yt(t,dm,void 0);else{const i=t._editorState._selection;Uu(i)?Ak(n,e,r,s)?(c.preventDefault(),Yt(t,fm,c)):Pk(n,e,r,s)?(c.preventDefault(),Yt(t,pm,c)):b1(n,r,s)&&(c.preventDefault(),Yt(t,hm,c)):!ks&&b1(n,r,s)&&(c.preventDefault(),Yt(t,hm,c))}$k(s,e,o,r)&&Yt(t,K_,c)}}function B1(c){let t=c.__lexicalEventHandles;return t===void 0&&(t=[],c.__lexicalEventHandles=t),t}const $l=new Map;function F1(c){const t=c.target,n=t==null?null:t.nodeType===9?t.defaultView:t.ownerDocument.defaultView,e=_i(n);if(e===null)return;const s=Dm(e.anchorNode);if(s===null)return;i0&&(i0=!1,ko(s,()=>{const f=Hl(),l=e.anchorNode;if(l===null)return;const d=l.nodeType;if(d!==Tu&&d!==As)return;const p=p0(f,e,s,c);vi(p)}));const r=Fm(s),o=r[r.length-1],i=o._key,u=$l.get(i),a=u||o;a!==s&&D1(e,a,!1),D1(e,s,!0),s!==o?$l.set(i,s):u&&$l.delete(i)}function $1(c){c._lexicalHandled=!0}function z1(c){return c._lexicalHandled===!0}function xA(c,t){const n=c.ownerDocument,e=Zf.get(n);e===void 0&&n.addEventListener("selectionchange",F1),Zf.set(n,e||0+1),c.__lexicalEditor=t;const s=B1(c);for(let r=0;r<r0.length;r++){const[o,i]=r0[r],u=typeof i=="function"?a=>{z1(a)||($1(a),(t.isEditable()||o==="click")&&i(a,t))}:a=>{if(!z1(a)&&($1(a),t.isEditable()))switch(o){case"cut":return Yt(t,pm,a);case"copy":return Yt(t,fm,a);case"paste":return Yt(t,lm,a);case"dragstart":return Yt(t,F_,a);case"dragover":return Yt(t,$_,a);case"dragend":return Yt(t,z_,a);case"focus":return Yt(t,U_,a);case"blur":return Yt(t,H_,a);case"drop":return Yt(t,B_,a)}};c.addEventListener(o,u),s.push(()=>{c.removeEventListener(o,u)})}}function wA(c){const t=c.ownerDocument,n=Zf.get(t);if(n===void 0)throw Error("Root element not registered");Zf.set(t,n-1),n===1&&t.removeEventListener("selectionchange",F1);const e=c.__lexicalEditor;e!=null&&(SA(e),c.__lexicalEditor=null);const s=B1(c);for(let r=0;r<s.length;r++)s[r]();c.__lexicalEventHandles=[]}function SA(c){if(c._parentEditor!==null){const t=Fm(c),e=t[t.length-1]._key;$l.get(e)===c&&$l.delete(e)}else $l.delete(c._key)}function CA(){o0=!0}function EA(c,t,n,e,s){I1=[c,t,n,e,s]}function a0(c,t,n){Jr();const e=c.__key,s=c.getParent();if(s===null)return;const r=Vk(c);let o=!1;if(vn(r)&&t){const i=r.anchor,u=r.focus;i.key===e&&(ip(i,c,s,c.getPreviousSibling(),c.getNextSibling()),o=!0),u.key===e&&(ip(u,c,s,c.getPreviousSibling(),c.getNextSibling()),o=!0)}else Uu(r)&&t&&c.isSelected()&&c.selectPrevious();if(vn(r)&&t&&!o){const i=c.getIndexWithinParent();Da(c),op(r,s,i,-1)}else Da(c);!n&&!Is(s)&&!s.canBeEmpty()&&s.isEmpty()&&a0(s,t),t&&Ao(s)&&s.isEmpty()&&s.selectEnd()}class Qf{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(t){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,s1(this,t),this.__type!=="root"&&(Jr(),OA(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=qr(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||Jn();if(n==null)return!1;const e=n.getNodes().some(s=>s.__key===this.__key);return rn(this)?e:vn(n)&&n.anchor.type==="element"&&n.focus.type==="element"&&n.anchor.key===n.focus.key&&n.anchor.offset===n.focus.offset?!1:e}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),e=0;for(;n!==null;){if(this.is(n))return e;e++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:qr(t)}getParentOrThrow(){const t=this.getParent();if(t===null)throw Error(`Expected node ${this.__key} to have a parent.`);return t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(Is(n)){if(!At(t))throw Error("Children of root nodes must be elements");return t}t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();if(t===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const n=this.getLatest().__prev;return n===null?null:qr(n)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let e=n.getFirstChild();for(;e!==null&&!e.is(this);)t.push(e),e=e.getNextSibling();return t}getNextSibling(){const n=this.getLatest().__next;return n===null?null:qr(n)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=this.getParents(),e=t.getParents();At(this)&&n.unshift(this),At(t)&&e.unshift(t);const s=n.length,r=e.length;if(s===0||r===0||n[s-1]!==e[r-1])return null;const o=new Set(e);for(let i=0;i<s;i++){const u=n[i];if(o.has(u))return u}return null}is(t){return t==null?!1:this.__key===t.__key}isBefore(t){if(this===t)return!1;if(t.isParentOf(this))return!0;if(this.isParentOf(t))return!1;const n=this.getCommonAncestor(t);let e=0,s=0,r=this;for(;;){const o=r.getParentOrThrow();if(o===n){e=r.getIndexWithinParent();break}r=o}for(r=t;;){const o=r.getParentOrThrow();if(o===n){s=r.getIndexWithinParent();break}r=o}return e<s}isParentOf(t){const n=this.__key;if(n===t.__key)return!1;let e=t;for(;e!==null;){if(e.__key===n)return!0;e=e.getParent()}return!1}getNodesBetween(t){const n=this.isBefore(t),e=[],s=new Set;let r=this;for(;r!==null;){const o=r.__key;if(s.has(o)||(s.add(o),e.push(r)),r===t)break;const i=At(r)?n?r.getFirstChild():r.getLastChild():null;if(i!==null){r=i;continue}const u=n?r.getNextSibling():r.getPreviousSibling();if(u!==null){r=u;continue}const a=r.getParentOrThrow();if(s.has(a.__key)||e.push(a),a===t)break;let f=null,l=a;do{if(l===null)throw Error("getNodesBetween: ancestor is null");if(f=n?l.getNextSibling():l.getPreviousSibling(),l=l.getParent(),l!==null)f===null&&!s.has(l.__key)&&e.push(l);else break}while(f===null);r=f}return n||e.reverse(),e}isDirty(){const n=Xn()._dirtyLeaves;return n!==null&&n.has(this.__key)}getLatest(){const t=qr(this.__key);if(t===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 t}getWritable(){Jr();const t=xi(),n=Xn(),e=t._nodeMap,s=this.__key,r=this.getLatest(),o=r.__parent,i=n._cloneNotNeeded,u=Jn();if(u!==null&&u.setCachedNodes(null),i.has(s))return $f(r),r;const f=r.constructor.clone(r);return f.__parent=o,f.__next=r.__next,f.__prev=r.__prev,At(r)&&At(f)?(f.__first=r.__first,f.__last=r.__last,f.__size=r.__size,f.__indent=r.__indent,f.__format=r.__format,f.__dir=r.__dir):rn(r)&&rn(f)&&(f.__format=r.__format,f.__style=r.__style,f.__mode=r.__mode,f.__detail=r.__detail),i.add(s),f.__key=s,$f(f),e.set(s,f),f}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){throw Error("createDOM: base method not extended")}updateDOM(t,n,e){throw Error("updateDOM: base method not extended")}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(t){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(t){a0(this,!0,t)}replace(t,n){Jr();let e=Jn();e!==null&&(e=e.clone()),Km(this,t);const s=this.getLatest(),r=this.__key,o=t.__key,i=t.getWritable(),u=this.getParentOrThrow().getWritable(),a=u.__size;Da(i);const f=s.getPreviousSibling(),l=s.getNextSibling(),d=s.__prev,p=s.__next,h=s.__parent;if(a0(s,!1,!0),f===null)u.__first=o;else{const m=f.getWritable();m.__next=o}if(i.__prev=d,l===null)u.__last=o;else{const m=l.getWritable();m.__prev=o}if(i.__next=p,i.__parent=h,u.__size=a,n){if(!(At(this)&&At(i)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(m=>{i.append(m)})}if(vn(e)){vi(e);const m=e.anchor,g=e.focus;m.key===r&&G1(m,i),g.key===r&&G1(g,i)}return Ms()===r&&Mr(o),i}insertAfter(t,n=!0){Jr(),Km(this,t);const e=this.getWritable(),s=t.getWritable(),r=s.getParent(),o=Jn();let i=!1,u=!1;if(r!==null){const p=t.getIndexWithinParent();if(Da(s),vn(o)){const h=r.__key,m=o.anchor,g=o.focus;i=m.type==="element"&&m.key===h&&m.offset===p+1,u=g.type==="element"&&g.key===h&&g.offset===p+1}}const a=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),l=s.__key,d=e.__next;if(a===null)f.__last=l;else{const p=a.getWritable();p.__prev=l}if(f.__size++,e.__next=l,s.__next=d,s.__prev=e.__key,s.__parent=e.__parent,n&&vn(o)){const p=this.getIndexWithinParent();op(o,f,p+1);const h=f.__key;i&&o.anchor.set(h,p+2,"element"),u&&o.focus.set(h,p+2,"element")}return t}insertBefore(t,n=!0){Jr(),Km(this,t);const e=this.getWritable(),s=t.getWritable(),r=s.__key;Da(s);const o=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),u=e.__prev,a=this.getIndexWithinParent();if(o===null)i.__first=r;else{const l=o.getWritable();l.__next=r}i.__size++,e.__prev=r,s.__prev=u,s.__next=e.__key,s.__parent=e.__parent;const f=Jn();if(n&&vn(f)){const l=this.getParentOrThrow();op(f,l,a)}return t}isParentRequired(){return!1}createParentElementNode(){return Zi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){Jr();const e=this.getPreviousSibling(),s=this.getParentOrThrow();if(e===null)return s.select(0,0);if(At(e))return e.select();if(!rn(e)){const r=e.getIndexWithinParent()+1;return s.select(r,r)}return e.select(t,n)}selectNext(t,n){Jr();const e=this.getNextSibling(),s=this.getParentOrThrow();if(e===null)return s.select();if(At(e))return e.select(0,0);if(!rn(e)){const r=e.getIndexWithinParent();return s.select(r,r)}return e.select(t,n)}markDirty(){this.getWritable()}}function OA(c,t){const n=Xn()._nodes.get(c);if(n===void 0)throw Error(`Create node: Attempted to create node ${t.name} that was not configured to be used on the editor.`);const e=n.klass;if(e!==t)throw Error(`Create node: Type ${c} in node ${t.name} does not match registered node ${e.name} with the same type`)}function TA(c,t,n){const e=n||t.getParentOrThrow().getLastChild();let s=t;const r=[t];for(;s!==e;){if(!s.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");s=s.getNextSibling(),r.push(s)}let o=c;for(const i of r)o=o.insertAfter(i)}let ep=class uN extends Qf{static getType(){return"linebreak"}static clone(t){return new uN(t.__key)}constructor(t){super(t)}getTextContent(){return`
|
|
34
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:t=>kA(t)?null:{conversion:NA,priority:0}}}static importJSON(t){return zl()}exportJSON(){return{type:"linebreak",version:1}}};function NA(c){return{node:zl()}}function zl(){return Ru(new ep)}function Fa(c){return c instanceof ep}function kA(c){const t=c.parentElement;if(t!==null){const n=t.firstChild;if(n===c||n.nextSibling===c&&U1(n)){const e=t.lastChild;if(e===c||e.previousSibling===c&&U1(e))return!0}}return!1}function U1(c){return c.nodeType===As&&/^( |\t|\r?\n)+$/.test(c.textContent||"")}function l0(c,t){return t&xm?"code":t&Cm?"mark":t&wm?"sub":t&Sm?"sup":null}function c0(c,t){return t&vm?"strong":t&_m?"em":"span"}function H1(c,t,n,e,s){const r=e.classList;let o=Iu(s,"base");o!==void 0&&r.add(...o),o=Iu(s,"underlineStrikethrough");let i=!1;const u=t&jf&&t&Rf,a=n&jf&&n&Rf;o!==void 0&&(a?(i=!0,u||r.add(...o)):u&&r.remove(...o));for(const f in Ps){const d=Ps[f];if(o=Iu(s,f),o!==void 0)if(n&d){if(i&&(f==="underline"||f==="strikethrough")){t&d&&r.remove(...o);continue}(!(t&d)||u&&f==="underline"||f==="strikethrough")&&r.add(...o)}else t&d&&r.remove(...o)}}function AA(c,t){const n=c.length,e=t.length;let s=0,r=0;for(;s<n&&s<e&&c[s]===t[s];)s++;for(;r+s<n&&r+s<e&&c[n-r-1]===t[e-r-1];)r++;return[s,n-s-r,t.slice(s,e-r)]}function K1(c,t,n){const e=t.firstChild,s=n.isComposing(),o=c+(s?Lf:"");if(e==null)t.textContent=o;else{const i=e.nodeValue;if(i!==o)if(s||ks){const[u,a,f]=AA(i,o);a!==0&&e.deleteData(u,a),e.insertData(u,f)}else e.nodeValue=o}}function W1(c,t,n,e,s,r){K1(s,c,t);const i=r.theme.text;i!==void 0&&H1(n,0,e,c,i)}function tp(c,t){const n=document.createElement(t);return n.appendChild(c),n}let zu=class dN extends Qf{static getType(){return"text"}static clone(t){return new dN(t.__text,t.__key)}constructor(t,n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return qN[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===ym}isComposing(){return this.__key===Ms()}isSegmented(){return this.getLatest().__mode===bm}isDirectionless(){return(this.getLatest().__detail&Em)!==0}isUnmergeable(){return(this.getLatest().__detail&Df)!==0}hasFormat(t){const n=Ps[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){const s=this.getLatest().__format;return Bm(s,t,n)}canHaveFormat(){return!0}createDOM(t,n){const e=this.__format,s=l0(this,e),r=c0(this,e),o=s===null?r:s,i=document.createElement(o);let u=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),s!==null&&(u=document.createElement(r),i.appendChild(u));const a=this.__text;W1(u,this,r,e,a,t);const f=this.__style;return f!==""&&(i.style.cssText=f),i}updateDOM(t,n,e){const s=this.__text,r=t.__format,o=this.__format,i=l0(this,r),u=l0(this,o),a=c0(this,r),f=c0(this,o);if((i===null?a:i)!==(u===null?f:u))return!0;if(i===u&&a!==f){const b=n.firstChild;if(b==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const v=document.createElement(f);return W1(v,this,f,o,s,e),n.replaceChild(v,b),!1}let p=n;if(u!==null&&i!==null&&(p=n.firstChild,p==null))throw Error("updateDOM: innerDOM is null or undefined");K1(s,p,this);const m=e.theme.text;m!==void 0&&r!==o&&H1(f,r,o,p,m);const g=t.__style,y=this.__style;return g!==y&&(n.style.cssText=y),!1}static importDOM(){return{"#text":()=>({conversion:jA,priority:0}),b:()=>({conversion:MA,priority:0}),code:()=>({conversion:Ds,priority:0}),em:()=>({conversion:Ds,priority:0}),i:()=>({conversion:Ds,priority:0}),s:()=>({conversion:Ds,priority:0}),span:()=>({conversion:PA,priority:0}),strong:()=>({conversion:Ds,priority:0}),sub:()=>({conversion:Ds,priority:0}),sup:()=>({conversion:Ds,priority:0}),u:()=>({conversion:Ds,priority:0})}}static importJSON(t){const n=$r(t.text);return n.setFormat(t.format),n.setDetail(t.detail),n.setMode(t.mode),n.setStyle(t.style),n}exportDOM(t){let{element:n}=super.exportDOM(t);if(!(n!==null&&qf(n)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return n.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(n=tp(n,"b")),this.hasFormat("italic")&&(n=tp(n,"i")),this.hasFormat("strikethrough")&&(n=tp(n,"s")),this.hasFormat("underline")&&(n=tp(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Ps[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?HN[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=this.getFormat(),e=Bm(n,t,null);return this.setFormat(e)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=Em,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=Df,t}setMode(t){const n=WN[t];if(this.__mode===n)return this;const e=this.getWritable();return e.__mode=n,e}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){Jr();let e=t,s=n;const r=Jn(),o=this.getTextContent(),i=this.__key;if(typeof o=="string"){const u=o.length;e===void 0&&(e=u),s===void 0&&(s=u)}else e=0,s=0;if(vn(r)){const u=Ms();(u===r.anchor.key||u===r.focus.key)&&Mr(i),r.setTextNodeRange(this,e,this,s)}else return rx(i,e,i,s,"text","text");return r}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,e,s){const r=this.getWritable(),o=r.__text,i=e.length;let u=t;u<0&&(u=i+u,u<0&&(u=0));const a=Jn();if(s&&vn(a)){const l=t+i;a.setTextNodeRange(r,l,r,l)}const f=o.slice(0,u)+e+o.slice(u+n);return r.__text=f,r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){Jr();const n=this.getLatest(),e=n.getTextContent(),s=n.__key,r=Ms(),o=new Set(t),i=[],u=e.length;let a="";for(let S=0;S<u;S++)a!==""&&o.has(S)&&(i.push(a),a=""),a+=e[S];a!==""&&i.push(a);const f=i.length;if(f===0)return[];if(i[0]===e)return[n];const l=i[0],d=n.getParentOrThrow();let p;const h=n.getFormat(),m=n.getStyle(),g=n.__detail;let y=!1;n.isSegmented()?(p=$r(l),p.__format=h,p.__style=m,p.__detail=g,y=!0):(p=n.getWritable(),p.__text=l);const b=Jn(),v=[p];let _=l.length;for(let S=1;S<f;S++){const E=i[S],O=E.length,j=$r(E).getWritable();j.__format=h,j.__style=m,j.__detail=g;const A=j.__key,T=_+O;if(vn(b)){const I=b.anchor,k=b.focus;I.key===s&&I.type==="text"&&I.offset>_&&I.offset<=T&&(I.key=A,I.offset-=_,b.dirty=!0),k.key===s&&k.type==="text"&&k.offset>_&&k.offset<=T&&(k.key=A,k.offset-=_,b.dirty=!0)}r===s&&Mr(A),_=T,v.push(j)}ck(this);const w=d.getWritable(),x=this.getIndexWithinParent();return y?(w.splice(x,0,v),this.remove()):w.splice(x,1,v),vn(b)&&op(b,d,x,f-1),v}mergeWithSibling(t){const n=t===this.getPreviousSibling();if(!n&&t!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const e=this.__key,s=t.__key,r=this.__text,o=r.length;Ms()===s&&Mr(e);const u=Jn();if(vn(u)){const d=u.anchor,p=u.focus;d!==null&&d.key===s&&(ix(d,n,e,t,o),u.dirty=!0),p!==null&&p.key===s&&(ix(p,n,e,t,o),u.dirty=!0)}const a=t.__text,f=n?a+r:r+a;this.setTextContent(f);const l=this.getWritable();return t.remove(),l}isTextEntity(){return!1}};function PA(c){const t=c,n=t.style.fontWeight==="700",e=t.style.textDecoration==="line-through",s=t.style.fontStyle==="italic",r=t.style.textDecoration==="underline",o=t.style.verticalAlign;return{forChild:i=>(rn(i)&&(n&&i.toggleFormat("bold"),e&&i.toggleFormat("strikethrough"),s&&i.toggleFormat("italic"),r&&i.toggleFormat("underline"),o==="sub"&&i.toggleFormat("subscript"),o==="super"&&i.toggleFormat("superscript")),i),node:null}}function MA(c){const n=c.style.fontWeight==="normal";return{forChild:e=>(rn(e)&&!n&&e.toggleFormat("bold"),e),node:null}}const q1=new WeakMap;function IA(c){return c.nodeName==="PRE"||c.nodeType===Tu&&c.style!==void 0&&c.style.whiteSpace!==void 0&&c.style.whiteSpace.startsWith("pre")}function RA(c){let t,n=c.parentNode;const e=[c];for(;n!==null&&(t=q1.get(n))===void 0&&!IA(n);)e.push(n),n=n.parentNode;const s=t===void 0?n:t;for(let r=0;r<e.length;r++)q1.set(e[r],s);return s}function jA(c){const t=c;if(c.parentElement===null)throw Error("Expected parentElement of Text not to be null");let e=t.textContent||"";if(RA(t)!==null){const s=e.split(/(\r?\n|\t)/),r=[],o=s.length;for(let i=0;i<o;i++){const u=s[i];u===`
|
|
35
35
|
`||u===`\r
|
|
36
|
-
`?r.push(zl()):u===" "?r.push(np()):u!==""&&r.push($r(u))}return{node:r}}if(e=e.replace(/\r/g,"").replace(/[ \t\n]+/g," "),e==="")return{node:null};if(e[0]===" "){let s=t,r=!0;for(;s!==null&&(s=
|
|
37
|
-
`),d.isEmpty()?f=!1:f=!0;else if(f=!1,rn(d)){let p=d.getTextContent();d===n?d===e?(s.type!=="element"||r.type!=="element"||r.offset===s.offset)&&(p=i<u?p.slice(i,u):p.slice(u,i)):p=o?p.slice(i):p.slice(u):d===e&&(p=o?p.slice(0,u):p.slice(0,i)),a+=p}else(dr(d)||Fa(d))&&(d!==e||!this.isCollapsed())&&(a+=d.getTextContent())}return a}applyDOMRange(t){const n=Xn(),s=n.getEditorState()._selection,r=
|
|
36
|
+
`?r.push(zl()):u===" "?r.push(np()):u!==""&&r.push($r(u))}return{node:r}}if(e=e.replace(/\r/g,"").replace(/[ \t\n]+/g," "),e==="")return{node:null};if(e[0]===" "){let s=t,r=!0;for(;s!==null&&(s=J1(s,!1))!==null;){const o=s.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(e=e.slice(1)),r=!1;break}}r&&(e=e.slice(1))}if(e[e.length-1]===" "){let s=t,r=!0;for(;s!==null&&(s=J1(s,!0))!==null;)if((s.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(e=e.slice(0,e.length-1))}return e===""?{node:null}:{node:$r(e)}}const DA=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 J1(c,t){let n=c;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){const r=n.parentElement;if(r===null)return null;n=r}if(n=e,n.nodeType===Tu){const r=n.style.display;if(r===""&&n.nodeName.match(DA)===null||r!==""&&!r.startsWith("inline"))return null}let s=n;for(;(s=t?n.firstChild:n.lastChild)!==null;)n=s;if(n.nodeType===As)return n;if(n.nodeName==="BR")return null}}const LA={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ds(c){const t=LA[c.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:n=>(rn(n)&&!n.hasFormat(t)&&n.toggleFormat(t),n),node:null}}function $r(c=""){return Ru(new zu(c))}function rn(c){return c instanceof zu}class Ul extends zu{static getType(){return"tab"}static clone(t){const n=new Ul(t.__key);return n.__text=t.__text,n.__format=t.__format,n.__style=t.__style,n}constructor(t){super(" ",t),this.__detail=Df}static importDOM(){return null}static importJSON(t){const n=np();return n.setFormat(t.format),n.setStyle(t.style),n}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(t){throw Error("TabNode does not support setTextContent")}setDetail(t){throw Error("TabNode does not support setDetail")}setMode(t){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function np(){return Ru(new Ul)}function V1(c){return c instanceof Ul}class BA{constructor(t,n,e){this._selection=null,this.key=t,this.offset=n,this.type=e}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){let n=this.getNode(),e=t.getNode();const s=this.offset,r=t.offset;if(At(n)){const o=n.getDescendantByIndex(s);n=o??n}if(At(e)){const o=e.getDescendantByIndex(r);e=o??e}return n===e?s<r:n.isBefore(e)}getNode(){const t=this.key,n=qr(t);if(n===null)throw Error("Point.getNode: node not found");return n}set(t,n,e){const s=this._selection,r=this.key;this.key=t,this.offset=n,this.type=e,Kl()||(Ms()===r&&Mr(t),s!==null&&(s.setCachedNodes(null),s.dirty=!0))}}function ri(c,t,n){return new BA(c,t,n)}function u0(c,t){let n=t.__key,e=c.offset,s="element";if(rn(t)){s="text";const r=t.getTextContentSize();e>r&&(e=r)}else if(!At(t)){const r=t.getNextSibling();if(rn(r))n=r.__key,e=0,s="text";else{const o=t.getParent();o&&(n=o.__key,e=t.getIndexWithinParent()+1)}}c.set(n,e,s)}function G1(c,t){if(At(t)){const n=t.getLastDescendant();At(n)||rn(n)?u0(c,n):u0(c,t)}else u0(c,t)}function Y1(c,t,n,e){const s=c.getNode(),r=s.getChildAtIndex(c.offset),o=$r(),i=Ao(s)?Zi().append(o):o;o.setFormat(n),o.setStyle(e),r===null?s.append(i):r.insertBefore(i),c.is(t)&&t.set(o.__key,0,"text"),c.set(o.__key,0,"text")}function Ls(c,t,n,e){c.key=t,c.offset=n,c.type=e}class rp{constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Uu(t))return!1;const n=this._nodes,e=t._nodes;return n.size===e.size&&Array.from(n).every(s=>e.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new rp(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),e=n.length,s=n[e-1];let r;if(rn(s))r=s.select();else{const o=s.getIndexWithinParent()+1;r=s.getParentOrThrow().select(o,o)}r.insertNodes(t);for(let o=0;o<e;o++)n[o].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,e=[];for(const s of n){const r=qr(s);r!==null&&e.push(r)}return Kl()||(this._cachedNodes=e),e}getTextContent(){const t=this.getNodes();let n="";for(let e=0;e<t.length;e++)n+=t[e].getTextContent();return n}}function vn(c){return c instanceof Bs}class Bs{constructor(t,n,e,s){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=e,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return vn(t)?this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this.anchor,e=this.focus,s=n.isBefore(e),r=s?n:e,o=s?e:n;let i=r.getNode(),u=o.getNode();const a=r.offset,f=o.offset;if(At(i)){const d=i.getDescendantByIndex(a);i=d??i}if(At(u)){let d=u.getDescendantByIndex(f);d!==null&&d!==i&&u.getChildAtIndex(f)===d&&(d=d.getPreviousSibling()),u=d??u}let l;return i.is(u)?At(i)&&i.getChildrenSize()>0?l=[]:l=[i]:l=i.getNodesBetween(u),Kl()||(this._cachedNodes=l),l}setTextNodeRange(t,n,e,s){Ls(this.anchor,t.__key,n,"text"),Ls(this.focus,e.__key,s,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],e=t[t.length-1],s=this.anchor,r=this.focus,o=s.isBefore(r),[i,u]=d0(this);let a="",f=!0;for(let l=0;l<t.length;l++){const d=t[l];if(At(d)&&!d.isInline())f||(a+=`
|
|
37
|
+
`),d.isEmpty()?f=!1:f=!0;else if(f=!1,rn(d)){let p=d.getTextContent();d===n?d===e?(s.type!=="element"||r.type!=="element"||r.offset===s.offset)&&(p=i<u?p.slice(i,u):p.slice(u,i)):p=o?p.slice(i):p.slice(u):d===e&&(p=o?p.slice(0,u):p.slice(0,i)),a+=p}else(dr(d)||Fa(d))&&(d!==e||!this.isCollapsed())&&(a+=d.getTextContent())}return a}applyDOMRange(t){const n=Xn(),s=n.getEditorState()._selection,r=nx(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,s);if(r===null)return;const[o,i]=r;Ls(this.anchor,o.key,o.offset,o.type),Ls(this.focus,i.key,i.offset,i.type),this._cachedNodes=null}clone(){const t=this.anchor,n=this.focus;return new Bs(ri(t.key,t.offset,t.type),ri(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=Bm(this.format,t,null),this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Ps[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),e=[],s=n.length;for(let r=0;r<s;r++){const o=n[r];o===`
|
|
38
38
|
`||o===`\r
|
|
39
|
-
`?e.push(zl()):o===" "?e.push(np()):e.push($r(o))}this.insertNodes(e)}insertText(t){const n=this.anchor,e=this.focus,s=this.isCollapsed()||n.isBefore(e),r=this.format,o=this.style;s&&n.type==="element"?X1(n,e,r,o):!s&&e.type==="element"&&X1(e,n,r,o);const i=this.getNodes(),u=i.length,a=s?n:e,f=s?e:n,l=a.offset,d=f.offset;let p=i[0];if(!rn(p))throw Error("insertText: first node is not a text node");const m=p.getTextContent().length,g=p.getParentOrThrow(),y=u-1;let b=i[y];if(this.isCollapsed()&&l===m&&(p.isSegmented()||p.isToken()||!p.canInsertTextAfter()||!g.canInsertTextAfter()&&p.getNextSibling()===null)){let v=p.getNextSibling();if((!rn(v)||!v.canInsertTextBefore()||Lm(v))&&(v=$r(),v.setFormat(r),g.canInsertTextAfter()?p.insertAfter(v):g.insertAfter(v)),v.select(0,0),p=v,t!==""){this.insertText(t);return}}else if(this.isCollapsed()&&l===0&&(p.isSegmented()||p.isToken()||!p.canInsertTextBefore()||!g.canInsertTextBefore()&&p.getPreviousSibling()===null)){let v=p.getPreviousSibling();if((!rn(v)||Lm(v))&&(v=$r(),v.setFormat(r),g.canInsertTextBefore()?p.insertBefore(v):g.insertBefore(v)),v.select(),p=v,t!==""){this.insertText(t);return}}else if(p.isSegmented()&&l!==m){const v=$r(p.getTextContent());v.setFormat(r),p.replace(v),p=v}else if(!this.isCollapsed()&&t!==""){const v=b.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||At(v)&&(!v.canInsertTextBefore()||!v.canInsertTextAfter())){this.insertText(""),nx(this.anchor,this.focus,null),this.insertText(t);return}}if(u===1){if(p.isToken()){const x=$r(t);x.select(),p.replace(x);return}const v=p.getFormat(),_=p.getStyle();if(l===d&&(v!==r||_!==o))if(p.getTextContent()==="")p.setFormat(r),p.setStyle(o);else{const x=$r(t);if(x.setFormat(r),x.setStyle(o),x.select(),l===0)p.insertBefore(x,!1);else{const[S]=p.splitText(l);S.insertAfter(x,!1)}x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);return}else if(G1(p)){const x=$r(t);x.setFormat(r),x.setStyle(o),x.select(),p.replace(x);return}const w=d-l;p=p.spliceText(l,w,t,!0),p.getTextContent()===""?p.remove():this.anchor.type==="text"&&(p.isComposing()?this.anchor.offset-=t.length:(this.format=v,this.style=_))}else{const v=new Set([...p.getParentKeys(),...b.getParentKeys()]),_=At(p)?p:p.getParentOrThrow();let w=At(b)?b:b.getParentOrThrow(),x=b;if(!_.is(w)&&w.isInline())do x=w,w=w.getParentOrThrow();while(w.isInline());if(f.type==="text"&&(d!==0||b.getTextContent()==="")||f.type==="element"&&b.getIndexWithinParent()<d)if(rn(b)&&!b.isToken()&&d!==b.getTextContentSize()){if(b.isSegmented()){const A=$r(b.getTextContent());b.replace(A),b=A}!Ao(f.getNode())&&f.type==="text"&&(b=b.spliceText(0,d,"")),v.add(b.__key)}else{const A=b.getParentOrThrow();!A.canBeEmpty()&&A.getChildrenSize()===1?A.remove():b.remove()}else v.add(b.__key);const S=w.getChildren(),E=new Set(i),O=_.is(w),j=_.isInline()&&p.getNextSibling()===null?_:p;for(let A=S.length-1;A>=0;A--){const T=S[A];if(T.is(p)||At(T)&&T.isParentOf(p))break;T.isAttached()&&(!E.has(T)||T.is(x)?O||j.insertAfter(T,!1):T.remove())}if(!O){let A=w,T=null;for(;A!==null;){const I=A.getChildren(),k=I.length;(k===0||I[k-1].is(T))&&(v.delete(A.__key),T=A),A=A.getParent()}}if(!p.isToken())p=p.spliceText(l,m-l,t,!0),p.getTextContent()===""?p.remove():p.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);else if(l===m)p.select();else{const A=$r(t);A.select(),p.replace(A)}for(let A=1;A<u;A++){const T=i[A],I=T.__key;v.has(I)||T.remove()}}}removeText(){this.insertText("")}formatText(t){if(this.isCollapsed()){this.toggleFormat(t),Mr(null);return}const n=this.getNodes(),e=[];for(const b of n)rn(b)&&e.push(b);const s=e.length;if(s===0){this.toggleFormat(t),Mr(null);return}const r=this.anchor,o=this.focus,i=this.isBackward(),u=i?o:r,a=i?r:o;let f=0,l=e[0],d=u.type==="element"?0:u.offset;if(u.type==="text"&&d===l.getTextContentSize()&&(f=1,l=e[1],d=0),l==null)return;const p=l.getFormatFlags(t,null),h=s-1;let m=e[h];const g=a.type==="text"?a.offset:m.getTextContentSize();if(l.is(m)){if(d===g)return;if(d===0&&g===l.getTextContentSize())l.setFormat(p);else{const b=l.splitText(d,g),v=d===0?b[0]:b[1];v.setFormat(p),u.type==="text"&&u.set(v.__key,0,"text"),a.type==="text"&&a.set(v.__key,g-d,"text")}this.format=p;return}d!==0&&([,l]=l.splitText(d),d=0),l.setFormat(p);const y=m.getFormatFlags(t,p);g>0&&(g!==m.getTextContentSize()&&([m]=m.splitText(g)),m.setFormat(y));for(let b=f+1;b<h;b++){const v=e[b];if(!v.isToken()){const _=v.getFormatFlags(t,y);v.setFormat(_)}}u.type==="text"&&u.set(l.__key,d,"text"),a.type==="text"&&a.set(m.__key,g,"text"),this.format=p|y}insertNodes(t){if(t.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const y=Jn();if(!vn(y))throw Error("Expected RangeSelection after insertParagraph");return y.insertNodes(t)}const n=this.isBackward()?this.focus:this.anchor,e=Jm(n.getNode(),Bl),s=t[t.length-1];if("__language"in e&&At(e)){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const y=h0(this);e.splice(y,0,t),s.selectEnd()}return}const r=y=>(At(y)||dr(y))&&!y.isInline();if(!t.some(r)){if(!At(e))throw Error("Expected 'firstBlock' to be an ElementNode");const y=h0(this);e.splice(y,0,t),s.selectEnd();return}const o=ZA(t),i=o.getLastDescendant(),u=o.getChildren(),a=y=>"__value"in y&&"__checked"in y,f=y=>At(y)&&Bl(y)&&!y.isEmpty()&&At(e)&&(!e.isEmpty()||a(e)),d=!At(e)||!e.isEmpty()?this.insertParagraph():null,p=u[u.length-1];let h=u[0];if(f(h)){if(!At(e))throw Error("Expected 'firstBlock' to be an ElementNode");e.append(...h.getChildren()),h=u[1]}h&&NA(e,h);const m=Jm(i,Bl);d&&At(m)&&(a(d)||Bl(p))&&(m.append(...d.getChildren()),d.remove()),At(e)&&e.isEmpty()&&e.remove(),i.selectEnd();const g=At(e)?e.getLastChild():null;Fa(g)&&m!==e&&g.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=Zi();return No().splice(this.anchor.offset,0,[o]),o.select(),o}const t=h0(this),n=Jm(this.anchor.getNode(),Bl);if(!At(n))throw Error("Expected ancestor to be an ElementNode");const e=n.getChildAtIndex(t),s=e?[e,...e.getNextSiblings()]:[],r=n.insertNewAfter(this,!1);return r?(r.append(...s),r.selectStart(),r):null}insertLineBreak(t){const n=zl();if(this.insertNodes([n]),t){const e=n.getParentOrThrow(),s=n.getIndexWithinParent();e.select(s,s)}}extract(){const t=this.getNodes(),n=t.length,e=n-1,s=this.anchor,r=this.focus;let o=t[0],i=t[e];const[u,a]=d0(this);if(n===0)return[];if(n===1){if(rn(o)&&!this.isCollapsed()){const l=u>a?a:u,d=u>a?u:a,p=o.splitText(l,d),h=l===0?p[0]:p[1];return h!=null?[h]:[]}return[o]}const f=s.isBefore(r);if(rn(o)){const l=f?u:a;l===o.getTextContentSize()?t.shift():l!==0&&([,o]=o.splitText(l),t[0]=o)}if(rn(i)){const d=i.getTextContent().length,p=f?a:u;p===0?t.pop():p!==d&&([i]=i.splitText(p),t[e]=i)}return t}modify(t,n,e){const s=this.focus,r=this.anchor,o=t==="move",i=Hm(s,n);if(dr(i)&&!i.isIsolated()){if(o&&i.isKeyboardSelectable()){const p=f0();p.add(i.__key),vi(p);return}const d=n?i.getPreviousSibling():i.getNextSibling();if(rn(d)){const p=d.__key,h=n?d.getTextContent().length:0;s.set(p,h,"text"),o&&r.set(p,h,"text");return}else{const p=i.getParentOrThrow();let h,m;At(d)?(m=d.__key,h=n?d.getChildrenSize():0):(h=i.getIndexWithinParent(),m=p.__key,n||h++),s.set(m,h,"element"),o&&r.set(m,h,"element");return}}const u=Xn(),a=_i(u._window);if(!a)return;const f=u._blockCursorElement,l=u._rootElement;if(l!==null&&f!==null&&At(i)&&!i.isInline()&&!i.canBeEmpty()&&qm(f,u,l),zA(a,t,n?"backward":"forward",e),a.rangeCount>0){const d=a.getRangeAt(0),p=this.anchor.getNode(),h=Ao(p)?p:w1(p);if(this.applyDOMRange(d),this.dirty=!0,!o){const m=this.getNodes(),g=[];let y=!1;for(let b=0;b<m.length;b++){const v=m[b];Kf(v,h)?g.push(v):y=!0}if(y&&g.length>0)if(n){const b=g[0];At(b)?b.selectStart():b.getParentOrThrow().selectStart()}else{const b=g[g.length-1];At(b)?b.selectEnd():b.getParentOrThrow().selectEnd()}(a.anchorNode!==d.startContainer||a.anchorOffset!==d.startOffset)&&$A(this)}}}forwardDeletion(t,n,e){if(!e&&(t.type==="element"&&At(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const s=n.getParent(),r=n.getNextSibling()||(s===null?null:s.getNextSibling());if(At(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let s=e.getNode();if(this.forwardDeletion(e,s,t))return;const r=this.focus,o=Hm(r,t);if(dr(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&At(s)&&s.getChildrenSize()===0){s.remove();const i=f0();i.add(o.__key),vi(i)}else o.remove(),Xn().dispatchCommand(Af,void 0);return}else if(!t&&At(o)&&At(s)&&s.isEmpty()){s.remove(),o.selectStart();return}if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&e.offset===0&&(e.type==="element"?e.getNode():e.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const i=r.type==="text"?r.getNode():null;if(s=e.type==="text"?e.getNode():null,i!==null&&i.isSegmented()){const u=r.offset,a=i.getTextContentSize();if(i.is(s)||t&&u!==a||!t&&u!==0){Q1(i,t,u);return}}else if(s!==null&&s.isSegmented()){const u=e.offset,a=s.getTextContentSize();if(s.is(i)||t&&u!==0||!t&&u!==a){Q1(s,t,u);return}}UA(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const e=this.anchor.getNode();e.isEmpty()&&Ao(e.getParent())&&e.getIndexWithinParent()===0&&e.collapseAtStart(this)}}deleteLine(t){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",t,"lineboundary"),(t?this.focus:this.anchor).offset===0&&this.modify("extend",t,"character")),this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,e=n.getNode();if(this.forwardDeletion(n,e,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Uu(c){return c instanceof rp}function Z1(c){const t=c.offset;if(c.type==="text")return t;const n=c.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function d0(c){const t=c.getStartEndPoints();if(t===null)return[0,0];const[n,e]=t;return n.type==="element"&&e.type==="element"&&n.key===e.key&&n.offset===e.offset?[0,0]:[Z1(n),Z1(e)]}function $A(c){const t=c.focus,n=c.anchor,e=n.key,s=n.offset,r=n.type;Ls(n,t.key,t.offset,t.type),Ls(t,e,s,r),c._cachedNodes=null}function zA(c,t,n,e){c.modify(t,n,e)}function UA(c,t){const n=c.anchor,e=c.focus,s=n.getNode(),r=e.getNode();if(s===r&&n.type==="text"&&e.type==="text"){const o=n.offset,i=e.offset,u=o<i,a=u?o:i,f=u?i:o,l=f-1;if(a!==l){const d=s.getTextContent().slice(a,f);p1(d)||(t?e.offset=l:n.offset=l)}}}function Q1(c,t,n){const e=c,r=e.getTextContent().split(/(?=\s)/g),o=r.length;let i=0,u=0;for(let f=0;f<o;f++){const l=r[f],d=f===o-1;if(u=i,i+=l.length,t&&i===n||i>n||d){r.splice(f,1),d&&(u=void 0);break}}const a=r.join("").trim();a===""?e.remove():(e.setTextContent(a),e.select(u,u))}function HA(c,t,n){const e=c.getParent();return n===null||e===null||!e.canBeEmpty()||e!==n.getNode()}function ex(c,t,n,e){let s=t,r;if(c.nodeType===Tu){let o=!1;const i=c.childNodes,u=i.length;s===u&&(o=!0,s=u-1);let a=i[s],f=!1;if(a===e._blockCursorElement?(a=i[s+1],f=!0):e._blockCursorElement!==null&&s--,r=Ll(a),rn(r))s=f1(r,o);else{let l=Ll(c);if(l===null)return null;if(At(l)){let d=l.getChildAtIndex(s);if(At(d)&&HA(d,s,n)){const p=o?d.getLastDescendant():d.getFirstDescendant();p===null?(l=d,s=0):(d=p,l=At(d)?d:d.getParentOrThrow())}rn(d)?(r=d,l=null,s=f1(d,o)):d!==l&&o&&!f&&s++}else{const d=l.getIndexWithinParent();t===0&&dr(l)&&Ll(c)===l?s=d:s=d+1,l=l.getParentOrThrow()}if(At(l))return ri(l.__key,s,"element")}}else r=Ll(c);return rn(r)?ri(r.__key,s,"text"):null}function tx(c,t,n){const e=c.offset,s=c.getNode();if(e===0){const r=s.getPreviousSibling(),o=s.getParent();if(!t)At(r)&&!n&&r.isInline()?(c.key=r.__key,c.offset=r.getChildrenSize(),c.type="element"):rn(r)&&(c.key=r.__key,c.offset=r.getTextContent().length);else if((n||!t)&&r===null&&At(o)&&o.isInline()){const i=o.getPreviousSibling();rn(i)&&(c.key=i.__key,c.offset=i.getTextContent().length)}}else if(e===s.getTextContent().length){const r=s.getNextSibling(),o=s.getParent();if(t&&At(r)&&r.isInline())c.key=r.__key,c.offset=0,c.type="element";else if((n||t)&&r===null&&At(o)&&o.isInline()&&!o.canInsertTextAfter()){const i=o.getNextSibling();rn(i)&&(c.key=i.__key,c.offset=0)}}}function nx(c,t,n){if(c.type==="text"&&t.type==="text"){const e=c.isBefore(t),s=c.is(t);tx(c,e,s),tx(t,!e,s),s&&(t.key=c.key,t.offset=c.offset,t.type=c.type);const r=Xn();if(r.isComposing()&&r._compositionKey!==c.key&&vn(n)){const o=n.anchor,i=n.focus;Ls(c,o.key,o.offset,o.type),Ls(t,i.key,i.offset,i.type)}}}function rx(c,t,n,e,s,r){if(c===null||n===null||!Nu(s,c,n))return null;const o=ex(c,t,vn(r)?r.anchor:null,s);if(o===null)return null;const i=ex(n,e,vn(r)?r.focus:null,s);if(i===null)return null;if(o.type==="element"&&i.type==="element"){const u=Ll(c),a=Ll(n);if(dr(u)&&dr(a))return null}return nx(o,i,r),[o,i]}function KA(c){return At(c)&&!c.isInline()}function ox(c,t,n,e,s,r){const o=xi(),i=new Bs(ri(c,t,s),ri(n,e,r),0,"");return i.dirty=!0,o._selection=i,i}function WA(){const c=ri("root",0,"element"),t=ri("root",0,"element");return new Bs(c,t,0,"")}function f0(){return new rp(new Set)}function qA(c){const n=c.getEditorState()._selection,e=_i(c._window);return vn(n)||n==null?p0(n,e,c,null):n.clone()}function p0(c,t,n,e){const s=n._window;if(s===null)return null;const r=e||s.event,o=r?r.type:void 0,i=o==="selectionchange",u=!GN()&&(i||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&r&&r.detail===3||o==="drop"||o===void 0);let a,f,l,d;if(!vn(c)||u){if(t===null)return null;if(a=t.anchorNode,f=t.focusNode,l=t.anchorOffset,d=t.focusOffset,i&&vn(c)&&!Nu(n,a,f))return c.clone()}else return c.clone();const p=rx(a,l,f,d,n,c);if(p===null)return null;const[h,m]=p;return new Bs(h,m,vn(c)?c.format:0,vn(c)?c.style:"")}function Jn(){return xi()._selection}function Hl(){return Xn()._editorState._selection}function op(c,t,n,e=1){const s=c.anchor,r=c.focus,o=s.getNode(),i=r.getNode();if(!t.is(o)&&!t.is(i))return;const u=t.__key;if(c.isCollapsed()){const a=s.offset;if(n<=a&&e>0||n<a&&e<0){const f=Math.max(0,a+e);s.set(u,f,"element"),r.set(u,f,"element"),ix(c)}}else{const a=c.isBackward(),f=a?r:s,l=f.getNode(),d=a?s:r,p=d.getNode();if(t.is(l)){const h=f.offset;(n<=h&&e>0||n<h&&e<0)&&f.set(u,Math.max(0,h+e),"element")}if(t.is(p)){const h=d.offset;(n<=h&&e>0||n<h&&e<0)&&d.set(u,Math.max(0,h+e),"element")}}ix(c)}function ix(c){const t=c.anchor,n=t.offset,e=c.focus,s=e.offset,r=t.getNode(),o=e.getNode();if(c.isCollapsed()){if(!At(r))return;const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(rn(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text"),e.set(a.__key,f,"text")}return}if(At(r)){const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(rn(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text")}}if(At(o)){const i=o.getChildrenSize(),u=s>=i,a=u?o.getChildAtIndex(i-1):o.getChildAtIndex(s);if(rn(a)){let f=0;u&&(f=a.getTextContentSize()),e.set(a.__key,f,"text")}}}function JA(c,t){const e=t.getEditorState()._selection,s=c._selection;if(vn(s)){const r=s.anchor,o=s.focus;let i;if(r.type==="text"&&(i=r.getNode(),i.selectionTransform(e,s)),o.type==="text"){const u=o.getNode();i!==u&&u.selectionTransform(e,s)}}}function ip(c,t,n,e,s){let r=null,o=0,i=null;e!==null?(r=e.__key,rn(e)?(o=e.getTextContentSize(),i="text"):At(e)&&(o=e.getChildrenSize(),i="element")):s!==null&&(r=s.__key,rn(s)?i="text":At(s)&&(i="element")),r!==null&&i!==null?c.set(r,o,i):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),c.set(n.__key,o,"element"))}function sx(c,t,n,e,s){c.type==="text"?(c.key=n,t||(c.offset+=s)):c.offset>e.getIndexWithinParent()&&(c.offset-=1)}function VA(c,t,n,e,s,r,o){const i=e.anchorNode,u=e.focusNode,a=e.anchorOffset,f=e.focusOffset,l=document.activeElement;if(s.has("collaboration")&&l!==r||l!==null&&jm(l))return;if(!vn(t)){c!==null&&Nu(n,i,u)&&e.removeAllRanges();return}const d=t.anchor,p=t.focus,h=d.key,m=p.key,g=Uf(n,h),y=Uf(n,m),b=d.offset,v=p.offset,_=t.format,w=t.style,x=t.isCollapsed();let S=g,E=y,O=!1;if(d.type==="text"){S=Ff(g);const j=d.getNode();O=j.getFormat()!==_||j.getStyle()!==w}else vn(c)&&c.anchor.type==="text"&&(O=!0);if(p.type==="text"&&(E=Ff(y)),!(S===null||E===null)&&(x&&(c===null||O||vn(c)&&(c.format!==_||c.style!==w))&&OA(_,w,b,h,performance.now()),!(a===b&&f===v&&i===S&&u===E&&!(e.type==="Range"&&x)&&((l===null||!r.contains(l))&&r.focus({preventScroll:!0}),d.type!=="element")))){try{e.setBaseAndExtent(S,b,E,v)}catch{}if(!s.has("skip-scroll-into-view")&&t.isCollapsed()&&r!==null&&r===document.activeElement){const j=t instanceof Bs&&t.anchor.type==="element"?S.childNodes[b]||null:e.rangeCount>0?e.getRangeAt(0):null;if(j!==null){let A;if(j instanceof Text){const T=document.createRange();T.selectNode(j),A=T.getBoundingClientRect()}else A=j.getBoundingClientRect();qk(n,A,r)}}EA()}}function GA(c){let t=Jn()||Hl();t===null&&(t=No().selectEnd()),t.insertNodes(c)}function YA(){const c=Jn();return c===null?"":c.getTextContent()}function h0(c){c.isCollapsed()||c.removeText();const t=c.anchor;let n=t.getNode(),e=t.offset;for(;!Bl(n);)[n,e]=XA(n,e);return e}function XA(c,t){const n=c.getParent();if(!n){const s=Zi();return No().append(s),s.select(),[No(),0]}if(rn(c)){const s=c.splitText(t);if(s.length===0)return[n,c.getIndexWithinParent()];const r=t===0?0:1,o=s[0].getIndexWithinParent()+r;return[n,o]}if(!At(c)||t===0)return[n,c.getIndexWithinParent()];const e=c.getChildAtIndex(t);if(e){const s=new Bs(ri(c.__key,t,"element"),ri(c.__key,t,"element"),0,""),r=c.insertNewAfter(s);r&&r.append(e,...e.getNextSiblings())}return[n,c.getIndexWithinParent()+1]}function ZA(c){const t=Zi();let n=null;for(let e=0;e<c.length;e++){const s=c[e],r=Fa(s);if(r||dr(s)&&s.isInline()||At(s)&&s.isInline()||rn(s)||s.isParentRequired()){if(n===null&&(n=s.createParentElementNode(),t.append(n),r))continue;n!==null&&n.append(s)}else t.append(s),n=null}return t}let Ir=null,Rr=null,vo=!1,g0=!1,sp=0;const ax={characterData:!0,childList:!0,subtree:!0};function Kl(){return vo||Ir!==null&&Ir._readOnly}function Jr(){if(vo)throw Error("Cannot use method in read-only mode.")}function lx(){if(sp>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function xi(){if(Ir===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 Ir}function Xn(){if(Rr===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return Rr}function QA(){return Rr}function cx(c,t,n){const e=t.__type,s=rk(c,e);let r=n.get(e);r===void 0&&(r=Array.from(s.transforms),n.set(e,r));const o=r.length;for(let i=0;i<o&&(r[i](t),!!t.isAttached());i++);}function ux(c,t){return c!==void 0&&c.__key!==t&&c.isAttached()}function eP(c,t){const n=t._dirtyLeaves,e=c._nodeMap;for(const s of n){const r=e.get(s);rn(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&o1(r)}}function tP(c,t){const n=t._dirtyLeaves,e=t._dirtyElements,s=c._nodeMap,r=Ms(),o=new Map;let i=n,u=i.size,a=e,f=a.size;for(;u>0||f>0;){if(u>0){t._dirtyLeaves=new Set;for(const l of i){const d=s.get(l);rn(d)&&d.isAttached()&&d.isSimpleText()&&!d.isUnmergeable()&&o1(d),d!==void 0&&ux(d,r)&&cx(t,d,o),n.add(l)}if(i=t._dirtyLeaves,u=i.size,u>0){sp++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const l of a){const d=l[0],p=l[1];if(d!=="root"&&!p)continue;const h=s.get(d);h!==void 0&&ux(h,r)&&cx(t,h,o),e.set(d,p)}i=t._dirtyLeaves,u=i.size,a=t._dirtyElements,f=a.size,sp++}t._dirtyLeaves=n,t._dirtyElements=e}function nP(c){return m0(c,Xn()._nodes)}function m0(c,t){const n=c.type,e=t.get(n);if(e===void 0)throw Error(`parseEditorState: type "${n}" + not found`);const s=e.klass;if(c.type!==s.getType())throw Error(`LexicalNode: Node ${s.name} does not implement .importJSON().`);const r=s.importJSON(c),o=c.children;if(At(r)&&Array.isArray(o))for(let i=0;i<o.length;i++){const u=o[i],a=m0(u,t);r.append(a)}return r}function rP(c,t,n){const e=b0(),s=Ir,r=vo,o=Rr,i=t._dirtyElements,u=t._dirtyLeaves,a=t._cloneNotNeeded,f=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Ir=e,vo=!1,Rr=t;try{const l=t._nodes,d=c.root;m0(d,l),n&&n(),e._readOnly=!0,fx(e)}catch(l){l instanceof Error&&t._onError(l)}finally{t._dirtyElements=i,t._dirtyLeaves=u,t._cloneNotNeeded=a,t._dirtyType=f,Ir=s,vo=r,Rr=o}return e}function dx(c,t){const n=Ir,e=vo,s=Rr;Ir=c,vo=!0,Rr=null;try{return t()}finally{Ir=n,vo=e,Rr=s}}function fx(c){const t=c._nodeMap;t.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},t.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},t.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function $a(c,t){const n=c._pendingEditorState,e=c._rootElement,s=c._headless||e===null;if(n===null)return;const r=c._editorState,o=r._selection,i=n._selection,u=c._dirtyType!==ja,a=Ir,f=vo,l=Rr,d=c._updating,p=c._observer;let h=null;if(c._pendingEditorState=null,c._editorState=n,!s&&u&&p!==null){Rr=c,Ir=n,vo=!1,c._updating=!0;try{const x=c._dirtyType,S=c._dirtyElements,E=c._dirtyLeaves;p.disconnect(),h=dA(r,n,c,x,S,E)}catch(x){if(x instanceof Error&&c._onError(x),!g0)bx(c,null,e,n),t1(c),c._dirtyType=Dl,g0=!0,$a(c,r),g0=!1;else throw x;return}finally{p.observe(e,ax),c._updating=d,Ir=a,vo=f,Rr=l}}n._readOnly||(n._readOnly=!0,fx(n),vn(i)&&(Object.freeze(i.anchor),Object.freeze(i.focus)),Object.freeze(i));const m=c._dirtyLeaves,g=c._dirtyElements,y=c._normalizedNodes,b=c._updateTags,v=c._deferred;u&&(c._dirtyType=ja,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements=new Map,c._normalizedNodes=new Set,c._updateTags=new Set),rA(c,n);const _=s?null:_i(c._window);if(c._editable&&_!==null&&(u||i===null||i.dirty)){Rr=c,Ir=n;try{if(p!==null&&p.disconnect(),u||i===null||i.dirty){const x=c._blockCursorElement;x!==null&&qm(x,c,e),VA(o,i,c,_,b,e)}Qk(c,e,i),p!==null&&p.observe(e,ax)}finally{Rr=l,Ir=a}}h!==null&&iP(c,h,b,m,r),!vn(i)&&i!==null&&(o===null||!o.is(i))&&c.dispatchCommand(Af,void 0);const w=c._pendingDecorators;w!==null&&(c._decorators=w,c._pendingDecorators=null,Hu("decorator",c,!0,w)),oP(c,t||r,n),Hu("update",c,!0,{dirtyElements:g,dirtyLeaves:m,editorState:n,normalizedNodes:y,prevEditorState:t||r,tags:b}),aP(c,v),sP(c)}function oP(c,t,n){const e=u1(t),s=u1(n);e!==s&&Hu("textcontent",c,!0,s)}function iP(c,t,n,e,s){const r=Array.from(c._listeners.mutation),o=r.length;for(let i=0;i<o;i++){const[u,a]=r[i],f=t.get(a);f!==void 0&&u(f,{dirtyLeaves:e,prevEditorState:s,updateTags:n})}}function Hu(c,t,n,...e){const s=t._updating;t._updating=n;try{const r=Array.from(t._listeners[c]);for(let o=0;o<r.length;o++)r[o].apply(null,e)}finally{t._updating=s}}function px(c,t,n){if(c._updating===!1||Rr!==c){let s=!1;return c.update(()=>{s=px(c,t,n)}),s}const e=Fm(c);for(let s=4;s>=0;s--)for(let r=0;r<e.length;r++){const u=e[r]._commands.get(t);if(u!==void 0){const a=u[s];if(a!==void 0){const f=Array.from(a),l=f.length;for(let d=0;d<l;d++)if(f[d](n,c)===!0)return!0}}}return!1}function sP(c){const t=c._updates;if(t.length!==0){const n=t.shift();if(n){const[e,s]=n;gx(c,e,s)}}}function aP(c,t){if(c._deferred=[],t.length!==0){const n=c._updating;c._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{c._updating=n}}}function hx(c,t){const n=c._updates;let e=t||!1;for(;n.length!==0;){const s=n.shift();if(s){const[r,o]=s;let i,u;o!==void 0&&(i=o.onUpdate,u=o.tag,o.skipTransforms&&(e=!0),i&&c._deferred.push(i),u&&c._updateTags.add(u)),r()}}return e}function gx(c,t,n){const e=c._updateTags;let s,r,o=!1,i=!1;n!==void 0&&(s=n.onUpdate,r=n.tag,r!=null&&e.add(r),o=n.skipTransforms||!1,i=n.discrete||!1),s&&c._deferred.push(s);const u=c._editorState;let a=c._pendingEditorState,f=!1;(a===null||a._readOnly)&&(a=c._pendingEditorState=uP(a||u),f=!0),a._flushSync=i;const l=Ir,d=vo,p=Rr,h=c._updating;Ir=a,vo=!1,c._updating=!0,Rr=c;try{f&&(c._headless?u._selection!==null&&(a._selection=u._selection.clone()):a._selection=qA(c));const g=c._compositionKey;t(),o=hx(c,o),JA(a,c),c._dirtyType!==ja&&(o?eP(a,c):tP(a,c),hx(c),oA(u,a,c._dirtyLeaves,c._dirtyElements));const y=c._compositionKey;g!==y&&(a._flushSync=!0);const b=a._selection;if(vn(b)){const v=a._nodeMap,_=b.anchor.key,w=b.focus.key;if(v.get(_)===void 0||v.get(w)===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 Uu(b)&&b._nodes.size===0&&(a._selection=null)}catch(g){g instanceof Error&&c._onError(g),c._pendingEditorState=u,c._dirtyType=Dl,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),$a(c);return}finally{Ir=l,vo=d,Rr=p,c._updating=h,sp=0}c._dirtyType!==ja||cP(a,c)?a._flushSync?(a._flushSync=!1,$a(c)):f&&ok(()=>{$a(c)}):(a._flushSync=!1,f&&(e.clear(),c._deferred=[],c._pendingEditorState=null))}function ko(c,t,n){c._updating?c._updates.push([t,n]):gx(c,t,n)}let y0=class extends Qf{constructor(t){super(t)}decorate(t,n){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function dr(c){return c instanceof y0}let ap=class extends Qf{constructor(t){super(t),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 t=this.getFormat();return WN[t]||""}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const n=Xn()._dirtyElements;return n!==null&&n.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(rn(n)&&t.push(n),At(n)){const e=n.getAllTextNodes();t.push(...e)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;At(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;At(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),e=n.length;if(t>=e){const r=n[e-1];return At(r)&&r.getLastDescendant()||r||null}const s=n[t];return At(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const n=this.getLatest().__first;return n===null?null:qr(n)}getFirstChildOrThrow(){const t=this.getFirstChild();if(t===null)throw Error(`Expected node ${this.__key} to have a first child.`);return t}getLastChild(){const n=this.getLatest().__last;return n===null?null:qr(n)}getLastChildOrThrow(){const t=this.getLastChild();if(t===null)throw Error(`Expected node ${this.__key} to have a last child.`);return t}getChildAtIndex(t){const n=this.getChildrenSize();let e,s;if(t<n/2){for(e=this.getFirstChild(),s=0;e!==null&&s<=t;){if(s===t)return e;e=e.getNextSibling(),s++}return null}for(e=this.getLastChild(),s=n-1;e!==null&&s>=t;){if(s===t)return e;e=e.getPreviousSibling(),s--}return null}getTextContent(){let t="";const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContent(),At(r)&&s!==e-1&&!r.isInline()&&(t+=Gi)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContentSize(),At(r)&&s!==e-1&&!r.isInline()&&(t+=Gi.length)}return t}getDirection(){return this.getLatest().__dir}hasFormat(t){if(t!==""){const n=Z_[t];return(this.getFormat()&n)!==0}return!1}select(t,n){Jr();const e=Jn();let s=t,r=n;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const u=this.getFirstChild();if(rn(u)||At(u))return u.select(0,0)}else if((t===void 0||t===o)&&(n===void 0||n===o)){const u=this.getLastChild();if(rn(u)||At(u))return u.select()}}s===void 0&&(s=o),r===void 0&&(r=o);const i=this.__key;if(vn(e))e.anchor.set(i,s,"element"),e.focus.set(i,r,"element"),e.dirty=!0;else return ox(i,s,i,r,"element","element");return e}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(e=>e.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){const n=this.getWritable();return n.__format=t!==""?Z_[t]:0,this}setIndent(t){const n=this.getWritable();return n.__indent=t,this}splice(t,n,e){const s=e.length,r=this.getChildrenSize(),o=this.getWritable(),i=o.__key,u=[],a=[],f=this.getChildAtIndex(t+n);let l=null,d=r-n+s;if(t!==0)if(t===r)l=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(l=h.getPreviousSibling())}if(n>0){let h=l===null?this.getFirstChild():l.getNextSibling();for(let m=0;m<n;m++){if(h===null)throw Error("splice: sibling not found");const g=h.getNextSibling(),y=h.__key,b=h.getWritable();Da(b),a.push(y),h=g}}let p=l;for(let h=0;h<s;h++){const m=e[h];p!==null&&m.is(p)&&(l=p=p.getPreviousSibling());const g=m.getWritable();g.__parent===i&&d--,Da(g);const y=m.__key;if(p===null)o.__first=y,g.__prev=null;else{const b=p.getWritable();b.__next=y,g.__prev=b.__key}if(m.__key===i)throw Error("append: attempting to append self");g.__parent=i,u.push(y),p=m}if(t+n===r){if(p!==null){const h=p.getWritable();h.__next=null,o.__last=p.__key}}else if(f!==null){const h=f.getWritable();if(p!==null){const m=p.getWritable();h.__prev=p.__key,m.__next=f.__key}else h.__prev=null}if(o.__size=d,a.length){const h=Jn();if(vn(h)){const m=new Set(a),g=new Set(u),{anchor:y,focus:b}=h;mx(y,m,g)&&ip(y,y.getNode(),this,l,f),mx(b,m,g)&&ip(b,b.getNode(),this,l,f),d===0&&!this.canBeEmpty()&&!Is(this)&&this.remove()}}return o}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,e){return!1}};function At(c){return c instanceof ap}function mx(c,t,n){let e=c.getNode();for(;e;){const s=e.__key;if(t.has(s)&&!n.has(s))return!0;e=e.getParent()}return!1}let lp=class pN extends ap{static getType(){return"root"}static clone(){return new pN}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const t=this.__cachedText;return(Kl()||Xn()._dirtyType===ja)&&t!==null?t:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(t){throw Error("replace: cannot be called on root nodes")}insertBefore(t){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(t){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(t,n){return!1}append(...t){for(let n=0;n<t.length;n++){const e=t[n];if(!At(e)&&!dr(e))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...t)}static importJSON(t){const n=No();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}};function lP(){return new lp}function Ao(c){return c instanceof lp}function cP(c,t){const n=t.getEditorState()._selection,e=c._selection;if(e!==null){if(e.dirty||!e.is(n))return!0}else if(n!==null)return!0;return!1}function uP(c){return new cp(new Map(c._nodeMap))}function b0(){return new cp(new Map([["root",lP()]]))}function yx(c){const t=c.exportJSON(),n=c.constructor;if(t.type!==n.getType())throw Error(`LexicalNode: Node ${n.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(At(c)){const e=t.children;if(!Array.isArray(e))throw Error(`LexicalNode: Node ${n.name} is an element but .exportJSON() does not have a children array.`);const s=c.getChildren();for(let r=0;r<s.length;r++){const o=s[r],i=yx(o);e.push(i)}}return t}class cp{constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t){return dx(this,t)}clone(t){const n=new cp(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return dx(this,()=>({root:yx(No())}))}}let up=class hN extends ap{static getType(){return"paragraph"}static clone(t){return new hN(t.__key)}createDOM(t){const n=document.createElement("p"),e=Iu(t.theme,"paragraph");return e!==void 0&&n.classList.add(...e),n}updateDOM(t,n,e){return!1}static importDOM(){return{p:t=>({conversion:dP,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&qf(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s);const r=this.getIndent();r>0&&(n.style.textIndent=`${r*20}px`)}return{element:n}}static importJSON(t){const n=Zi();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(t,n){const e=Zi(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=this.getChildren();if(t.length===0||rn(t[0])&&t[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 dP(c){const t=Zi();if(c.style){t.setFormat(c.style.textAlign);const n=parseInt(c.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Zi(){return Ru(new up)}function fP(c){return c instanceof up}const pP=0,hP=1,gP=2,mP=3,yP=4;function bx(c,t,n,e){const s=c._keyToDOMMap;s.clear(),c._editorState=b0(),c._pendingEditorState=e,c._compositionKey=null,c._dirtyType=ja,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),c._normalizedNodes=new Set,c._updateTags=new Set,c._updates=[],c._blockCursorElement=null;const r=c._observer;r!==null&&(r.disconnect(),c._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",s.set("root",n))}function bP(c,t){const n=new Map,e=new Set,s=r=>{Object.keys(r).forEach(o=>{let i=n.get(o);i===void 0&&(i=[],n.set(o,i)),i.push(r[o])})};return c.forEach(r=>{const o=r.klass.importDOM;if(o==null||e.has(o))return;e.add(o);const i=o.call(r.klass);i!==null&&s(i)}),t&&s(t),n}function vP(c){const t=c||{},n=QA(),e=t.theme||{},s=c===void 0?n:t.parentEditor||null,r=t.disableEvents||!1,o=b0(),i=t.namespace||(s!==null?s._config.namespace:h1()),u=t.editorState,a=[lp,zu,ep,Ul,up,...t.nodes||[]],{onError:f,html:l}=t,d=t.editable!==void 0?t.editable:!0;let p;if(c===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let m=0;m<a.length;m++){let g=a[m],y=null,b=null;if(typeof g!="function"){const x=g;g=x.replace,y=x.with,b=x.withKlass||null}{const x=g.name;if(x!=="RootNode"){const S=g.prototype;["getType","clone"].forEach(E=>{g.hasOwnProperty(E)||console.warn(`${x} must implement static "${E}" method`)}),!g.hasOwnProperty("importDOM")&&g.hasOwnProperty("exportDOM")&&console.warn(`${x} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),S instanceof y0&&(S.hasOwnProperty("decorate")||console.warn(`${S.constructor.name} must implement "decorate" method`)),g.hasOwnProperty("importJSON")||console.warn(`${x} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),S.hasOwnProperty("exportJSON")||console.warn(`${x} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const v=g.getType(),_=g.transform(),w=new Set;_!==null&&w.add(_),p.set(v,{exportDOM:l&&l.export?l.export.get(g):void 0,klass:g,replace:y,replaceWithKlass:b,transforms:w})}}const h=new _P(o,s,p,{disableEvents:r,namespace:i,theme:e},f||console.error,bP(p,l?l.import:void 0),d);return u!==void 0&&(h._pendingEditorState=u,h._dirtyType=Dl),h}class _P{constructor(t,n,e,s,r,o,i){this._parentEditor=n,this._rootElement=null,this._editorState=t,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=s,this._nodes=e,this._decorators={},this._pendingDecorators=null,this._dirtyType=ja,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=h1(),this._onError=r,this._htmlConversions=o,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,e){if(e===void 0)throw Error('Listener for type "command" requires a "priority".');const s=this._commands;s.has(t)||s.set(t,[new Set,new Set,new Set,new Set,new Set]);const r=s.get(t);if(r===void 0)throw Error(`registerCommand: Command ${String(t)} not found in command map`);const o=r[e];return o.add(n),()=>{o.delete(n),r.every(i=>i.size===0)&&s.delete(t)}}registerMutationListener(t,n){if(this._nodes.get(t.getType())===void 0)throw Error(`Node ${t.name} has not been registered. Ensure node has been passed to createEditor.`);const s=this._listeners.mutation;return s.set(n,t),()=>{s.delete(n)}}registerNodeTransformToKlass(t,n){const e=t.getType(),s=this._nodes.get(e);if(s===void 0)throw Error(`Node ${t.name} has not been registered. Ensure node has been passed to createEditor.`);return s.transforms.add(n),s}registerNodeTransform(t,n){const e=this.registerNodeTransformToKlass(t,n),s=[e],r=e.replaceWithKlass;if(r!=null){const o=this.registerNodeTransformToKlass(r,n);s.push(o)}return dk(this,t.getType()),()=>{s.forEach(o=>o.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Yt(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const e=Iu(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=t,bx(this,n,t,s),n!==null&&(this._config.disableEvents||SA(n),e!=null&&n.classList.remove(...e)),t!==null){const r=Yk(t),o=t.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=Dl,t1(this),this._updateTags.add("history-merge"),$a(this),this._config.disableEvents||wA(t,this),e!=null&&t.classList.add(...e)}else this._editorState=s,this._pendingEditorState=null,this._window=null;Hu("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){if(t.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");e1(this);const e=this._pendingEditorState,s=this._updateTags,r=n!==void 0?n.tag:null;e!==null&&!e.isEmpty()&&(r!=null&&s.add(r),$a(this)),this._pendingEditorState=t,this._dirtyType=Dl,this._dirtyElements.set("root",!1),this._compositionKey=null,r!=null&&s.add(r),$a(this)}parseEditorState(t,n){const e=typeof t=="string"?JSON.parse(t):t;return rP(e,this,n)}update(t,n){ko(this,t,n)}focus(t,n={}){const e=this._rootElement;e!==null&&(e.setAttribute("autocapitalize","off"),ko(this,()=>{const s=Jn(),r=No();s!==null?s.dirty=!0:r.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?r.selectStart():r.selectEnd())},{onUpdate:()=>{e.removeAttribute("autocapitalize"),t&&t()},tag:"focus"}),this._pendingEditorState===null&&e.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=_i(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Hu("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}const xP=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:Vk,$applyNodeReplacement:Ru,$copyNode:S1,$createLineBreakNode:zl,$createNodeSelection:f0,$createParagraphNode:Zi,$createPoint:ri,$createRangeSelection:WA,$createTabNode:np,$createTextNode:$r,$getAdjacentNode:Hm,$getCharacterOffsets:d0,$getEditor:nA,$getNearestNodeFromDOMNode:ku,$getNearestRootOrShadowRoot:w1,$getNodeByKey:qr,$getPreviousSelection:Hl,$getRoot:No,$getSelection:Jn,$getTextContent:YA,$hasAncestor:Kf,$hasUpdateTag:Jk,$insertNodes:GA,$isBlockElementNode:KA,$isDecoratorNode:dr,$isElementNode:At,$isInlineElementOrDecoratorNode:Xk,$isLeafNode:lk,$isLineBreakNode:Fa,$isNodeSelection:Uu,$isParagraphNode:fP,$isRangeSelection:vn,$isRootNode:Ao,$isRootOrShadowRoot:Is,$isTabNode:G1,$isTextNode:rn,$nodesOfType:Wk,$normalizeSelection__EXPERIMENTAL:i1,$parseSerializedNode:nP,$selectAll:Kk,$setCompositionKey:Mr,$setSelection:vi,$splitNode:eA,BLUR_COMMAND:K_,CAN_REDO_COMMAND:jN,CAN_UNDO_COMMAND:DN,CLEAR_EDITOR_COMMAND:IN,CLEAR_HISTORY_COMMAND:RN,CLICK_COMMAND:O_,COMMAND_PRIORITY_CRITICAL:yP,COMMAND_PRIORITY_EDITOR:pP,COMMAND_PRIORITY_HIGH:mP,COMMAND_PRIORITY_LOW:hP,COMMAND_PRIORITY_NORMAL:gP,CONTROLLED_TEXT_INSERTION_COMMAND:jl,COPY_COMMAND:fm,CUT_COMMAND:pm,DELETE_CHARACTER_COMMAND:Su,DELETE_LINE_COMMAND:Ou,DELETE_WORD_COMMAND:Eu,DRAGEND_COMMAND:U_,DRAGOVER_COMMAND:z_,DRAGSTART_COMMAND:$_,DROP_COMMAND:F_,DecoratorNode:y0,ElementNode:ap,FOCUS_COMMAND:H_,FORMAT_ELEMENT_COMMAND:MN,FORMAT_TEXT_COMMAND:Ns,INDENT_CONTENT_COMMAND:AN,INSERT_LINE_BREAK_COMMAND:Cu,INSERT_PARAGRAPH_COMMAND:am,INSERT_TAB_COMMAND:kN,KEY_ARROW_DOWN_COMMAND:I_,KEY_ARROW_LEFT_COMMAND:A_,KEY_ARROW_RIGHT_COMMAND:N_,KEY_ARROW_UP_COMMAND:M_,KEY_BACKSPACE_COMMAND:j_,KEY_DELETE_COMMAND:L_,KEY_DOWN_COMMAND:T_,KEY_ENTER_COMMAND:Pf,KEY_ESCAPE_COMMAND:D_,KEY_MODIFIER_COMMAND:W_,KEY_SPACE_COMMAND:R_,KEY_TAB_COMMAND:B_,LineBreakNode:ep,MOVE_TO_END:k_,MOVE_TO_START:P_,OUTDENT_CONTENT_COMMAND:PN,PASTE_COMMAND:lm,ParagraphNode:up,REDO_COMMAND:dm,REMOVE_TEXT_COMMAND:cm,RootNode:lp,SELECTION_CHANGE_COMMAND:Af,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:NN,SELECT_ALL_COMMAND:hm,TabNode:Ul,TextNode:zu,UNDO_COMMAND:um,createCommand:bn,createEditor:vP,getNearestEditorFromDOMNode:Dm,isCurrentlyReadOnlyMode:Kl,isHTMLAnchorElement:tA,isHTMLElement:qf,isSelectionCapturedInDecoratorInput:jm,isSelectionWithinEditor:Nu},Symbol.toStringTag,{value:"Module"}));function wP(c){return{}}const dp={},SP={},vx={},Ku={},Wu={},v0={},Wl={},_0={},x0={},qu={},Ju={},Fs={},w0={},S0={},_x={},xx={},wx={},Sx={},Cx={},Ex={},Ox={},fp={},Tx={},Nx={},kx={},Ax={},Px={},CP={},EP={},OP={},Mx={},TP={},Ix={},Rx={},jx={},C0={},E0={},O0={},NP={},kP={},AP={},PP={},Dx={},Lx={},Bx={};var Xt=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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.`)};const oi=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,MP=oi&&"documentMode"in document?document.documentMode:null,ii=oi&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$s=oi&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),pp=!(!oi||!("InputEvent"in window)||MP)&&"getTargetRanges"in new window.InputEvent("input"),T0=oi&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),hp=oi&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,IP=oi&&/Android/.test(navigator.userAgent),Fx=oi&&/^(?=.*Chrome).*/i.test(navigator.userAgent),RP=oi&&IP&&Fx,N0=oi&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Fx,Vu=1,zs=3,za=0,$x=1,ql=2,gp=4,mp=8,jP=240|(3|gp|mp),k0=1,A0=2,P0=3,M0=4,I0=5,R0=6,yp=T0||hp||N0?" ":"",Qi=`
|
|
39
|
+
`?e.push(zl()):o===" "?e.push(np()):e.push($r(o))}this.insertNodes(e)}insertText(t){const n=this.anchor,e=this.focus,s=this.isCollapsed()||n.isBefore(e),r=this.format,o=this.style;s&&n.type==="element"?Y1(n,e,r,o):!s&&e.type==="element"&&Y1(e,n,r,o);const i=this.getNodes(),u=i.length,a=s?n:e,f=s?e:n,l=a.offset,d=f.offset;let p=i[0];if(!rn(p))throw Error("insertText: first node is not a text node");const m=p.getTextContent().length,g=p.getParentOrThrow(),y=u-1;let b=i[y];if(this.isCollapsed()&&l===m&&(p.isSegmented()||p.isToken()||!p.canInsertTextAfter()||!g.canInsertTextAfter()&&p.getNextSibling()===null)){let v=p.getNextSibling();if((!rn(v)||!v.canInsertTextBefore()||Lm(v))&&(v=$r(),v.setFormat(r),g.canInsertTextAfter()?p.insertAfter(v):g.insertAfter(v)),v.select(0,0),p=v,t!==""){this.insertText(t);return}}else if(this.isCollapsed()&&l===0&&(p.isSegmented()||p.isToken()||!p.canInsertTextBefore()||!g.canInsertTextBefore()&&p.getPreviousSibling()===null)){let v=p.getPreviousSibling();if((!rn(v)||Lm(v))&&(v=$r(),v.setFormat(r),g.canInsertTextBefore()?p.insertBefore(v):g.insertBefore(v)),v.select(),p=v,t!==""){this.insertText(t);return}}else if(p.isSegmented()&&l!==m){const v=$r(p.getTextContent());v.setFormat(r),p.replace(v),p=v}else if(!this.isCollapsed()&&t!==""){const v=b.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||At(v)&&(!v.canInsertTextBefore()||!v.canInsertTextAfter())){this.insertText(""),tx(this.anchor,this.focus,null),this.insertText(t);return}}if(u===1){if(p.isToken()){const x=$r(t);x.select(),p.replace(x);return}const v=p.getFormat(),_=p.getStyle();if(l===d&&(v!==r||_!==o))if(p.getTextContent()==="")p.setFormat(r),p.setStyle(o);else{const x=$r(t);if(x.setFormat(r),x.setStyle(o),x.select(),l===0)p.insertBefore(x,!1);else{const[S]=p.splitText(l);S.insertAfter(x,!1)}x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);return}else if(V1(p)){const x=$r(t);x.setFormat(r),x.setStyle(o),x.select(),p.replace(x);return}const w=d-l;p=p.spliceText(l,w,t,!0),p.getTextContent()===""?p.remove():this.anchor.type==="text"&&(p.isComposing()?this.anchor.offset-=t.length:(this.format=v,this.style=_))}else{const v=new Set([...p.getParentKeys(),...b.getParentKeys()]),_=At(p)?p:p.getParentOrThrow();let w=At(b)?b:b.getParentOrThrow(),x=b;if(!_.is(w)&&w.isInline())do x=w,w=w.getParentOrThrow();while(w.isInline());if(f.type==="text"&&(d!==0||b.getTextContent()==="")||f.type==="element"&&b.getIndexWithinParent()<d)if(rn(b)&&!b.isToken()&&d!==b.getTextContentSize()){if(b.isSegmented()){const A=$r(b.getTextContent());b.replace(A),b=A}!Ao(f.getNode())&&f.type==="text"&&(b=b.spliceText(0,d,"")),v.add(b.__key)}else{const A=b.getParentOrThrow();!A.canBeEmpty()&&A.getChildrenSize()===1?A.remove():b.remove()}else v.add(b.__key);const S=w.getChildren(),E=new Set(i),O=_.is(w),j=_.isInline()&&p.getNextSibling()===null?_:p;for(let A=S.length-1;A>=0;A--){const T=S[A];if(T.is(p)||At(T)&&T.isParentOf(p))break;T.isAttached()&&(!E.has(T)||T.is(x)?O||j.insertAfter(T,!1):T.remove())}if(!O){let A=w,T=null;for(;A!==null;){const I=A.getChildren(),k=I.length;(k===0||I[k-1].is(T))&&(v.delete(A.__key),T=A),A=A.getParent()}}if(!p.isToken())p=p.spliceText(l,m-l,t,!0),p.getTextContent()===""?p.remove():p.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);else if(l===m)p.select();else{const A=$r(t);A.select(),p.replace(A)}for(let A=1;A<u;A++){const T=i[A],I=T.__key;v.has(I)||T.remove()}}}removeText(){this.insertText("")}formatText(t){if(this.isCollapsed()){this.toggleFormat(t),Mr(null);return}const n=this.getNodes(),e=[];for(const b of n)rn(b)&&e.push(b);const s=e.length;if(s===0){this.toggleFormat(t),Mr(null);return}const r=this.anchor,o=this.focus,i=this.isBackward(),u=i?o:r,a=i?r:o;let f=0,l=e[0],d=u.type==="element"?0:u.offset;if(u.type==="text"&&d===l.getTextContentSize()&&(f=1,l=e[1],d=0),l==null)return;const p=l.getFormatFlags(t,null),h=s-1;let m=e[h];const g=a.type==="text"?a.offset:m.getTextContentSize();if(l.is(m)){if(d===g)return;if(d===0&&g===l.getTextContentSize())l.setFormat(p);else{const b=l.splitText(d,g),v=d===0?b[0]:b[1];v.setFormat(p),u.type==="text"&&u.set(v.__key,0,"text"),a.type==="text"&&a.set(v.__key,g-d,"text")}this.format=p;return}d!==0&&([,l]=l.splitText(d),d=0),l.setFormat(p);const y=m.getFormatFlags(t,p);g>0&&(g!==m.getTextContentSize()&&([m]=m.splitText(g)),m.setFormat(y));for(let b=f+1;b<h;b++){const v=e[b];if(!v.isToken()){const _=v.getFormatFlags(t,y);v.setFormat(_)}}u.type==="text"&&u.set(l.__key,d,"text"),a.type==="text"&&a.set(m.__key,g,"text"),this.format=p|y}insertNodes(t){if(t.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const y=Jn();if(!vn(y))throw Error("Expected RangeSelection after insertParagraph");return y.insertNodes(t)}const n=this.isBackward()?this.focus:this.anchor,e=Jm(n.getNode(),Bl),s=t[t.length-1];if("__language"in e&&At(e)){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const y=h0(this);e.splice(y,0,t),s.selectEnd()}return}const r=y=>(At(y)||dr(y))&&!y.isInline();if(!t.some(r)){if(!At(e))throw Error("Expected 'firstBlock' to be an ElementNode");const y=h0(this);e.splice(y,0,t),s.selectEnd();return}const o=XA(t),i=o.getLastDescendant(),u=o.getChildren(),a=y=>"__value"in y&&"__checked"in y,f=y=>At(y)&&Bl(y)&&!y.isEmpty()&&At(e)&&(!e.isEmpty()||a(e)),d=!At(e)||!e.isEmpty()?this.insertParagraph():null,p=u[u.length-1];let h=u[0];if(f(h)){if(!At(e))throw Error("Expected 'firstBlock' to be an ElementNode");e.append(...h.getChildren()),h=u[1]}h&&TA(e,h);const m=Jm(i,Bl);d&&At(m)&&(a(d)||Bl(p))&&(m.append(...d.getChildren()),d.remove()),At(e)&&e.isEmpty()&&e.remove(),i.selectEnd();const g=At(e)?e.getLastChild():null;Fa(g)&&m!==e&&g.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=Zi();return No().splice(this.anchor.offset,0,[o]),o.select(),o}const t=h0(this),n=Jm(this.anchor.getNode(),Bl);if(!At(n))throw Error("Expected ancestor to be an ElementNode");const e=n.getChildAtIndex(t),s=e?[e,...e.getNextSiblings()]:[],r=n.insertNewAfter(this,!1);return r?(r.append(...s),r.selectStart(),r):null}insertLineBreak(t){const n=zl();if(this.insertNodes([n]),t){const e=n.getParentOrThrow(),s=n.getIndexWithinParent();e.select(s,s)}}extract(){const t=this.getNodes(),n=t.length,e=n-1,s=this.anchor,r=this.focus;let o=t[0],i=t[e];const[u,a]=d0(this);if(n===0)return[];if(n===1){if(rn(o)&&!this.isCollapsed()){const l=u>a?a:u,d=u>a?u:a,p=o.splitText(l,d),h=l===0?p[0]:p[1];return h!=null?[h]:[]}return[o]}const f=s.isBefore(r);if(rn(o)){const l=f?u:a;l===o.getTextContentSize()?t.shift():l!==0&&([,o]=o.splitText(l),t[0]=o)}if(rn(i)){const d=i.getTextContent().length,p=f?a:u;p===0?t.pop():p!==d&&([i]=i.splitText(p),t[e]=i)}return t}modify(t,n,e){const s=this.focus,r=this.anchor,o=t==="move",i=Hm(s,n);if(dr(i)&&!i.isIsolated()){if(o&&i.isKeyboardSelectable()){const p=f0();p.add(i.__key),vi(p);return}const d=n?i.getPreviousSibling():i.getNextSibling();if(rn(d)){const p=d.__key,h=n?d.getTextContent().length:0;s.set(p,h,"text"),o&&r.set(p,h,"text");return}else{const p=i.getParentOrThrow();let h,m;At(d)?(m=d.__key,h=n?d.getChildrenSize():0):(h=i.getIndexWithinParent(),m=p.__key,n||h++),s.set(m,h,"element"),o&&r.set(m,h,"element");return}}const u=Xn(),a=_i(u._window);if(!a)return;const f=u._blockCursorElement,l=u._rootElement;if(l!==null&&f!==null&&At(i)&&!i.isInline()&&!i.canBeEmpty()&&qm(f,u,l),$A(a,t,n?"backward":"forward",e),a.rangeCount>0){const d=a.getRangeAt(0),p=this.anchor.getNode(),h=Ao(p)?p:x1(p);if(this.applyDOMRange(d),this.dirty=!0,!o){const m=this.getNodes(),g=[];let y=!1;for(let b=0;b<m.length;b++){const v=m[b];Kf(v,h)?g.push(v):y=!0}if(y&&g.length>0)if(n){const b=g[0];At(b)?b.selectStart():b.getParentOrThrow().selectStart()}else{const b=g[g.length-1];At(b)?b.selectEnd():b.getParentOrThrow().selectEnd()}(a.anchorNode!==d.startContainer||a.anchorOffset!==d.startOffset)&&FA(this)}}}forwardDeletion(t,n,e){if(!e&&(t.type==="element"&&At(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const s=n.getParent(),r=n.getNextSibling()||(s===null?null:s.getNextSibling());if(At(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let s=e.getNode();if(this.forwardDeletion(e,s,t))return;const r=this.focus,o=Hm(r,t);if(dr(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&At(s)&&s.getChildrenSize()===0){s.remove();const i=f0();i.add(o.__key),vi(i)}else o.remove(),Xn().dispatchCommand(Af,void 0);return}else if(!t&&At(o)&&At(s)&&s.isEmpty()){s.remove(),o.selectStart();return}if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&e.offset===0&&(e.type==="element"?e.getNode():e.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const i=r.type==="text"?r.getNode():null;if(s=e.type==="text"?e.getNode():null,i!==null&&i.isSegmented()){const u=r.offset,a=i.getTextContentSize();if(i.is(s)||t&&u!==a||!t&&u!==0){Z1(i,t,u);return}}else if(s!==null&&s.isSegmented()){const u=e.offset,a=s.getTextContentSize();if(s.is(i)||t&&u!==0||!t&&u!==a){Z1(s,t,u);return}}zA(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const e=this.anchor.getNode();e.isEmpty()&&Ao(e.getParent())&&e.getIndexWithinParent()===0&&e.collapseAtStart(this)}}deleteLine(t){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",t,"lineboundary"),(t?this.focus:this.anchor).offset===0&&this.modify("extend",t,"character")),this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,e=n.getNode();if(this.forwardDeletion(n,e,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Uu(c){return c instanceof rp}function X1(c){const t=c.offset;if(c.type==="text")return t;const n=c.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function d0(c){const t=c.getStartEndPoints();if(t===null)return[0,0];const[n,e]=t;return n.type==="element"&&e.type==="element"&&n.key===e.key&&n.offset===e.offset?[0,0]:[X1(n),X1(e)]}function FA(c){const t=c.focus,n=c.anchor,e=n.key,s=n.offset,r=n.type;Ls(n,t.key,t.offset,t.type),Ls(t,e,s,r),c._cachedNodes=null}function $A(c,t,n,e){c.modify(t,n,e)}function zA(c,t){const n=c.anchor,e=c.focus,s=n.getNode(),r=e.getNode();if(s===r&&n.type==="text"&&e.type==="text"){const o=n.offset,i=e.offset,u=o<i,a=u?o:i,f=u?i:o,l=f-1;if(a!==l){const d=s.getTextContent().slice(a,f);f1(d)||(t?e.offset=l:n.offset=l)}}}function Z1(c,t,n){const e=c,r=e.getTextContent().split(/(?=\s)/g),o=r.length;let i=0,u=0;for(let f=0;f<o;f++){const l=r[f],d=f===o-1;if(u=i,i+=l.length,t&&i===n||i>n||d){r.splice(f,1),d&&(u=void 0);break}}const a=r.join("").trim();a===""?e.remove():(e.setTextContent(a),e.select(u,u))}function UA(c,t,n){const e=c.getParent();return n===null||e===null||!e.canBeEmpty()||e!==n.getNode()}function Q1(c,t,n,e){let s=t,r;if(c.nodeType===Tu){let o=!1;const i=c.childNodes,u=i.length;s===u&&(o=!0,s=u-1);let a=i[s],f=!1;if(a===e._blockCursorElement?(a=i[s+1],f=!0):e._blockCursorElement!==null&&s--,r=Ll(a),rn(r))s=d1(r,o);else{let l=Ll(c);if(l===null)return null;if(At(l)){let d=l.getChildAtIndex(s);if(At(d)&&UA(d,s,n)){const p=o?d.getLastDescendant():d.getFirstDescendant();p===null?(l=d,s=0):(d=p,l=At(d)?d:d.getParentOrThrow())}rn(d)?(r=d,l=null,s=d1(d,o)):d!==l&&o&&!f&&s++}else{const d=l.getIndexWithinParent();t===0&&dr(l)&&Ll(c)===l?s=d:s=d+1,l=l.getParentOrThrow()}if(At(l))return ri(l.__key,s,"element")}}else r=Ll(c);return rn(r)?ri(r.__key,s,"text"):null}function ex(c,t,n){const e=c.offset,s=c.getNode();if(e===0){const r=s.getPreviousSibling(),o=s.getParent();if(!t)At(r)&&!n&&r.isInline()?(c.key=r.__key,c.offset=r.getChildrenSize(),c.type="element"):rn(r)&&(c.key=r.__key,c.offset=r.getTextContent().length);else if((n||!t)&&r===null&&At(o)&&o.isInline()){const i=o.getPreviousSibling();rn(i)&&(c.key=i.__key,c.offset=i.getTextContent().length)}}else if(e===s.getTextContent().length){const r=s.getNextSibling(),o=s.getParent();if(t&&At(r)&&r.isInline())c.key=r.__key,c.offset=0,c.type="element";else if((n||t)&&r===null&&At(o)&&o.isInline()&&!o.canInsertTextAfter()){const i=o.getNextSibling();rn(i)&&(c.key=i.__key,c.offset=0)}}}function tx(c,t,n){if(c.type==="text"&&t.type==="text"){const e=c.isBefore(t),s=c.is(t);ex(c,e,s),ex(t,!e,s),s&&(t.key=c.key,t.offset=c.offset,t.type=c.type);const r=Xn();if(r.isComposing()&&r._compositionKey!==c.key&&vn(n)){const o=n.anchor,i=n.focus;Ls(c,o.key,o.offset,o.type),Ls(t,i.key,i.offset,i.type)}}}function nx(c,t,n,e,s,r){if(c===null||n===null||!Nu(s,c,n))return null;const o=Q1(c,t,vn(r)?r.anchor:null,s);if(o===null)return null;const i=Q1(n,e,vn(r)?r.focus:null,s);if(i===null)return null;if(o.type==="element"&&i.type==="element"){const u=Ll(c),a=Ll(n);if(dr(u)&&dr(a))return null}return tx(o,i,r),[o,i]}function HA(c){return At(c)&&!c.isInline()}function rx(c,t,n,e,s,r){const o=xi(),i=new Bs(ri(c,t,s),ri(n,e,r),0,"");return i.dirty=!0,o._selection=i,i}function KA(){const c=ri("root",0,"element"),t=ri("root",0,"element");return new Bs(c,t,0,"")}function f0(){return new rp(new Set)}function WA(c){const n=c.getEditorState()._selection,e=_i(c._window);return vn(n)||n==null?p0(n,e,c,null):n.clone()}function p0(c,t,n,e){const s=n._window;if(s===null)return null;const r=e||s.event,o=r?r.type:void 0,i=o==="selectionchange",u=!VN()&&(i||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&r&&r.detail===3||o==="drop"||o===void 0);let a,f,l,d;if(!vn(c)||u){if(t===null)return null;if(a=t.anchorNode,f=t.focusNode,l=t.anchorOffset,d=t.focusOffset,i&&vn(c)&&!Nu(n,a,f))return c.clone()}else return c.clone();const p=nx(a,l,f,d,n,c);if(p===null)return null;const[h,m]=p;return new Bs(h,m,vn(c)?c.format:0,vn(c)?c.style:"")}function Jn(){return xi()._selection}function Hl(){return Xn()._editorState._selection}function op(c,t,n,e=1){const s=c.anchor,r=c.focus,o=s.getNode(),i=r.getNode();if(!t.is(o)&&!t.is(i))return;const u=t.__key;if(c.isCollapsed()){const a=s.offset;if(n<=a&&e>0||n<a&&e<0){const f=Math.max(0,a+e);s.set(u,f,"element"),r.set(u,f,"element"),ox(c)}}else{const a=c.isBackward(),f=a?r:s,l=f.getNode(),d=a?s:r,p=d.getNode();if(t.is(l)){const h=f.offset;(n<=h&&e>0||n<h&&e<0)&&f.set(u,Math.max(0,h+e),"element")}if(t.is(p)){const h=d.offset;(n<=h&&e>0||n<h&&e<0)&&d.set(u,Math.max(0,h+e),"element")}}ox(c)}function ox(c){const t=c.anchor,n=t.offset,e=c.focus,s=e.offset,r=t.getNode(),o=e.getNode();if(c.isCollapsed()){if(!At(r))return;const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(rn(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text"),e.set(a.__key,f,"text")}return}if(At(r)){const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(rn(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text")}}if(At(o)){const i=o.getChildrenSize(),u=s>=i,a=u?o.getChildAtIndex(i-1):o.getChildAtIndex(s);if(rn(a)){let f=0;u&&(f=a.getTextContentSize()),e.set(a.__key,f,"text")}}}function qA(c,t){const e=t.getEditorState()._selection,s=c._selection;if(vn(s)){const r=s.anchor,o=s.focus;let i;if(r.type==="text"&&(i=r.getNode(),i.selectionTransform(e,s)),o.type==="text"){const u=o.getNode();i!==u&&u.selectionTransform(e,s)}}}function ip(c,t,n,e,s){let r=null,o=0,i=null;e!==null?(r=e.__key,rn(e)?(o=e.getTextContentSize(),i="text"):At(e)&&(o=e.getChildrenSize(),i="element")):s!==null&&(r=s.__key,rn(s)?i="text":At(s)&&(i="element")),r!==null&&i!==null?c.set(r,o,i):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),c.set(n.__key,o,"element"))}function ix(c,t,n,e,s){c.type==="text"?(c.key=n,t||(c.offset+=s)):c.offset>e.getIndexWithinParent()&&(c.offset-=1)}function JA(c,t,n,e,s,r,o){const i=e.anchorNode,u=e.focusNode,a=e.anchorOffset,f=e.focusOffset,l=document.activeElement;if(s.has("collaboration")&&l!==r||l!==null&&jm(l))return;if(!vn(t)){c!==null&&Nu(n,i,u)&&e.removeAllRanges();return}const d=t.anchor,p=t.focus,h=d.key,m=p.key,g=Uf(n,h),y=Uf(n,m),b=d.offset,v=p.offset,_=t.format,w=t.style,x=t.isCollapsed();let S=g,E=y,O=!1;if(d.type==="text"){S=Ff(g);const j=d.getNode();O=j.getFormat()!==_||j.getStyle()!==w}else vn(c)&&c.anchor.type==="text"&&(O=!0);if(p.type==="text"&&(E=Ff(y)),!(S===null||E===null)&&(x&&(c===null||O||vn(c)&&(c.format!==_||c.style!==w))&&EA(_,w,b,h,performance.now()),!(a===b&&f===v&&i===S&&u===E&&!(e.type==="Range"&&x)&&((l===null||!r.contains(l))&&r.focus({preventScroll:!0}),d.type!=="element")))){try{e.setBaseAndExtent(S,b,E,v)}catch{}if(!s.has("skip-scroll-into-view")&&t.isCollapsed()&&r!==null&&r===document.activeElement){const j=t instanceof Bs&&t.anchor.type==="element"?S.childNodes[b]||null:e.rangeCount>0?e.getRangeAt(0):null;if(j!==null){let A;if(j instanceof Text){const T=document.createRange();T.selectNode(j),A=T.getBoundingClientRect()}else A=j.getBoundingClientRect();Wk(n,A,r)}}CA()}}function VA(c){let t=Jn()||Hl();t===null&&(t=No().selectEnd()),t.insertNodes(c)}function GA(){const c=Jn();return c===null?"":c.getTextContent()}function h0(c){c.isCollapsed()||c.removeText();const t=c.anchor;let n=t.getNode(),e=t.offset;for(;!Bl(n);)[n,e]=YA(n,e);return e}function YA(c,t){const n=c.getParent();if(!n){const s=Zi();return No().append(s),s.select(),[No(),0]}if(rn(c)){const s=c.splitText(t);if(s.length===0)return[n,c.getIndexWithinParent()];const r=t===0?0:1,o=s[0].getIndexWithinParent()+r;return[n,o]}if(!At(c)||t===0)return[n,c.getIndexWithinParent()];const e=c.getChildAtIndex(t);if(e){const s=new Bs(ri(c.__key,t,"element"),ri(c.__key,t,"element"),0,""),r=c.insertNewAfter(s);r&&r.append(e,...e.getNextSiblings())}return[n,c.getIndexWithinParent()+1]}function XA(c){const t=Zi();let n=null;for(let e=0;e<c.length;e++){const s=c[e],r=Fa(s);if(r||dr(s)&&s.isInline()||At(s)&&s.isInline()||rn(s)||s.isParentRequired()){if(n===null&&(n=s.createParentElementNode(),t.append(n),r))continue;n!==null&&n.append(s)}else t.append(s),n=null}return t}let Ir=null,Rr=null,vo=!1,g0=!1,sp=0;const sx={characterData:!0,childList:!0,subtree:!0};function Kl(){return vo||Ir!==null&&Ir._readOnly}function Jr(){if(vo)throw Error("Cannot use method in read-only mode.")}function ax(){if(sp>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function xi(){if(Ir===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 Ir}function Xn(){if(Rr===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return Rr}function ZA(){return Rr}function lx(c,t,n){const e=t.__type,s=nk(c,e);let r=n.get(e);r===void 0&&(r=Array.from(s.transforms),n.set(e,r));const o=r.length;for(let i=0;i<o&&(r[i](t),!!t.isAttached());i++);}function cx(c,t){return c!==void 0&&c.__key!==t&&c.isAttached()}function QA(c,t){const n=t._dirtyLeaves,e=c._nodeMap;for(const s of n){const r=e.get(s);rn(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&r1(r)}}function eP(c,t){const n=t._dirtyLeaves,e=t._dirtyElements,s=c._nodeMap,r=Ms(),o=new Map;let i=n,u=i.size,a=e,f=a.size;for(;u>0||f>0;){if(u>0){t._dirtyLeaves=new Set;for(const l of i){const d=s.get(l);rn(d)&&d.isAttached()&&d.isSimpleText()&&!d.isUnmergeable()&&r1(d),d!==void 0&&cx(d,r)&&lx(t,d,o),n.add(l)}if(i=t._dirtyLeaves,u=i.size,u>0){sp++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const l of a){const d=l[0],p=l[1];if(d!=="root"&&!p)continue;const h=s.get(d);h!==void 0&&cx(h,r)&&lx(t,h,o),e.set(d,p)}i=t._dirtyLeaves,u=i.size,a=t._dirtyElements,f=a.size,sp++}t._dirtyLeaves=n,t._dirtyElements=e}function tP(c){return m0(c,Xn()._nodes)}function m0(c,t){const n=c.type,e=t.get(n);if(e===void 0)throw Error(`parseEditorState: type "${n}" + not found`);const s=e.klass;if(c.type!==s.getType())throw Error(`LexicalNode: Node ${s.name} does not implement .importJSON().`);const r=s.importJSON(c),o=c.children;if(At(r)&&Array.isArray(o))for(let i=0;i<o.length;i++){const u=o[i],a=m0(u,t);r.append(a)}return r}function nP(c,t,n){const e=b0(),s=Ir,r=vo,o=Rr,i=t._dirtyElements,u=t._dirtyLeaves,a=t._cloneNotNeeded,f=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Ir=e,vo=!1,Rr=t;try{const l=t._nodes,d=c.root;m0(d,l),n&&n(),e._readOnly=!0,dx(e)}catch(l){l instanceof Error&&t._onError(l)}finally{t._dirtyElements=i,t._dirtyLeaves=u,t._cloneNotNeeded=a,t._dirtyType=f,Ir=s,vo=r,Rr=o}return e}function ux(c,t){const n=Ir,e=vo,s=Rr;Ir=c,vo=!0,Rr=null;try{return t()}finally{Ir=n,vo=e,Rr=s}}function dx(c){const t=c._nodeMap;t.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},t.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},t.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function $a(c,t){const n=c._pendingEditorState,e=c._rootElement,s=c._headless||e===null;if(n===null)return;const r=c._editorState,o=r._selection,i=n._selection,u=c._dirtyType!==ja,a=Ir,f=vo,l=Rr,d=c._updating,p=c._observer;let h=null;if(c._pendingEditorState=null,c._editorState=n,!s&&u&&p!==null){Rr=c,Ir=n,vo=!1,c._updating=!0;try{const x=c._dirtyType,S=c._dirtyElements,E=c._dirtyLeaves;p.disconnect(),h=uA(r,n,c,x,S,E)}catch(x){if(x instanceof Error&&c._onError(x),!g0)yx(c,null,e,n),e1(c),c._dirtyType=Dl,g0=!0,$a(c,r),g0=!1;else throw x;return}finally{p.observe(e,sx),c._updating=d,Ir=a,vo=f,Rr=l}}n._readOnly||(n._readOnly=!0,dx(n),vn(i)&&(Object.freeze(i.anchor),Object.freeze(i.focus)),Object.freeze(i));const m=c._dirtyLeaves,g=c._dirtyElements,y=c._normalizedNodes,b=c._updateTags,v=c._deferred;u&&(c._dirtyType=ja,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements=new Map,c._normalizedNodes=new Set,c._updateTags=new Set),nA(c,n);const _=s?null:_i(c._window);if(c._editable&&_!==null&&(u||i===null||i.dirty)){Rr=c,Ir=n;try{if(p!==null&&p.disconnect(),u||i===null||i.dirty){const x=c._blockCursorElement;x!==null&&qm(x,c,e),JA(o,i,c,_,b,e)}Zk(c,e,i),p!==null&&p.observe(e,sx)}finally{Rr=l,Ir=a}}h!==null&&oP(c,h,b,m,r),!vn(i)&&i!==null&&(o===null||!o.is(i))&&c.dispatchCommand(Af,void 0);const w=c._pendingDecorators;w!==null&&(c._decorators=w,c._pendingDecorators=null,Hu("decorator",c,!0,w)),rP(c,t||r,n),Hu("update",c,!0,{dirtyElements:g,dirtyLeaves:m,editorState:n,normalizedNodes:y,prevEditorState:t||r,tags:b}),sP(c,v),iP(c)}function rP(c,t,n){const e=c1(t),s=c1(n);e!==s&&Hu("textcontent",c,!0,s)}function oP(c,t,n,e,s){const r=Array.from(c._listeners.mutation),o=r.length;for(let i=0;i<o;i++){const[u,a]=r[i],f=t.get(a);f!==void 0&&u(f,{dirtyLeaves:e,prevEditorState:s,updateTags:n})}}function Hu(c,t,n,...e){const s=t._updating;t._updating=n;try{const r=Array.from(t._listeners[c]);for(let o=0;o<r.length;o++)r[o].apply(null,e)}finally{t._updating=s}}function fx(c,t,n){if(c._updating===!1||Rr!==c){let s=!1;return c.update(()=>{s=fx(c,t,n)}),s}const e=Fm(c);for(let s=4;s>=0;s--)for(let r=0;r<e.length;r++){const u=e[r]._commands.get(t);if(u!==void 0){const a=u[s];if(a!==void 0){const f=Array.from(a),l=f.length;for(let d=0;d<l;d++)if(f[d](n,c)===!0)return!0}}}return!1}function iP(c){const t=c._updates;if(t.length!==0){const n=t.shift();if(n){const[e,s]=n;hx(c,e,s)}}}function sP(c,t){if(c._deferred=[],t.length!==0){const n=c._updating;c._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{c._updating=n}}}function px(c,t){const n=c._updates;let e=t||!1;for(;n.length!==0;){const s=n.shift();if(s){const[r,o]=s;let i,u;o!==void 0&&(i=o.onUpdate,u=o.tag,o.skipTransforms&&(e=!0),i&&c._deferred.push(i),u&&c._updateTags.add(u)),r()}}return e}function hx(c,t,n){const e=c._updateTags;let s,r,o=!1,i=!1;n!==void 0&&(s=n.onUpdate,r=n.tag,r!=null&&e.add(r),o=n.skipTransforms||!1,i=n.discrete||!1),s&&c._deferred.push(s);const u=c._editorState;let a=c._pendingEditorState,f=!1;(a===null||a._readOnly)&&(a=c._pendingEditorState=cP(a||u),f=!0),a._flushSync=i;const l=Ir,d=vo,p=Rr,h=c._updating;Ir=a,vo=!1,c._updating=!0,Rr=c;try{f&&(c._headless?u._selection!==null&&(a._selection=u._selection.clone()):a._selection=WA(c));const g=c._compositionKey;t(),o=px(c,o),qA(a,c),c._dirtyType!==ja&&(o?QA(a,c):eP(a,c),px(c),rA(u,a,c._dirtyLeaves,c._dirtyElements));const y=c._compositionKey;g!==y&&(a._flushSync=!0);const b=a._selection;if(vn(b)){const v=a._nodeMap,_=b.anchor.key,w=b.focus.key;if(v.get(_)===void 0||v.get(w)===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 Uu(b)&&b._nodes.size===0&&(a._selection=null)}catch(g){g instanceof Error&&c._onError(g),c._pendingEditorState=u,c._dirtyType=Dl,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),$a(c);return}finally{Ir=l,vo=d,Rr=p,c._updating=h,sp=0}c._dirtyType!==ja||lP(a,c)?a._flushSync?(a._flushSync=!1,$a(c)):f&&rk(()=>{$a(c)}):(a._flushSync=!1,f&&(e.clear(),c._deferred=[],c._pendingEditorState=null))}function ko(c,t,n){c._updating?c._updates.push([t,n]):hx(c,t,n)}let y0=class extends Qf{constructor(t){super(t)}decorate(t,n){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function dr(c){return c instanceof y0}let ap=class extends Qf{constructor(t){super(t),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 t=this.getFormat();return KN[t]||""}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const n=Xn()._dirtyElements;return n!==null&&n.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(rn(n)&&t.push(n),At(n)){const e=n.getAllTextNodes();t.push(...e)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;At(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;At(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),e=n.length;if(t>=e){const r=n[e-1];return At(r)&&r.getLastDescendant()||r||null}const s=n[t];return At(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const n=this.getLatest().__first;return n===null?null:qr(n)}getFirstChildOrThrow(){const t=this.getFirstChild();if(t===null)throw Error(`Expected node ${this.__key} to have a first child.`);return t}getLastChild(){const n=this.getLatest().__last;return n===null?null:qr(n)}getLastChildOrThrow(){const t=this.getLastChild();if(t===null)throw Error(`Expected node ${this.__key} to have a last child.`);return t}getChildAtIndex(t){const n=this.getChildrenSize();let e,s;if(t<n/2){for(e=this.getFirstChild(),s=0;e!==null&&s<=t;){if(s===t)return e;e=e.getNextSibling(),s++}return null}for(e=this.getLastChild(),s=n-1;e!==null&&s>=t;){if(s===t)return e;e=e.getPreviousSibling(),s--}return null}getTextContent(){let t="";const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContent(),At(r)&&s!==e-1&&!r.isInline()&&(t+=Gi)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContentSize(),At(r)&&s!==e-1&&!r.isInline()&&(t+=Gi.length)}return t}getDirection(){return this.getLatest().__dir}hasFormat(t){if(t!==""){const n=X_[t];return(this.getFormat()&n)!==0}return!1}select(t,n){Jr();const e=Jn();let s=t,r=n;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const u=this.getFirstChild();if(rn(u)||At(u))return u.select(0,0)}else if((t===void 0||t===o)&&(n===void 0||n===o)){const u=this.getLastChild();if(rn(u)||At(u))return u.select()}}s===void 0&&(s=o),r===void 0&&(r=o);const i=this.__key;if(vn(e))e.anchor.set(i,s,"element"),e.focus.set(i,r,"element"),e.dirty=!0;else return rx(i,s,i,r,"element","element");return e}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(e=>e.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){const n=this.getWritable();return n.__format=t!==""?X_[t]:0,this}setIndent(t){const n=this.getWritable();return n.__indent=t,this}splice(t,n,e){const s=e.length,r=this.getChildrenSize(),o=this.getWritable(),i=o.__key,u=[],a=[],f=this.getChildAtIndex(t+n);let l=null,d=r-n+s;if(t!==0)if(t===r)l=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(l=h.getPreviousSibling())}if(n>0){let h=l===null?this.getFirstChild():l.getNextSibling();for(let m=0;m<n;m++){if(h===null)throw Error("splice: sibling not found");const g=h.getNextSibling(),y=h.__key,b=h.getWritable();Da(b),a.push(y),h=g}}let p=l;for(let h=0;h<s;h++){const m=e[h];p!==null&&m.is(p)&&(l=p=p.getPreviousSibling());const g=m.getWritable();g.__parent===i&&d--,Da(g);const y=m.__key;if(p===null)o.__first=y,g.__prev=null;else{const b=p.getWritable();b.__next=y,g.__prev=b.__key}if(m.__key===i)throw Error("append: attempting to append self");g.__parent=i,u.push(y),p=m}if(t+n===r){if(p!==null){const h=p.getWritable();h.__next=null,o.__last=p.__key}}else if(f!==null){const h=f.getWritable();if(p!==null){const m=p.getWritable();h.__prev=p.__key,m.__next=f.__key}else h.__prev=null}if(o.__size=d,a.length){const h=Jn();if(vn(h)){const m=new Set(a),g=new Set(u),{anchor:y,focus:b}=h;gx(y,m,g)&&ip(y,y.getNode(),this,l,f),gx(b,m,g)&&ip(b,b.getNode(),this,l,f),d===0&&!this.canBeEmpty()&&!Is(this)&&this.remove()}}return o}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,e){return!1}};function At(c){return c instanceof ap}function gx(c,t,n){let e=c.getNode();for(;e;){const s=e.__key;if(t.has(s)&&!n.has(s))return!0;e=e.getParent()}return!1}let lp=class fN extends ap{static getType(){return"root"}static clone(){return new fN}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const t=this.__cachedText;return(Kl()||Xn()._dirtyType===ja)&&t!==null?t:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(t){throw Error("replace: cannot be called on root nodes")}insertBefore(t){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(t){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(t,n){return!1}append(...t){for(let n=0;n<t.length;n++){const e=t[n];if(!At(e)&&!dr(e))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...t)}static importJSON(t){const n=No();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}};function aP(){return new lp}function Ao(c){return c instanceof lp}function lP(c,t){const n=t.getEditorState()._selection,e=c._selection;if(e!==null){if(e.dirty||!e.is(n))return!0}else if(n!==null)return!0;return!1}function cP(c){return new cp(new Map(c._nodeMap))}function b0(){return new cp(new Map([["root",aP()]]))}function mx(c){const t=c.exportJSON(),n=c.constructor;if(t.type!==n.getType())throw Error(`LexicalNode: Node ${n.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(At(c)){const e=t.children;if(!Array.isArray(e))throw Error(`LexicalNode: Node ${n.name} is an element but .exportJSON() does not have a children array.`);const s=c.getChildren();for(let r=0;r<s.length;r++){const o=s[r],i=mx(o);e.push(i)}}return t}class cp{constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t){return ux(this,t)}clone(t){const n=new cp(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return ux(this,()=>({root:mx(No())}))}}let up=class pN extends ap{static getType(){return"paragraph"}static clone(t){return new pN(t.__key)}createDOM(t){const n=document.createElement("p"),e=Iu(t.theme,"paragraph");return e!==void 0&&n.classList.add(...e),n}updateDOM(t,n,e){return!1}static importDOM(){return{p:t=>({conversion:uP,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&qf(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s);const r=this.getIndent();r>0&&(n.style.textIndent=`${r*20}px`)}return{element:n}}static importJSON(t){const n=Zi();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(t,n){const e=Zi(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=this.getChildren();if(t.length===0||rn(t[0])&&t[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 uP(c){const t=Zi();if(c.style){t.setFormat(c.style.textAlign);const n=parseInt(c.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Zi(){return Ru(new up)}function dP(c){return c instanceof up}const fP=0,pP=1,hP=2,gP=3,mP=4;function yx(c,t,n,e){const s=c._keyToDOMMap;s.clear(),c._editorState=b0(),c._pendingEditorState=e,c._compositionKey=null,c._dirtyType=ja,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),c._normalizedNodes=new Set,c._updateTags=new Set,c._updates=[],c._blockCursorElement=null;const r=c._observer;r!==null&&(r.disconnect(),c._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",s.set("root",n))}function yP(c,t){const n=new Map,e=new Set,s=r=>{Object.keys(r).forEach(o=>{let i=n.get(o);i===void 0&&(i=[],n.set(o,i)),i.push(r[o])})};return c.forEach(r=>{const o=r.klass.importDOM;if(o==null||e.has(o))return;e.add(o);const i=o.call(r.klass);i!==null&&s(i)}),t&&s(t),n}function bP(c){const t=c||{},n=ZA(),e=t.theme||{},s=c===void 0?n:t.parentEditor||null,r=t.disableEvents||!1,o=b0(),i=t.namespace||(s!==null?s._config.namespace:p1()),u=t.editorState,a=[lp,zu,ep,Ul,up,...t.nodes||[]],{onError:f,html:l}=t,d=t.editable!==void 0?t.editable:!0;let p;if(c===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let m=0;m<a.length;m++){let g=a[m],y=null,b=null;if(typeof g!="function"){const x=g;g=x.replace,y=x.with,b=x.withKlass||null}{const x=g.name;if(x!=="RootNode"){const S=g.prototype;["getType","clone"].forEach(E=>{g.hasOwnProperty(E)||console.warn(`${x} must implement static "${E}" method`)}),!g.hasOwnProperty("importDOM")&&g.hasOwnProperty("exportDOM")&&console.warn(`${x} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),S instanceof y0&&(S.hasOwnProperty("decorate")||console.warn(`${S.constructor.name} must implement "decorate" method`)),g.hasOwnProperty("importJSON")||console.warn(`${x} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),S.hasOwnProperty("exportJSON")||console.warn(`${x} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const v=g.getType(),_=g.transform(),w=new Set;_!==null&&w.add(_),p.set(v,{exportDOM:l&&l.export?l.export.get(g):void 0,klass:g,replace:y,replaceWithKlass:b,transforms:w})}}const h=new vP(o,s,p,{disableEvents:r,namespace:i,theme:e},f||console.error,yP(p,l?l.import:void 0),d);return u!==void 0&&(h._pendingEditorState=u,h._dirtyType=Dl),h}class vP{constructor(t,n,e,s,r,o,i){this._parentEditor=n,this._rootElement=null,this._editorState=t,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=s,this._nodes=e,this._decorators={},this._pendingDecorators=null,this._dirtyType=ja,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=p1(),this._onError=r,this._htmlConversions=o,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,e){if(e===void 0)throw Error('Listener for type "command" requires a "priority".');const s=this._commands;s.has(t)||s.set(t,[new Set,new Set,new Set,new Set,new Set]);const r=s.get(t);if(r===void 0)throw Error(`registerCommand: Command ${String(t)} not found in command map`);const o=r[e];return o.add(n),()=>{o.delete(n),r.every(i=>i.size===0)&&s.delete(t)}}registerMutationListener(t,n){if(this._nodes.get(t.getType())===void 0)throw Error(`Node ${t.name} has not been registered. Ensure node has been passed to createEditor.`);const s=this._listeners.mutation;return s.set(n,t),()=>{s.delete(n)}}registerNodeTransformToKlass(t,n){const e=t.getType(),s=this._nodes.get(e);if(s===void 0)throw Error(`Node ${t.name} has not been registered. Ensure node has been passed to createEditor.`);return s.transforms.add(n),s}registerNodeTransform(t,n){const e=this.registerNodeTransformToKlass(t,n),s=[e],r=e.replaceWithKlass;if(r!=null){const o=this.registerNodeTransformToKlass(r,n);s.push(o)}return uk(this,t.getType()),()=>{s.forEach(o=>o.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Yt(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const e=Iu(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=t,yx(this,n,t,s),n!==null&&(this._config.disableEvents||wA(n),e!=null&&n.classList.remove(...e)),t!==null){const r=Gk(t),o=t.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=Dl,e1(this),this._updateTags.add("history-merge"),$a(this),this._config.disableEvents||xA(t,this),e!=null&&t.classList.add(...e)}else this._editorState=s,this._pendingEditorState=null,this._window=null;Hu("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){if(t.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");Q_(this);const e=this._pendingEditorState,s=this._updateTags,r=n!==void 0?n.tag:null;e!==null&&!e.isEmpty()&&(r!=null&&s.add(r),$a(this)),this._pendingEditorState=t,this._dirtyType=Dl,this._dirtyElements.set("root",!1),this._compositionKey=null,r!=null&&s.add(r),$a(this)}parseEditorState(t,n){const e=typeof t=="string"?JSON.parse(t):t;return nP(e,this,n)}update(t,n){ko(this,t,n)}focus(t,n={}){const e=this._rootElement;e!==null&&(e.setAttribute("autocapitalize","off"),ko(this,()=>{const s=Jn(),r=No();s!==null?s.dirty=!0:r.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?r.selectStart():r.selectEnd())},{onUpdate:()=>{e.removeAttribute("autocapitalize"),t&&t()},tag:"focus"}),this._pendingEditorState===null&&e.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=_i(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Hu("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}const _P=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:Jk,$applyNodeReplacement:Ru,$copyNode:w1,$createLineBreakNode:zl,$createNodeSelection:f0,$createParagraphNode:Zi,$createPoint:ri,$createRangeSelection:KA,$createTabNode:np,$createTextNode:$r,$getAdjacentNode:Hm,$getCharacterOffsets:d0,$getEditor:tA,$getNearestNodeFromDOMNode:ku,$getNearestRootOrShadowRoot:x1,$getNodeByKey:qr,$getPreviousSelection:Hl,$getRoot:No,$getSelection:Jn,$getTextContent:GA,$hasAncestor:Kf,$hasUpdateTag:qk,$insertNodes:VA,$isBlockElementNode:HA,$isDecoratorNode:dr,$isElementNode:At,$isInlineElementOrDecoratorNode:Yk,$isLeafNode:ak,$isLineBreakNode:Fa,$isNodeSelection:Uu,$isParagraphNode:dP,$isRangeSelection:vn,$isRootNode:Ao,$isRootOrShadowRoot:Is,$isTabNode:V1,$isTextNode:rn,$nodesOfType:Kk,$normalizeSelection__EXPERIMENTAL:o1,$parseSerializedNode:tP,$selectAll:Hk,$setCompositionKey:Mr,$setSelection:vi,$splitNode:Qk,BLUR_COMMAND:H_,CAN_REDO_COMMAND:RN,CAN_UNDO_COMMAND:jN,CLEAR_EDITOR_COMMAND:MN,CLEAR_HISTORY_COMMAND:IN,CLICK_COMMAND:E_,COMMAND_PRIORITY_CRITICAL:mP,COMMAND_PRIORITY_EDITOR:fP,COMMAND_PRIORITY_HIGH:gP,COMMAND_PRIORITY_LOW:pP,COMMAND_PRIORITY_NORMAL:hP,CONTROLLED_TEXT_INSERTION_COMMAND:jl,COPY_COMMAND:fm,CUT_COMMAND:pm,DELETE_CHARACTER_COMMAND:Su,DELETE_LINE_COMMAND:Ou,DELETE_WORD_COMMAND:Eu,DRAGEND_COMMAND:z_,DRAGOVER_COMMAND:$_,DRAGSTART_COMMAND:F_,DROP_COMMAND:B_,DecoratorNode:y0,ElementNode:ap,FOCUS_COMMAND:U_,FORMAT_ELEMENT_COMMAND:PN,FORMAT_TEXT_COMMAND:Ns,INDENT_CONTENT_COMMAND:kN,INSERT_LINE_BREAK_COMMAND:Cu,INSERT_PARAGRAPH_COMMAND:am,INSERT_TAB_COMMAND:NN,KEY_ARROW_DOWN_COMMAND:M_,KEY_ARROW_LEFT_COMMAND:k_,KEY_ARROW_RIGHT_COMMAND:T_,KEY_ARROW_UP_COMMAND:P_,KEY_BACKSPACE_COMMAND:R_,KEY_DELETE_COMMAND:D_,KEY_DOWN_COMMAND:O_,KEY_ENTER_COMMAND:Pf,KEY_ESCAPE_COMMAND:j_,KEY_MODIFIER_COMMAND:K_,KEY_SPACE_COMMAND:I_,KEY_TAB_COMMAND:L_,LineBreakNode:ep,MOVE_TO_END:N_,MOVE_TO_START:A_,OUTDENT_CONTENT_COMMAND:AN,PASTE_COMMAND:lm,ParagraphNode:up,REDO_COMMAND:dm,REMOVE_TEXT_COMMAND:cm,RootNode:lp,SELECTION_CHANGE_COMMAND:Af,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:TN,SELECT_ALL_COMMAND:hm,TabNode:Ul,TextNode:zu,UNDO_COMMAND:um,createCommand:bn,createEditor:bP,getNearestEditorFromDOMNode:Dm,isCurrentlyReadOnlyMode:Kl,isHTMLAnchorElement:eA,isHTMLElement:qf,isSelectionCapturedInDecoratorInput:jm,isSelectionWithinEditor:Nu},Symbol.toStringTag,{value:"Module"}));function xP(c){return{}}const dp={},wP={},bx={},Ku={},Wu={},v0={},Wl={},_0={},x0={},qu={},Ju={},Fs={},w0={},S0={},vx={},_x={},xx={},wx={},Sx={},Cx={},Ex={},fp={},Ox={},Tx={},Nx={},kx={},Ax={},SP={},CP={},EP={},Px={},OP={},Mx={},Ix={},Rx={},C0={},E0={},O0={},TP={},NP={},kP={},AP={},jx={},Dx={},Lx={};var Xt=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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.`)};const oi=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,PP=oi&&"documentMode"in document?document.documentMode:null,ii=oi&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$s=oi&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),pp=!(!oi||!("InputEvent"in window)||PP)&&"getTargetRanges"in new window.InputEvent("input"),T0=oi&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),hp=oi&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,MP=oi&&/Android/.test(navigator.userAgent),Bx=oi&&/^(?=.*Chrome).*/i.test(navigator.userAgent),IP=oi&&MP&&Bx,N0=oi&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Bx,Vu=1,zs=3,za=0,Fx=1,ql=2,gp=4,mp=8,RP=240|(3|gp|mp),k0=1,A0=2,P0=3,M0=4,I0=5,R0=6,yp=T0||hp||N0?" ":"",Qi=`
|
|
40
40
|
|
|
41
|
-
`,DP=$s?" ":yp,zx="֑-߿יִ-﷽ﹰ-ﻼ",Ux="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",LP=new RegExp("^[^"+Ux+"]*["+zx+"]"),BP=new RegExp("^[^"+zx+"]*["+Ux+"]"),Us={bold:1,code:16,highlight:128,italic:2,strikethrough:gp,subscript:32,superscript:64,underline:mp},FP={directionless:1,unmergeable:2},Hx={center:A0,end:R0,justify:M0,left:k0,right:P0,start:I0},$P={[A0]:"center",[R0]:"end",[M0]:"justify",[k0]:"left",[P0]:"right",[I0]:"start"},zP={normal:0,segmented:2,token:1},UP={0:"normal",2:"segmented",1:"token"};function bp(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const HP=100;let j0=!1,D0=0;function KP(c){D0=c.timeStamp}function L0(c,t,n){return t.__lexicalLineBreak===c||c[`__lexicalKey_${n._key}`]!==void 0}function WP(c,t,n){const e=Si(n._window);let s=null,r=null;e!==null&&e.anchorNode===c&&(s=e.anchorOffset,r=e.focusOffset);const o=c.nodeValue;o!==null&&K0(t,o,s,r,!1)}function qP(c,t,n){if(xn(c)){const e=c.anchor.getNode();if(e.is(n)&&c.format!==e.getFormat())return!1}return t.nodeType===zs&&n.isAttached()}function Kx(c,t,n){j0=!0;const e=performance.now()-D0>HP;try{Mo(c,()=>{const s=Vn()||function(d){return d.getEditorState().read(()=>{const p=Vn();return p!==null?p.clone():null})}(c),r=new Map,o=c.getRootElement(),i=c._editorState,u=c._blockCursorElement;let a=!1,f="";for(let d=0;d<t.length;d++){const p=t[d],h=p.type,m=p.target;let g=Yu(m,i);if(!(g===null&&m!==o||fr(g))){if(h==="characterData")e&&on(g)&&qP(s,m,g)&&WP(m,g,c);else if(h==="childList"){a=!0;const y=p.addedNodes;for(let _=0;_<y.length;_++){const w=y[_],x=Qx(w),S=w.parentNode;if(S!=null&&w!==u&&x===null&&(w.nodeName!=="BR"||!L0(w,S,c))){if($s){const E=w.innerText||w.nodeValue;E&&(f+=E)}S.removeChild(w)}}const b=p.removedNodes,v=b.length;if(v>0){let _=0;for(let w=0;w<v;w++){const x=b[w];(x.nodeName==="BR"&&L0(x,m,c)||u===x)&&(m.appendChild(x),_++)}v!==_&&(m===o&&(g=nw(i)),r.set(m,g))}}}}if(r.size>0)for(const[d,p]of r)if(Pt(p)){const h=p.getChildrenKeys();let m=d.firstChild;for(let g=0;g<h.length;g++){const y=h[g],b=c.getElementByKey(y);b!==null&&(m==null?(d.appendChild(b),m=b):m!==b&&d.replaceChild(b,m),m=m.nextSibling)}}else on(p)&&p.markDirty();const l=n.takeRecords();if(l.length>0){for(let d=0;d<l.length;d++){const p=l[d],h=p.addedNodes,m=p.target;for(let g=0;g<h.length;g++){const y=h[g],b=y.parentNode;b==null||y.nodeName!=="BR"||L0(y,m,c)||b.removeChild(y)}}n.takeRecords()}s!==null&&(a&&(s.dirty=!0,wi(s)),$s&&fw(c)&&s.insertRawText(f))})}finally{j0=!1}}function Wx(c){const t=c._observer;t!==null&&Kx(c,t.takeRecords(),t)}function qx(c){(function(t){D0===0&&Ep(t).addEventListener("textInput",KP,!0)})(c),c._observer=new MutationObserver((t,n)=>{Kx(c,t,n)})}function Jx(c,t){const n=c.__mode,e=c.__format,s=c.__style,r=t.__mode,o=t.__format,i=t.__style;return!(n!==null&&n!==r||e!==null&&e!==o||s!==null&&s!==i)}function Vx(c,t){const n=c.mergeWithSibling(t),e=tr()._normalizedNodes;return e.add(c.__key),e.add(t.__key),n}function Gx(c){let t,n,e=c;if(e.__text!==""||!e.isSimpleText()||e.isUnmergeable()){for(;(t=e.getPreviousSibling())!==null&&on(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Jx(t,e)){e=Vx(t,e);break}break}t.remove()}for(;(n=e.getNextSibling())!==null&&on(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(Jx(e,n)){e=Vx(e,n);break}break}n.remove()}}else e.remove()}function Yx(c){return Xx(c.anchor),Xx(c.focus),c}function Xx(c){for(;c.type==="element";){const t=c.getNode(),n=c.offset;let e,s;if(n===t.getChildrenSize()?(e=t.getChildAtIndex(n-1),s=!0):(e=t.getChildAtIndex(n),s=!1),on(e)){c.set(e.__key,s?e.getTextContentSize():0,"text");break}if(!Pt(e))break;c.set(e.__key,s?e.getChildrenSize():0,"element")}}let JP=1;const VP=typeof queueMicrotask=="function"?queueMicrotask:c=>{Promise.resolve().then(c)};function B0(c){const t=document.activeElement;if(t===null)return!1;const n=t.nodeName;return fr(Yu(c))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&t.__lexicalEditor==null)}function Gu(c,t,n){const e=c.getRootElement();try{return e!==null&&e.contains(t)&&e.contains(n)&&t!==null&&!B0(t)&&F0(t)===c}catch{return!1}}function F0(c){let t=c;for(;t!=null;){const n=t.__lexicalEditor;if(n!=null)return n;t=Sp(t)}return null}function $0(c){return c.isToken()||c.isSegmented()}function GP(c){return c.nodeType===zs}function vp(c){let t=c;for(;t!=null;){if(GP(t))return t;t=t.firstChild}return null}function z0(c,t,n){const e=Us[t];if(n!==null&&(c&e)==(n&e))return c;let s=c^e;return t==="subscript"?s&=~Us.superscript:t==="superscript"&&(s&=~Us.subscript),s}function YP(c){return on(c)||Wa(c)||fr(c)}function Zx(c,t){if(t!=null)return void(c.__key=t);co(),Qw();const n=tr(),e=Ci(),s=""+JP++;e._nodeMap.set(s,c),Pt(c)?n._dirtyElements.set(s,!0):n._dirtyLeaves.add(s),n._cloneNotNeeded.add(s),n._dirtyType=$x,c.__key=s}function Ua(c){const t=c.getParent();if(t!==null){const n=c.getWritable(),e=t.getWritable(),s=c.getPreviousSibling(),r=c.getNextSibling();if(s===null)if(r!==null){const o=r.getWritable();e.__first=r.__key,o.__prev=null}else e.__first=null;else{const o=s.getWritable();if(r!==null){const i=r.getWritable();i.__prev=o.__key,o.__next=i.__key}else o.__next=null;n.__prev=null}if(r===null)if(s!==null){const o=s.getWritable();e.__last=s.__key,o.__next=null}else e.__last=null;else{const o=r.getWritable();if(s!==null){const i=s.getWritable();i.__next=o.__key,o.__prev=i.__key}else o.__prev=null;n.__next=null}e.__size--,n.__parent=null}}function _p(c){Qw();const t=c.getLatest(),n=t.__parent,e=Ci(),s=tr(),r=e._nodeMap,o=s._dirtyElements;n!==null&&function(u,a,f){let l=u;for(;l!==null;){if(f.has(l))return;const d=a.get(l);if(d===void 0)break;f.set(l,!1),l=d.__parent}}(n,r,o);const i=t.__key;s._dirtyType=$x,Pt(c)?o.set(i,!0):s._dirtyLeaves.add(i)}function jr(c){co();const t=tr(),n=t._compositionKey;if(c!==n){if(t._compositionKey=c,n!==null){const e=Vr(n);e!==null&&e.getWritable()}if(c!==null){const e=Vr(c);e!==null&&e.getWritable()}}}function Hs(){return tc()?null:tr()._compositionKey}function Vr(c,t){const n=(t||Ci())._nodeMap.get(c);return n===void 0?null:n}function Qx(c,t){const n=c[`__lexicalKey_${tr()._key}`];return n!==void 0?Vr(n,t):null}function Yu(c,t){let n=c;for(;n!=null;){const e=Qx(n,t);if(e!==null)return e;n=Sp(n)}return null}function ew(c){const t=c._decorators,n=Object.assign({},t);return c._pendingDecorators=n,n}function tw(c){return c.read(()=>Po().getTextContent())}function Po(){return nw(Ci())}function nw(c){return c._nodeMap.get("root")}function wi(c){co();const t=Ci();c!==null&&(c.dirty=!0,c.setCachedNodes(null)),t._selection=c}function Jl(c){const t=tr(),n=function(e,s){let r=e;for(;r!=null;){const o=r[`__lexicalKey_${s._key}`];if(o!==void 0)return o;r=Sp(r)}return null}(c,t);return n===null?c===t.getRootElement()?Vr("root"):null:Vr(n)}function rw(c,t){return t?c.getTextContentSize():0}function ow(c){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(c)}function U0(c){const t=[];let n=c;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function iw(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function sw(c){return c.nodeType===zs?c.nodeValue:null}function H0(c,t,n){const e=Si(t._window);if(e===null)return;const s=e.anchorNode;let{anchorOffset:r,focusOffset:o}=e;if(s!==null){let i=sw(s);const u=Yu(s);if(i!==null&&on(u)){if(i===yp&&n){const a=n.length;i=n,r=a,o=a}i!==null&&K0(u,i,r,o,c)}}}function K0(c,t,n,e,s){let r=c;if(r.isAttached()&&(s||!r.isDirty())){const o=r.isComposing();let i=t;(o||s)&&t[t.length-1]===yp&&(i=t.slice(0,-1));const u=r.getTextContent();if(s||i!==u){if(i===""){if(jr(null),T0||hp||N0)r.remove();else{const m=tr();setTimeout(()=>{m.update(()=>{r.isAttached()&&r.remove()})},20)}return}const a=r.getParent(),f=ec(),l=r.getTextContentSize(),d=Hs(),p=r.getKey();if(r.isToken()||d!==null&&p===d&&!o||xn(f)&&(a!==null&&!a.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===c.__key&&f.anchor.offset===0&&!r.canInsertTextBefore()&&!o||f.focus.key===c.__key&&f.focus.offset===l&&!r.canInsertTextAfter()&&!o))return void r.markDirty();const h=Vn();if(!xn(h)||n===null||e===null)return void r.setTextContent(i);if(h.setTextNodeRange(r,n,r,e),r.isSegmented()){const m=zr(r.getTextContent());r.replace(m),r=m}r.setTextContent(i)}}}function XP(c,t){if(t.isSegmented())return!0;if(!c.isCollapsed())return!1;const n=c.anchor.offset,e=t.getParentOrThrow(),s=t.isToken();return n===0?!t.canInsertTextBefore()||!e.canInsertTextBefore()||s||function(r){const o=r.getPreviousSibling();return(on(o)||Pt(o)&&o.isInline())&&!o.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!e.canInsertTextAfter()||s)}function aw(c){return c===37}function lw(c){return c===39}function Xu(c,t){return ii?c:t}function cw(c){return c===13}function Zu(c){return c===8}function Qu(c){return c===46}function uw(c,t,n){return c===65&&Xu(t,n)}function ZP(){const c=Po();wi(Yx(c.select(0,c.getChildrenSize())))}function ed(c,t){c.__lexicalClassNameCache===void 0&&(c.__lexicalClassNameCache={});const n=c.__lexicalClassNameCache,e=n[t];if(e!==void 0)return e;const s=c[t];if(typeof s=="string"){const r=bp(s);return n[t]=r,r}return s}function W0(c,t,n,e,s){if(n.size===0)return;const r=e.__type,o=e.__key,i=t.get(r);i===void 0&&Xt(33,r);const u=i.klass;let a=c.get(u);a===void 0&&(a=new Map,c.set(u,a));const f=a.get(o),l=f==="destroyed"&&s==="created";(f===void 0||l)&&a.set(o,l?"updated":s)}function QP(c){const t=Ci(),n=t._readOnly,e=c.getType(),s=t._nodeMap,r=[];for(const[,o]of s)o instanceof c&&o.__type===e&&(n||o.isAttached())&&r.push(o);return r}function dw(c,t,n){const e=c.getParent();let s=n,r=c;return e!==null&&(t&&n===0?(s=r.getIndexWithinParent(),r=e):t||n!==r.getChildrenSize()||(s=r.getIndexWithinParent()+1,r=e)),r.getChildAtIndex(t?s-1:s)}function q0(c,t){const n=c.offset;if(c.type==="element")return dw(c.getNode(),t,n);{const e=c.getNode();if(t&&n===0||!t&&n===e.getTextContentSize()){const s=t?e.getPreviousSibling():e.getNextSibling();return s===null?dw(e.getParentOrThrow(),t,e.getIndexWithinParent()+(t?0:1)):s}}return null}function fw(c){const t=Ep(c).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Zt(c,t,n){return rS(c,t,n)}function xp(c){return!Io(c)&&!c.isLastChild()&&!c.isInline()}function wp(c,t){const n=c._keyToDOMMap.get(t);return n===void 0&&Xt(75,t),n}function Sp(c){const t=c.assignedSlot||c.parentElement;return t!==null&&t.nodeType===11?t.host:t}function eM(c){return tr()._updateTags.has(c)}function tM(c){co(),tr()._updateTags.add(c)}function Cp(c,t){let n=c.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Ep(c){const t=c._window;return t===null&&Xt(78),t}function nM(c){return Pt(c)&&c.isInline()||fr(c)&&c.isInline()}function pw(c){let t=c.getParentOrThrow();for(;t!==null;){if(Ks(t))return t;t=t.getParentOrThrow()}return t}function Ks(c){return Io(c)||Pt(c)&&c.isShadowRoot()}function hw(c){const t=c.constructor.clone(c);return Zx(t,null),t}function td(c){const t=tr(),n=c.constructor.getType(),e=t._nodes.get(n);e===void 0&&Xt(97);const s=e.replace;if(s!==null){const r=s(c);return r instanceof c.constructor||Xt(98),r}return c}function J0(c,t){!Io(c.getParent())||Pt(t)||fr(t)||Xt(99)}function V0(c){return(fr(c)||Pt(c)&&!c.canBeEmpty())&&!c.isInline()}function G0(c,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const e=c.parentElement;e!==null&&e.removeChild(c)}function rM(c,t,n){let e=c._blockCursorElement;if(xn(n)&&n.isCollapsed()&&n.anchor.type==="element"&&t.contains(document.activeElement)){const s=n.anchor,r=s.getNode(),o=s.offset;let i=!1,u=null;if(o===r.getChildrenSize())V0(r.getChildAtIndex(o-1))&&(i=!0);else{const a=r.getChildAtIndex(o);if(V0(a)){const f=a.getPreviousSibling();(f===null||V0(f))&&(i=!0,u=c.getElementByKey(a.__key))}}if(i){const a=c.getElementByKey(r.__key);return e===null&&(c._blockCursorElement=e=function(f){const l=f.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let p=l.blockCursor;if(p!==void 0){if(typeof p=="string"){const h=bp(p);p=l.blockCursor=h}p!==void 0&&d.classList.add(...p)}return d}(c._config)),t.style.caretColor="transparent",void(u===null?a.appendChild(e):a.insertBefore(e,u))}}e!==null&&G0(e,c,t)}function Si(c){return oi?(c||window).getSelection():null}function oM(c,t){let n=c.getChildAtIndex(t);n==null&&(n=c),Ks(c)&&Xt(102);const e=o=>{const i=o.getParentOrThrow(),u=Ks(i),a=o!==n||u?hw(o):o;if(u)return Pt(o)&&Pt(a)||Xt(133),o.insertAfter(a),[o,a,a];{const[f,l,d]=e(i),p=o.getNextSiblings();return d.append(a,...p),[f,l,a]}},[s,r]=e(n);return[s,r]}function iM(c){return Op(c)&&c.tagName==="A"}function Op(c){return c.nodeType===1}function Vl(c){if(fr(c)&&!c.isInline())return!0;if(!Pt(c)||Ks(c))return!1;const t=c.getFirstChild(),n=t===null||Wa(t)||on(t)||t.isInline();return!c.isInline()&&c.canBeEmpty()!==!1&&n}function Y0(c,t){let n=c;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function sM(){return tr()}function gw(c,t,n,e,s,r){let o=c.getFirstChild();for(;o!==null;){const i=o.__key;o.__parent===t&&(Pt(o)&&gw(o,i,n,e,s,r),n.has(i)||r.delete(i),s.push(i)),o=o.getNextSibling()}}let Ws,ao,nd,Tp,X0,Z0,Ha,qs,Q0,rd,Nr="",lo="",es="",mw=!1,ey=!1,Np=null;function kp(c,t){const n=Ha.get(c);if(t!==null){const e=oy(c);e.parentNode===t&&t.removeChild(e)}if(qs.has(c)||ao._keyToDOMMap.delete(c),Pt(n)){const e=Pp(n,Ha);ty(e,0,e.length-1,null)}n!==void 0&&W0(rd,nd,Tp,n,"destroyed")}function ty(c,t,n,e){let s=t;for(;s<=n;++s){const r=c[s];r!==void 0&&kp(r,e)}}function Ka(c,t){c.setProperty("text-align",t)}const aM="40px";function yw(c,t){const n=Ws.theme.indent;if(typeof n=="string"){const s=c.classList.contains(n);t>0&&!s?c.classList.add(n):t<1&&s&&c.classList.remove(n)}const e=getComputedStyle(c).getPropertyValue("--lexical-indent-base-value")||aM;c.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${e})`)}function bw(c,t){const n=c.style;t===0?Ka(n,""):t===k0?Ka(n,"left"):t===A0?Ka(n,"center"):t===P0?Ka(n,"right"):t===M0?Ka(n,"justify"):t===I0?Ka(n,"start"):t===R0&&Ka(n,"end")}function Ap(c,t,n){const e=qs.get(c);e===void 0&&Xt(60);const s=e.createDOM(Ws,ao);if(function(r,o,i){const u=i._keyToDOMMap;o["__lexicalKey_"+i._key]=r,u.set(r,o)}(c,s,ao),on(e)?s.setAttribute("data-lexical-text","true"):fr(e)&&s.setAttribute("data-lexical-decorator","true"),Pt(e)){const r=e.__indent,o=e.__size;if(r!==0&&yw(s,r),o!==0){const u=o-1;(function(a,f,l,d){const p=lo;lo="",ny(a,l,0,f,d,null),xw(l,d),lo=p})(Pp(e,qs),u,e,s)}const i=e.__format;i!==0&&bw(s,i),e.isInline()||_w(null,e,s),xp(e)&&(Nr+=Qi,es+=Qi)}else{const r=e.getTextContent();if(fr(e)){const o=e.decorate(ao,Ws);o!==null&&ww(c,o),s.contentEditable="false"}else on(e)&&(e.isDirectionless()||(lo+=r));Nr+=r,es+=r}if(t!==null)if(n!=null)t.insertBefore(s,n);else{const r=t.__lexicalLineBreak;r!=null?t.insertBefore(s,r):t.appendChild(s)}return W0(rd,nd,Tp,e,"created"),s}function ny(c,t,n,e,s,r){const o=Nr;Nr="";let i=n;for(;i<=e;++i)Ap(c[i],s,r);xp(t)&&(Nr+=Qi),s.__lexicalTextContent=Nr,Nr=o+Nr}function vw(c,t){const n=t.get(c);return Wa(n)||fr(n)&&n.isInline()}function _w(c,t,n){const e=c!==null&&(c.__size===0||vw(c.__last,Ha)),s=t.__size===0||vw(t.__last,qs);if(e){if(!s){const r=n.__lexicalLineBreak;r!=null&&n.removeChild(r),n.__lexicalLineBreak=null}}else if(s){const r=document.createElement("br");n.__lexicalLineBreak=r,n.appendChild(r)}}function xw(c,t){const n=t.__lexicalDirTextContent,e=t.__lexicalDir;if(n!==lo||e!==Np){const r=lo==="",o=r?Np:(s=lo,LP.test(s)?"rtl":BP.test(s)?"ltr":null);if(o!==e){const i=t.classList,u=Ws.theme;let a=e!==null?u[e]:void 0,f=o!==null?u[o]:void 0;if(a!==void 0){if(typeof a=="string"){const l=bp(a);a=u[e]=l}i.remove(...a)}if(o===null||r&&o==="ltr")t.removeAttribute("dir");else{if(f!==void 0){if(typeof f=="string"){const l=bp(f);f=u[o]=l}f!==void 0&&i.add(...f)}t.dir=o}ey||(c.getWritable().__dir=o)}Np=o,t.__lexicalDirTextContent=lo,t.__lexicalDir=o}var s}function lM(c,t,n){const e=lo;lo="",function(s,r,o){const i=Nr,u=s.__size,a=r.__size;if(Nr="",u===1&&a===1){const f=s.__first,l=r.__first;if(f===l)od(f,o);else{const d=oy(f),p=Ap(l,null,null);o.replaceChild(p,d),kp(f,null)}}else{const f=Pp(s,Ha),l=Pp(r,qs);if(u===0)a!==0&&ny(l,r,0,a-1,o,null);else if(a===0){if(u!==0){const d=o.__lexicalLineBreak==null;ty(f,0,u-1,d?null:o),d&&(o.textContent="")}}else(function(d,p,h,m,g,y){const b=m-1,v=g-1;let _,w,x=(O=y,O.firstChild),S=0,E=0;for(var O;S<=b&&E<=v;){const T=p[S],I=h[E];if(T===I)x=ry(od(I,y)),S++,E++;else{_===void 0&&(_=new Set(p)),w===void 0&&(w=new Set(h));const k=w.has(T),$=_.has(I);if(k)if($){const H=wp(ao,I);H===x?x=ry(od(I,y)):(x!=null?y.insertBefore(H,x):y.appendChild(H),od(I,y)),S++,E++}else Ap(I,y,x),E++;else x=ry(oy(T)),kp(T,y),S++}}const j=S>b,A=E>v;if(j&&!A){const T=h[v+1];ny(h,d,E,v,y,T===void 0?null:ao.getElementByKey(T))}else A&&!j&&ty(p,S,b,y)})(r,f,l,u,a,o)}xp(r)&&(Nr+=Qi),o.__lexicalTextContent=Nr,Nr=i+Nr}(c,t,n),xw(t,n),lo=e}function Pp(c,t){const n=[];let e=c.__first;for(;e!==null;){const s=t.get(e);s===void 0&&Xt(101),n.push(e),e=s.__next}return n}function od(c,t){const n=Ha.get(c);let e=qs.get(c);n!==void 0&&e!==void 0||Xt(61);const s=mw||Z0.has(c)||X0.has(c),r=wp(ao,c);if(n===e&&!s){if(Pt(n)){const o=r.__lexicalTextContent;o!==void 0&&(Nr+=o,es+=o);const i=r.__lexicalDirTextContent;i!==void 0&&(lo+=i)}else{const o=n.getTextContent();on(n)&&!n.isDirectionless()&&(lo+=o),es+=o,Nr+=o}return r}if(n!==e&&s&&W0(rd,nd,Tp,e,"updated"),e.updateDOM(n,r,Ws)){const o=Ap(c,null,null);return t===null&&Xt(62),t.replaceChild(o,r),kp(c,null),o}if(Pt(n)&&Pt(e)){const o=e.__indent;o!==n.__indent&&yw(r,o);const i=e.__format;i!==n.__format&&bw(r,i),s&&(lM(n,e,r),Io(e)||e.isInline()||_w(n,e,r)),xp(e)&&(Nr+=Qi,es+=Qi)}else{const o=e.getTextContent();if(fr(e)){const i=e.decorate(ao,Ws);i!==null&&ww(c,i)}else on(e)&&!e.isDirectionless()&&(lo+=o);Nr+=o,es+=o}if(!ey&&Io(e)&&e.__cachedText!==es){const o=e.getWritable();o.__cachedText=es,e=o}return r}function ww(c,t){let n=ao._pendingDecorators;const e=ao._decorators;if(n===null){if(e[c]===t)return;n=ew(ao)}n[c]=t}function ry(c){let t=c.nextSibling;return t!==null&&t===ao._blockCursorElement&&(t=t.nextSibling),t}function cM(c,t,n,e,s,r){Nr="",es="",lo="",mw=e===ql,Np=null,ao=n,Ws=n._config,nd=n._nodes,Tp=ao._listeners.mutation,X0=s,Z0=r,Ha=c._nodeMap,qs=t._nodeMap,ey=t._readOnly,Q0=new Map(n._keyToDOMMap);const o=new Map;return rd=o,od("root",null),ao=void 0,nd=void 0,X0=void 0,Z0=void 0,Ha=void 0,qs=void 0,Ws=void 0,Q0=void 0,rd=void 0,o}function oy(c){const t=Q0.get(c);return t===void 0&&Xt(75,c),t}const ts=Object.freeze({}),iy=30,sy=[["keydown",function(c,t){if(id=c.timeStamp,Sw=c.keyCode,t.isComposing())return;const{keyCode:n,shiftKey:e,ctrlKey:s,metaKey:r,altKey:o}=c;Zt(t,_x,c)||(function(i,u,a,f){return lw(i)&&!u&&!f&&!a}(n,s,o,r)?Zt(t,xx,c):function(i,u,a,f,l){return lw(i)&&!f&&!a&&(u||l)}(n,s,e,o,r)?Zt(t,wx,c):function(i,u,a,f){return aw(i)&&!u&&!f&&!a}(n,s,o,r)?Zt(t,Sx,c):function(i,u,a,f,l){return aw(i)&&!f&&!a&&(u||l)}(n,s,e,o,r)?Zt(t,Cx,c):function(i,u,a){return function(f){return f===38}(i)&&!u&&!a}(n,s,r)?Zt(t,Ex,c):function(i,u,a){return function(f){return f===40}(i)&&!u&&!a}(n,s,r)?Zt(t,Ox,c):function(i,u){return cw(i)&&u}(n,e)?(sd=!0,Zt(t,fp,c)):function(i){return i===32}(n)?Zt(t,Tx,c):function(i,u){return ii&&u&&i===79}(n,s)?(c.preventDefault(),sd=!0,Zt(t,Wu,!0)):function(i,u){return cw(i)&&!u}(n,e)?(sd=!1,Zt(t,fp,c)):function(i,u,a,f){return ii?!u&&!a&&(Zu(i)||i===72&&f):!(f||u||a)&&Zu(i)}(n,o,r,s)?Zu(n)?Zt(t,Nx,c):(c.preventDefault(),Zt(t,Ku,!0)):function(i){return i===27}(n)?Zt(t,kx,c):function(i,u,a,f,l){return ii?!(a||f||l)&&(Qu(i)||i===68&&u):!(u||f||l)&&Qu(i)}(n,s,e,o,r)?Qu(n)?Zt(t,Ax,c):(c.preventDefault(),Zt(t,Ku,!1)):function(i,u,a){return Zu(i)&&(ii?u:a)}(n,o,s)?(c.preventDefault(),Zt(t,qu,!0)):function(i,u,a){return Qu(i)&&(ii?u:a)}(n,o,s)?(c.preventDefault(),Zt(t,qu,!1)):function(i,u){return ii&&u&&Zu(i)}(n,r)?(c.preventDefault(),Zt(t,Ju,!0)):function(i,u){return ii&&u&&Qu(i)}(n,r)?(c.preventDefault(),Zt(t,Ju,!1)):function(i,u,a,f){return i===66&&!u&&Xu(a,f)}(n,o,r,s)?(c.preventDefault(),Zt(t,Fs,"bold")):function(i,u,a,f){return i===85&&!u&&Xu(a,f)}(n,o,r,s)?(c.preventDefault(),Zt(t,Fs,"underline")):function(i,u,a,f){return i===73&&!u&&Xu(a,f)}(n,o,r,s)?(c.preventDefault(),Zt(t,Fs,"italic")):function(i,u,a,f){return i===9&&!u&&!a&&!f}(n,o,s,r)?Zt(t,Px,c):function(i,u,a,f){return i===90&&!u&&Xu(a,f)}(n,e,r,s)?(c.preventDefault(),Zt(t,w0,void 0)):function(i,u,a,f){return ii?i===90&&a&&u:i===89&&f||i===90&&f&&u}(n,e,r,s)?(c.preventDefault(),Zt(t,S0,void 0)):ld(t._editorState._selection)?function(i,u,a,f){return!u&&i===67&&(ii?a:f)}(n,e,r,s)?(c.preventDefault(),Zt(t,C0,c)):function(i,u,a,f){return!u&&i===88&&(ii?a:f)}(n,e,r,s)?(c.preventDefault(),Zt(t,E0,c)):uw(n,r,s)&&(c.preventDefault(),Zt(t,O0,c)):!$s&&uw(n,r,s)&&(c.preventDefault(),Zt(t,O0,c)),function(i,u,a,f){return i||u||a||f}(s,e,o,r)&&Zt(t,Bx,c))}],["pointerdown",function(c,t){const n=c.target,e=c.pointerType;n instanceof Node&&e!=="touch"&&Mo(t,()=>{fr(Yu(n))||(ly=!0)})}],["compositionstart",function(c,t){Mo(t,()=>{const n=Vn();if(xn(n)&&!t.isComposing()){const e=n.anchor,s=n.anchor.getNode();jr(e.key),(c.timeStamp<id+iy||e.type==="element"||!n.isCollapsed()||s.getFormat()!==n.format||on(s)&&s.getStyle()!==n.style)&&Zt(t,Wl,DP)}})}],["compositionend",function(c,t){$s?ad=!0:Mo(t,()=>{cy(t,c.data)})}],["input",function(c,t){c.stopPropagation(),Mo(t,()=>{const n=Vn(),e=c.data,s=kw(c);if(e!=null&&xn(n)&&Ow(n,s,e,c.timeStamp,!1)){ad&&(cy(t,e),ad=!1);const r=n.anchor,o=r.getNode(),i=Si(t._window);if(i===null)return;const u=r.offset;pp&&!n.isCollapsed()&&on(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,u)+e+o.getTextContent().slice(u+n.focus.offset)===sw(i.anchorNode)||Zt(t,Wl,e);const a=e.length;$s&&a>1&&c.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=a),T0||hp||N0||!t.isComposing()||(id=0,jr(null))}else H0(!1,t,e!==null?e:void 0),ad&&(cy(t,e||void 0),ad=!1);co(),Wx(tr())}),Gl=null}],["click",function(c,t){Mo(t,()=>{const n=Vn(),e=Si(t._window),s=ec();if(e){if(xn(n)){const r=n.anchor,o=r.getNode();r.type==="element"&&r.offset===0&&n.isCollapsed()&&!Io(o)&&Po().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&n.is(s)?(e.removeAllRanges(),n.dirty=!0):c.detail===3&&!n.isCollapsed()&&o!==n.focus.getNode()&&(Pt(o)?o.select(0):o.getParentOrThrow().select(0))}else if(c.pointerType==="touch"){const r=e.anchorNode;if(r!==null){const o=r.nodeType;(o===Vu||o===zs)&&wi(my(s,e,t,c))}}}Zt(t,vx,c)})}],["cut",ts],["copy",ts],["dragstart",ts],["dragover",ts],["dragend",ts],["paste",ts],["focus",ts],["blur",ts],["drop",ts]];pp&&sy.push(["beforeinput",(c,t)=>function(n,e){const s=n.inputType,r=kw(n);s==="deleteCompositionText"||$s&&fw(e)||s!=="insertCompositionText"&&Mo(e,()=>{const o=Vn();if(s==="deleteContentBackward"){if(o===null){const p=ec();if(!xn(p))return;wi(p.clone())}if(xn(o)){const p=o.anchor.key===o.focus.key;if(i=n.timeStamp,Sw===229&&i<id+iy&&e.isComposing()&&p){if(jr(null),id=0,setTimeout(()=>{Mo(e,()=>{jr(null)})},iy),xn(o)){const h=o.anchor.getNode();h.markDirty(),o.format=h.getFormat(),on(h)||Xt(142),o.style=h.getStyle()}}else{jr(null),n.preventDefault();const h=o.anchor.getNode().getTextContent(),m=o.anchor.offset===0&&o.focus.offset===h.length;RP&&p&&!m||Zt(e,Ku,!0)}return}}var i;if(!xn(o))return;const u=n.data;Gl!==null&&H0(!1,e,Gl),o.dirty&&Gl===null||!o.isCollapsed()||Io(o.anchor.getNode())||r===null||o.applyDOMRange(r),Gl=null;const a=o.anchor,f=o.focus,l=a.getNode(),d=f.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(n.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Zt(e,Wl,n);break;case"insertFromComposition":jr(null),Zt(e,Wl,n);break;case"insertLineBreak":jr(null),Zt(e,Wu,!1);break;case"insertParagraph":jr(null),sd&&!hp?(sd=!1,Zt(e,Wu,!1)):Zt(e,v0,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Zt(e,_0,n);break;case"deleteByComposition":(function(p,h){return p!==h||Pt(p)||Pt(h)||!p.isToken()||!h.isToken()})(l,d)&&Zt(e,x0,n);break;case"deleteByDrag":case"deleteByCut":Zt(e,x0,n);break;case"deleteContent":Zt(e,Ku,!1);break;case"deleteWordBackward":Zt(e,qu,!0);break;case"deleteWordForward":Zt(e,qu,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Zt(e,Ju,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Zt(e,Ju,!1);break;case"formatStrikeThrough":Zt(e,Fs,"strikethrough");break;case"formatBold":Zt(e,Fs,"bold");break;case"formatItalic":Zt(e,Fs,"italic");break;case"formatUnderline":Zt(e,Fs,"underline");break;case"historyUndo":Zt(e,w0,void 0);break;case"historyRedo":Zt(e,S0,void 0)}else{if(u===`
|
|
42
|
-
`)n.preventDefault(),Zt(e,Wu,!1);else if(u===Qi)n.preventDefault(),Zt(e,v0,void 0);else if(u==null&&n.dataTransfer){const p=n.dataTransfer.getData("text/plain");n.preventDefault(),o.insertRawText(p)}else u!=null&&
|
|
43
|
-
`){const e=Vn();if(xn(e)){const s=e.focus;return e.anchor.set(s.key,s.offset,s.type),void Zt(c,fp,null)}}}H0(!0,c,t)}function
|
|
44
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:t=>function(n){const e=n.parentElement;if(e!==null){const s=e.firstChild;if(s===n||s.nextSibling===n&&
|
|
41
|
+
`,jP=$s?" ":yp,$x="֑-߿יִ-﷽ﹰ-ﻼ",zx="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",DP=new RegExp("^[^"+zx+"]*["+$x+"]"),LP=new RegExp("^[^"+$x+"]*["+zx+"]"),Us={bold:1,code:16,highlight:128,italic:2,strikethrough:gp,subscript:32,superscript:64,underline:mp},BP={directionless:1,unmergeable:2},Ux={center:A0,end:R0,justify:M0,left:k0,right:P0,start:I0},FP={[A0]:"center",[R0]:"end",[M0]:"justify",[k0]:"left",[P0]:"right",[I0]:"start"},$P={normal:0,segmented:2,token:1},zP={0:"normal",2:"segmented",1:"token"};function bp(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const UP=100;let j0=!1,D0=0;function HP(c){D0=c.timeStamp}function L0(c,t,n){return t.__lexicalLineBreak===c||c[`__lexicalKey_${n._key}`]!==void 0}function KP(c,t,n){const e=Si(n._window);let s=null,r=null;e!==null&&e.anchorNode===c&&(s=e.anchorOffset,r=e.focusOffset);const o=c.nodeValue;o!==null&&K0(t,o,s,r,!1)}function WP(c,t,n){if(xn(c)){const e=c.anchor.getNode();if(e.is(n)&&c.format!==e.getFormat())return!1}return t.nodeType===zs&&n.isAttached()}function Hx(c,t,n){j0=!0;const e=performance.now()-D0>UP;try{Mo(c,()=>{const s=Vn()||function(d){return d.getEditorState().read(()=>{const p=Vn();return p!==null?p.clone():null})}(c),r=new Map,o=c.getRootElement(),i=c._editorState,u=c._blockCursorElement;let a=!1,f="";for(let d=0;d<t.length;d++){const p=t[d],h=p.type,m=p.target;let g=Yu(m,i);if(!(g===null&&m!==o||fr(g))){if(h==="characterData")e&&on(g)&&WP(s,m,g)&&KP(m,g,c);else if(h==="childList"){a=!0;const y=p.addedNodes;for(let _=0;_<y.length;_++){const w=y[_],x=Zx(w),S=w.parentNode;if(S!=null&&w!==u&&x===null&&(w.nodeName!=="BR"||!L0(w,S,c))){if($s){const E=w.innerText||w.nodeValue;E&&(f+=E)}S.removeChild(w)}}const b=p.removedNodes,v=b.length;if(v>0){let _=0;for(let w=0;w<v;w++){const x=b[w];(x.nodeName==="BR"&&L0(x,m,c)||u===x)&&(m.appendChild(x),_++)}v!==_&&(m===o&&(g=tw(i)),r.set(m,g))}}}}if(r.size>0)for(const[d,p]of r)if(Pt(p)){const h=p.getChildrenKeys();let m=d.firstChild;for(let g=0;g<h.length;g++){const y=h[g],b=c.getElementByKey(y);b!==null&&(m==null?(d.appendChild(b),m=b):m!==b&&d.replaceChild(b,m),m=m.nextSibling)}}else on(p)&&p.markDirty();const l=n.takeRecords();if(l.length>0){for(let d=0;d<l.length;d++){const p=l[d],h=p.addedNodes,m=p.target;for(let g=0;g<h.length;g++){const y=h[g],b=y.parentNode;b==null||y.nodeName!=="BR"||L0(y,m,c)||b.removeChild(y)}}n.takeRecords()}s!==null&&(a&&(s.dirty=!0,wi(s)),$s&&dw(c)&&s.insertRawText(f))})}finally{j0=!1}}function Kx(c){const t=c._observer;t!==null&&Hx(c,t.takeRecords(),t)}function Wx(c){(function(t){D0===0&&Ep(t).addEventListener("textInput",HP,!0)})(c),c._observer=new MutationObserver((t,n)=>{Hx(c,t,n)})}function qx(c,t){const n=c.__mode,e=c.__format,s=c.__style,r=t.__mode,o=t.__format,i=t.__style;return!(n!==null&&n!==r||e!==null&&e!==o||s!==null&&s!==i)}function Jx(c,t){const n=c.mergeWithSibling(t),e=tr()._normalizedNodes;return e.add(c.__key),e.add(t.__key),n}function Vx(c){let t,n,e=c;if(e.__text!==""||!e.isSimpleText()||e.isUnmergeable()){for(;(t=e.getPreviousSibling())!==null&&on(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(qx(t,e)){e=Jx(t,e);break}break}t.remove()}for(;(n=e.getNextSibling())!==null&&on(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(qx(e,n)){e=Jx(e,n);break}break}n.remove()}}else e.remove()}function Gx(c){return Yx(c.anchor),Yx(c.focus),c}function Yx(c){for(;c.type==="element";){const t=c.getNode(),n=c.offset;let e,s;if(n===t.getChildrenSize()?(e=t.getChildAtIndex(n-1),s=!0):(e=t.getChildAtIndex(n),s=!1),on(e)){c.set(e.__key,s?e.getTextContentSize():0,"text");break}if(!Pt(e))break;c.set(e.__key,s?e.getChildrenSize():0,"element")}}let qP=1;const JP=typeof queueMicrotask=="function"?queueMicrotask:c=>{Promise.resolve().then(c)};function B0(c){const t=document.activeElement;if(t===null)return!1;const n=t.nodeName;return fr(Yu(c))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&t.__lexicalEditor==null)}function Gu(c,t,n){const e=c.getRootElement();try{return e!==null&&e.contains(t)&&e.contains(n)&&t!==null&&!B0(t)&&F0(t)===c}catch{return!1}}function F0(c){let t=c;for(;t!=null;){const n=t.__lexicalEditor;if(n!=null)return n;t=Sp(t)}return null}function $0(c){return c.isToken()||c.isSegmented()}function VP(c){return c.nodeType===zs}function vp(c){let t=c;for(;t!=null;){if(VP(t))return t;t=t.firstChild}return null}function z0(c,t,n){const e=Us[t];if(n!==null&&(c&e)==(n&e))return c;let s=c^e;return t==="subscript"?s&=~Us.superscript:t==="superscript"&&(s&=~Us.subscript),s}function GP(c){return on(c)||Wa(c)||fr(c)}function Xx(c,t){if(t!=null)return void(c.__key=t);co(),Zw();const n=tr(),e=Ci(),s=""+qP++;e._nodeMap.set(s,c),Pt(c)?n._dirtyElements.set(s,!0):n._dirtyLeaves.add(s),n._cloneNotNeeded.add(s),n._dirtyType=Fx,c.__key=s}function Ua(c){const t=c.getParent();if(t!==null){const n=c.getWritable(),e=t.getWritable(),s=c.getPreviousSibling(),r=c.getNextSibling();if(s===null)if(r!==null){const o=r.getWritable();e.__first=r.__key,o.__prev=null}else e.__first=null;else{const o=s.getWritable();if(r!==null){const i=r.getWritable();i.__prev=o.__key,o.__next=i.__key}else o.__next=null;n.__prev=null}if(r===null)if(s!==null){const o=s.getWritable();e.__last=s.__key,o.__next=null}else e.__last=null;else{const o=r.getWritable();if(s!==null){const i=s.getWritable();i.__next=o.__key,o.__prev=i.__key}else o.__prev=null;n.__next=null}e.__size--,n.__parent=null}}function _p(c){Zw();const t=c.getLatest(),n=t.__parent,e=Ci(),s=tr(),r=e._nodeMap,o=s._dirtyElements;n!==null&&function(u,a,f){let l=u;for(;l!==null;){if(f.has(l))return;const d=a.get(l);if(d===void 0)break;f.set(l,!1),l=d.__parent}}(n,r,o);const i=t.__key;s._dirtyType=Fx,Pt(c)?o.set(i,!0):s._dirtyLeaves.add(i)}function jr(c){co();const t=tr(),n=t._compositionKey;if(c!==n){if(t._compositionKey=c,n!==null){const e=Vr(n);e!==null&&e.getWritable()}if(c!==null){const e=Vr(c);e!==null&&e.getWritable()}}}function Hs(){return tc()?null:tr()._compositionKey}function Vr(c,t){const n=(t||Ci())._nodeMap.get(c);return n===void 0?null:n}function Zx(c,t){const n=c[`__lexicalKey_${tr()._key}`];return n!==void 0?Vr(n,t):null}function Yu(c,t){let n=c;for(;n!=null;){const e=Zx(n,t);if(e!==null)return e;n=Sp(n)}return null}function Qx(c){const t=c._decorators,n=Object.assign({},t);return c._pendingDecorators=n,n}function ew(c){return c.read(()=>Po().getTextContent())}function Po(){return tw(Ci())}function tw(c){return c._nodeMap.get("root")}function wi(c){co();const t=Ci();c!==null&&(c.dirty=!0,c.setCachedNodes(null)),t._selection=c}function Jl(c){const t=tr(),n=function(e,s){let r=e;for(;r!=null;){const o=r[`__lexicalKey_${s._key}`];if(o!==void 0)return o;r=Sp(r)}return null}(c,t);return n===null?c===t.getRootElement()?Vr("root"):null:Vr(n)}function nw(c,t){return t?c.getTextContentSize():0}function rw(c){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(c)}function U0(c){const t=[];let n=c;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function ow(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function iw(c){return c.nodeType===zs?c.nodeValue:null}function H0(c,t,n){const e=Si(t._window);if(e===null)return;const s=e.anchorNode;let{anchorOffset:r,focusOffset:o}=e;if(s!==null){let i=iw(s);const u=Yu(s);if(i!==null&&on(u)){if(i===yp&&n){const a=n.length;i=n,r=a,o=a}i!==null&&K0(u,i,r,o,c)}}}function K0(c,t,n,e,s){let r=c;if(r.isAttached()&&(s||!r.isDirty())){const o=r.isComposing();let i=t;(o||s)&&t[t.length-1]===yp&&(i=t.slice(0,-1));const u=r.getTextContent();if(s||i!==u){if(i===""){if(jr(null),T0||hp||N0)r.remove();else{const m=tr();setTimeout(()=>{m.update(()=>{r.isAttached()&&r.remove()})},20)}return}const a=r.getParent(),f=ec(),l=r.getTextContentSize(),d=Hs(),p=r.getKey();if(r.isToken()||d!==null&&p===d&&!o||xn(f)&&(a!==null&&!a.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===c.__key&&f.anchor.offset===0&&!r.canInsertTextBefore()&&!o||f.focus.key===c.__key&&f.focus.offset===l&&!r.canInsertTextAfter()&&!o))return void r.markDirty();const h=Vn();if(!xn(h)||n===null||e===null)return void r.setTextContent(i);if(h.setTextNodeRange(r,n,r,e),r.isSegmented()){const m=zr(r.getTextContent());r.replace(m),r=m}r.setTextContent(i)}}}function YP(c,t){if(t.isSegmented())return!0;if(!c.isCollapsed())return!1;const n=c.anchor.offset,e=t.getParentOrThrow(),s=t.isToken();return n===0?!t.canInsertTextBefore()||!e.canInsertTextBefore()||s||function(r){const o=r.getPreviousSibling();return(on(o)||Pt(o)&&o.isInline())&&!o.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!e.canInsertTextAfter()||s)}function sw(c){return c===37}function aw(c){return c===39}function Xu(c,t){return ii?c:t}function lw(c){return c===13}function Zu(c){return c===8}function Qu(c){return c===46}function cw(c,t,n){return c===65&&Xu(t,n)}function XP(){const c=Po();wi(Gx(c.select(0,c.getChildrenSize())))}function ed(c,t){c.__lexicalClassNameCache===void 0&&(c.__lexicalClassNameCache={});const n=c.__lexicalClassNameCache,e=n[t];if(e!==void 0)return e;const s=c[t];if(typeof s=="string"){const r=bp(s);return n[t]=r,r}return s}function W0(c,t,n,e,s){if(n.size===0)return;const r=e.__type,o=e.__key,i=t.get(r);i===void 0&&Xt(33,r);const u=i.klass;let a=c.get(u);a===void 0&&(a=new Map,c.set(u,a));const f=a.get(o),l=f==="destroyed"&&s==="created";(f===void 0||l)&&a.set(o,l?"updated":s)}function ZP(c){const t=Ci(),n=t._readOnly,e=c.getType(),s=t._nodeMap,r=[];for(const[,o]of s)o instanceof c&&o.__type===e&&(n||o.isAttached())&&r.push(o);return r}function uw(c,t,n){const e=c.getParent();let s=n,r=c;return e!==null&&(t&&n===0?(s=r.getIndexWithinParent(),r=e):t||n!==r.getChildrenSize()||(s=r.getIndexWithinParent()+1,r=e)),r.getChildAtIndex(t?s-1:s)}function q0(c,t){const n=c.offset;if(c.type==="element")return uw(c.getNode(),t,n);{const e=c.getNode();if(t&&n===0||!t&&n===e.getTextContentSize()){const s=t?e.getPreviousSibling():e.getNextSibling();return s===null?uw(e.getParentOrThrow(),t,e.getIndexWithinParent()+(t?0:1)):s}}return null}function dw(c){const t=Ep(c).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Zt(c,t,n){return nS(c,t,n)}function xp(c){return!Io(c)&&!c.isLastChild()&&!c.isInline()}function wp(c,t){const n=c._keyToDOMMap.get(t);return n===void 0&&Xt(75,t),n}function Sp(c){const t=c.assignedSlot||c.parentElement;return t!==null&&t.nodeType===11?t.host:t}function QP(c){return tr()._updateTags.has(c)}function eM(c){co(),tr()._updateTags.add(c)}function Cp(c,t){let n=c.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Ep(c){const t=c._window;return t===null&&Xt(78),t}function tM(c){return Pt(c)&&c.isInline()||fr(c)&&c.isInline()}function fw(c){let t=c.getParentOrThrow();for(;t!==null;){if(Ks(t))return t;t=t.getParentOrThrow()}return t}function Ks(c){return Io(c)||Pt(c)&&c.isShadowRoot()}function pw(c){const t=c.constructor.clone(c);return Xx(t,null),t}function td(c){const t=tr(),n=c.constructor.getType(),e=t._nodes.get(n);e===void 0&&Xt(97);const s=e.replace;if(s!==null){const r=s(c);return r instanceof c.constructor||Xt(98),r}return c}function J0(c,t){!Io(c.getParent())||Pt(t)||fr(t)||Xt(99)}function V0(c){return(fr(c)||Pt(c)&&!c.canBeEmpty())&&!c.isInline()}function G0(c,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const e=c.parentElement;e!==null&&e.removeChild(c)}function nM(c,t,n){let e=c._blockCursorElement;if(xn(n)&&n.isCollapsed()&&n.anchor.type==="element"&&t.contains(document.activeElement)){const s=n.anchor,r=s.getNode(),o=s.offset;let i=!1,u=null;if(o===r.getChildrenSize())V0(r.getChildAtIndex(o-1))&&(i=!0);else{const a=r.getChildAtIndex(o);if(V0(a)){const f=a.getPreviousSibling();(f===null||V0(f))&&(i=!0,u=c.getElementByKey(a.__key))}}if(i){const a=c.getElementByKey(r.__key);return e===null&&(c._blockCursorElement=e=function(f){const l=f.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let p=l.blockCursor;if(p!==void 0){if(typeof p=="string"){const h=bp(p);p=l.blockCursor=h}p!==void 0&&d.classList.add(...p)}return d}(c._config)),t.style.caretColor="transparent",void(u===null?a.appendChild(e):a.insertBefore(e,u))}}e!==null&&G0(e,c,t)}function Si(c){return oi?(c||window).getSelection():null}function rM(c,t){let n=c.getChildAtIndex(t);n==null&&(n=c),Ks(c)&&Xt(102);const e=o=>{const i=o.getParentOrThrow(),u=Ks(i),a=o!==n||u?pw(o):o;if(u)return Pt(o)&&Pt(a)||Xt(133),o.insertAfter(a),[o,a,a];{const[f,l,d]=e(i),p=o.getNextSiblings();return d.append(a,...p),[f,l,a]}},[s,r]=e(n);return[s,r]}function oM(c){return Op(c)&&c.tagName==="A"}function Op(c){return c.nodeType===1}function Vl(c){if(fr(c)&&!c.isInline())return!0;if(!Pt(c)||Ks(c))return!1;const t=c.getFirstChild(),n=t===null||Wa(t)||on(t)||t.isInline();return!c.isInline()&&c.canBeEmpty()!==!1&&n}function Y0(c,t){let n=c;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function iM(){return tr()}function hw(c,t,n,e,s,r){let o=c.getFirstChild();for(;o!==null;){const i=o.__key;o.__parent===t&&(Pt(o)&&hw(o,i,n,e,s,r),n.has(i)||r.delete(i),s.push(i)),o=o.getNextSibling()}}let Ws,ao,nd,Tp,X0,Z0,Ha,qs,Q0,rd,Nr="",lo="",es="",gw=!1,ey=!1,Np=null;function kp(c,t){const n=Ha.get(c);if(t!==null){const e=oy(c);e.parentNode===t&&t.removeChild(e)}if(qs.has(c)||ao._keyToDOMMap.delete(c),Pt(n)){const e=Pp(n,Ha);ty(e,0,e.length-1,null)}n!==void 0&&W0(rd,nd,Tp,n,"destroyed")}function ty(c,t,n,e){let s=t;for(;s<=n;++s){const r=c[s];r!==void 0&&kp(r,e)}}function Ka(c,t){c.setProperty("text-align",t)}const sM="40px";function mw(c,t){const n=Ws.theme.indent;if(typeof n=="string"){const s=c.classList.contains(n);t>0&&!s?c.classList.add(n):t<1&&s&&c.classList.remove(n)}const e=getComputedStyle(c).getPropertyValue("--lexical-indent-base-value")||sM;c.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${e})`)}function yw(c,t){const n=c.style;t===0?Ka(n,""):t===k0?Ka(n,"left"):t===A0?Ka(n,"center"):t===P0?Ka(n,"right"):t===M0?Ka(n,"justify"):t===I0?Ka(n,"start"):t===R0&&Ka(n,"end")}function Ap(c,t,n){const e=qs.get(c);e===void 0&&Xt(60);const s=e.createDOM(Ws,ao);if(function(r,o,i){const u=i._keyToDOMMap;o["__lexicalKey_"+i._key]=r,u.set(r,o)}(c,s,ao),on(e)?s.setAttribute("data-lexical-text","true"):fr(e)&&s.setAttribute("data-lexical-decorator","true"),Pt(e)){const r=e.__indent,o=e.__size;if(r!==0&&mw(s,r),o!==0){const u=o-1;(function(a,f,l,d){const p=lo;lo="",ny(a,l,0,f,d,null),_w(l,d),lo=p})(Pp(e,qs),u,e,s)}const i=e.__format;i!==0&&yw(s,i),e.isInline()||vw(null,e,s),xp(e)&&(Nr+=Qi,es+=Qi)}else{const r=e.getTextContent();if(fr(e)){const o=e.decorate(ao,Ws);o!==null&&xw(c,o),s.contentEditable="false"}else on(e)&&(e.isDirectionless()||(lo+=r));Nr+=r,es+=r}if(t!==null)if(n!=null)t.insertBefore(s,n);else{const r=t.__lexicalLineBreak;r!=null?t.insertBefore(s,r):t.appendChild(s)}return W0(rd,nd,Tp,e,"created"),s}function ny(c,t,n,e,s,r){const o=Nr;Nr="";let i=n;for(;i<=e;++i)Ap(c[i],s,r);xp(t)&&(Nr+=Qi),s.__lexicalTextContent=Nr,Nr=o+Nr}function bw(c,t){const n=t.get(c);return Wa(n)||fr(n)&&n.isInline()}function vw(c,t,n){const e=c!==null&&(c.__size===0||bw(c.__last,Ha)),s=t.__size===0||bw(t.__last,qs);if(e){if(!s){const r=n.__lexicalLineBreak;r!=null&&n.removeChild(r),n.__lexicalLineBreak=null}}else if(s){const r=document.createElement("br");n.__lexicalLineBreak=r,n.appendChild(r)}}function _w(c,t){const n=t.__lexicalDirTextContent,e=t.__lexicalDir;if(n!==lo||e!==Np){const r=lo==="",o=r?Np:(s=lo,DP.test(s)?"rtl":LP.test(s)?"ltr":null);if(o!==e){const i=t.classList,u=Ws.theme;let a=e!==null?u[e]:void 0,f=o!==null?u[o]:void 0;if(a!==void 0){if(typeof a=="string"){const l=bp(a);a=u[e]=l}i.remove(...a)}if(o===null||r&&o==="ltr")t.removeAttribute("dir");else{if(f!==void 0){if(typeof f=="string"){const l=bp(f);f=u[o]=l}f!==void 0&&i.add(...f)}t.dir=o}ey||(c.getWritable().__dir=o)}Np=o,t.__lexicalDirTextContent=lo,t.__lexicalDir=o}var s}function aM(c,t,n){const e=lo;lo="",function(s,r,o){const i=Nr,u=s.__size,a=r.__size;if(Nr="",u===1&&a===1){const f=s.__first,l=r.__first;if(f===l)od(f,o);else{const d=oy(f),p=Ap(l,null,null);o.replaceChild(p,d),kp(f,null)}}else{const f=Pp(s,Ha),l=Pp(r,qs);if(u===0)a!==0&&ny(l,r,0,a-1,o,null);else if(a===0){if(u!==0){const d=o.__lexicalLineBreak==null;ty(f,0,u-1,d?null:o),d&&(o.textContent="")}}else(function(d,p,h,m,g,y){const b=m-1,v=g-1;let _,w,x=(O=y,O.firstChild),S=0,E=0;for(var O;S<=b&&E<=v;){const T=p[S],I=h[E];if(T===I)x=ry(od(I,y)),S++,E++;else{_===void 0&&(_=new Set(p)),w===void 0&&(w=new Set(h));const k=w.has(T),$=_.has(I);if(k)if($){const H=wp(ao,I);H===x?x=ry(od(I,y)):(x!=null?y.insertBefore(H,x):y.appendChild(H),od(I,y)),S++,E++}else Ap(I,y,x),E++;else x=ry(oy(T)),kp(T,y),S++}}const j=S>b,A=E>v;if(j&&!A){const T=h[v+1];ny(h,d,E,v,y,T===void 0?null:ao.getElementByKey(T))}else A&&!j&&ty(p,S,b,y)})(r,f,l,u,a,o)}xp(r)&&(Nr+=Qi),o.__lexicalTextContent=Nr,Nr=i+Nr}(c,t,n),_w(t,n),lo=e}function Pp(c,t){const n=[];let e=c.__first;for(;e!==null;){const s=t.get(e);s===void 0&&Xt(101),n.push(e),e=s.__next}return n}function od(c,t){const n=Ha.get(c);let e=qs.get(c);n!==void 0&&e!==void 0||Xt(61);const s=gw||Z0.has(c)||X0.has(c),r=wp(ao,c);if(n===e&&!s){if(Pt(n)){const o=r.__lexicalTextContent;o!==void 0&&(Nr+=o,es+=o);const i=r.__lexicalDirTextContent;i!==void 0&&(lo+=i)}else{const o=n.getTextContent();on(n)&&!n.isDirectionless()&&(lo+=o),es+=o,Nr+=o}return r}if(n!==e&&s&&W0(rd,nd,Tp,e,"updated"),e.updateDOM(n,r,Ws)){const o=Ap(c,null,null);return t===null&&Xt(62),t.replaceChild(o,r),kp(c,null),o}if(Pt(n)&&Pt(e)){const o=e.__indent;o!==n.__indent&&mw(r,o);const i=e.__format;i!==n.__format&&yw(r,i),s&&(aM(n,e,r),Io(e)||e.isInline()||vw(n,e,r)),xp(e)&&(Nr+=Qi,es+=Qi)}else{const o=e.getTextContent();if(fr(e)){const i=e.decorate(ao,Ws);i!==null&&xw(c,i)}else on(e)&&!e.isDirectionless()&&(lo+=o);Nr+=o,es+=o}if(!ey&&Io(e)&&e.__cachedText!==es){const o=e.getWritable();o.__cachedText=es,e=o}return r}function xw(c,t){let n=ao._pendingDecorators;const e=ao._decorators;if(n===null){if(e[c]===t)return;n=Qx(ao)}n[c]=t}function ry(c){let t=c.nextSibling;return t!==null&&t===ao._blockCursorElement&&(t=t.nextSibling),t}function lM(c,t,n,e,s,r){Nr="",es="",lo="",gw=e===ql,Np=null,ao=n,Ws=n._config,nd=n._nodes,Tp=ao._listeners.mutation,X0=s,Z0=r,Ha=c._nodeMap,qs=t._nodeMap,ey=t._readOnly,Q0=new Map(n._keyToDOMMap);const o=new Map;return rd=o,od("root",null),ao=void 0,nd=void 0,X0=void 0,Z0=void 0,Ha=void 0,qs=void 0,Ws=void 0,Q0=void 0,rd=void 0,o}function oy(c){const t=Q0.get(c);return t===void 0&&Xt(75,c),t}const ts=Object.freeze({}),iy=30,sy=[["keydown",function(c,t){if(id=c.timeStamp,ww=c.keyCode,t.isComposing())return;const{keyCode:n,shiftKey:e,ctrlKey:s,metaKey:r,altKey:o}=c;Zt(t,vx,c)||(function(i,u,a,f){return aw(i)&&!u&&!f&&!a}(n,s,o,r)?Zt(t,_x,c):function(i,u,a,f,l){return aw(i)&&!f&&!a&&(u||l)}(n,s,e,o,r)?Zt(t,xx,c):function(i,u,a,f){return sw(i)&&!u&&!f&&!a}(n,s,o,r)?Zt(t,wx,c):function(i,u,a,f,l){return sw(i)&&!f&&!a&&(u||l)}(n,s,e,o,r)?Zt(t,Sx,c):function(i,u,a){return function(f){return f===38}(i)&&!u&&!a}(n,s,r)?Zt(t,Cx,c):function(i,u,a){return function(f){return f===40}(i)&&!u&&!a}(n,s,r)?Zt(t,Ex,c):function(i,u){return lw(i)&&u}(n,e)?(sd=!0,Zt(t,fp,c)):function(i){return i===32}(n)?Zt(t,Ox,c):function(i,u){return ii&&u&&i===79}(n,s)?(c.preventDefault(),sd=!0,Zt(t,Wu,!0)):function(i,u){return lw(i)&&!u}(n,e)?(sd=!1,Zt(t,fp,c)):function(i,u,a,f){return ii?!u&&!a&&(Zu(i)||i===72&&f):!(f||u||a)&&Zu(i)}(n,o,r,s)?Zu(n)?Zt(t,Tx,c):(c.preventDefault(),Zt(t,Ku,!0)):function(i){return i===27}(n)?Zt(t,Nx,c):function(i,u,a,f,l){return ii?!(a||f||l)&&(Qu(i)||i===68&&u):!(u||f||l)&&Qu(i)}(n,s,e,o,r)?Qu(n)?Zt(t,kx,c):(c.preventDefault(),Zt(t,Ku,!1)):function(i,u,a){return Zu(i)&&(ii?u:a)}(n,o,s)?(c.preventDefault(),Zt(t,qu,!0)):function(i,u,a){return Qu(i)&&(ii?u:a)}(n,o,s)?(c.preventDefault(),Zt(t,qu,!1)):function(i,u){return ii&&u&&Zu(i)}(n,r)?(c.preventDefault(),Zt(t,Ju,!0)):function(i,u){return ii&&u&&Qu(i)}(n,r)?(c.preventDefault(),Zt(t,Ju,!1)):function(i,u,a,f){return i===66&&!u&&Xu(a,f)}(n,o,r,s)?(c.preventDefault(),Zt(t,Fs,"bold")):function(i,u,a,f){return i===85&&!u&&Xu(a,f)}(n,o,r,s)?(c.preventDefault(),Zt(t,Fs,"underline")):function(i,u,a,f){return i===73&&!u&&Xu(a,f)}(n,o,r,s)?(c.preventDefault(),Zt(t,Fs,"italic")):function(i,u,a,f){return i===9&&!u&&!a&&!f}(n,o,s,r)?Zt(t,Ax,c):function(i,u,a,f){return i===90&&!u&&Xu(a,f)}(n,e,r,s)?(c.preventDefault(),Zt(t,w0,void 0)):function(i,u,a,f){return ii?i===90&&a&&u:i===89&&f||i===90&&f&&u}(n,e,r,s)?(c.preventDefault(),Zt(t,S0,void 0)):ld(t._editorState._selection)?function(i,u,a,f){return!u&&i===67&&(ii?a:f)}(n,e,r,s)?(c.preventDefault(),Zt(t,C0,c)):function(i,u,a,f){return!u&&i===88&&(ii?a:f)}(n,e,r,s)?(c.preventDefault(),Zt(t,E0,c)):cw(n,r,s)&&(c.preventDefault(),Zt(t,O0,c)):!$s&&cw(n,r,s)&&(c.preventDefault(),Zt(t,O0,c)),function(i,u,a,f){return i||u||a||f}(s,e,o,r)&&Zt(t,Lx,c))}],["pointerdown",function(c,t){const n=c.target,e=c.pointerType;n instanceof Node&&e!=="touch"&&Mo(t,()=>{fr(Yu(n))||(ly=!0)})}],["compositionstart",function(c,t){Mo(t,()=>{const n=Vn();if(xn(n)&&!t.isComposing()){const e=n.anchor,s=n.anchor.getNode();jr(e.key),(c.timeStamp<id+iy||e.type==="element"||!n.isCollapsed()||s.getFormat()!==n.format||on(s)&&s.getStyle()!==n.style)&&Zt(t,Wl,jP)}})}],["compositionend",function(c,t){$s?ad=!0:Mo(t,()=>{cy(t,c.data)})}],["input",function(c,t){c.stopPropagation(),Mo(t,()=>{const n=Vn(),e=c.data,s=Nw(c);if(e!=null&&xn(n)&&Ew(n,s,e,c.timeStamp,!1)){ad&&(cy(t,e),ad=!1);const r=n.anchor,o=r.getNode(),i=Si(t._window);if(i===null)return;const u=r.offset;pp&&!n.isCollapsed()&&on(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,u)+e+o.getTextContent().slice(u+n.focus.offset)===iw(i.anchorNode)||Zt(t,Wl,e);const a=e.length;$s&&a>1&&c.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=a),T0||hp||N0||!t.isComposing()||(id=0,jr(null))}else H0(!1,t,e!==null?e:void 0),ad&&(cy(t,e||void 0),ad=!1);co(),Kx(tr())}),Gl=null}],["click",function(c,t){Mo(t,()=>{const n=Vn(),e=Si(t._window),s=ec();if(e){if(xn(n)){const r=n.anchor,o=r.getNode();r.type==="element"&&r.offset===0&&n.isCollapsed()&&!Io(o)&&Po().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&n.is(s)?(e.removeAllRanges(),n.dirty=!0):c.detail===3&&!n.isCollapsed()&&o!==n.focus.getNode()&&(Pt(o)?o.select(0):o.getParentOrThrow().select(0))}else if(c.pointerType==="touch"){const r=e.anchorNode;if(r!==null){const o=r.nodeType;(o===Vu||o===zs)&&wi(my(s,e,t,c))}}}Zt(t,bx,c)})}],["cut",ts],["copy",ts],["dragstart",ts],["dragover",ts],["dragend",ts],["paste",ts],["focus",ts],["blur",ts],["drop",ts]];pp&&sy.push(["beforeinput",(c,t)=>function(n,e){const s=n.inputType,r=Nw(n);s==="deleteCompositionText"||$s&&dw(e)||s!=="insertCompositionText"&&Mo(e,()=>{const o=Vn();if(s==="deleteContentBackward"){if(o===null){const p=ec();if(!xn(p))return;wi(p.clone())}if(xn(o)){const p=o.anchor.key===o.focus.key;if(i=n.timeStamp,ww===229&&i<id+iy&&e.isComposing()&&p){if(jr(null),id=0,setTimeout(()=>{Mo(e,()=>{jr(null)})},iy),xn(o)){const h=o.anchor.getNode();h.markDirty(),o.format=h.getFormat(),on(h)||Xt(142),o.style=h.getStyle()}}else{jr(null),n.preventDefault();const h=o.anchor.getNode().getTextContent(),m=o.anchor.offset===0&&o.focus.offset===h.length;IP&&p&&!m||Zt(e,Ku,!0)}return}}var i;if(!xn(o))return;const u=n.data;Gl!==null&&H0(!1,e,Gl),o.dirty&&Gl===null||!o.isCollapsed()||Io(o.anchor.getNode())||r===null||o.applyDOMRange(r),Gl=null;const a=o.anchor,f=o.focus,l=a.getNode(),d=f.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(n.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Zt(e,Wl,n);break;case"insertFromComposition":jr(null),Zt(e,Wl,n);break;case"insertLineBreak":jr(null),Zt(e,Wu,!1);break;case"insertParagraph":jr(null),sd&&!hp?(sd=!1,Zt(e,Wu,!1)):Zt(e,v0,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Zt(e,_0,n);break;case"deleteByComposition":(function(p,h){return p!==h||Pt(p)||Pt(h)||!p.isToken()||!h.isToken()})(l,d)&&Zt(e,x0,n);break;case"deleteByDrag":case"deleteByCut":Zt(e,x0,n);break;case"deleteContent":Zt(e,Ku,!1);break;case"deleteWordBackward":Zt(e,qu,!0);break;case"deleteWordForward":Zt(e,qu,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Zt(e,Ju,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Zt(e,Ju,!1);break;case"formatStrikeThrough":Zt(e,Fs,"strikethrough");break;case"formatBold":Zt(e,Fs,"bold");break;case"formatItalic":Zt(e,Fs,"italic");break;case"formatUnderline":Zt(e,Fs,"underline");break;case"historyUndo":Zt(e,w0,void 0);break;case"historyRedo":Zt(e,S0,void 0)}else{if(u===`
|
|
42
|
+
`)n.preventDefault(),Zt(e,Wu,!1);else if(u===Qi)n.preventDefault(),Zt(e,v0,void 0);else if(u==null&&n.dataTransfer){const p=n.dataTransfer.getData("text/plain");n.preventDefault(),o.insertRawText(p)}else u!=null&&Ew(o,r,u,n.timeStamp,!0)?(n.preventDefault(),Zt(e,Wl,u)):Gl=u;Sw=n.timeStamp}})}(c,t)]);let id=0,ww=0,Sw=0,Gl=null;const Mp=new WeakMap;let ay=!1,ly=!1,sd=!1,ad=!1,Cw=[0,"",0,"root",0];function Ew(c,t,n,e,s){const r=c.anchor,o=c.focus,i=r.getNode(),u=tr(),a=Si(u._window),f=a!==null?a.anchorNode:null,l=r.key,d=u.getElementByKey(l),p=n.length;return l!==o.key||!on(i)||(!s&&(!pp||Sw<e+50)||i.isDirty()&&p<2||rw(n))&&r.offset!==o.offset&&!i.isComposing()||$0(i)||i.isDirty()&&p>1||(s||!pp)&&d!==null&&!i.isComposing()&&f!==vp(d)||a!==null&&t!==null&&(!t.collapsed||t.startContainer!==a.anchorNode||t.startOffset!==a.anchorOffset)||i.getFormat()!==c.format||i.getStyle()!==c.style||YP(c,i)}function Ow(c,t){return c!==null&&c.nodeValue!==null&&c.nodeType===zs&&t!==0&&t!==c.nodeValue.length}function Tw(c,t,n){const{anchorNode:e,anchorOffset:s,focusNode:r,focusOffset:o}=c;ay&&(ay=!1,Ow(e,s)&&Ow(r,o))||Mo(t,()=>{if(!n)return void wi(null);if(!Gu(t,e,r))return;const i=Vn();if(xn(i)){const u=i.anchor,a=u.getNode();if(i.isCollapsed()){c.type==="Range"&&c.anchorNode===c.focusNode&&(i.dirty=!0);const f=Ep(t).event,l=f?f.timeStamp:performance.now(),[d,p,h,m,g]=Cw,y=Po(),b=t.isComposing()===!1&&y.getTextContent()==="";l<g+200&&u.offset===h&&u.key===m?(i.format=d,i.style=p):u.type==="text"?(on(a)||Xt(141),i.format=a.getFormat(),i.style=a.getStyle()):u.type!=="element"||b||(i.format=0,i.style="")}else{const f=u.key,l=i.focus.key,d=i.getNodes(),p=d.length,h=i.isBackward(),m=h?o:s,g=h?s:o,y=h?l:f,b=h?f:l;let v=RP,_=!1;for(let w=0;w<p;w++){const x=d[w],S=x.getTextContentSize();if(on(x)&&S!==0&&!(w===0&&x.__key===y&&m===S||w===p-1&&x.__key===b&&g===0)&&(_=!0,v&=x.getFormat(),v===0))break}i.format=_?v:0}}Zt(t,dp,void 0)})}function Nw(c){if(!c.getTargetRanges)return null;const t=c.getTargetRanges();return t.length===0?null:t[0]}function cy(c,t){const n=c._compositionKey;if(jr(null),n!==null&&t!=null){if(t===""){const e=Vr(n),s=vp(c.getElementByKey(n));return void(s!==null&&s.nodeValue!==null&&on(e)&&K0(e,s.nodeValue,null,null,!0))}if(t[t.length-1]===`
|
|
43
|
+
`){const e=Vn();if(xn(e)){const s=e.focus;return e.anchor.set(s.key,s.offset,s.type),void Zt(c,fp,null)}}}H0(!0,c,t)}function kw(c){let t=c.__lexicalEventHandles;return t===void 0&&(t=[],c.__lexicalEventHandles=t),t}const Yl=new Map;function Aw(c){const t=c.target,n=Si(t==null?null:t.nodeType===9?t.defaultView:t.ownerDocument.defaultView);if(n===null)return;const e=F0(n.anchorNode);if(e===null)return;ly&&(ly=!1,Mo(e,()=>{const a=ec(),f=n.anchorNode;if(f===null)return;const l=f.nodeType;l!==Vu&&l!==zs||wi(my(a,n,e,c))}));const s=U0(e),r=s[s.length-1],o=r._key,i=Yl.get(o),u=i||r;u!==e&&Tw(n,u,!1),Tw(n,e,!0),e!==r?Yl.set(o,e):i&&Yl.delete(o)}function Pw(c){c._lexicalHandled=!0}function Mw(c){return c._lexicalHandled===!0}function cM(c){const t=c.ownerDocument,n=Mp.get(t);if(n===void 0)throw Error("Root element not registered");Mp.set(t,n-1),n===1&&t.removeEventListener("selectionchange",Aw);const e=c.__lexicalEditor;e!=null&&(function(r){if(r._parentEditor!==null){const o=U0(r),i=o[o.length-1]._key;Yl.get(i)===r&&Yl.delete(i)}else Yl.delete(r._key)}(e),c.__lexicalEditor=null);const s=kw(c);for(let r=0;r<s.length;r++)s[r]();c.__lexicalEventHandles=[]}function uy(c,t,n){co();const e=c.__key,s=c.getParent();if(s===null)return;const r=function(i){const u=Vn();if(!xn(u)||!Pt(i))return u;const{anchor:a,focus:f}=u,l=a.getNode(),d=f.getNode();return Cp(l,i)&&a.set(i.__key,0,"element"),Cp(d,i)&&f.set(i.__key,0,"element"),u}(c);let o=!1;if(xn(r)&&t){const i=r.anchor,u=r.focus;i.key===e&&(Bp(i,c,s,c.getPreviousSibling(),c.getNextSibling()),o=!0),u.key===e&&(Bp(u,c,s,c.getPreviousSibling(),c.getNextSibling()),o=!0)}else ld(r)&&t&&c.isSelected()&&c.selectPrevious();if(xn(r)&&t&&!o){const i=c.getIndexWithinParent();Ua(c),Lp(r,s,i,-1)}else Ua(c);n||Ks(s)||s.canBeEmpty()||!s.isEmpty()||uy(s,t),t&&Io(s)&&s.isEmpty()&&s.selectEnd()}class Ip{static getType(){Xt(64,this.name)}static clone(t){Xt(65,this.name)}constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Xx(this,t)}getType(){return this.__type}isInline(){Xt(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Vr(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||Vn();if(n==null)return!1;const e=n.getNodes().some(s=>s.__key===this.__key);return(on(this)||!xn(n)||n.anchor.type!=="element"||n.focus.type!=="element"||n.anchor.key!==n.focus.key||n.anchor.offset!==n.focus.offset)&&e}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),e=0;for(;n!==null;){if(this.is(n))return e;e++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Vr(t)}getParentOrThrow(){const t=this.getParent();return t===null&&Xt(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(Ks(n))return Pt(t)||Xt(138),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&Xt(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Vr(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let e=n.getFirstChild();for(;e!==null&&!e.is(this);)t.push(e),e=e.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Vr(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=this.getParents(),e=t.getParents();Pt(this)&&n.unshift(this),Pt(t)&&e.unshift(t);const s=n.length,r=e.length;if(s===0||r===0||n[s-1]!==e[r-1])return null;const o=new Set(e);for(let i=0;i<s;i++){const u=n[i];if(o.has(u))return u}return null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){if(this===t)return!1;if(t.isParentOf(this))return!0;if(this.isParentOf(t))return!1;const n=this.getCommonAncestor(t);let e=0,s=0,r=this;for(;;){const o=r.getParentOrThrow();if(o===n){e=r.getIndexWithinParent();break}r=o}for(r=t;;){const o=r.getParentOrThrow();if(o===n){s=r.getIndexWithinParent();break}r=o}return e<s}isParentOf(t){const n=this.__key;if(n===t.__key)return!1;let e=t;for(;e!==null;){if(e.__key===n)return!0;e=e.getParent()}return!1}getNodesBetween(t){const n=this.isBefore(t),e=[],s=new Set;let r=this;for(;r!==null;){const o=r.__key;if(s.has(o)||(s.add(o),e.push(r)),r===t)break;const i=Pt(r)?n?r.getFirstChild():r.getLastChild():null;if(i!==null){r=i;continue}const u=n?r.getNextSibling():r.getPreviousSibling();if(u!==null){r=u;continue}const a=r.getParentOrThrow();if(s.has(a.__key)||e.push(a),a===t)break;let f=null,l=a;do{if(l===null&&Xt(68),f=n?l.getNextSibling():l.getPreviousSibling(),l=l.getParent(),l===null)break;f!==null||s.has(l.__key)||e.push(l)}while(f===null);r=f}return n||e.reverse(),e}isDirty(){const t=tr()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){const t=Vr(this.__key);return t===null&&Xt(113),t}getWritable(){co();const t=Ci(),n=tr(),e=t._nodeMap,s=this.__key,r=this.getLatest(),o=r.__parent,i=n._cloneNotNeeded,u=Vn();if(u!==null&&u.setCachedNodes(null),i.has(s))return _p(r),r;const a=r.constructor.clone(r);return a.__parent=o,a.__next=r.__next,a.__prev=r.__prev,Pt(r)&&Pt(a)?(a.__first=r.__first,a.__last=r.__last,a.__size=r.__size,a.__indent=r.__indent,a.__format=r.__format,a.__dir=r.__dir):on(r)&&on(a)&&(a.__format=r.__format,a.__style=r.__style,a.__mode=r.__mode,a.__detail=r.__detail),i.add(s),a.__key=s,_p(a),e.set(s,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){Xt(70)}updateDOM(t,n,e){Xt(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){Xt(72)}static importJSON(t){Xt(18,this.name)}static transform(){return null}remove(t){uy(this,!0,t)}replace(t,n){co();let e=Vn();e!==null&&(e=e.clone()),J0(this,t);const s=this.getLatest(),r=this.__key,o=t.__key,i=t.getWritable(),u=this.getParentOrThrow().getWritable(),a=u.__size;Ua(i);const f=s.getPreviousSibling(),l=s.getNextSibling(),d=s.__prev,p=s.__next,h=s.__parent;if(uy(s,!1,!0),f===null?u.__first=o:f.getWritable().__next=o,i.__prev=d,l===null?u.__last=o:l.getWritable().__prev=o,i.__next=p,i.__parent=h,u.__size=a,n&&(Pt(this)&&Pt(i)||Xt(139),this.getChildren().forEach(m=>{i.append(m)})),xn(e)){wi(e);const m=e.anchor,g=e.focus;m.key===r&&$w(m,i),g.key===r&&$w(g,i)}return Hs()===r&&jr(o),i}insertAfter(t,n=!0){co(),J0(this,t);const e=this.getWritable(),s=t.getWritable(),r=s.getParent(),o=Vn();let i=!1,u=!1;if(r!==null){const p=t.getIndexWithinParent();if(Ua(s),xn(o)){const h=r.__key,m=o.anchor,g=o.focus;i=m.type==="element"&&m.key===h&&m.offset===p+1,u=g.type==="element"&&g.key===h&&g.offset===p+1}}const a=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),l=s.__key,d=e.__next;if(a===null?f.__last=l:a.getWritable().__prev=l,f.__size++,e.__next=l,s.__next=d,s.__prev=e.__key,s.__parent=e.__parent,n&&xn(o)){const p=this.getIndexWithinParent();Lp(o,f,p+1);const h=f.__key;i&&o.anchor.set(h,p+2,"element"),u&&o.focus.set(h,p+2,"element")}return t}insertBefore(t,n=!0){co(),J0(this,t);const e=this.getWritable(),s=t.getWritable(),r=s.__key;Ua(s);const o=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),u=e.__prev,a=this.getIndexWithinParent();o===null?i.__first=r:o.getWritable().__next=r,i.__size++,e.__prev=r,s.__prev=u,s.__next=e.__key,s.__parent=e.__parent;const f=Vn();return n&&xn(f)&&Lp(f,this.getParentOrThrow(),a),t}isParentRequired(){return!1}createParentElementNode(){return ns()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){co();const e=this.getPreviousSibling(),s=this.getParentOrThrow();if(e===null)return s.select(0,0);if(Pt(e))return e.select();if(!on(e)){const r=e.getIndexWithinParent()+1;return s.select(r,r)}return e.select(t,n)}selectNext(t,n){co();const e=this.getNextSibling(),s=this.getParentOrThrow();if(e===null)return s.select();if(Pt(e))return e.select(0,0);if(!on(e)){const r=e.getIndexWithinParent();return s.select(r,r)}return e.select(t,n)}markDirty(){this.getWritable()}}class Xl extends Ip{static getType(){return"linebreak"}static clone(t){return new Xl(t.__key)}constructor(t){super(t)}getTextContent(){return`
|
|
44
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:t=>function(n){const e=n.parentElement;if(e!==null){const s=e.firstChild;if(s===n||s.nextSibling===n&&Iw(s)){const r=e.lastChild;if(r===n||r.previousSibling===n&&Iw(r))return!0}}return!1}(t)?null:{conversion:uM,priority:0}}}static importJSON(t){return Zl()}exportJSON(){return{type:"linebreak",version:1}}}function uM(c){return{node:Zl()}}function Zl(){return td(new Xl)}function Wa(c){return c instanceof Xl}function Iw(c){return c.nodeType===zs&&/^( |\t|\r?\n)+$/.test(c.textContent||"")}function dy(c,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function fy(c,t){return 1&t?"strong":2&t?"em":"span"}function Rw(c,t,n,e,s){const r=e.classList;let o=ed(s,"base");o!==void 0&&r.add(...o),o=ed(s,"underlineStrikethrough");let i=!1;const u=t&mp&&t&gp;o!==void 0&&(n&mp&&n&gp?(i=!0,u||r.add(...o)):u&&r.remove(...o));for(const a in Us){const f=Us[a];if(o=ed(s,a),o!==void 0)if(n&f){if(i&&(a==="underline"||a==="strikethrough")){t&f&&r.remove(...o);continue}(!(t&f)||u&&a==="underline"||a==="strikethrough")&&r.add(...o)}else t&f&&r.remove(...o)}}function jw(c,t,n){const e=t.firstChild,s=n.isComposing(),r=c+(s?yp:"");if(e==null)t.textContent=r;else{const o=e.nodeValue;if(o!==r)if(s||$s){const[i,u,a]=function(f,l){const d=f.length,p=l.length;let h=0,m=0;for(;h<d&&h<p&&f[h]===l[h];)h++;for(;m+h<d&&m+h<p&&f[d-m-1]===l[p-m-1];)m++;return[h,d-h-m,l.slice(h,p-m)]}(o,r);u!==0&&e.deleteData(i,u),e.insertData(i,a)}else e.nodeValue=r}}function Dw(c,t,n,e,s,r){jw(s,c,t);const o=r.theme.text;o!==void 0&&Rw(0,0,e,c,o)}function Rp(c,t){const n=document.createElement(t);return n.appendChild(c),n}class qa extends Ip{static getType(){return"text"}static clone(t){return new qa(t.__text,t.__key)}constructor(t,n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return zP[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Hs()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(1&this.getLatest().__detail)!=0}isUnmergeable(){return(2&this.getLatest().__detail)!=0}hasFormat(t){const n=Us[t];return(this.getFormat()&n)!=0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return z0(this.getLatest().__format,t,n)}canHaveFormat(){return!0}createDOM(t,n){const e=this.__format,s=dy(0,e),r=fy(0,e),o=s===null?r:s,i=document.createElement(o);let u=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),s!==null&&(u=document.createElement(r),i.appendChild(u)),Dw(u,this,0,e,this.__text,t);const a=this.__style;return a!==""&&(i.style.cssText=a),i}updateDOM(t,n,e){const s=this.__text,r=t.__format,o=this.__format,i=dy(0,r),u=dy(0,o),a=fy(0,r),f=fy(0,o);if((i===null?a:i)!==(u===null?f:u))return!0;if(i===u&&a!==f){const m=n.firstChild;m==null&&Xt(48);const g=document.createElement(f);return Dw(g,this,0,o,s,e),n.replaceChild(g,m),!1}let l=n;u!==null&&i!==null&&(l=n.firstChild,l==null&&Xt(49)),jw(s,l,this);const d=e.theme.text;d!==void 0&&r!==o&&Rw(0,r,o,l,d);const p=t.__style,h=this.__style;return p!==h&&(n.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:hM,priority:0}),b:()=>({conversion:fM,priority:0}),code:()=>({conversion:Js,priority:0}),em:()=>({conversion:Js,priority:0}),i:()=>({conversion:Js,priority:0}),s:()=>({conversion:Js,priority:0}),span:()=>({conversion:dM,priority:0}),strong:()=>({conversion:Js,priority:0}),sub:()=>({conversion:Js,priority:0}),sup:()=>({conversion:Js,priority:0}),u:()=>({conversion:Js,priority:0})}}static importJSON(t){const n=zr(t.text);return n.setFormat(t.format),n.setDetail(t.detail),n.setMode(t.mode),n.setStyle(t.style),n}exportDOM(t){let{element:n}=super.exportDOM(t);return n!==null&&Op(n)||Xt(132),n.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(n=Rp(n,"b")),this.hasFormat("italic")&&(n=Rp(n,"i")),this.hasFormat("strikethrough")&&(n=Rp(n,"s")),this.hasFormat("underline")&&(n=Rp(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Us[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?BP[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=z0(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=$P[t];if(this.__mode===n)return this;const e=this.getWritable();return e.__mode=n,e}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){co();let e=t,s=n;const r=Vn(),o=this.getTextContent(),i=this.__key;if(typeof o=="string"){const u=o.length;e===void 0&&(e=u),s===void 0&&(s=u)}else e=0,s=0;if(!xn(r))return Vw(i,e,i,s,"text","text");{const u=Hs();u!==r.anchor.key&&u!==r.focus.key||jr(i),r.setTextNodeRange(this,e,this,s)}return r}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,e,s){const r=this.getWritable(),o=r.__text,i=e.length;let u=t;u<0&&(u=i+u,u<0&&(u=0));const a=Vn();if(s&&xn(a)){const l=t+i;a.setTextNodeRange(r,l,r,l)}const f=o.slice(0,u)+e+o.slice(u+n);return r.__text=f,r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){co();const n=this.getLatest(),e=n.getTextContent(),s=n.__key,r=Hs(),o=new Set(t),i=[],u=e.length;let a="";for(let S=0;S<u;S++)a!==""&&o.has(S)&&(i.push(a),a=""),a+=e[S];a!==""&&i.push(a);const f=i.length;if(f===0)return[];if(i[0]===e)return[n];const l=i[0],d=n.getParentOrThrow();let p;const h=n.getFormat(),m=n.getStyle(),g=n.__detail;let y=!1;n.isSegmented()?(p=zr(l),p.__format=h,p.__style=m,p.__detail=g,y=!0):(p=n.getWritable(),p.__text=l);const b=Vn(),v=[p];let _=l.length;for(let S=1;S<f;S++){const E=i[S],O=E.length,j=zr(E).getWritable();j.__format=h,j.__style=m,j.__detail=g;const A=j.__key,T=_+O;if(xn(b)){const I=b.anchor,k=b.focus;I.key===s&&I.type==="text"&&I.offset>_&&I.offset<=T&&(I.key=A,I.offset-=_,b.dirty=!0),k.key===s&&k.type==="text"&&k.offset>_&&k.offset<=T&&(k.key=A,k.offset-=_,b.dirty=!0)}r===s&&jr(A),_=T,v.push(j)}(function(S){const E=S.getPreviousSibling(),O=S.getNextSibling();E!==null&&_p(E),O!==null&&_p(O)})(this);const w=d.getWritable(),x=this.getIndexWithinParent();return y?(w.splice(x,0,v),this.remove()):w.splice(x,1,v),xn(b)&&Lp(b,d,x,f-1),v}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||Xt(50);const e=this.__key,s=t.__key,r=this.__text,o=r.length;Hs()===s&&jr(e);const i=Vn();if(xn(i)){const l=i.anchor,d=i.focus;l!==null&&l.key===s&&(Yw(l,n,e,t,o),i.dirty=!0),d!==null&&d.key===s&&(Yw(d,n,e,t,o),i.dirty=!0)}const u=t.__text,a=n?u+r:r+u;this.setTextContent(a);const f=this.getWritable();return t.remove(),f}isTextEntity(){return!1}}function dM(c){const t=c,n=t.style.fontWeight==="700",e=t.style.textDecoration==="line-through",s=t.style.fontStyle==="italic",r=t.style.textDecoration==="underline",o=t.style.verticalAlign;return{forChild:i=>(on(i)&&(n&&i.toggleFormat("bold"),e&&i.toggleFormat("strikethrough"),s&&i.toggleFormat("italic"),r&&i.toggleFormat("underline"),o==="sub"&&i.toggleFormat("subscript"),o==="super"&&i.toggleFormat("superscript")),i),node:null}}function fM(c){const t=c.style.fontWeight==="normal";return{forChild:n=>(on(n)&&!t&&n.toggleFormat("bold"),n),node:null}}const Lw=new WeakMap;function pM(c){return c.nodeName==="PRE"||c.nodeType===Vu&&c.style!==void 0&&c.style.whiteSpace!==void 0&&c.style.whiteSpace.startsWith("pre")}function hM(c){const t=c;c.parentElement===null&&Xt(129);let n=t.textContent||"";if(function(e){let s,r=e.parentNode;const o=[e];for(;r!==null&&(s=Lw.get(r))===void 0&&!pM(r);)o.push(r),r=r.parentNode;const i=s===void 0?r:s;for(let u=0;u<o.length;u++)Lw.set(o[u],i);return i}(t)!==null){const e=n.split(/(\r?\n|\t)/),s=[],r=e.length;for(let o=0;o<r;o++){const i=e[o];i===`
|
|
45
45
|
`||i===`\r
|
|
46
|
-
`?s.push(Zl()):i===" "?s.push(jp()):i!==""&&s.push(zr(i))}return{node:s}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let e=t,s=!0;for(;e!==null&&(e=
|
|
47
|
-
`),f=!d.isEmpty();else if(f=!1,on(d)){let p=d.getTextContent();d===n?d===e?s.type==="element"&&r.type==="element"&&r.offset!==s.offset||(p=i<u?p.slice(i,u):p.slice(u,i)):p=o?p.slice(i):p.slice(u):d===e&&(p=o?p.slice(0,u):p.slice(0,i)),a+=p}else!fr(d)&&!Wa(d)||d===e&&this.isCollapsed()||(a+=d.getTextContent())}return a}applyDOMRange(t){const n=tr(),e=n.getEditorState()._selection,s=
|
|
46
|
+
`?s.push(Zl()):i===" "?s.push(jp()):i!==""&&s.push(zr(i))}return{node:s}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let e=t,s=!0;for(;e!==null&&(e=Bw(e,!1))!==null;){const r=e.textContent||"";if(r.length>0){/[ \t\n]$/.test(r)&&(n=n.slice(1)),s=!1;break}}s&&(n=n.slice(1))}if(n[n.length-1]===" "){let e=t,s=!0;for(;e!==null&&(e=Bw(e,!0))!==null;)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:zr(n)}}const gM=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 Bw(c,t){let n=c;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){const r=n.parentElement;if(r===null)return null;n=r}if(n=e,n.nodeType===Vu){const r=n.style.display;if(r===""&&n.nodeName.match(gM)===null||r!==""&&!r.startsWith("inline"))return null}let s=n;for(;(s=t?n.firstChild:n.lastChild)!==null;)n=s;if(n.nodeType===zs)return n;if(n.nodeName==="BR")return null}}const mM={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Js(c){const t=mM[c.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:n=>(on(n)&&!n.hasFormat(t)&&n.toggleFormat(t),n),node:null}}function zr(c=""){return td(new qa(c))}function on(c){return c instanceof qa}class Ql extends qa{static getType(){return"tab"}static clone(t){const n=new Ql(t.__key);return n.__text=t.__text,n.__format=t.__format,n.__style=t.__style,n}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}static importJSON(t){const n=jp();return n.setFormat(t.format),n.setStyle(t.style),n}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(t){Xt(126)}setDetail(t){Xt(127)}setMode(t){Xt(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function jp(){return td(new Ql)}function Fw(c){return c instanceof Ql}class yM{constructor(t,n,e){this._selection=null,this.key=t,this.offset=n,this.type=e}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){let n=this.getNode(),e=t.getNode();const s=this.offset,r=t.offset;if(Pt(n)){const o=n.getDescendantByIndex(s);n=o??n}if(Pt(e)){const o=e.getDescendantByIndex(r);e=o??e}return n===e?s<r:n.isBefore(e)}getNode(){const t=Vr(this.key);return t===null&&Xt(20),t}set(t,n,e){const s=this._selection,r=this.key;this.key=t,this.offset=n,this.type=e,tc()||(Hs()===r&&jr(t),s!==null&&(s.setCachedNodes(null),s.dirty=!0))}}function si(c,t,n){return new yM(c,t,n)}function py(c,t){let n=t.__key,e=c.offset,s="element";if(on(t)){s="text";const r=t.getTextContentSize();e>r&&(e=r)}else if(!Pt(t)){const r=t.getNextSibling();if(on(r))n=r.__key,e=0,s="text";else{const o=t.getParent();o&&(n=o.__key,e=t.getIndexWithinParent()+1)}}c.set(n,e,s)}function $w(c,t){if(Pt(t)){const n=t.getLastDescendant();Pt(n)||on(n)?py(c,n):py(c,t)}else py(c,t)}function zw(c,t,n,e){const s=c.getNode(),r=s.getChildAtIndex(c.offset),o=zr(),i=Io(s)?ns().append(o):o;o.setFormat(n),o.setStyle(e),r===null?s.append(i):r.insertBefore(i),c.is(t)&&t.set(o.__key,0,"text"),c.set(o.__key,0,"text")}function Vs(c,t,n,e){c.key=t,c.offset=n,c.type=e}class Dp{constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!ld(t))return!1;const n=this._nodes,e=t._nodes;return n.size===e.size&&Array.from(n).every(s=>e.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new Dp(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),e=n.length,s=n[e-1];let r;if(on(s))r=s.select();else{const o=s.getIndexWithinParent()+1;r=s.getParentOrThrow().select(o,o)}r.insertNodes(t);for(let o=0;o<e;o++)n[o].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,e=[];for(const s of n){const r=Vr(s);r!==null&&e.push(r)}return tc()||(this._cachedNodes=e),e}getTextContent(){const t=this.getNodes();let n="";for(let e=0;e<t.length;e++)n+=t[e].getTextContent();return n}}function xn(c){return c instanceof Gs}class Gs{constructor(t,n,e,s){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=e,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!xn(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this.anchor,e=this.focus,s=n.isBefore(e),r=s?n:e,o=s?e:n;let i=r.getNode(),u=o.getNode();const a=r.offset,f=o.offset;if(Pt(i)){const d=i.getDescendantByIndex(a);i=d??i}if(Pt(u)){let d=u.getDescendantByIndex(f);d!==null&&d!==i&&u.getChildAtIndex(f)===d&&(d=d.getPreviousSibling()),u=d??u}let l;return l=i.is(u)?Pt(i)&&i.getChildrenSize()>0?[]:[i]:i.getNodesBetween(u),tc()||(this._cachedNodes=l),l}setTextNodeRange(t,n,e,s){Vs(this.anchor,t.__key,n,"text"),Vs(this.focus,e.__key,s,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],e=t[t.length-1],s=this.anchor,r=this.focus,o=s.isBefore(r),[i,u]=hy(this);let a="",f=!0;for(let l=0;l<t.length;l++){const d=t[l];if(Pt(d)&&!d.isInline())f||(a+=`
|
|
47
|
+
`),f=!d.isEmpty();else if(f=!1,on(d)){let p=d.getTextContent();d===n?d===e?s.type==="element"&&r.type==="element"&&r.offset!==s.offset||(p=i<u?p.slice(i,u):p.slice(u,i)):p=o?p.slice(i):p.slice(u):d===e&&(p=o?p.slice(0,u):p.slice(0,i)),a+=p}else!fr(d)&&!Wa(d)||d===e&&this.isCollapsed()||(a+=d.getTextContent())}return a}applyDOMRange(t){const n=tr(),e=n.getEditorState()._selection,s=Jw(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,e);if(s===null)return;const[r,o]=s;Vs(this.anchor,r.key,r.offset,r.type),Vs(this.focus,o.key,o.offset,o.type),this._cachedNodes=null}clone(){const t=this.anchor,n=this.focus;return new Gs(si(t.key,t.offset,t.type),si(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=z0(this.format,t,null),this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Us[t];return(this.format&n)!=0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),e=[],s=n.length;for(let r=0;r<s;r++){const o=n[r];o===`
|
|
48
48
|
`||o===`\r
|
|
49
|
-
`?e.push(Zl()):o===" "?e.push(jp()):e.push(zr(o))}this.insertNodes(e)}insertText(t){const n=this.anchor,e=this.focus,s=this.isCollapsed()||n.isBefore(e),r=this.format,o=this.style;s&&n.type==="element"?Uw(n,e,r,o):s||e.type!=="element"||Uw(e,n,r,o);const i=this.getNodes(),u=i.length,a=s?e:n,f=(s?n:e).offset,l=a.offset;let d=i[0];on(d)||Xt(26);const p=d.getTextContent().length,h=d.getParentOrThrow();let m=i[u-1];if(this.isCollapsed()&&f===p&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let g=d.getNextSibling();if(on(g)&&g.canInsertTextBefore()&&!$0(g)||(g=zr(),g.setFormat(r),h.canInsertTextAfter()?d.insertAfter(g):h.insertAfter(g)),g.select(0,0),d=g,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&f===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let g=d.getPreviousSibling();if(on(g)&&!$0(g)||(g=zr(),g.setFormat(r),h.canInsertTextBefore()?d.insertBefore(g):h.insertBefore(g)),g.select(),d=g,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&f!==p){const g=zr(d.getTextContent());g.setFormat(r),d.replace(g),d=g}else if(!this.isCollapsed()&&t!==""){const g=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||Pt(g)&&(!g.canInsertTextBefore()||!g.canInsertTextAfter()))return this.insertText(""),Jw(this.anchor,this.focus,null),void this.insertText(t)}if(u===1){if(d.isToken()){const v=zr(t);return v.select(),void d.replace(v)}const g=d.getFormat(),y=d.getStyle();if(f!==l||g===r&&y===o){if($w(d)){const v=zr(t);return v.setFormat(r),v.setStyle(o),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=zr(t);if(v.setFormat(r),v.setStyle(o),v.select(),f===0)d.insertBefore(v,!1);else{const[_]=d.splitText(f);_.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(r),d.setStyle(o)}const b=l-f;d=d.spliceText(f,b,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=g,this.style=y))}else{const g=new Set([...d.getParentKeys(),...m.getParentKeys()]),y=Pt(d)?d:d.getParentOrThrow();let b=Pt(m)?m:m.getParentOrThrow(),v=m;if(!y.is(b)&&b.isInline())do v=b,b=b.getParentOrThrow();while(b.isInline());if(a.type==="text"&&(l!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<l)if(on(m)&&!m.isToken()&&l!==m.getTextContentSize()){if(m.isSegmented()){const E=zr(m.getTextContent());m.replace(E),m=E}Io(a.getNode())||a.type!=="text"||(m=m.spliceText(0,l,"")),g.add(m.__key)}else{const E=m.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?m.remove():E.remove()}else g.add(m.__key);const _=b.getChildren(),w=new Set(i),x=y.is(b),S=y.isInline()&&d.getNextSibling()===null?y:d;for(let E=_.length-1;E>=0;E--){const O=_[E];if(O.is(d)||Pt(O)&&O.isParentOf(d))break;O.isAttached()&&(!w.has(O)||O.is(v)?x||S.insertAfter(O,!1):O.remove())}if(!x){let E=b,O=null;for(;E!==null;){const j=E.getChildren(),A=j.length;(A===0||j[A-1].is(O))&&(g.delete(E.__key),O=E),E=E.getParent()}}if(d.isToken())if(f===p)d.select();else{const E=zr(t);E.select(),d.replace(E)}else d=d.spliceText(f,p-f,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let E=1;E<u;E++){const O=i[E],j=O.__key;g.has(j)||O.remove()}}}removeText(){this.insertText("")}formatText(t){if(this.isCollapsed())return this.toggleFormat(t),void jr(null);const n=this.getNodes(),e=[];for(const b of n)on(b)&&e.push(b);const s=e.length;if(s===0)return this.toggleFormat(t),void jr(null);const r=this.anchor,o=this.focus,i=this.isBackward(),u=i?o:r,a=i?r:o;let f=0,l=e[0],d=u.type==="element"?0:u.offset;if(u.type==="text"&&d===l.getTextContentSize()&&(f=1,l=e[1],d=0),l==null)return;const p=l.getFormatFlags(t,null),h=s-1;let m=e[h];const g=a.type==="text"?a.offset:m.getTextContentSize();if(l.is(m)){if(d===g)return;if(d===0&&g===l.getTextContentSize())l.setFormat(p);else{const b=l.splitText(d,g),v=d===0?b[0]:b[1];v.setFormat(p),u.type==="text"&&u.set(v.__key,0,"text"),a.type==="text"&&a.set(v.__key,g-d,"text")}return void(this.format=p)}d!==0&&([,l]=l.splitText(d),d=0),l.setFormat(p);const y=m.getFormatFlags(t,p);g>0&&(g!==m.getTextContentSize()&&([m]=m.splitText(g)),m.setFormat(y));for(let b=f+1;b<h;b++){const v=e[b];if(!v.isToken()){const _=v.getFormatFlags(t,y);v.setFormat(_)}}u.type==="text"&&u.set(l.__key,d,"text"),a.type==="text"&&a.set(m.__key,g,"text"),this.format=p|y}insertNodes(t){if(t.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=Vn();return xn(h)||Xt(134),h.insertNodes(t)}const n=Y0((this.isBackward()?this.focus:this.anchor).getNode(),Vl),e=t[t.length-1];if("__language"in n&&Pt(n)){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const h=yy(this);n.splice(h,0,t),e.selectEnd()}return}if(!t.some(h=>(Pt(h)||fr(h))&&!h.isInline())){Pt(n)||Xt(135);const h=yy(this);return n.splice(h,0,t),void e.selectEnd()}const s=function(h){const m=ns();let g=null;for(let y=0;y<h.length;y++){const b=h[y],v=Wa(b);if(v||fr(b)&&b.isInline()||Pt(b)&&b.isInline()||on(b)||b.isParentRequired()){if(g===null&&(g=b.createParentElementNode(),m.append(g),v))continue;g!==null&&g.append(b)}else m.append(b),g=null}return m}(t),r=s.getLastDescendant(),o=s.getChildren(),i=h=>"__value"in h&&"__checked"in h,u=!Pt(n)||!n.isEmpty()?this.insertParagraph():null,a=o[o.length-1];let f=o[0];var l;Pt(l=f)&&Vl(l)&&!l.isEmpty()&&Pt(n)&&(!n.isEmpty()||i(n))&&(Pt(n)||Xt(135),n.append(...f.getChildren()),f=o[1]),f&&function(h,m,g){const y=g||m.getParentOrThrow().getLastChild();let b=m;const v=[m];for(;b!==y;)b.getNextSibling()||Xt(140),b=b.getNextSibling(),v.push(b);let _=h;for(const w of v)_=_.insertAfter(w)}(n,f);const d=Y0(r,Vl);u&&Pt(d)&&(i(u)||Vl(a))&&(d.append(...u.getChildren()),u.remove()),Pt(n)&&n.isEmpty()&&n.remove(),r.selectEnd();const p=Pt(n)?n.getLastChild():null;Wa(p)&&d!==n&&p.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=ns();return Po().splice(this.anchor.offset,0,[o]),o.select(),o}const t=yy(this),n=Y0(this.anchor.getNode(),Vl);Pt(n)||Xt(136);const e=n.getChildAtIndex(t),s=e?[e,...e.getNextSiblings()]:[],r=n.insertNewAfter(this,!1);return r?(r.append(...s),r.selectStart(),r):null}insertLineBreak(t){const n=Zl();if(this.insertNodes([n]),t){const e=n.getParentOrThrow(),s=n.getIndexWithinParent();e.select(s,s)}}extract(){const t=this.getNodes(),n=t.length,e=n-1,s=this.anchor,r=this.focus;let o=t[0],i=t[e];const[u,a]=hy(this);if(n===0)return[];if(n===1){if(on(o)&&!this.isCollapsed()){const l=u>a?a:u,d=u>a?u:a,p=o.splitText(l,d),h=l===0?p[0]:p[1];return h!=null?[h]:[]}return[o]}const f=s.isBefore(r);if(on(o)){const l=f?u:a;l===o.getTextContentSize()?t.shift():l!==0&&([,o]=o.splitText(l),t[0]=o)}if(on(i)){const l=i.getTextContent().length,d=f?a:u;d===0?t.pop():d!==l&&([i]=i.splitText(d),t[e]=i)}return t}modify(t,n,e){const s=this.focus,r=this.anchor,o=t==="move",i=q0(s,n);if(fr(i)&&!i.isIsolated()){if(o&&i.isKeyboardSelectable()){const p=gy();return p.add(i.__key),void wi(p)}const d=n?i.getPreviousSibling():i.getNextSibling();if(on(d)){const p=d.__key,h=n?d.getTextContent().length:0;return s.set(p,h,"text"),void(o&&r.set(p,h,"text"))}{const p=i.getParentOrThrow();let h,m;return Pt(d)?(m=d.__key,h=n?d.getChildrenSize():0):(h=i.getIndexWithinParent(),m=p.__key,n||h++),s.set(m,h,"element"),void(o&&r.set(m,h,"element"))}}const u=tr(),a=Si(u._window);if(!a)return;const f=u._blockCursorElement,l=u._rootElement;if(l===null||f===null||!Pt(i)||i.isInline()||i.canBeEmpty()||G0(f,u,l),function(d,p,h,m){d.modify(p,h,m)}(a,t,n?"backward":"forward",e),a.rangeCount>0){const d=a.getRangeAt(0),p=this.anchor.getNode(),h=Io(p)?p:pw(p);if(this.applyDOMRange(d),this.dirty=!0,!o){const m=this.getNodes(),g=[];let y=!1;for(let b=0;b<m.length;b++){const v=m[b];Cp(v,h)?g.push(v):y=!0}if(y&&g.length>0)if(n){const b=g[0];Pt(b)?b.selectStart():b.getParentOrThrow().selectStart()}else{const b=g[g.length-1];Pt(b)?b.selectEnd():b.getParentOrThrow().selectEnd()}a.anchorNode===d.startContainer&&a.anchorOffset===d.startOffset||function(b){const v=b.focus,_=b.anchor,w=_.key,x=_.offset,S=_.type;Vs(_,v.key,v.offset,v.type),Vs(v,w,x,S),b._cachedNodes=null}(this)}}}forwardDeletion(t,n,e){if(!e&&(t.type==="element"&&Pt(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const s=n.getParent(),r=n.getNextSibling()||(s===null?null:s.getNextSibling());if(Pt(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let s=e.getNode();if(this.forwardDeletion(e,s,t))return;const r=this.focus,o=q0(r,t);if(fr(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Pt(s)&&s.getChildrenSize()===0){s.remove();const i=gy();i.add(o.__key),wi(i)}else o.remove(),tr().dispatchCommand(dp,void 0);return}if(!t&&Pt(o)&&Pt(s)&&s.isEmpty())return s.remove(),void o.selectStart();if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&e.offset===0&&(e.type==="element"?e.getNode():e.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const i=r.type==="text"?r.getNode():null;if(s=e.type==="text"?e.getNode():null,i!==null&&i.isSegmented()){const u=r.offset,a=i.getTextContentSize();if(i.is(s)||t&&u!==a||!t&&u!==0)return void Kw(i,t,u)}else if(s!==null&&s.isSegmented()){const u=e.offset,a=s.getTextContentSize();if(s.is(i)||t&&u!==0||!t&&u!==a)return void Kw(s,t,u)}(function(u,a){const f=u.anchor,l=u.focus,d=f.getNode(),p=l.getNode();if(d===p&&f.type==="text"&&l.type==="text"){const h=f.offset,m=l.offset,g=h<m,y=g?h:m,b=g?m:h,v=b-1;y!==v&&(ow(d.getTextContent().slice(y,b))||(a?l.offset=v:f.offset=v))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const e=this.anchor.getNode();e.isEmpty()&&Io(e.getParent())&&e.getIndexWithinParent()===0&&e.collapseAtStart(this)}}deleteLine(t){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",t,"lineboundary"),(t?this.focus:this.anchor).offset===0&&this.modify("extend",t,"character")),this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,e=n.getNode();if(this.forwardDeletion(n,e,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ld(c){return c instanceof Dp}function Hw(c){const t=c.offset;if(c.type==="text")return t;const n=c.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function hy(c){const t=c.getStartEndPoints();if(t===null)return[0,0];const[n,e]=t;return n.type==="element"&&e.type==="element"&&n.key===e.key&&n.offset===e.offset?[0,0]:[Hw(n),Hw(e)]}function Kw(c,t,n){const e=c,s=e.getTextContent().split(/(?=\s)/g),r=s.length;let o=0,i=0;for(let a=0;a<r;a++){const f=a===r-1;if(i=o,o+=s[a].length,t&&o===n||o>n||f){s.splice(a,1),f&&(i=void 0);break}}const u=s.join("").trim();u===""?e.remove():(e.setTextContent(u),e.select(i,i))}function Ww(c,t,n,e){let s,r=t;if(c.nodeType===Vu){let o=!1;const i=c.childNodes,u=i.length;r===u&&(o=!0,r=u-1);let a=i[r],f=!1;if(a===e._blockCursorElement?(a=i[r+1],f=!0):e._blockCursorElement!==null&&r--,s=Jl(a),on(s))r=rw(s,o);else{let l=Jl(c);if(l===null)return null;if(Pt(l)){let d=l.getChildAtIndex(r);if(Pt(d)&&function(p,h,m){const g=p.getParent();return m===null||g===null||!g.canBeEmpty()||g!==m.getNode()}(d,0,n)){const p=o?d.getLastDescendant():d.getFirstDescendant();p===null?(l=d,r=0):(d=p,l=Pt(d)?d:d.getParentOrThrow())}on(d)?(s=d,l=null,r=rw(d,o)):d!==l&&o&&!f&&r++}else{const d=l.getIndexWithinParent();r=t===0&&fr(l)&&Jl(c)===l?d:d+1,l=l.getParentOrThrow()}if(Pt(l))return si(l.__key,r,"element")}}else s=Jl(c);return on(s)?si(s.__key,r,"text"):null}function qw(c,t,n){const e=c.offset,s=c.getNode();if(e===0){const r=s.getPreviousSibling(),o=s.getParent();if(t){if((n||!t)&&r===null&&Pt(o)&&o.isInline()){const i=o.getPreviousSibling();on(i)&&(c.key=i.__key,c.offset=i.getTextContent().length)}}else Pt(r)&&!n&&r.isInline()?(c.key=r.__key,c.offset=r.getChildrenSize(),c.type="element"):on(r)&&(c.key=r.__key,c.offset=r.getTextContent().length)}else if(e===s.getTextContent().length){const r=s.getNextSibling(),o=s.getParent();if(t&&Pt(r)&&r.isInline())c.key=r.__key,c.offset=0,c.type="element";else if((n||t)&&r===null&&Pt(o)&&o.isInline()&&!o.canInsertTextAfter()){const i=o.getNextSibling();on(i)&&(c.key=i.__key,c.offset=0)}}}function Jw(c,t,n){if(c.type==="text"&&t.type==="text"){const e=c.isBefore(t),s=c.is(t);qw(c,e,s),qw(t,!e,s),s&&(t.key=c.key,t.offset=c.offset,t.type=c.type);const r=tr();if(r.isComposing()&&r._compositionKey!==c.key&&xn(n)){const o=n.anchor,i=n.focus;Vs(c,o.key,o.offset,o.type),Vs(t,i.key,i.offset,i.type)}}}function Vw(c,t,n,e,s,r){if(c===null||n===null||!Gu(s,c,n))return null;const o=Ww(c,t,xn(r)?r.anchor:null,s);if(o===null)return null;const i=Ww(n,e,xn(r)?r.focus:null,s);if(i===null)return null;if(o.type==="element"&&i.type==="element"){const u=Jl(c),a=Jl(n);if(fr(u)&&fr(a))return null}return Jw(o,i,r),[o,i]}function vM(c){return Pt(c)&&!c.isInline()}function Gw(c,t,n,e,s,r){const o=Ci(),i=new Gs(si(c,t,s),si(n,e,r),0,"");return i.dirty=!0,o._selection=i,i}function _M(){const c=si("root",0,"element"),t=si("root",0,"element");return new Gs(c,t,0,"")}function gy(){return new Dp(new Set)}function my(c,t,n,e){const s=n._window;if(s===null)return null;const r=e||s.event,o=r?r.type:void 0,i=o==="selectionchange",u=!j0&&(i||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&r&&r.detail===3||o==="drop"||o===void 0);let a,f,l,d;if(xn(c)&&!u)return c.clone();if(t===null)return null;if(a=t.anchorNode,f=t.focusNode,l=t.anchorOffset,d=t.focusOffset,i&&xn(c)&&!Gu(n,a,f))return c.clone();const p=Vw(a,l,f,d,n,c);if(p===null)return null;const[h,m]=p;return new Gs(h,m,xn(c)?c.format:0,xn(c)?c.style:"")}function Vn(){return Ci()._selection}function ec(){return tr()._editorState._selection}function Lp(c,t,n,e=1){const s=c.anchor,r=c.focus,o=s.getNode(),i=r.getNode();if(!t.is(o)&&!t.is(i))return;const u=t.__key;if(c.isCollapsed()){const a=s.offset;if(n<=a&&e>0||n<a&&e<0){const f=Math.max(0,a+e);s.set(u,f,"element"),r.set(u,f,"element"),Yw(c)}}else{const a=c.isBackward(),f=a?r:s,l=f.getNode(),d=a?s:r,p=d.getNode();if(t.is(l)){const h=f.offset;(n<=h&&e>0||n<h&&e<0)&&f.set(u,Math.max(0,h+e),"element")}if(t.is(p)){const h=d.offset;(n<=h&&e>0||n<h&&e<0)&&d.set(u,Math.max(0,h+e),"element")}}Yw(c)}function Yw(c){const t=c.anchor,n=t.offset,e=c.focus,s=e.offset,r=t.getNode(),o=e.getNode();if(c.isCollapsed()){if(!Pt(r))return;const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(on(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text"),e.set(a.__key,f,"text")}}else{if(Pt(r)){const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(on(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text")}}if(Pt(o)){const i=o.getChildrenSize(),u=s>=i,a=u?o.getChildAtIndex(i-1):o.getChildAtIndex(s);if(on(a)){let f=0;u&&(f=a.getTextContentSize()),e.set(a.__key,f,"text")}}}}function Bp(c,t,n,e,s){let r=null,o=0,i=null;e!==null?(r=e.__key,on(e)?(o=e.getTextContentSize(),i="text"):Pt(e)&&(o=e.getChildrenSize(),i="element")):s!==null&&(r=s.__key,on(s)?i="text":Pt(s)&&(i="element")),r!==null&&i!==null?c.set(r,o,i):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),c.set(n.__key,o,"element"))}function Xw(c,t,n,e,s){c.type==="text"?(c.key=n,t||(c.offset+=s)):c.offset>e.getIndexWithinParent()&&(c.offset-=1)}function xM(c,t,n,e,s,r,o){const i=e.anchorNode,u=e.focusNode,a=e.anchorOffset,f=e.focusOffset,l=document.activeElement;if(s.has("collaboration")&&l!==r||l!==null&&B0(l))return;if(!xn(t))return void(c!==null&&Gu(n,i,u)&&e.removeAllRanges());const d=t.anchor,p=t.focus,h=d.key,m=p.key,g=wp(n,h),y=wp(n,m),b=d.offset,v=p.offset,_=t.format,w=t.style,x=t.isCollapsed();let S=g,E=y,O=!1;if(d.type==="text"){S=vp(g);const $=d.getNode();O=$.getFormat()!==_||$.getStyle()!==w}else xn(c)&&c.anchor.type==="text"&&(O=!0);var j,A,T,I,k;if(p.type==="text"&&(E=vp(y)),S!==null&&E!==null&&(x&&(c===null||O||xn(c)&&(c.format!==_||c.style!==w))&&(j=_,A=w,T=b,I=h,k=performance.now(),Ew=[j,A,T,I,k]),a!==b||f!==v||i!==S||u!==E||e.type==="Range"&&x||(l!==null&&r.contains(l)||r.focus({preventScroll:!0}),d.type==="element"))){try{e.setBaseAndExtent(S,b,E,v)}catch{}if(!s.has("skip-scroll-into-view")&&t.isCollapsed()&&r!==null&&r===document.activeElement){const $=t instanceof Gs&&t.anchor.type==="element"?S.childNodes[b]||null:e.rangeCount>0?e.getRangeAt(0):null;if($!==null){let H;if($ instanceof Text){const U=document.createRange();U.selectNode($),H=U.getBoundingClientRect()}else H=$.getBoundingClientRect();(function(U,D,W){const J=W.ownerDocument,M=J.defaultView;if(M===null)return;let{top:z,bottom:V}=D,G=0,F=0,K=W;for(;K!==null;){const N=K===J.body;if(N)G=0,F=Ep(U).innerHeight;else{const L=K.getBoundingClientRect();G=L.top,F=L.bottom}let R=0;if(z<G?R=-(G-z):V>F&&(R=V-F),R!==0)if(N)M.scrollBy(0,R);else{const L=K.scrollTop;K.scrollTop+=R;const B=K.scrollTop-L;z-=B,V-=B}if(N)break;K=Sp(K)}})(n,H,r)}}ay=!0}}function wM(c){let t=Vn()||ec();t===null&&(t=Po().selectEnd()),t.insertNodes(c)}function SM(){const c=Vn();return c===null?"":c.getTextContent()}function yy(c){c.isCollapsed()||c.removeText();const t=c.anchor;let n=t.getNode(),e=t.offset;for(;!Vl(n);)[n,e]=CM(n,e);return e}function CM(c,t){const n=c.getParent();if(!n){const s=ns();return Po().append(s),s.select(),[Po(),0]}if(on(c)){const s=c.splitText(t);if(s.length===0)return[n,c.getIndexWithinParent()];const r=t===0?0:1;return[n,s[0].getIndexWithinParent()+r]}if(!Pt(c)||t===0)return[n,c.getIndexWithinParent()];const e=c.getChildAtIndex(t);if(e){const s=new Gs(si(c.__key,t,"element"),si(c.__key,t,"element"),0,""),r=c.insertNewAfter(s);r&&r.append(e,...e.getNextSiblings())}return[n,c.getIndexWithinParent()+1]}let Dr=null,Lr=null,_o=!1,by=!1,Fp=0;const Zw={characterData:!0,childList:!0,subtree:!0};function tc(){return _o||Dr!==null&&Dr._readOnly}function co(){_o&&Xt(13)}function Qw(){Fp>99&&Xt(14)}function Ci(){return Dr===null&&Xt(15),Dr}function tr(){return Lr===null&&Xt(16),Lr}function EM(){return Lr}function eS(c,t,n){const e=t.__type,s=function(i,u){const a=i._nodes.get(u);return a===void 0&&Xt(30,u),a}(c,e);let r=n.get(e);r===void 0&&(r=Array.from(s.transforms),n.set(e,r));const o=r.length;for(let i=0;i<o&&(r[i](t),t.isAttached());i++);}function tS(c,t){return c!==void 0&&c.__key!==t&&c.isAttached()}function OM(c){return vy(c,tr()._nodes)}function vy(c,t){const n=c.type,e=t.get(n);e===void 0&&Xt(17,n);const s=e.klass;c.type!==s.getType()&&Xt(18,s.name);const r=s.importJSON(c),o=c.children;if(Pt(r)&&Array.isArray(o))for(let i=0;i<o.length;i++){const u=vy(o[i],t);r.append(u)}return r}function nS(c,t){const n=Dr,e=_o,s=Lr;Dr=c,_o=!0,Lr=null;try{return t()}finally{Dr=n,_o=e,Lr=s}}function Ja(c,t){const n=c._pendingEditorState,e=c._rootElement,s=c._headless||e===null;if(n===null)return;const r=c._editorState,o=r._selection,i=n._selection,u=c._dirtyType!==za,a=Dr,f=_o,l=Lr,d=c._updating,p=c._observer;let h=null;if(c._pendingEditorState=null,c._editorState=n,!s&&u&&p!==null){Lr=c,Dr=n,_o=!1,c._updating=!0;try{const x=c._dirtyType,S=c._dirtyElements,E=c._dirtyLeaves;p.disconnect(),h=cM(r,n,c,x,S,E)}catch(x){if(x instanceof Error&&c._onError(x),by)throw x;return cS(c,null,e,n),qx(c),c._dirtyType=ql,by=!0,Ja(c,r),void(by=!1)}finally{p.observe(e,Zw),c._updating=d,Dr=a,_o=f,Lr=l}}n._readOnly||(n._readOnly=!0);const m=c._dirtyLeaves,g=c._dirtyElements,y=c._normalizedNodes,b=c._updateTags,v=c._deferred;u&&(c._dirtyType=za,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements=new Map,c._normalizedNodes=new Set,c._updateTags=new Set),function(x,S){const E=x._decorators;let O=x._pendingDecorators||E;const j=S._nodeMap;let A;for(A in O)j.has(A)||(O===E&&(O=ew(x)),delete O[A])}(c,n);const _=s?null:Si(c._window);if(c._editable&&_!==null&&(u||i===null||i.dirty)){Lr=c,Dr=n;try{if(p!==null&&p.disconnect(),u||i===null||i.dirty){const x=c._blockCursorElement;x!==null&&G0(x,c,e),xM(o,i,c,_,b,e)}rM(c,e,i),p!==null&&p.observe(e,Zw)}finally{Lr=l,Dr=a}}h!==null&&function(x,S,E,O,j){const A=Array.from(x._listeners.mutation),T=A.length;for(let I=0;I<T;I++){const[k,$]=A[I],H=S.get($);H!==void 0&&k(H,{dirtyLeaves:O,prevEditorState:j,updateTags:E})}}(c,h,b,m,r),xn(i)||i===null||o!==null&&o.is(i)||c.dispatchCommand(dp,void 0);const w=c._pendingDecorators;w!==null&&(c._decorators=w,c._pendingDecorators=null,cd("decorator",c,!0,w)),function(x,S,E){const O=tw(S),j=tw(E);O!==j&&cd("textcontent",x,!0,j)}(c,t||r,n),cd("update",c,!0,{dirtyElements:g,dirtyLeaves:m,editorState:n,normalizedNodes:y,prevEditorState:t||r,tags:b}),function(x,S){if(x._deferred=[],S.length!==0){const E=x._updating;x._updating=!0;try{for(let O=0;O<S.length;O++)S[O]()}finally{x._updating=E}}}(c,v),function(x){const S=x._updates;if(S.length!==0){const E=S.shift();if(E){const[O,j]=E;iS(x,O,j)}}}(c)}function cd(c,t,n,...e){const s=t._updating;t._updating=n;try{const r=Array.from(t._listeners[c]);for(let o=0;o<r.length;o++)r[o].apply(null,e)}finally{t._updating=s}}function rS(c,t,n){if(c._updating===!1||Lr!==c){let s=!1;return c.update(()=>{s=rS(c,t,n)}),s}const e=U0(c);for(let s=4;s>=0;s--)for(let r=0;r<e.length;r++){const o=e[r]._commands.get(t);if(o!==void 0){const i=o[s];if(i!==void 0){const u=Array.from(i),a=u.length;for(let f=0;f<a;f++)if(u[f](n,c)===!0)return!0}}}return!1}function oS(c,t){const n=c._updates;let e=t||!1;for(;n.length!==0;){const s=n.shift();if(s){const[r,o]=s;let i,u;o!==void 0&&(i=o.onUpdate,u=o.tag,o.skipTransforms&&(e=!0),i&&c._deferred.push(i),u&&c._updateTags.add(u)),r()}}return e}function iS(c,t,n){const e=c._updateTags;let s,r,o=!1,i=!1;n!==void 0&&(s=n.onUpdate,r=n.tag,r!=null&&e.add(r),o=n.skipTransforms||!1,i=n.discrete||!1),s&&c._deferred.push(s);const u=c._editorState;let a=c._pendingEditorState,f=!1;(a===null||a._readOnly)&&(a=c._pendingEditorState=new zp(new Map((a||u)._nodeMap)),f=!0),a._flushSync=i;const l=Dr,d=_o,p=Lr,h=c._updating;Dr=a,_o=!1,c._updating=!0,Lr=c;try{f&&(c._headless?u._selection!==null&&(a._selection=u._selection.clone()):a._selection=function(b){const v=b.getEditorState()._selection,_=Si(b._window);return xn(v)||v==null?my(v,_,b,null):v.clone()}(c));const g=c._compositionKey;t(),o=oS(c,o),function(b,v){const _=v.getEditorState()._selection,w=b._selection;if(xn(w)){const x=w.anchor,S=w.focus;let E;if(x.type==="text"&&(E=x.getNode(),E.selectionTransform(_,w)),S.type==="text"){const O=S.getNode();E!==O&&O.selectionTransform(_,w)}}}(a,c),c._dirtyType!==za&&(o?function(b,v){const _=v._dirtyLeaves,w=b._nodeMap;for(const x of _){const S=w.get(x);on(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&Gx(S)}}(a,c):function(b,v){const _=v._dirtyLeaves,w=v._dirtyElements,x=b._nodeMap,S=Hs(),E=new Map;let O=_,j=O.size,A=w,T=A.size;for(;j>0||T>0;){if(j>0){v._dirtyLeaves=new Set;for(const I of O){const k=x.get(I);on(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&Gx(k),k!==void 0&&tS(k,S)&&eS(v,k,E),_.add(I)}if(O=v._dirtyLeaves,j=O.size,j>0){Fp++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map;for(const I of A){const k=I[0],$=I[1];if(k!=="root"&&!$)continue;const H=x.get(k);H!==void 0&&tS(H,S)&&eS(v,H,E),w.set(k,$)}O=v._dirtyLeaves,j=O.size,A=v._dirtyElements,T=A.size,Fp++}v._dirtyLeaves=_,v._dirtyElements=w}(a,c),oS(c),function(b,v,_,w){const x=b._nodeMap,S=v._nodeMap,E=[];for(const[O]of w){const j=S.get(O);j!==void 0&&(j.isAttached()||(Pt(j)&&gw(j,O,x,S,E,w),x.has(O)||w.delete(O),E.push(O)))}for(const O of E)S.delete(O);for(const O of _){const j=S.get(O);j===void 0||j.isAttached()||(x.has(O)||_.delete(O),S.delete(O))}}(u,a,c._dirtyLeaves,c._dirtyElements)),g!==c._compositionKey&&(a._flushSync=!0);const y=a._selection;if(xn(y)){const b=a._nodeMap,v=y.anchor.key,_=y.focus.key;b.get(v)!==void 0&&b.get(_)!==void 0||Xt(19)}else ld(y)&&y._nodes.size===0&&(a._selection=null)}catch(g){return g instanceof Error&&c._onError(g),c._pendingEditorState=u,c._dirtyType=ql,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),void Ja(c)}finally{Dr=l,_o=d,Lr=p,c._updating=h,Fp=0}c._dirtyType!==za||function(g,y){const b=y.getEditorState()._selection,v=g._selection;if(v!==null){if(v.dirty||!v.is(b))return!0}else if(b!==null)return!0;return!1}(a,c)?a._flushSync?(a._flushSync=!1,Ja(c)):f&&VP(()=>{Ja(c)}):(a._flushSync=!1,f&&(e.clear(),c._deferred=[],c._pendingEditorState=null))}function Mo(c,t,n){c._updating?c._updates.push([t,n]):iS(c,t,n)}class sS extends Ip{constructor(t){super(t)}decorate(t,n){Xt(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function fr(c){return c instanceof sS}class $p extends Ip{constructor(t){super(t),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 t=this.getFormat();return $P[t]||""}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=tr()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(on(n)&&t.push(n),Pt(n)){const e=n.getAllTextNodes();t.push(...e)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;Pt(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;Pt(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),e=n.length;if(t>=e){const r=n[e-1];return Pt(r)&&r.getLastDescendant()||r||null}const s=n[t];return Pt(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Vr(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&Xt(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Vr(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&Xt(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let e,s;if(t<n/2){for(e=this.getFirstChild(),s=0;e!==null&&s<=t;){if(s===t)return e;e=e.getNextSibling(),s++}return null}for(e=this.getLastChild(),s=n-1;e!==null&&s>=t;){if(s===t)return e;e=e.getPreviousSibling(),s--}return null}getTextContent(){let t="";const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContent(),Pt(r)&&s!==e-1&&!r.isInline()&&(t+=Qi)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContentSize(),Pt(r)&&s!==e-1&&!r.isInline()&&(t+=Qi.length)}return t}getDirection(){return this.getLatest().__dir}hasFormat(t){if(t!==""){const n=Hx[t];return(this.getFormat()&n)!=0}return!1}select(t,n){co();const e=Vn();let s=t,r=n;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const u=this.getFirstChild();if(on(u)||Pt(u))return u.select(0,0)}else if(!(t!==void 0&&t!==o||n!==void 0&&n!==o)){const u=this.getLastChild();if(on(u)||Pt(u))return u.select()}}s===void 0&&(s=o),r===void 0&&(r=o);const i=this.__key;return xn(e)?(e.anchor.set(i,s,"element"),e.focus.set(i,r,"element"),e.dirty=!0,e):Gw(i,s,i,r,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?Hx[t]:0,this}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,e){const s=e.length,r=this.getChildrenSize(),o=this.getWritable(),i=o.__key,u=[],a=[],f=this.getChildAtIndex(t+n);let l=null,d=r-n+s;if(t!==0)if(t===r)l=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(l=h.getPreviousSibling())}if(n>0){let h=l===null?this.getFirstChild():l.getNextSibling();for(let m=0;m<n;m++){h===null&&Xt(100);const g=h.getNextSibling(),y=h.__key;Ua(h.getWritable()),a.push(y),h=g}}let p=l;for(let h=0;h<s;h++){const m=e[h];p!==null&&m.is(p)&&(l=p=p.getPreviousSibling());const g=m.getWritable();g.__parent===i&&d--,Ua(g);const y=m.__key;if(p===null)o.__first=y,g.__prev=null;else{const b=p.getWritable();b.__next=y,g.__prev=b.__key}m.__key===i&&Xt(76),g.__parent=i,u.push(y),p=m}if(t+n===r)p!==null&&(p.getWritable().__next=null,o.__last=p.__key);else if(f!==null){const h=f.getWritable();if(p!==null){const m=p.getWritable();h.__prev=p.__key,m.__next=f.__key}else h.__prev=null}if(o.__size=d,a.length){const h=Vn();if(xn(h)){const m=new Set(a),g=new Set(u),{anchor:y,focus:b}=h;aS(y,m,g)&&Bp(y,y.getNode(),this,l,f),aS(b,m,g)&&Bp(b,b.getNode(),this,l,f),d!==0||this.canBeEmpty()||Ks(this)||this.remove()}}return o}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,e){return!1}}function Pt(c){return c instanceof $p}function aS(c,t,n){let e=c.getNode();for(;e;){const s=e.__key;if(t.has(s)&&!n.has(s))return!0;e=e.getParent()}return!1}class nc extends $p{static getType(){return"root"}static clone(){return new nc}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Xt(51)}getTextContent(){const t=this.__cachedText;return!tc()&&tr()._dirtyType!==za||t===null?super.getTextContent():t}remove(){Xt(52)}replace(t){Xt(53)}insertBefore(t){Xt(54)}insertAfter(t){Xt(55)}updateDOM(t,n){return!1}append(...t){for(let n=0;n<t.length;n++){const e=t[n];Pt(e)||fr(e)||Xt(56)}return super.append(...t)}static importJSON(t){const n=Po();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Io(c){return c instanceof nc}function _y(){return new zp(new Map([["root",new nc]]))}function lS(c){const t=c.exportJSON(),n=c.constructor;if(t.type!==n.getType()&&Xt(130,n.name),Pt(c)){const e=t.children;Array.isArray(e)||Xt(59,n.name);const s=c.getChildren();for(let r=0;r<s.length;r++){const o=lS(s[r]);e.push(o)}}return t}class zp{constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t){return nS(this,t)}clone(t){const n=new zp(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return nS(this,()=>({root:lS(Po())}))}}class rc extends $p{static getType(){return"paragraph"}static clone(t){return new rc(t.__key)}createDOM(t){const n=document.createElement("p"),e=ed(t.theme,"paragraph");return e!==void 0&&n.classList.add(...e),n}updateDOM(t,n,e){return!1}static importDOM(){return{p:t=>({conversion:TM,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&Op(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s);const r=this.getIndent();r>0&&(n.style.textIndent=20*r+"px")}return{element:n}}static importJSON(t){const n=ns();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(t,n){const e=ns(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=this.getChildren();if(t.length===0||on(t[0])&&t[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 TM(c){const t=ns();if(c.style){t.setFormat(c.style.textAlign);const n=parseInt(c.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function ns(){return td(new rc)}function NM(c){return c instanceof rc}const kM=0,AM=1,PM=2,MM=3,IM=4;function cS(c,t,n,e){const s=c._keyToDOMMap;s.clear(),c._editorState=_y(),c._pendingEditorState=e,c._compositionKey=null,c._dirtyType=za,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),c._normalizedNodes=new Set,c._updateTags=new Set,c._updates=[],c._blockCursorElement=null;const r=c._observer;r!==null&&(r.disconnect(),c._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",s.set("root",n))}function RM(c){const t=c||{},n=EM(),e=t.theme||{},s=c===void 0?n:t.parentEditor||null,r=t.disableEvents||!1,o=_y(),i=t.namespace||(s!==null?s._config.namespace:iw()),u=t.editorState,a=[nc,qa,Xl,Ql,rc,...t.nodes||[]],{onError:f,html:l}=t,d=t.editable===void 0||t.editable;let p;if(c===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let m=0;m<a.length;m++){let g=a[m],y=null,b=null;if(typeof g!="function"){const x=g;g=x.replace,y=x.with,b=x.withKlass||null}const v=g.getType(),_=g.transform(),w=new Set;_!==null&&w.add(_),p.set(v,{exportDOM:l&&l.export?l.export.get(g):void 0,klass:g,replace:y,replaceWithKlass:b,transforms:w})}}const h=new jM(o,s,p,{disableEvents:r,namespace:i,theme:e},f||console.error,function(m,g){const y=new Map,b=new Set,v=_=>{Object.keys(_).forEach(w=>{let x=y.get(w);x===void 0&&(x=[],y.set(w,x)),x.push(_[w])})};return m.forEach(_=>{const w=_.klass.importDOM;if(w==null||b.has(w))return;b.add(w);const x=w.call(_.klass);x!==null&&v(x)}),g&&v(g),y}(p,l?l.import:void 0),d);return u!==void 0&&(h._pendingEditorState=u,h._dirtyType=ql),h}class jM{constructor(t,n,e,s,r,o,i){this._parentEditor=n,this._rootElement=null,this._editorState=t,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=s,this._nodes=e,this._decorators={},this._pendingDecorators=null,this._dirtyType=za,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=iw(),this._onError=r,this._htmlConversions=o,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,e){e===void 0&&Xt(35);const s=this._commands;s.has(t)||s.set(t,[new Set,new Set,new Set,new Set,new Set]);const r=s.get(t);r===void 0&&Xt(36,String(t));const o=r[e];return o.add(n),()=>{o.delete(n),r.every(i=>i.size===0)&&s.delete(t)}}registerMutationListener(t,n){this._nodes.get(t.getType())===void 0&&Xt(37,t.name);const e=this._listeners.mutation;return e.set(n,t),()=>{e.delete(n)}}registerNodeTransformToKlass(t,n){const e=t.getType(),s=this._nodes.get(e);return s===void 0&&Xt(37,t.name),s.transforms.add(n),s}registerNodeTransform(t,n){const e=this.registerNodeTransformToKlass(t,n),s=[e],r=e.replaceWithKlass;if(r!=null){const u=this.registerNodeTransformToKlass(r,n);s.push(u)}var o,i;return o=this,i=t.getType(),Mo(o,()=>{const u=Ci();if(u.isEmpty())return;if(i==="root")return void Po().markDirty();const a=u._nodeMap;for(const[,f]of a)f.markDirty()},o._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{s.forEach(u=>u.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Zt(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const e=ed(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=t,cS(this,n,t,s),n!==null&&(this._config.disableEvents||uM(n),e!=null&&n.classList.remove(...e)),t!==null){const r=function(i){const u=i.ownerDocument;return u&&u.defaultView||null}(t),o=t.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=ql,qx(this),this._updateTags.add("history-merge"),Ja(this),this._config.disableEvents||function(i,u){const a=i.ownerDocument,f=Mp.get(a);f===void 0&&a.addEventListener("selectionchange",Pw),Mp.set(a,f||1),i.__lexicalEditor=u;const l=Aw(i);for(let d=0;d<sy.length;d++){const[p,h]=sy[d],m=typeof h=="function"?g=>{Iw(g)||(Mw(g),(u.isEditable()||p==="click")&&h(g,u))}:g=>{if(!Iw(g)&&(Mw(g),u.isEditable()))switch(p){case"cut":return Zt(u,E0,g);case"copy":return Zt(u,C0,g);case"paste":return Zt(u,_0,g);case"dragstart":return Zt(u,Ix,g);case"dragover":return Zt(u,Rx,g);case"dragend":return Zt(u,jx,g);case"focus":return Zt(u,Dx,g);case"blur":return Zt(u,Lx,g);case"drop":return Zt(u,Mx,g)}};i.addEventListener(p,m),l.push(()=>{i.removeEventListener(p,m)})}}(t,this),e!=null&&t.classList.add(...e)}else this._editorState=s,this._pendingEditorState=null,this._window=null;cd("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&Xt(38),Wx(this);const e=this._pendingEditorState,s=this._updateTags,r=n!==void 0?n.tag:null;e===null||e.isEmpty()||(r!=null&&s.add(r),Ja(this)),this._pendingEditorState=t,this._dirtyType=ql,this._dirtyElements.set("root",!1),this._compositionKey=null,r!=null&&s.add(r),Ja(this)}parseEditorState(t,n){return function(e,s,r){const o=_y(),i=Dr,u=_o,a=Lr,f=s._dirtyElements,l=s._dirtyLeaves,d=s._cloneNotNeeded,p=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Dr=o,_o=!1,Lr=s;try{const h=s._nodes;vy(e.root,h),r&&r(),o._readOnly=!0}catch(h){h instanceof Error&&s._onError(h)}finally{s._dirtyElements=f,s._dirtyLeaves=l,s._cloneNotNeeded=d,s._dirtyType=p,Dr=i,_o=u,Lr=a}return o}(typeof t=="string"?JSON.parse(t):t,this,n)}update(t,n){Mo(this,t,n)}focus(t,n={}){const e=this._rootElement;e!==null&&(e.setAttribute("autocapitalize","off"),Mo(this,()=>{const s=Vn(),r=Po();s!==null?s.dirty=!0:r.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?r.selectStart():r.selectEnd())},{onUpdate:()=>{e.removeAttribute("autocapitalize"),t&&t()},tag:"focus"}),this._pendingEditorState===null&&e.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Si(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,cd("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}const DM=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:tM,$applyNodeReplacement:td,$copyNode:hw,$createLineBreakNode:Zl,$createNodeSelection:gy,$createParagraphNode:ns,$createPoint:si,$createRangeSelection:_M,$createTabNode:jp,$createTextNode:zr,$getAdjacentNode:q0,$getCharacterOffsets:hy,$getEditor:sM,$getNearestNodeFromDOMNode:Yu,$getNearestRootOrShadowRoot:pw,$getNodeByKey:Vr,$getPreviousSelection:ec,$getRoot:Po,$getSelection:Vn,$getTextContent:SM,$hasAncestor:Cp,$hasUpdateTag:eM,$insertNodes:wM,$isBlockElementNode:vM,$isDecoratorNode:fr,$isElementNode:Pt,$isInlineElementOrDecoratorNode:nM,$isLeafNode:YP,$isLineBreakNode:Wa,$isNodeSelection:ld,$isParagraphNode:NM,$isRangeSelection:xn,$isRootNode:Io,$isRootOrShadowRoot:Ks,$isTabNode:$w,$isTextNode:on,$nodesOfType:QP,$normalizeSelection__EXPERIMENTAL:Yx,$parseSerializedNode:OM,$selectAll:ZP,$setCompositionKey:jr,$setSelection:wi,$splitNode:oM,BLUR_COMMAND:Lx,CAN_REDO_COMMAND:AP,CAN_UNDO_COMMAND:PP,CLEAR_EDITOR_COMMAND:NP,CLEAR_HISTORY_COMMAND:kP,CLICK_COMMAND:vx,COMMAND_PRIORITY_CRITICAL:IM,COMMAND_PRIORITY_EDITOR:kM,COMMAND_PRIORITY_HIGH:MM,COMMAND_PRIORITY_LOW:AM,COMMAND_PRIORITY_NORMAL:PM,CONTROLLED_TEXT_INSERTION_COMMAND:Wl,COPY_COMMAND:C0,CUT_COMMAND:E0,DELETE_CHARACTER_COMMAND:Ku,DELETE_LINE_COMMAND:Ju,DELETE_WORD_COMMAND:qu,DRAGEND_COMMAND:jx,DRAGOVER_COMMAND:Rx,DRAGSTART_COMMAND:Ix,DROP_COMMAND:Mx,DecoratorNode:sS,ElementNode:$p,FOCUS_COMMAND:Dx,FORMAT_ELEMENT_COMMAND:TP,FORMAT_TEXT_COMMAND:Fs,INDENT_CONTENT_COMMAND:EP,INSERT_LINE_BREAK_COMMAND:Wu,INSERT_PARAGRAPH_COMMAND:v0,INSERT_TAB_COMMAND:CP,KEY_ARROW_DOWN_COMMAND:Ox,KEY_ARROW_LEFT_COMMAND:Sx,KEY_ARROW_RIGHT_COMMAND:xx,KEY_ARROW_UP_COMMAND:Ex,KEY_BACKSPACE_COMMAND:Nx,KEY_DELETE_COMMAND:Ax,KEY_DOWN_COMMAND:_x,KEY_ENTER_COMMAND:fp,KEY_ESCAPE_COMMAND:kx,KEY_MODIFIER_COMMAND:Bx,KEY_SPACE_COMMAND:Tx,KEY_TAB_COMMAND:Px,LineBreakNode:Xl,MOVE_TO_END:wx,MOVE_TO_START:Cx,OUTDENT_CONTENT_COMMAND:OP,PASTE_COMMAND:_0,ParagraphNode:rc,REDO_COMMAND:S0,REMOVE_TEXT_COMMAND:x0,RootNode:nc,SELECTION_CHANGE_COMMAND:dp,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:SP,SELECT_ALL_COMMAND:O0,TabNode:Ql,TextNode:qa,UNDO_COMMAND:w0,createCommand:wP,createEditor:RM,getNearestEditorFromDOMNode:F0,isCurrentlyReadOnlyMode:tc,isHTMLAnchorElement:iM,isHTMLElement:Op,isSelectionCapturedInDecoratorInput:B0,isSelectionWithinEditor:Gu},Symbol.toStringTag,{value:"Module"})),Ft=process.env.NODE_ENV==="development"?xP:DM,LM=Ft.$addUpdateTag,Gr=Ft.$applyNodeReplacement,BM=Ft.$createNodeSelection,An=Ft.$createParagraphNode,Up=Ft.$createPoint,ud=Ft.$createRangeSelection,Hp=Ft.$createTabNode,Ei=Ft.$createTextNode,oc=Ft.$getAdjacentNode,uS=Ft.$getCharacterOffsets,xr=Ft.$getNearestNodeFromDOMNode,Ro=Ft.$getNodeByKey,Ys=Ft.$getPreviousSelection,Un=Ft.$getRoot,st=Ft.$getSelection,dS=Ft.$hasAncestor,fS=Ft.$insertNodes,uo=Ft.$isDecoratorNode,Rt=Ft.$isElementNode,pS=Ft.$isLeafNode,dd=Ft.$isLineBreakNode,fo=Ft.$isNodeSelection,xy=Ft.$isParagraphNode,at=Ft.$isRangeSelection,Xs=Ft.$isRootNode,Uo=Ft.$isRootOrShadowRoot,zt=Ft.$isTextNode,FM=Ft.$nodesOfType,Kp=Ft.$normalizeSelection__EXPERIMENTAL,hS=Ft.$parseSerializedNode,Wp=Ft.$selectAll,kr=Ft.$setSelection,qp=Ft.$splitNode,Oi=Ft.CAN_REDO_COMMAND,Ti=Ft.CAN_UNDO_COMMAND,fd=Ft.CLEAR_EDITOR_COMMAND,gS=Ft.CLEAR_HISTORY_COMMAND,mS=Ft.CLICK_COMMAND,mr=Ft.COMMAND_PRIORITY_CRITICAL,Ct=Ft.COMMAND_PRIORITY_EDITOR,Ho=Ft.COMMAND_PRIORITY_HIGH,ic=Ft.CONTROLLED_TEXT_INSERTION_COMMAND,sc=Ft.COPY_COMMAND,pd=Ft.CUT_COMMAND,Yr=Ft.DELETE_CHARACTER_COMMAND,Zs=Ft.DELETE_LINE_COMMAND,Qs=Ft.DELETE_WORD_COMMAND,yS=Ft.DRAGOVER_COMMAND,Jp=Ft.DRAGSTART_COMMAND,Vp=Ft.DROP_COMMAND,$M=Ft.DecoratorNode,po=Ft.ElementNode,bS=Ft.FOCUS_COMMAND,ea=Ft.FORMAT_ELEMENT_COMMAND,Ni=Ft.FORMAT_TEXT_COMMAND,vS=Ft.INDENT_CONTENT_COMMAND,ta=Ft.INSERT_LINE_BREAK_COMMAND,ac=Ft.INSERT_PARAGRAPH_COMMAND,_S=Ft.INSERT_TAB_COMMAND,Gp=Ft.KEY_ARROW_DOWN_COMMAND,lc=Ft.KEY_ARROW_LEFT_COMMAND,cc=Ft.KEY_ARROW_RIGHT_COMMAND,Yp=Ft.KEY_ARROW_UP_COMMAND,Va=Ft.KEY_BACKSPACE_COMMAND,Ga=Ft.KEY_DELETE_COMMAND,Xp=Ft.KEY_ENTER_COMMAND,hd=Ft.KEY_ESCAPE_COMMAND,xS=Ft.KEY_TAB_COMMAND,zM=Ft.LineBreakNode,Zp=Ft.OUTDENT_CONTENT_COMMAND,gd=Ft.PASTE_COMMAND,UM=Ft.ParagraphNode,Qp=Ft.REDO_COMMAND,eh=Ft.REMOVE_TEXT_COMMAND,HM=Ft.RootNode,ai=Ft.SELECTION_CHANGE_COMMAND,th=Ft.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,nh=Ft.SELECT_ALL_COMMAND,Ya=Ft.TextNode,rh=Ft.UNDO_COMMAND,Xa=Ft.createCommand,wy=Ft.createEditor,wS=Ft.isCurrentlyReadOnlyMode,SS=Ft.isHTMLAnchorElement,CS=Ft.isHTMLElement,ES=Ft.isSelectionCapturedInDecoratorInput,OS=Ft.isSelectionWithinEditor,e$="",TS=St.createContext(null);function KM(c,t){let n=null;c!=null&&(n=c[1]);function e(){return t??(n!=null?n.getTheme():null)}return{getTheme:e}}function WM(){const c=St.useContext(TS);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}const qM=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposerContext:TS,createLexicalComposerContext:KM,useLexicalComposerContext:WM},Symbol.toStringTag,{value:"Module"}));var JM=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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.`)};const NS=St.createContext(null);function VM(c,t){let n=null;return c!=null&&(n=c[1]),{getTheme:function(){return t??(n!=null?n.getTheme():null)}}}function GM(){const c=St.useContext(NS);return c==null&&JM(8),c}const YM=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposerContext:NS,createLexicalComposerContext:VM,useLexicalComposerContext:GM},Symbol.toStringTag,{value:"Module"})),Sy=process.env.NODE_ENV==="development"?qM:YM,Cy=Sy.LexicalComposerContext,kS=Sy.createLexicalComposerContext,pr=Sy.useLexicalComposerContext,AS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var XM=AS?St.useLayoutEffect:St.useEffect;const oh={tag:"history-merge"};function ZM({initialConfig:c,children:t}){const n=St.useMemo(()=>{const{theme:e,namespace:s,editor__DEPRECATED:r,nodes:o,onError:i,editorState:u,html:a}=c,f=kS(null,e);let l=r||null;if(l===null){const d=wy({editable:c.editable,html:a,namespace:s,nodes:o,onError:p=>i(p,d),theme:e});QM(d,u),l=d}return[l,f]},[]);return XM(()=>{const e=c.editable,[s]=n;s.setEditable(e!==void 0?e:!0)},[]),mn.createElement(Cy.Provider,{value:n},t)}function QM(c,t){if(t!==null){if(t===void 0)c.update(()=>{const n=Un();if(n.isEmpty()){const e=An();n.append(e);const s=AS?document.activeElement:null;(st()!==null||s!==null&&s===c.getRootElement())&&e.select()}},oh);else if(t!==null)switch(typeof t){case"string":{const n=c.parseEditorState(t);c.setEditorState(n,oh);break}case"object":{c.setEditorState(t,oh);break}case"function":{c.update(()=>{Un().isEmpty()&&t(c)},oh);break}}}}const eI=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposer:ZM},Symbol.toStringTag,{value:"Module"})),PS=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;var tI=PS?St.useLayoutEffect:St.useEffect;const ih={tag:"history-merge"};function nI({initialConfig:c,children:t}){const n=St.useMemo(()=>{const{theme:e,namespace:s,editor__DEPRECATED:r,nodes:o,onError:i,editorState:u,html:a}=c,f=kS(null,e);let l=r||null;if(l===null){const d=wy({editable:c.editable,html:a,namespace:s,nodes:o,onError:p=>i(p,d),theme:e});(function(p,h){if(h!==null){if(h===void 0)p.update(()=>{const m=Un();if(m.isEmpty()){const g=An();m.append(g);const y=PS?document.activeElement:null;(st()!==null||y!==null&&y===p.getRootElement())&&g.select()}},ih);else if(h!==null)switch(typeof h){case"string":{const m=p.parseEditorState(h);p.setEditorState(m,ih);break}case"object":p.setEditorState(h,ih);break;case"function":p.update(()=>{Un().isEmpty()&&h(p)},ih)}}})(d,u),l=d}return[l,f]},[]);return tI(()=>{const e=c.editable,[s]=n;s.setEditable(e===void 0||e)},[]),mn.createElement(Cy.Provider,{value:n},t)}const rI=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposer:nI},Symbol.toStringTag,{value:"Module"})),MS=(process.env.NODE_ENV==="development"?eI:rI).LexicalComposer;function oI({defaultSelection:c}){const[t]=pr();return St.useEffect(()=>{t.focus(()=>{const n=document.activeElement,e=t.getRootElement();e!==null&&(n===null||!e.contains(n))&&e.focus({preventScroll:!0})},{defaultSelection:c})},[c,t]),null}const iI=Object.freeze(Object.defineProperty({__proto__:null,AutoFocusPlugin:oI},Symbol.toStringTag,{value:"Module"}));function sI({defaultSelection:c}){const[t]=pr();return St.useEffect(()=>{t.focus(()=>{const n=document.activeElement,e=t.getRootElement();e===null||n!==null&&e.contains(n)||e.focus({preventScroll:!0})},{defaultSelection:c})},[c,t]),null}const aI=Object.freeze(Object.defineProperty({__proto__:null,AutoFocusPlugin:sI},Symbol.toStringTag,{value:"Module"})),IS=(process.env.NODE_ENV==="development"?iI:aI).AutoFocusPlugin;function Ey(){return Ey=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Ey.apply(this,arguments)}var lI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function cI({ariaActiveDescendant:c,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:e,ariaExpanded:s,ariaLabel:r,ariaLabelledBy:o,ariaMultiline:i,ariaOwns:u,ariaRequired:a,autoCapitalize:f,className:l,id:d,role:p="textbox",spellCheck:h=!0,style:m,tabIndex:g,"data-testid":y,...b}){const[v]=pr(),[_,w]=St.useState(!1),x=St.useCallback(S=>{S&&S.ownerDocument&&S.ownerDocument.defaultView&&v.setRootElement(S)},[v]);return lI(()=>(w(v.isEditable()),v.registerEditableListener(S=>{w(S)})),[v]),mn.createElement("div",Ey({},b,{"aria-activedescendant":_?c:void 0,"aria-autocomplete":_?t:"none","aria-controls":_?n:void 0,"aria-describedby":e,"aria-expanded":_&&p==="combobox"?!!s:void 0,"aria-label":r,"aria-labelledby":o,"aria-multiline":i,"aria-owns":_?u:void 0,"aria-readonly":_?void 0:!0,"aria-required":a,autoCapitalize:f,className:l,contentEditable:_,"data-testid":y,id:d,ref:x,role:p,spellCheck:h,style:m,tabIndex:g}))}const uI=Object.freeze(Object.defineProperty({__proto__:null,ContentEditable:cI},Symbol.toStringTag,{value:"Module"}));function Oy(){return Oy=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Oy.apply(this,arguments)}var dI=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function fI({ariaActiveDescendant:c,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:e,ariaExpanded:s,ariaLabel:r,ariaLabelledBy:o,ariaMultiline:i,ariaOwns:u,ariaRequired:a,autoCapitalize:f,className:l,id:d,role:p="textbox",spellCheck:h=!0,style:m,tabIndex:g,"data-testid":y,...b}){const[v]=pr(),[_,w]=St.useState(!1),x=St.useCallback(S=>{S&&S.ownerDocument&&S.ownerDocument.defaultView&&v.setRootElement(S)},[v]);return dI(()=>(w(v.isEditable()),v.registerEditableListener(S=>{w(S)})),[v]),mn.createElement("div",Oy({},b,{"aria-activedescendant":_?c:void 0,"aria-autocomplete":_?t:"none","aria-controls":_?n:void 0,"aria-describedby":e,"aria-expanded":_&&p==="combobox"?!!s:void 0,"aria-label":r,"aria-labelledby":o,"aria-multiline":i,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":a,autoCapitalize:f,className:l,contentEditable:_,"data-testid":y,id:d,ref:x,role:p,spellCheck:h,style:m,tabIndex:g}))}const pI=Object.freeze(Object.defineProperty({__proto__:null,ContentEditable:fI},Symbol.toStringTag,{value:"Module"})),RS=(process.env.NODE_ENV==="development"?uI:pI).ContentEditable,sh=new Map;function jS(c){let t=c;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function DS(c){const t=c.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(c)]}function hI(c,t,n,e,s){const r=t.getKey(),o=e.getKey(),i=document.createRange();let u=c.getElementByKey(r),a=c.getElementByKey(o),f=n,l=s;if(zt(t)&&(u=jS(u)),zt(e)&&(a=jS(a)),t===void 0||e===void 0||u===null||a===null)return null;u.nodeName==="BR"&&([u,f]=DS(u)),a.nodeName==="BR"&&([a,l]=DS(a));const d=u.firstChild;u===a&&d!=null&&d.nodeName==="BR"&&f===0&&l===0&&(l=1);try{i.setStart(u,f),i.setEnd(a,l)}catch{return null}return i.collapsed&&(f!==l||r!==o)&&(i.setStart(a,l),i.setEnd(u,f)),i}function gI(c,t){const n=c.getRootElement();if(n===null)return[];const e=n.getBoundingClientRect(),s=getComputedStyle(n),r=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),o=Array.from(t.getClientRects());let i=o.length;o.sort((a,f)=>{const l=a.top-f.top;return Math.abs(l)<=3?a.left-f.left:l});let u;for(let a=0;a<i;a++){const f=o[a],l=u&&u.top<=f.top&&u.top+u.height>f.top&&u.left+u.width>f.left,d=f.width+r===e.width;if(l||d){o.splice(a--,1),i--;continue}u=f}return o}function LS(c){const t={},n=c.split(";");for(const e of n)if(e!==""){const[s,r]=e.split(/:([^]+)/);s&&r&&(t[s.trim()]=r.trim())}return t}function ah(c){let t=sh.get(c);return t===void 0&&(t=LS(c),sh.set(c,t)),Object.freeze(t),t}function mI(c){let t="";for(const n in c)n&&(t+=`${n}: ${c[n]};`);return t}function yI(c,t){return c.__first=t.__first,c.__last=t.__last,c.__size=t.__size,c.__format=t.__format,c.__indent=t.__indent,c.__dir=t.__dir,c}function bI(c,t){return c.__format=t.__format,c.__style=t.__style,c.__mode=t.__mode,c.__detail=t.__detail,c}function vI(c){const n=c.constructor.clone(c);return n.__parent=c.__parent,n.__next=c.__next,n.__prev=c.__prev,Rt(c)&&Rt(n)?yI(n,c):zt(c)&&zt(n)?bI(n,c):n}function _I(c,t){const n=c.getStartEndPoints();if(t.isSelected(c)&&!t.isSegmented()&&!t.isToken()&&n!==null){const[e,s]=n,r=c.isBackward(),o=e.getNode(),i=s.getNode(),u=t.is(o),a=t.is(i);if(u||a){const[f,l]=uS(c),d=o.is(i),p=t.is(r?i:o),h=t.is(r?o:i);let m=0,g;if(d)m=f>l?l:f,g=f>l?f:l;else if(p)m=r?l:f,g=void 0;else if(h){const y=r?f:l;m=0,g=y}return t.__text=t.__text.slice(m,g),t}}return t}function xI(c){if(c.type==="text")return c.offset===c.getNode().getTextContentSize();const t=c.getNode();if(!Rt(t))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return c.offset===t.getChildrenSize()}function wI(c,t,n){let e=t.getNode(),s=n;if(Rt(e)){const r=e.getDescendantByIndex(t.offset);r!==null&&(e=r)}for(;s>0&&e!==null;){if(Rt(e)){const a=e.getLastDescendant();a!==null&&(e=a)}let r=e.getPreviousSibling(),o=0;if(r===null){let a=e.getParentOrThrow(),f=a.getPreviousSibling();for(;f===null;){if(a=a.getParent(),a===null){r=null;break}f=a.getPreviousSibling()}a!==null&&(o=a.isInline()?0:2,r=f)}let i=e.getTextContent();i===""&&Rt(e)&&!e.isInline()&&(i=`
|
|
49
|
+
`?e.push(Zl()):o===" "?e.push(jp()):e.push(zr(o))}this.insertNodes(e)}insertText(t){const n=this.anchor,e=this.focus,s=this.isCollapsed()||n.isBefore(e),r=this.format,o=this.style;s&&n.type==="element"?zw(n,e,r,o):s||e.type!=="element"||zw(e,n,r,o);const i=this.getNodes(),u=i.length,a=s?e:n,f=(s?n:e).offset,l=a.offset;let d=i[0];on(d)||Xt(26);const p=d.getTextContent().length,h=d.getParentOrThrow();let m=i[u-1];if(this.isCollapsed()&&f===p&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let g=d.getNextSibling();if(on(g)&&g.canInsertTextBefore()&&!$0(g)||(g=zr(),g.setFormat(r),h.canInsertTextAfter()?d.insertAfter(g):h.insertAfter(g)),g.select(0,0),d=g,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&f===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let g=d.getPreviousSibling();if(on(g)&&!$0(g)||(g=zr(),g.setFormat(r),h.canInsertTextBefore()?d.insertBefore(g):h.insertBefore(g)),g.select(),d=g,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&f!==p){const g=zr(d.getTextContent());g.setFormat(r),d.replace(g),d=g}else if(!this.isCollapsed()&&t!==""){const g=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||Pt(g)&&(!g.canInsertTextBefore()||!g.canInsertTextAfter()))return this.insertText(""),qw(this.anchor,this.focus,null),void this.insertText(t)}if(u===1){if(d.isToken()){const v=zr(t);return v.select(),void d.replace(v)}const g=d.getFormat(),y=d.getStyle();if(f!==l||g===r&&y===o){if(Fw(d)){const v=zr(t);return v.setFormat(r),v.setStyle(o),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=zr(t);if(v.setFormat(r),v.setStyle(o),v.select(),f===0)d.insertBefore(v,!1);else{const[_]=d.splitText(f);_.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(r),d.setStyle(o)}const b=l-f;d=d.spliceText(f,b,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=g,this.style=y))}else{const g=new Set([...d.getParentKeys(),...m.getParentKeys()]),y=Pt(d)?d:d.getParentOrThrow();let b=Pt(m)?m:m.getParentOrThrow(),v=m;if(!y.is(b)&&b.isInline())do v=b,b=b.getParentOrThrow();while(b.isInline());if(a.type==="text"&&(l!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<l)if(on(m)&&!m.isToken()&&l!==m.getTextContentSize()){if(m.isSegmented()){const E=zr(m.getTextContent());m.replace(E),m=E}Io(a.getNode())||a.type!=="text"||(m=m.spliceText(0,l,"")),g.add(m.__key)}else{const E=m.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?m.remove():E.remove()}else g.add(m.__key);const _=b.getChildren(),w=new Set(i),x=y.is(b),S=y.isInline()&&d.getNextSibling()===null?y:d;for(let E=_.length-1;E>=0;E--){const O=_[E];if(O.is(d)||Pt(O)&&O.isParentOf(d))break;O.isAttached()&&(!w.has(O)||O.is(v)?x||S.insertAfter(O,!1):O.remove())}if(!x){let E=b,O=null;for(;E!==null;){const j=E.getChildren(),A=j.length;(A===0||j[A-1].is(O))&&(g.delete(E.__key),O=E),E=E.getParent()}}if(d.isToken())if(f===p)d.select();else{const E=zr(t);E.select(),d.replace(E)}else d=d.spliceText(f,p-f,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let E=1;E<u;E++){const O=i[E],j=O.__key;g.has(j)||O.remove()}}}removeText(){this.insertText("")}formatText(t){if(this.isCollapsed())return this.toggleFormat(t),void jr(null);const n=this.getNodes(),e=[];for(const b of n)on(b)&&e.push(b);const s=e.length;if(s===0)return this.toggleFormat(t),void jr(null);const r=this.anchor,o=this.focus,i=this.isBackward(),u=i?o:r,a=i?r:o;let f=0,l=e[0],d=u.type==="element"?0:u.offset;if(u.type==="text"&&d===l.getTextContentSize()&&(f=1,l=e[1],d=0),l==null)return;const p=l.getFormatFlags(t,null),h=s-1;let m=e[h];const g=a.type==="text"?a.offset:m.getTextContentSize();if(l.is(m)){if(d===g)return;if(d===0&&g===l.getTextContentSize())l.setFormat(p);else{const b=l.splitText(d,g),v=d===0?b[0]:b[1];v.setFormat(p),u.type==="text"&&u.set(v.__key,0,"text"),a.type==="text"&&a.set(v.__key,g-d,"text")}return void(this.format=p)}d!==0&&([,l]=l.splitText(d),d=0),l.setFormat(p);const y=m.getFormatFlags(t,p);g>0&&(g!==m.getTextContentSize()&&([m]=m.splitText(g)),m.setFormat(y));for(let b=f+1;b<h;b++){const v=e[b];if(!v.isToken()){const _=v.getFormatFlags(t,y);v.setFormat(_)}}u.type==="text"&&u.set(l.__key,d,"text"),a.type==="text"&&a.set(m.__key,g,"text"),this.format=p|y}insertNodes(t){if(t.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=Vn();return xn(h)||Xt(134),h.insertNodes(t)}const n=Y0((this.isBackward()?this.focus:this.anchor).getNode(),Vl),e=t[t.length-1];if("__language"in n&&Pt(n)){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const h=yy(this);n.splice(h,0,t),e.selectEnd()}return}if(!t.some(h=>(Pt(h)||fr(h))&&!h.isInline())){Pt(n)||Xt(135);const h=yy(this);return n.splice(h,0,t),void e.selectEnd()}const s=function(h){const m=ns();let g=null;for(let y=0;y<h.length;y++){const b=h[y],v=Wa(b);if(v||fr(b)&&b.isInline()||Pt(b)&&b.isInline()||on(b)||b.isParentRequired()){if(g===null&&(g=b.createParentElementNode(),m.append(g),v))continue;g!==null&&g.append(b)}else m.append(b),g=null}return m}(t),r=s.getLastDescendant(),o=s.getChildren(),i=h=>"__value"in h&&"__checked"in h,u=!Pt(n)||!n.isEmpty()?this.insertParagraph():null,a=o[o.length-1];let f=o[0];var l;Pt(l=f)&&Vl(l)&&!l.isEmpty()&&Pt(n)&&(!n.isEmpty()||i(n))&&(Pt(n)||Xt(135),n.append(...f.getChildren()),f=o[1]),f&&function(h,m,g){const y=g||m.getParentOrThrow().getLastChild();let b=m;const v=[m];for(;b!==y;)b.getNextSibling()||Xt(140),b=b.getNextSibling(),v.push(b);let _=h;for(const w of v)_=_.insertAfter(w)}(n,f);const d=Y0(r,Vl);u&&Pt(d)&&(i(u)||Vl(a))&&(d.append(...u.getChildren()),u.remove()),Pt(n)&&n.isEmpty()&&n.remove(),r.selectEnd();const p=Pt(n)?n.getLastChild():null;Wa(p)&&d!==n&&p.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=ns();return Po().splice(this.anchor.offset,0,[o]),o.select(),o}const t=yy(this),n=Y0(this.anchor.getNode(),Vl);Pt(n)||Xt(136);const e=n.getChildAtIndex(t),s=e?[e,...e.getNextSiblings()]:[],r=n.insertNewAfter(this,!1);return r?(r.append(...s),r.selectStart(),r):null}insertLineBreak(t){const n=Zl();if(this.insertNodes([n]),t){const e=n.getParentOrThrow(),s=n.getIndexWithinParent();e.select(s,s)}}extract(){const t=this.getNodes(),n=t.length,e=n-1,s=this.anchor,r=this.focus;let o=t[0],i=t[e];const[u,a]=hy(this);if(n===0)return[];if(n===1){if(on(o)&&!this.isCollapsed()){const l=u>a?a:u,d=u>a?u:a,p=o.splitText(l,d),h=l===0?p[0]:p[1];return h!=null?[h]:[]}return[o]}const f=s.isBefore(r);if(on(o)){const l=f?u:a;l===o.getTextContentSize()?t.shift():l!==0&&([,o]=o.splitText(l),t[0]=o)}if(on(i)){const l=i.getTextContent().length,d=f?a:u;d===0?t.pop():d!==l&&([i]=i.splitText(d),t[e]=i)}return t}modify(t,n,e){const s=this.focus,r=this.anchor,o=t==="move",i=q0(s,n);if(fr(i)&&!i.isIsolated()){if(o&&i.isKeyboardSelectable()){const p=gy();return p.add(i.__key),void wi(p)}const d=n?i.getPreviousSibling():i.getNextSibling();if(on(d)){const p=d.__key,h=n?d.getTextContent().length:0;return s.set(p,h,"text"),void(o&&r.set(p,h,"text"))}{const p=i.getParentOrThrow();let h,m;return Pt(d)?(m=d.__key,h=n?d.getChildrenSize():0):(h=i.getIndexWithinParent(),m=p.__key,n||h++),s.set(m,h,"element"),void(o&&r.set(m,h,"element"))}}const u=tr(),a=Si(u._window);if(!a)return;const f=u._blockCursorElement,l=u._rootElement;if(l===null||f===null||!Pt(i)||i.isInline()||i.canBeEmpty()||G0(f,u,l),function(d,p,h,m){d.modify(p,h,m)}(a,t,n?"backward":"forward",e),a.rangeCount>0){const d=a.getRangeAt(0),p=this.anchor.getNode(),h=Io(p)?p:fw(p);if(this.applyDOMRange(d),this.dirty=!0,!o){const m=this.getNodes(),g=[];let y=!1;for(let b=0;b<m.length;b++){const v=m[b];Cp(v,h)?g.push(v):y=!0}if(y&&g.length>0)if(n){const b=g[0];Pt(b)?b.selectStart():b.getParentOrThrow().selectStart()}else{const b=g[g.length-1];Pt(b)?b.selectEnd():b.getParentOrThrow().selectEnd()}a.anchorNode===d.startContainer&&a.anchorOffset===d.startOffset||function(b){const v=b.focus,_=b.anchor,w=_.key,x=_.offset,S=_.type;Vs(_,v.key,v.offset,v.type),Vs(v,w,x,S),b._cachedNodes=null}(this)}}}forwardDeletion(t,n,e){if(!e&&(t.type==="element"&&Pt(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const s=n.getParent(),r=n.getNextSibling()||(s===null?null:s.getNextSibling());if(Pt(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let s=e.getNode();if(this.forwardDeletion(e,s,t))return;const r=this.focus,o=q0(r,t);if(fr(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Pt(s)&&s.getChildrenSize()===0){s.remove();const i=gy();i.add(o.__key),wi(i)}else o.remove(),tr().dispatchCommand(dp,void 0);return}if(!t&&Pt(o)&&Pt(s)&&s.isEmpty())return s.remove(),void o.selectStart();if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&e.offset===0&&(e.type==="element"?e.getNode():e.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const i=r.type==="text"?r.getNode():null;if(s=e.type==="text"?e.getNode():null,i!==null&&i.isSegmented()){const u=r.offset,a=i.getTextContentSize();if(i.is(s)||t&&u!==a||!t&&u!==0)return void Hw(i,t,u)}else if(s!==null&&s.isSegmented()){const u=e.offset,a=s.getTextContentSize();if(s.is(i)||t&&u!==0||!t&&u!==a)return void Hw(s,t,u)}(function(u,a){const f=u.anchor,l=u.focus,d=f.getNode(),p=l.getNode();if(d===p&&f.type==="text"&&l.type==="text"){const h=f.offset,m=l.offset,g=h<m,y=g?h:m,b=g?m:h,v=b-1;y!==v&&(rw(d.getTextContent().slice(y,b))||(a?l.offset=v:f.offset=v))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const e=this.anchor.getNode();e.isEmpty()&&Io(e.getParent())&&e.getIndexWithinParent()===0&&e.collapseAtStart(this)}}deleteLine(t){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",t,"lineboundary"),(t?this.focus:this.anchor).offset===0&&this.modify("extend",t,"character")),this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,e=n.getNode();if(this.forwardDeletion(n,e,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ld(c){return c instanceof Dp}function Uw(c){const t=c.offset;if(c.type==="text")return t;const n=c.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function hy(c){const t=c.getStartEndPoints();if(t===null)return[0,0];const[n,e]=t;return n.type==="element"&&e.type==="element"&&n.key===e.key&&n.offset===e.offset?[0,0]:[Uw(n),Uw(e)]}function Hw(c,t,n){const e=c,s=e.getTextContent().split(/(?=\s)/g),r=s.length;let o=0,i=0;for(let a=0;a<r;a++){const f=a===r-1;if(i=o,o+=s[a].length,t&&o===n||o>n||f){s.splice(a,1),f&&(i=void 0);break}}const u=s.join("").trim();u===""?e.remove():(e.setTextContent(u),e.select(i,i))}function Kw(c,t,n,e){let s,r=t;if(c.nodeType===Vu){let o=!1;const i=c.childNodes,u=i.length;r===u&&(o=!0,r=u-1);let a=i[r],f=!1;if(a===e._blockCursorElement?(a=i[r+1],f=!0):e._blockCursorElement!==null&&r--,s=Jl(a),on(s))r=nw(s,o);else{let l=Jl(c);if(l===null)return null;if(Pt(l)){let d=l.getChildAtIndex(r);if(Pt(d)&&function(p,h,m){const g=p.getParent();return m===null||g===null||!g.canBeEmpty()||g!==m.getNode()}(d,0,n)){const p=o?d.getLastDescendant():d.getFirstDescendant();p===null?(l=d,r=0):(d=p,l=Pt(d)?d:d.getParentOrThrow())}on(d)?(s=d,l=null,r=nw(d,o)):d!==l&&o&&!f&&r++}else{const d=l.getIndexWithinParent();r=t===0&&fr(l)&&Jl(c)===l?d:d+1,l=l.getParentOrThrow()}if(Pt(l))return si(l.__key,r,"element")}}else s=Jl(c);return on(s)?si(s.__key,r,"text"):null}function Ww(c,t,n){const e=c.offset,s=c.getNode();if(e===0){const r=s.getPreviousSibling(),o=s.getParent();if(t){if((n||!t)&&r===null&&Pt(o)&&o.isInline()){const i=o.getPreviousSibling();on(i)&&(c.key=i.__key,c.offset=i.getTextContent().length)}}else Pt(r)&&!n&&r.isInline()?(c.key=r.__key,c.offset=r.getChildrenSize(),c.type="element"):on(r)&&(c.key=r.__key,c.offset=r.getTextContent().length)}else if(e===s.getTextContent().length){const r=s.getNextSibling(),o=s.getParent();if(t&&Pt(r)&&r.isInline())c.key=r.__key,c.offset=0,c.type="element";else if((n||t)&&r===null&&Pt(o)&&o.isInline()&&!o.canInsertTextAfter()){const i=o.getNextSibling();on(i)&&(c.key=i.__key,c.offset=0)}}}function qw(c,t,n){if(c.type==="text"&&t.type==="text"){const e=c.isBefore(t),s=c.is(t);Ww(c,e,s),Ww(t,!e,s),s&&(t.key=c.key,t.offset=c.offset,t.type=c.type);const r=tr();if(r.isComposing()&&r._compositionKey!==c.key&&xn(n)){const o=n.anchor,i=n.focus;Vs(c,o.key,o.offset,o.type),Vs(t,i.key,i.offset,i.type)}}}function Jw(c,t,n,e,s,r){if(c===null||n===null||!Gu(s,c,n))return null;const o=Kw(c,t,xn(r)?r.anchor:null,s);if(o===null)return null;const i=Kw(n,e,xn(r)?r.focus:null,s);if(i===null)return null;if(o.type==="element"&&i.type==="element"){const u=Jl(c),a=Jl(n);if(fr(u)&&fr(a))return null}return qw(o,i,r),[o,i]}function bM(c){return Pt(c)&&!c.isInline()}function Vw(c,t,n,e,s,r){const o=Ci(),i=new Gs(si(c,t,s),si(n,e,r),0,"");return i.dirty=!0,o._selection=i,i}function vM(){const c=si("root",0,"element"),t=si("root",0,"element");return new Gs(c,t,0,"")}function gy(){return new Dp(new Set)}function my(c,t,n,e){const s=n._window;if(s===null)return null;const r=e||s.event,o=r?r.type:void 0,i=o==="selectionchange",u=!j0&&(i||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&r&&r.detail===3||o==="drop"||o===void 0);let a,f,l,d;if(xn(c)&&!u)return c.clone();if(t===null)return null;if(a=t.anchorNode,f=t.focusNode,l=t.anchorOffset,d=t.focusOffset,i&&xn(c)&&!Gu(n,a,f))return c.clone();const p=Jw(a,l,f,d,n,c);if(p===null)return null;const[h,m]=p;return new Gs(h,m,xn(c)?c.format:0,xn(c)?c.style:"")}function Vn(){return Ci()._selection}function ec(){return tr()._editorState._selection}function Lp(c,t,n,e=1){const s=c.anchor,r=c.focus,o=s.getNode(),i=r.getNode();if(!t.is(o)&&!t.is(i))return;const u=t.__key;if(c.isCollapsed()){const a=s.offset;if(n<=a&&e>0||n<a&&e<0){const f=Math.max(0,a+e);s.set(u,f,"element"),r.set(u,f,"element"),Gw(c)}}else{const a=c.isBackward(),f=a?r:s,l=f.getNode(),d=a?s:r,p=d.getNode();if(t.is(l)){const h=f.offset;(n<=h&&e>0||n<h&&e<0)&&f.set(u,Math.max(0,h+e),"element")}if(t.is(p)){const h=d.offset;(n<=h&&e>0||n<h&&e<0)&&d.set(u,Math.max(0,h+e),"element")}}Gw(c)}function Gw(c){const t=c.anchor,n=t.offset,e=c.focus,s=e.offset,r=t.getNode(),o=e.getNode();if(c.isCollapsed()){if(!Pt(r))return;const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(on(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text"),e.set(a.__key,f,"text")}}else{if(Pt(r)){const i=r.getChildrenSize(),u=n>=i,a=u?r.getChildAtIndex(i-1):r.getChildAtIndex(n);if(on(a)){let f=0;u&&(f=a.getTextContentSize()),t.set(a.__key,f,"text")}}if(Pt(o)){const i=o.getChildrenSize(),u=s>=i,a=u?o.getChildAtIndex(i-1):o.getChildAtIndex(s);if(on(a)){let f=0;u&&(f=a.getTextContentSize()),e.set(a.__key,f,"text")}}}}function Bp(c,t,n,e,s){let r=null,o=0,i=null;e!==null?(r=e.__key,on(e)?(o=e.getTextContentSize(),i="text"):Pt(e)&&(o=e.getChildrenSize(),i="element")):s!==null&&(r=s.__key,on(s)?i="text":Pt(s)&&(i="element")),r!==null&&i!==null?c.set(r,o,i):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),c.set(n.__key,o,"element"))}function Yw(c,t,n,e,s){c.type==="text"?(c.key=n,t||(c.offset+=s)):c.offset>e.getIndexWithinParent()&&(c.offset-=1)}function _M(c,t,n,e,s,r,o){const i=e.anchorNode,u=e.focusNode,a=e.anchorOffset,f=e.focusOffset,l=document.activeElement;if(s.has("collaboration")&&l!==r||l!==null&&B0(l))return;if(!xn(t))return void(c!==null&&Gu(n,i,u)&&e.removeAllRanges());const d=t.anchor,p=t.focus,h=d.key,m=p.key,g=wp(n,h),y=wp(n,m),b=d.offset,v=p.offset,_=t.format,w=t.style,x=t.isCollapsed();let S=g,E=y,O=!1;if(d.type==="text"){S=vp(g);const $=d.getNode();O=$.getFormat()!==_||$.getStyle()!==w}else xn(c)&&c.anchor.type==="text"&&(O=!0);var j,A,T,I,k;if(p.type==="text"&&(E=vp(y)),S!==null&&E!==null&&(x&&(c===null||O||xn(c)&&(c.format!==_||c.style!==w))&&(j=_,A=w,T=b,I=h,k=performance.now(),Cw=[j,A,T,I,k]),a!==b||f!==v||i!==S||u!==E||e.type==="Range"&&x||(l!==null&&r.contains(l)||r.focus({preventScroll:!0}),d.type==="element"))){try{e.setBaseAndExtent(S,b,E,v)}catch{}if(!s.has("skip-scroll-into-view")&&t.isCollapsed()&&r!==null&&r===document.activeElement){const $=t instanceof Gs&&t.anchor.type==="element"?S.childNodes[b]||null:e.rangeCount>0?e.getRangeAt(0):null;if($!==null){let H;if($ instanceof Text){const U=document.createRange();U.selectNode($),H=U.getBoundingClientRect()}else H=$.getBoundingClientRect();(function(U,D,W){const J=W.ownerDocument,M=J.defaultView;if(M===null)return;let{top:z,bottom:V}=D,G=0,F=0,K=W;for(;K!==null;){const N=K===J.body;if(N)G=0,F=Ep(U).innerHeight;else{const L=K.getBoundingClientRect();G=L.top,F=L.bottom}let R=0;if(z<G?R=-(G-z):V>F&&(R=V-F),R!==0)if(N)M.scrollBy(0,R);else{const L=K.scrollTop;K.scrollTop+=R;const B=K.scrollTop-L;z-=B,V-=B}if(N)break;K=Sp(K)}})(n,H,r)}}ay=!0}}function xM(c){let t=Vn()||ec();t===null&&(t=Po().selectEnd()),t.insertNodes(c)}function wM(){const c=Vn();return c===null?"":c.getTextContent()}function yy(c){c.isCollapsed()||c.removeText();const t=c.anchor;let n=t.getNode(),e=t.offset;for(;!Vl(n);)[n,e]=SM(n,e);return e}function SM(c,t){const n=c.getParent();if(!n){const s=ns();return Po().append(s),s.select(),[Po(),0]}if(on(c)){const s=c.splitText(t);if(s.length===0)return[n,c.getIndexWithinParent()];const r=t===0?0:1;return[n,s[0].getIndexWithinParent()+r]}if(!Pt(c)||t===0)return[n,c.getIndexWithinParent()];const e=c.getChildAtIndex(t);if(e){const s=new Gs(si(c.__key,t,"element"),si(c.__key,t,"element"),0,""),r=c.insertNewAfter(s);r&&r.append(e,...e.getNextSiblings())}return[n,c.getIndexWithinParent()+1]}let Dr=null,Lr=null,_o=!1,by=!1,Fp=0;const Xw={characterData:!0,childList:!0,subtree:!0};function tc(){return _o||Dr!==null&&Dr._readOnly}function co(){_o&&Xt(13)}function Zw(){Fp>99&&Xt(14)}function Ci(){return Dr===null&&Xt(15),Dr}function tr(){return Lr===null&&Xt(16),Lr}function CM(){return Lr}function Qw(c,t,n){const e=t.__type,s=function(i,u){const a=i._nodes.get(u);return a===void 0&&Xt(30,u),a}(c,e);let r=n.get(e);r===void 0&&(r=Array.from(s.transforms),n.set(e,r));const o=r.length;for(let i=0;i<o&&(r[i](t),t.isAttached());i++);}function eS(c,t){return c!==void 0&&c.__key!==t&&c.isAttached()}function EM(c){return vy(c,tr()._nodes)}function vy(c,t){const n=c.type,e=t.get(n);e===void 0&&Xt(17,n);const s=e.klass;c.type!==s.getType()&&Xt(18,s.name);const r=s.importJSON(c),o=c.children;if(Pt(r)&&Array.isArray(o))for(let i=0;i<o.length;i++){const u=vy(o[i],t);r.append(u)}return r}function tS(c,t){const n=Dr,e=_o,s=Lr;Dr=c,_o=!0,Lr=null;try{return t()}finally{Dr=n,_o=e,Lr=s}}function Ja(c,t){const n=c._pendingEditorState,e=c._rootElement,s=c._headless||e===null;if(n===null)return;const r=c._editorState,o=r._selection,i=n._selection,u=c._dirtyType!==za,a=Dr,f=_o,l=Lr,d=c._updating,p=c._observer;let h=null;if(c._pendingEditorState=null,c._editorState=n,!s&&u&&p!==null){Lr=c,Dr=n,_o=!1,c._updating=!0;try{const x=c._dirtyType,S=c._dirtyElements,E=c._dirtyLeaves;p.disconnect(),h=lM(r,n,c,x,S,E)}catch(x){if(x instanceof Error&&c._onError(x),by)throw x;return lS(c,null,e,n),Wx(c),c._dirtyType=ql,by=!0,Ja(c,r),void(by=!1)}finally{p.observe(e,Xw),c._updating=d,Dr=a,_o=f,Lr=l}}n._readOnly||(n._readOnly=!0);const m=c._dirtyLeaves,g=c._dirtyElements,y=c._normalizedNodes,b=c._updateTags,v=c._deferred;u&&(c._dirtyType=za,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements=new Map,c._normalizedNodes=new Set,c._updateTags=new Set),function(x,S){const E=x._decorators;let O=x._pendingDecorators||E;const j=S._nodeMap;let A;for(A in O)j.has(A)||(O===E&&(O=Qx(x)),delete O[A])}(c,n);const _=s?null:Si(c._window);if(c._editable&&_!==null&&(u||i===null||i.dirty)){Lr=c,Dr=n;try{if(p!==null&&p.disconnect(),u||i===null||i.dirty){const x=c._blockCursorElement;x!==null&&G0(x,c,e),_M(o,i,c,_,b,e)}nM(c,e,i),p!==null&&p.observe(e,Xw)}finally{Lr=l,Dr=a}}h!==null&&function(x,S,E,O,j){const A=Array.from(x._listeners.mutation),T=A.length;for(let I=0;I<T;I++){const[k,$]=A[I],H=S.get($);H!==void 0&&k(H,{dirtyLeaves:O,prevEditorState:j,updateTags:E})}}(c,h,b,m,r),xn(i)||i===null||o!==null&&o.is(i)||c.dispatchCommand(dp,void 0);const w=c._pendingDecorators;w!==null&&(c._decorators=w,c._pendingDecorators=null,cd("decorator",c,!0,w)),function(x,S,E){const O=ew(S),j=ew(E);O!==j&&cd("textcontent",x,!0,j)}(c,t||r,n),cd("update",c,!0,{dirtyElements:g,dirtyLeaves:m,editorState:n,normalizedNodes:y,prevEditorState:t||r,tags:b}),function(x,S){if(x._deferred=[],S.length!==0){const E=x._updating;x._updating=!0;try{for(let O=0;O<S.length;O++)S[O]()}finally{x._updating=E}}}(c,v),function(x){const S=x._updates;if(S.length!==0){const E=S.shift();if(E){const[O,j]=E;oS(x,O,j)}}}(c)}function cd(c,t,n,...e){const s=t._updating;t._updating=n;try{const r=Array.from(t._listeners[c]);for(let o=0;o<r.length;o++)r[o].apply(null,e)}finally{t._updating=s}}function nS(c,t,n){if(c._updating===!1||Lr!==c){let s=!1;return c.update(()=>{s=nS(c,t,n)}),s}const e=U0(c);for(let s=4;s>=0;s--)for(let r=0;r<e.length;r++){const o=e[r]._commands.get(t);if(o!==void 0){const i=o[s];if(i!==void 0){const u=Array.from(i),a=u.length;for(let f=0;f<a;f++)if(u[f](n,c)===!0)return!0}}}return!1}function rS(c,t){const n=c._updates;let e=t||!1;for(;n.length!==0;){const s=n.shift();if(s){const[r,o]=s;let i,u;o!==void 0&&(i=o.onUpdate,u=o.tag,o.skipTransforms&&(e=!0),i&&c._deferred.push(i),u&&c._updateTags.add(u)),r()}}return e}function oS(c,t,n){const e=c._updateTags;let s,r,o=!1,i=!1;n!==void 0&&(s=n.onUpdate,r=n.tag,r!=null&&e.add(r),o=n.skipTransforms||!1,i=n.discrete||!1),s&&c._deferred.push(s);const u=c._editorState;let a=c._pendingEditorState,f=!1;(a===null||a._readOnly)&&(a=c._pendingEditorState=new zp(new Map((a||u)._nodeMap)),f=!0),a._flushSync=i;const l=Dr,d=_o,p=Lr,h=c._updating;Dr=a,_o=!1,c._updating=!0,Lr=c;try{f&&(c._headless?u._selection!==null&&(a._selection=u._selection.clone()):a._selection=function(b){const v=b.getEditorState()._selection,_=Si(b._window);return xn(v)||v==null?my(v,_,b,null):v.clone()}(c));const g=c._compositionKey;t(),o=rS(c,o),function(b,v){const _=v.getEditorState()._selection,w=b._selection;if(xn(w)){const x=w.anchor,S=w.focus;let E;if(x.type==="text"&&(E=x.getNode(),E.selectionTransform(_,w)),S.type==="text"){const O=S.getNode();E!==O&&O.selectionTransform(_,w)}}}(a,c),c._dirtyType!==za&&(o?function(b,v){const _=v._dirtyLeaves,w=b._nodeMap;for(const x of _){const S=w.get(x);on(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&Vx(S)}}(a,c):function(b,v){const _=v._dirtyLeaves,w=v._dirtyElements,x=b._nodeMap,S=Hs(),E=new Map;let O=_,j=O.size,A=w,T=A.size;for(;j>0||T>0;){if(j>0){v._dirtyLeaves=new Set;for(const I of O){const k=x.get(I);on(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&Vx(k),k!==void 0&&eS(k,S)&&Qw(v,k,E),_.add(I)}if(O=v._dirtyLeaves,j=O.size,j>0){Fp++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map;for(const I of A){const k=I[0],$=I[1];if(k!=="root"&&!$)continue;const H=x.get(k);H!==void 0&&eS(H,S)&&Qw(v,H,E),w.set(k,$)}O=v._dirtyLeaves,j=O.size,A=v._dirtyElements,T=A.size,Fp++}v._dirtyLeaves=_,v._dirtyElements=w}(a,c),rS(c),function(b,v,_,w){const x=b._nodeMap,S=v._nodeMap,E=[];for(const[O]of w){const j=S.get(O);j!==void 0&&(j.isAttached()||(Pt(j)&&hw(j,O,x,S,E,w),x.has(O)||w.delete(O),E.push(O)))}for(const O of E)S.delete(O);for(const O of _){const j=S.get(O);j===void 0||j.isAttached()||(x.has(O)||_.delete(O),S.delete(O))}}(u,a,c._dirtyLeaves,c._dirtyElements)),g!==c._compositionKey&&(a._flushSync=!0);const y=a._selection;if(xn(y)){const b=a._nodeMap,v=y.anchor.key,_=y.focus.key;b.get(v)!==void 0&&b.get(_)!==void 0||Xt(19)}else ld(y)&&y._nodes.size===0&&(a._selection=null)}catch(g){return g instanceof Error&&c._onError(g),c._pendingEditorState=u,c._dirtyType=ql,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),void Ja(c)}finally{Dr=l,_o=d,Lr=p,c._updating=h,Fp=0}c._dirtyType!==za||function(g,y){const b=y.getEditorState()._selection,v=g._selection;if(v!==null){if(v.dirty||!v.is(b))return!0}else if(b!==null)return!0;return!1}(a,c)?a._flushSync?(a._flushSync=!1,Ja(c)):f&&JP(()=>{Ja(c)}):(a._flushSync=!1,f&&(e.clear(),c._deferred=[],c._pendingEditorState=null))}function Mo(c,t,n){c._updating?c._updates.push([t,n]):oS(c,t,n)}class iS extends Ip{constructor(t){super(t)}decorate(t,n){Xt(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function fr(c){return c instanceof iS}class $p extends Ip{constructor(t){super(t),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 t=this.getFormat();return FP[t]||""}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=tr()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(on(n)&&t.push(n),Pt(n)){const e=n.getAllTextNodes();t.push(...e)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;Pt(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;Pt(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),e=n.length;if(t>=e){const r=n[e-1];return Pt(r)&&r.getLastDescendant()||r||null}const s=n[t];return Pt(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Vr(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&Xt(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Vr(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&Xt(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let e,s;if(t<n/2){for(e=this.getFirstChild(),s=0;e!==null&&s<=t;){if(s===t)return e;e=e.getNextSibling(),s++}return null}for(e=this.getLastChild(),s=n-1;e!==null&&s>=t;){if(s===t)return e;e=e.getPreviousSibling(),s--}return null}getTextContent(){let t="";const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContent(),Pt(r)&&s!==e-1&&!r.isInline()&&(t+=Qi)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),e=n.length;for(let s=0;s<e;s++){const r=n[s];t+=r.getTextContentSize(),Pt(r)&&s!==e-1&&!r.isInline()&&(t+=Qi.length)}return t}getDirection(){return this.getLatest().__dir}hasFormat(t){if(t!==""){const n=Ux[t];return(this.getFormat()&n)!=0}return!1}select(t,n){co();const e=Vn();let s=t,r=n;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const u=this.getFirstChild();if(on(u)||Pt(u))return u.select(0,0)}else if(!(t!==void 0&&t!==o||n!==void 0&&n!==o)){const u=this.getLastChild();if(on(u)||Pt(u))return u.select()}}s===void 0&&(s=o),r===void 0&&(r=o);const i=this.__key;return xn(e)?(e.anchor.set(i,s,"element"),e.focus.set(i,r,"element"),e.dirty=!0,e):Vw(i,s,i,r,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?Ux[t]:0,this}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,e){const s=e.length,r=this.getChildrenSize(),o=this.getWritable(),i=o.__key,u=[],a=[],f=this.getChildAtIndex(t+n);let l=null,d=r-n+s;if(t!==0)if(t===r)l=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(l=h.getPreviousSibling())}if(n>0){let h=l===null?this.getFirstChild():l.getNextSibling();for(let m=0;m<n;m++){h===null&&Xt(100);const g=h.getNextSibling(),y=h.__key;Ua(h.getWritable()),a.push(y),h=g}}let p=l;for(let h=0;h<s;h++){const m=e[h];p!==null&&m.is(p)&&(l=p=p.getPreviousSibling());const g=m.getWritable();g.__parent===i&&d--,Ua(g);const y=m.__key;if(p===null)o.__first=y,g.__prev=null;else{const b=p.getWritable();b.__next=y,g.__prev=b.__key}m.__key===i&&Xt(76),g.__parent=i,u.push(y),p=m}if(t+n===r)p!==null&&(p.getWritable().__next=null,o.__last=p.__key);else if(f!==null){const h=f.getWritable();if(p!==null){const m=p.getWritable();h.__prev=p.__key,m.__next=f.__key}else h.__prev=null}if(o.__size=d,a.length){const h=Vn();if(xn(h)){const m=new Set(a),g=new Set(u),{anchor:y,focus:b}=h;sS(y,m,g)&&Bp(y,y.getNode(),this,l,f),sS(b,m,g)&&Bp(b,b.getNode(),this,l,f),d!==0||this.canBeEmpty()||Ks(this)||this.remove()}}return o}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,e){return!1}}function Pt(c){return c instanceof $p}function sS(c,t,n){let e=c.getNode();for(;e;){const s=e.__key;if(t.has(s)&&!n.has(s))return!0;e=e.getParent()}return!1}class nc extends $p{static getType(){return"root"}static clone(){return new nc}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Xt(51)}getTextContent(){const t=this.__cachedText;return!tc()&&tr()._dirtyType!==za||t===null?super.getTextContent():t}remove(){Xt(52)}replace(t){Xt(53)}insertBefore(t){Xt(54)}insertAfter(t){Xt(55)}updateDOM(t,n){return!1}append(...t){for(let n=0;n<t.length;n++){const e=t[n];Pt(e)||fr(e)||Xt(56)}return super.append(...t)}static importJSON(t){const n=Po();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Io(c){return c instanceof nc}function _y(){return new zp(new Map([["root",new nc]]))}function aS(c){const t=c.exportJSON(),n=c.constructor;if(t.type!==n.getType()&&Xt(130,n.name),Pt(c)){const e=t.children;Array.isArray(e)||Xt(59,n.name);const s=c.getChildren();for(let r=0;r<s.length;r++){const o=aS(s[r]);e.push(o)}}return t}class zp{constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t){return tS(this,t)}clone(t){const n=new zp(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return tS(this,()=>({root:aS(Po())}))}}class rc extends $p{static getType(){return"paragraph"}static clone(t){return new rc(t.__key)}createDOM(t){const n=document.createElement("p"),e=ed(t.theme,"paragraph");return e!==void 0&&n.classList.add(...e),n}updateDOM(t,n,e){return!1}static importDOM(){return{p:t=>({conversion:OM,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&Op(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s);const r=this.getIndent();r>0&&(n.style.textIndent=20*r+"px")}return{element:n}}static importJSON(t){const n=ns();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(t,n){const e=ns(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=this.getChildren();if(t.length===0||on(t[0])&&t[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 OM(c){const t=ns();if(c.style){t.setFormat(c.style.textAlign);const n=parseInt(c.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function ns(){return td(new rc)}function TM(c){return c instanceof rc}const NM=0,kM=1,AM=2,PM=3,MM=4;function lS(c,t,n,e){const s=c._keyToDOMMap;s.clear(),c._editorState=_y(),c._pendingEditorState=e,c._compositionKey=null,c._dirtyType=za,c._cloneNotNeeded.clear(),c._dirtyLeaves=new Set,c._dirtyElements.clear(),c._normalizedNodes=new Set,c._updateTags=new Set,c._updates=[],c._blockCursorElement=null;const r=c._observer;r!==null&&(r.disconnect(),c._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",s.set("root",n))}function IM(c){const t=c||{},n=CM(),e=t.theme||{},s=c===void 0?n:t.parentEditor||null,r=t.disableEvents||!1,o=_y(),i=t.namespace||(s!==null?s._config.namespace:ow()),u=t.editorState,a=[nc,qa,Xl,Ql,rc,...t.nodes||[]],{onError:f,html:l}=t,d=t.editable===void 0||t.editable;let p;if(c===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let m=0;m<a.length;m++){let g=a[m],y=null,b=null;if(typeof g!="function"){const x=g;g=x.replace,y=x.with,b=x.withKlass||null}const v=g.getType(),_=g.transform(),w=new Set;_!==null&&w.add(_),p.set(v,{exportDOM:l&&l.export?l.export.get(g):void 0,klass:g,replace:y,replaceWithKlass:b,transforms:w})}}const h=new RM(o,s,p,{disableEvents:r,namespace:i,theme:e},f||console.error,function(m,g){const y=new Map,b=new Set,v=_=>{Object.keys(_).forEach(w=>{let x=y.get(w);x===void 0&&(x=[],y.set(w,x)),x.push(_[w])})};return m.forEach(_=>{const w=_.klass.importDOM;if(w==null||b.has(w))return;b.add(w);const x=w.call(_.klass);x!==null&&v(x)}),g&&v(g),y}(p,l?l.import:void 0),d);return u!==void 0&&(h._pendingEditorState=u,h._dirtyType=ql),h}class RM{constructor(t,n,e,s,r,o,i){this._parentEditor=n,this._rootElement=null,this._editorState=t,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=s,this._nodes=e,this._decorators={},this._pendingDecorators=null,this._dirtyType=za,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=ow(),this._onError=r,this._htmlConversions=o,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,e){e===void 0&&Xt(35);const s=this._commands;s.has(t)||s.set(t,[new Set,new Set,new Set,new Set,new Set]);const r=s.get(t);r===void 0&&Xt(36,String(t));const o=r[e];return o.add(n),()=>{o.delete(n),r.every(i=>i.size===0)&&s.delete(t)}}registerMutationListener(t,n){this._nodes.get(t.getType())===void 0&&Xt(37,t.name);const e=this._listeners.mutation;return e.set(n,t),()=>{e.delete(n)}}registerNodeTransformToKlass(t,n){const e=t.getType(),s=this._nodes.get(e);return s===void 0&&Xt(37,t.name),s.transforms.add(n),s}registerNodeTransform(t,n){const e=this.registerNodeTransformToKlass(t,n),s=[e],r=e.replaceWithKlass;if(r!=null){const u=this.registerNodeTransformToKlass(r,n);s.push(u)}var o,i;return o=this,i=t.getType(),Mo(o,()=>{const u=Ci();if(u.isEmpty())return;if(i==="root")return void Po().markDirty();const a=u._nodeMap;for(const[,f]of a)f.markDirty()},o._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{s.forEach(u=>u.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Zt(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const e=ed(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=t,lS(this,n,t,s),n!==null&&(this._config.disableEvents||cM(n),e!=null&&n.classList.remove(...e)),t!==null){const r=function(i){const u=i.ownerDocument;return u&&u.defaultView||null}(t),o=t.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=ql,Wx(this),this._updateTags.add("history-merge"),Ja(this),this._config.disableEvents||function(i,u){const a=i.ownerDocument,f=Mp.get(a);f===void 0&&a.addEventListener("selectionchange",Aw),Mp.set(a,f||1),i.__lexicalEditor=u;const l=kw(i);for(let d=0;d<sy.length;d++){const[p,h]=sy[d],m=typeof h=="function"?g=>{Mw(g)||(Pw(g),(u.isEditable()||p==="click")&&h(g,u))}:g=>{if(!Mw(g)&&(Pw(g),u.isEditable()))switch(p){case"cut":return Zt(u,E0,g);case"copy":return Zt(u,C0,g);case"paste":return Zt(u,_0,g);case"dragstart":return Zt(u,Mx,g);case"dragover":return Zt(u,Ix,g);case"dragend":return Zt(u,Rx,g);case"focus":return Zt(u,jx,g);case"blur":return Zt(u,Dx,g);case"drop":return Zt(u,Px,g)}};i.addEventListener(p,m),l.push(()=>{i.removeEventListener(p,m)})}}(t,this),e!=null&&t.classList.add(...e)}else this._editorState=s,this._pendingEditorState=null,this._window=null;cd("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&Xt(38),Kx(this);const e=this._pendingEditorState,s=this._updateTags,r=n!==void 0?n.tag:null;e===null||e.isEmpty()||(r!=null&&s.add(r),Ja(this)),this._pendingEditorState=t,this._dirtyType=ql,this._dirtyElements.set("root",!1),this._compositionKey=null,r!=null&&s.add(r),Ja(this)}parseEditorState(t,n){return function(e,s,r){const o=_y(),i=Dr,u=_o,a=Lr,f=s._dirtyElements,l=s._dirtyLeaves,d=s._cloneNotNeeded,p=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Dr=o,_o=!1,Lr=s;try{const h=s._nodes;vy(e.root,h),r&&r(),o._readOnly=!0}catch(h){h instanceof Error&&s._onError(h)}finally{s._dirtyElements=f,s._dirtyLeaves=l,s._cloneNotNeeded=d,s._dirtyType=p,Dr=i,_o=u,Lr=a}return o}(typeof t=="string"?JSON.parse(t):t,this,n)}update(t,n){Mo(this,t,n)}focus(t,n={}){const e=this._rootElement;e!==null&&(e.setAttribute("autocapitalize","off"),Mo(this,()=>{const s=Vn(),r=Po();s!==null?s.dirty=!0:r.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?r.selectStart():r.selectEnd())},{onUpdate:()=>{e.removeAttribute("autocapitalize"),t&&t()},tag:"focus"}),this._pendingEditorState===null&&e.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Si(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,cd("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}const jM=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:eM,$applyNodeReplacement:td,$copyNode:pw,$createLineBreakNode:Zl,$createNodeSelection:gy,$createParagraphNode:ns,$createPoint:si,$createRangeSelection:vM,$createTabNode:jp,$createTextNode:zr,$getAdjacentNode:q0,$getCharacterOffsets:hy,$getEditor:iM,$getNearestNodeFromDOMNode:Yu,$getNearestRootOrShadowRoot:fw,$getNodeByKey:Vr,$getPreviousSelection:ec,$getRoot:Po,$getSelection:Vn,$getTextContent:wM,$hasAncestor:Cp,$hasUpdateTag:QP,$insertNodes:xM,$isBlockElementNode:bM,$isDecoratorNode:fr,$isElementNode:Pt,$isInlineElementOrDecoratorNode:tM,$isLeafNode:GP,$isLineBreakNode:Wa,$isNodeSelection:ld,$isParagraphNode:TM,$isRangeSelection:xn,$isRootNode:Io,$isRootOrShadowRoot:Ks,$isTabNode:Fw,$isTextNode:on,$nodesOfType:ZP,$normalizeSelection__EXPERIMENTAL:Gx,$parseSerializedNode:EM,$selectAll:XP,$setCompositionKey:jr,$setSelection:wi,$splitNode:rM,BLUR_COMMAND:Dx,CAN_REDO_COMMAND:kP,CAN_UNDO_COMMAND:AP,CLEAR_EDITOR_COMMAND:TP,CLEAR_HISTORY_COMMAND:NP,CLICK_COMMAND:bx,COMMAND_PRIORITY_CRITICAL:MM,COMMAND_PRIORITY_EDITOR:NM,COMMAND_PRIORITY_HIGH:PM,COMMAND_PRIORITY_LOW:kM,COMMAND_PRIORITY_NORMAL:AM,CONTROLLED_TEXT_INSERTION_COMMAND:Wl,COPY_COMMAND:C0,CUT_COMMAND:E0,DELETE_CHARACTER_COMMAND:Ku,DELETE_LINE_COMMAND:Ju,DELETE_WORD_COMMAND:qu,DRAGEND_COMMAND:Rx,DRAGOVER_COMMAND:Ix,DRAGSTART_COMMAND:Mx,DROP_COMMAND:Px,DecoratorNode:iS,ElementNode:$p,FOCUS_COMMAND:jx,FORMAT_ELEMENT_COMMAND:OP,FORMAT_TEXT_COMMAND:Fs,INDENT_CONTENT_COMMAND:CP,INSERT_LINE_BREAK_COMMAND:Wu,INSERT_PARAGRAPH_COMMAND:v0,INSERT_TAB_COMMAND:SP,KEY_ARROW_DOWN_COMMAND:Ex,KEY_ARROW_LEFT_COMMAND:wx,KEY_ARROW_RIGHT_COMMAND:_x,KEY_ARROW_UP_COMMAND:Cx,KEY_BACKSPACE_COMMAND:Tx,KEY_DELETE_COMMAND:kx,KEY_DOWN_COMMAND:vx,KEY_ENTER_COMMAND:fp,KEY_ESCAPE_COMMAND:Nx,KEY_MODIFIER_COMMAND:Lx,KEY_SPACE_COMMAND:Ox,KEY_TAB_COMMAND:Ax,LineBreakNode:Xl,MOVE_TO_END:xx,MOVE_TO_START:Sx,OUTDENT_CONTENT_COMMAND:EP,PASTE_COMMAND:_0,ParagraphNode:rc,REDO_COMMAND:S0,REMOVE_TEXT_COMMAND:x0,RootNode:nc,SELECTION_CHANGE_COMMAND:dp,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:wP,SELECT_ALL_COMMAND:O0,TabNode:Ql,TextNode:qa,UNDO_COMMAND:w0,createCommand:xP,createEditor:IM,getNearestEditorFromDOMNode:F0,isCurrentlyReadOnlyMode:tc,isHTMLAnchorElement:oM,isHTMLElement:Op,isSelectionCapturedInDecoratorInput:B0,isSelectionWithinEditor:Gu},Symbol.toStringTag,{value:"Module"})),Ft=process.env.NODE_ENV==="development"?_P:jM,DM=Ft.$addUpdateTag,Gr=Ft.$applyNodeReplacement,LM=Ft.$createNodeSelection,An=Ft.$createParagraphNode,Up=Ft.$createPoint,ud=Ft.$createRangeSelection,Hp=Ft.$createTabNode,Ei=Ft.$createTextNode,oc=Ft.$getAdjacentNode,cS=Ft.$getCharacterOffsets,xr=Ft.$getNearestNodeFromDOMNode,Ro=Ft.$getNodeByKey,Ys=Ft.$getPreviousSelection,Un=Ft.$getRoot,st=Ft.$getSelection,uS=Ft.$hasAncestor,dS=Ft.$insertNodes,uo=Ft.$isDecoratorNode,Rt=Ft.$isElementNode,fS=Ft.$isLeafNode,dd=Ft.$isLineBreakNode,fo=Ft.$isNodeSelection,xy=Ft.$isParagraphNode,at=Ft.$isRangeSelection,Xs=Ft.$isRootNode,Uo=Ft.$isRootOrShadowRoot,zt=Ft.$isTextNode,BM=Ft.$nodesOfType,Kp=Ft.$normalizeSelection__EXPERIMENTAL,pS=Ft.$parseSerializedNode,Wp=Ft.$selectAll,kr=Ft.$setSelection,qp=Ft.$splitNode,Oi=Ft.CAN_REDO_COMMAND,Ti=Ft.CAN_UNDO_COMMAND,fd=Ft.CLEAR_EDITOR_COMMAND,hS=Ft.CLEAR_HISTORY_COMMAND,gS=Ft.CLICK_COMMAND,mr=Ft.COMMAND_PRIORITY_CRITICAL,Ct=Ft.COMMAND_PRIORITY_EDITOR,Ho=Ft.COMMAND_PRIORITY_HIGH,ic=Ft.CONTROLLED_TEXT_INSERTION_COMMAND,sc=Ft.COPY_COMMAND,pd=Ft.CUT_COMMAND,Yr=Ft.DELETE_CHARACTER_COMMAND,Zs=Ft.DELETE_LINE_COMMAND,Qs=Ft.DELETE_WORD_COMMAND,mS=Ft.DRAGOVER_COMMAND,Jp=Ft.DRAGSTART_COMMAND,Vp=Ft.DROP_COMMAND,FM=Ft.DecoratorNode,po=Ft.ElementNode,yS=Ft.FOCUS_COMMAND,ea=Ft.FORMAT_ELEMENT_COMMAND,Ni=Ft.FORMAT_TEXT_COMMAND,bS=Ft.INDENT_CONTENT_COMMAND,ta=Ft.INSERT_LINE_BREAK_COMMAND,ac=Ft.INSERT_PARAGRAPH_COMMAND,vS=Ft.INSERT_TAB_COMMAND,Gp=Ft.KEY_ARROW_DOWN_COMMAND,lc=Ft.KEY_ARROW_LEFT_COMMAND,cc=Ft.KEY_ARROW_RIGHT_COMMAND,Yp=Ft.KEY_ARROW_UP_COMMAND,Va=Ft.KEY_BACKSPACE_COMMAND,Ga=Ft.KEY_DELETE_COMMAND,Xp=Ft.KEY_ENTER_COMMAND,hd=Ft.KEY_ESCAPE_COMMAND,_S=Ft.KEY_TAB_COMMAND,$M=Ft.LineBreakNode,Zp=Ft.OUTDENT_CONTENT_COMMAND,gd=Ft.PASTE_COMMAND,zM=Ft.ParagraphNode,Qp=Ft.REDO_COMMAND,eh=Ft.REMOVE_TEXT_COMMAND,UM=Ft.RootNode,ai=Ft.SELECTION_CHANGE_COMMAND,th=Ft.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,nh=Ft.SELECT_ALL_COMMAND,Ya=Ft.TextNode,rh=Ft.UNDO_COMMAND,Xa=Ft.createCommand,wy=Ft.createEditor,xS=Ft.isCurrentlyReadOnlyMode,wS=Ft.isHTMLAnchorElement,SS=Ft.isHTMLElement,CS=Ft.isSelectionCapturedInDecoratorInput,ES=Ft.isSelectionWithinEditor,QF="",OS=St.createContext(null);function HM(c,t){let n=null;c!=null&&(n=c[1]);function e(){return t??(n!=null?n.getTheme():null)}return{getTheme:e}}function KM(){const c=St.useContext(OS);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}const WM=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposerContext:OS,createLexicalComposerContext:HM,useLexicalComposerContext:KM},Symbol.toStringTag,{value:"Module"}));var qM=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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.`)};const TS=St.createContext(null);function JM(c,t){let n=null;return c!=null&&(n=c[1]),{getTheme:function(){return t??(n!=null?n.getTheme():null)}}}function VM(){const c=St.useContext(TS);return c==null&&qM(8),c}const GM=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposerContext:TS,createLexicalComposerContext:JM,useLexicalComposerContext:VM},Symbol.toStringTag,{value:"Module"})),Sy=process.env.NODE_ENV==="development"?WM:GM,Cy=Sy.LexicalComposerContext,NS=Sy.createLexicalComposerContext,pr=Sy.useLexicalComposerContext,kS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var YM=kS?St.useLayoutEffect:St.useEffect;const oh={tag:"history-merge"};function XM({initialConfig:c,children:t}){const n=St.useMemo(()=>{const{theme:e,namespace:s,editor__DEPRECATED:r,nodes:o,onError:i,editorState:u,html:a}=c,f=NS(null,e);let l=r||null;if(l===null){const d=wy({editable:c.editable,html:a,namespace:s,nodes:o,onError:p=>i(p,d),theme:e});ZM(d,u),l=d}return[l,f]},[]);return YM(()=>{const e=c.editable,[s]=n;s.setEditable(e!==void 0?e:!0)},[]),gn.createElement(Cy.Provider,{value:n},t)}function ZM(c,t){if(t!==null){if(t===void 0)c.update(()=>{const n=Un();if(n.isEmpty()){const e=An();n.append(e);const s=kS?document.activeElement:null;(st()!==null||s!==null&&s===c.getRootElement())&&e.select()}},oh);else if(t!==null)switch(typeof t){case"string":{const n=c.parseEditorState(t);c.setEditorState(n,oh);break}case"object":{c.setEditorState(t,oh);break}case"function":{c.update(()=>{Un().isEmpty()&&t(c)},oh);break}}}}const QM=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposer:XM},Symbol.toStringTag,{value:"Module"})),AS=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;var eI=AS?St.useLayoutEffect:St.useEffect;const ih={tag:"history-merge"};function tI({initialConfig:c,children:t}){const n=St.useMemo(()=>{const{theme:e,namespace:s,editor__DEPRECATED:r,nodes:o,onError:i,editorState:u,html:a}=c,f=NS(null,e);let l=r||null;if(l===null){const d=wy({editable:c.editable,html:a,namespace:s,nodes:o,onError:p=>i(p,d),theme:e});(function(p,h){if(h!==null){if(h===void 0)p.update(()=>{const m=Un();if(m.isEmpty()){const g=An();m.append(g);const y=AS?document.activeElement:null;(st()!==null||y!==null&&y===p.getRootElement())&&g.select()}},ih);else if(h!==null)switch(typeof h){case"string":{const m=p.parseEditorState(h);p.setEditorState(m,ih);break}case"object":p.setEditorState(h,ih);break;case"function":p.update(()=>{Un().isEmpty()&&h(p)},ih)}}})(d,u),l=d}return[l,f]},[]);return eI(()=>{const e=c.editable,[s]=n;s.setEditable(e===void 0||e)},[]),gn.createElement(Cy.Provider,{value:n},t)}const nI=Object.freeze(Object.defineProperty({__proto__:null,LexicalComposer:tI},Symbol.toStringTag,{value:"Module"})),PS=(process.env.NODE_ENV==="development"?QM:nI).LexicalComposer;function rI({defaultSelection:c}){const[t]=pr();return St.useEffect(()=>{t.focus(()=>{const n=document.activeElement,e=t.getRootElement();e!==null&&(n===null||!e.contains(n))&&e.focus({preventScroll:!0})},{defaultSelection:c})},[c,t]),null}const oI=Object.freeze(Object.defineProperty({__proto__:null,AutoFocusPlugin:rI},Symbol.toStringTag,{value:"Module"}));function iI({defaultSelection:c}){const[t]=pr();return St.useEffect(()=>{t.focus(()=>{const n=document.activeElement,e=t.getRootElement();e===null||n!==null&&e.contains(n)||e.focus({preventScroll:!0})},{defaultSelection:c})},[c,t]),null}const sI=Object.freeze(Object.defineProperty({__proto__:null,AutoFocusPlugin:iI},Symbol.toStringTag,{value:"Module"})),MS=(process.env.NODE_ENV==="development"?oI:sI).AutoFocusPlugin;function Ey(){return Ey=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Ey.apply(this,arguments)}var aI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function lI({ariaActiveDescendant:c,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:e,ariaExpanded:s,ariaLabel:r,ariaLabelledBy:o,ariaMultiline:i,ariaOwns:u,ariaRequired:a,autoCapitalize:f,className:l,id:d,role:p="textbox",spellCheck:h=!0,style:m,tabIndex:g,"data-testid":y,...b}){const[v]=pr(),[_,w]=St.useState(!1),x=St.useCallback(S=>{S&&S.ownerDocument&&S.ownerDocument.defaultView&&v.setRootElement(S)},[v]);return aI(()=>(w(v.isEditable()),v.registerEditableListener(S=>{w(S)})),[v]),gn.createElement("div",Ey({},b,{"aria-activedescendant":_?c:void 0,"aria-autocomplete":_?t:"none","aria-controls":_?n:void 0,"aria-describedby":e,"aria-expanded":_&&p==="combobox"?!!s:void 0,"aria-label":r,"aria-labelledby":o,"aria-multiline":i,"aria-owns":_?u:void 0,"aria-readonly":_?void 0:!0,"aria-required":a,autoCapitalize:f,className:l,contentEditable:_,"data-testid":y,id:d,ref:x,role:p,spellCheck:h,style:m,tabIndex:g}))}const cI=Object.freeze(Object.defineProperty({__proto__:null,ContentEditable:lI},Symbol.toStringTag,{value:"Module"}));function Oy(){return Oy=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Oy.apply(this,arguments)}var uI=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function dI({ariaActiveDescendant:c,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:e,ariaExpanded:s,ariaLabel:r,ariaLabelledBy:o,ariaMultiline:i,ariaOwns:u,ariaRequired:a,autoCapitalize:f,className:l,id:d,role:p="textbox",spellCheck:h=!0,style:m,tabIndex:g,"data-testid":y,...b}){const[v]=pr(),[_,w]=St.useState(!1),x=St.useCallback(S=>{S&&S.ownerDocument&&S.ownerDocument.defaultView&&v.setRootElement(S)},[v]);return uI(()=>(w(v.isEditable()),v.registerEditableListener(S=>{w(S)})),[v]),gn.createElement("div",Oy({},b,{"aria-activedescendant":_?c:void 0,"aria-autocomplete":_?t:"none","aria-controls":_?n:void 0,"aria-describedby":e,"aria-expanded":_&&p==="combobox"?!!s:void 0,"aria-label":r,"aria-labelledby":o,"aria-multiline":i,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":a,autoCapitalize:f,className:l,contentEditable:_,"data-testid":y,id:d,ref:x,role:p,spellCheck:h,style:m,tabIndex:g}))}const fI=Object.freeze(Object.defineProperty({__proto__:null,ContentEditable:dI},Symbol.toStringTag,{value:"Module"})),IS=(process.env.NODE_ENV==="development"?cI:fI).ContentEditable,sh=new Map;function RS(c){let t=c;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function jS(c){const t=c.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(c)]}function pI(c,t,n,e,s){const r=t.getKey(),o=e.getKey(),i=document.createRange();let u=c.getElementByKey(r),a=c.getElementByKey(o),f=n,l=s;if(zt(t)&&(u=RS(u)),zt(e)&&(a=RS(a)),t===void 0||e===void 0||u===null||a===null)return null;u.nodeName==="BR"&&([u,f]=jS(u)),a.nodeName==="BR"&&([a,l]=jS(a));const d=u.firstChild;u===a&&d!=null&&d.nodeName==="BR"&&f===0&&l===0&&(l=1);try{i.setStart(u,f),i.setEnd(a,l)}catch{return null}return i.collapsed&&(f!==l||r!==o)&&(i.setStart(a,l),i.setEnd(u,f)),i}function hI(c,t){const n=c.getRootElement();if(n===null)return[];const e=n.getBoundingClientRect(),s=getComputedStyle(n),r=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),o=Array.from(t.getClientRects());let i=o.length;o.sort((a,f)=>{const l=a.top-f.top;return Math.abs(l)<=3?a.left-f.left:l});let u;for(let a=0;a<i;a++){const f=o[a],l=u&&u.top<=f.top&&u.top+u.height>f.top&&u.left+u.width>f.left,d=f.width+r===e.width;if(l||d){o.splice(a--,1),i--;continue}u=f}return o}function DS(c){const t={},n=c.split(";");for(const e of n)if(e!==""){const[s,r]=e.split(/:([^]+)/);s&&r&&(t[s.trim()]=r.trim())}return t}function ah(c){let t=sh.get(c);return t===void 0&&(t=DS(c),sh.set(c,t)),Object.freeze(t),t}function gI(c){let t="";for(const n in c)n&&(t+=`${n}: ${c[n]};`);return t}function mI(c,t){return c.__first=t.__first,c.__last=t.__last,c.__size=t.__size,c.__format=t.__format,c.__indent=t.__indent,c.__dir=t.__dir,c}function yI(c,t){return c.__format=t.__format,c.__style=t.__style,c.__mode=t.__mode,c.__detail=t.__detail,c}function bI(c){const n=c.constructor.clone(c);return n.__parent=c.__parent,n.__next=c.__next,n.__prev=c.__prev,Rt(c)&&Rt(n)?mI(n,c):zt(c)&&zt(n)?yI(n,c):n}function vI(c,t){const n=c.getStartEndPoints();if(t.isSelected(c)&&!t.isSegmented()&&!t.isToken()&&n!==null){const[e,s]=n,r=c.isBackward(),o=e.getNode(),i=s.getNode(),u=t.is(o),a=t.is(i);if(u||a){const[f,l]=cS(c),d=o.is(i),p=t.is(r?i:o),h=t.is(r?o:i);let m=0,g;if(d)m=f>l?l:f,g=f>l?f:l;else if(p)m=r?l:f,g=void 0;else if(h){const y=r?f:l;m=0,g=y}return t.__text=t.__text.slice(m,g),t}}return t}function _I(c){if(c.type==="text")return c.offset===c.getNode().getTextContentSize();const t=c.getNode();if(!Rt(t))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return c.offset===t.getChildrenSize()}function xI(c,t,n){let e=t.getNode(),s=n;if(Rt(e)){const r=e.getDescendantByIndex(t.offset);r!==null&&(e=r)}for(;s>0&&e!==null;){if(Rt(e)){const a=e.getLastDescendant();a!==null&&(e=a)}let r=e.getPreviousSibling(),o=0;if(r===null){let a=e.getParentOrThrow(),f=a.getPreviousSibling();for(;f===null;){if(a=a.getParent(),a===null){r=null;break}f=a.getPreviousSibling()}a!==null&&(o=a.isInline()?0:2,r=f)}let i=e.getTextContent();i===""&&Rt(e)&&!e.isInline()&&(i=`
|
|
50
50
|
|
|
51
|
-
`);const u=i.length;if(!zt(e)||s>=u){const a=e.getParent();e.remove(),a!=null&&a.getChildrenSize()===0&&!Xs(a)&&a.remove(),s-=u+o,e=r}else{const a=e.getKey(),f=c.getEditorState().read(()=>{const p=Ro(a);return zt(p)&&p.isSimpleText()?p.getTextContent():null}),l=u-s,d=i.slice(0,l);if(f!==null&&f!==i){const p=Ys();let h=e;if(e.isSimpleText())e.setTextContent(f);else{const m=Ei(f);e.replace(m),h=m}if(at(p)&&p.isCollapsed()){const m=p.anchor.offset;h.select(m,m)}}else if(e.isSimpleText()){const p=t.key===a;let h=t.offset;h<s&&(h=u);const m=p?h-s:0,g=p?h:l;if(p&&m===0){const[y]=e.splitText(m,g);y.remove()}else{const[,y]=e.splitText(m,g);y.remove()}}else{const p=Ei(d);e.replace(p)}s=0}}}function
|
|
51
|
+
`);const u=i.length;if(!zt(e)||s>=u){const a=e.getParent();e.remove(),a!=null&&a.getChildrenSize()===0&&!Xs(a)&&a.remove(),s-=u+o,e=r}else{const a=e.getKey(),f=c.getEditorState().read(()=>{const p=Ro(a);return zt(p)&&p.isSimpleText()?p.getTextContent():null}),l=u-s,d=i.slice(0,l);if(f!==null&&f!==i){const p=Ys();let h=e;if(e.isSimpleText())e.setTextContent(f);else{const m=Ei(f);e.replace(m),h=m}if(at(p)&&p.isCollapsed()){const m=p.anchor.offset;h.select(m,m)}}else if(e.isSimpleText()){const p=t.key===a;let h=t.offset;h<s&&(h=u);const m=p?h-s:0,g=p?h:l;if(p&&m===0){const[y]=e.splitText(m,g);y.remove()}else{const[,y]=e.splitText(m,g);y.remove()}}else{const p=Ei(d);e.replace(p)}s=0}}}function wI(c){const t=c.getStyle(),n=DS(t);sh.set(t,n)}function uc(c,t){const n=ah("getStyle"in c?c.getStyle():c.style),e=Object.entries(t).reduce((r,[o,i])=>(i instanceof Function?r[o]=i(n[o]):i===null?delete r[o]:r[o]=i,r),{...n}),s=gI(e);c.setStyle(s),sh.set(s,e)}function SI(c,t){const n=c.getNodes(),e=n.length,s=c.getStartEndPoints();if(s===null)return;const[r,o]=s,i=e-1;let u=n[0],a=n[i];if(c.isCollapsed()&&at(c)){uc(c,t);return}const l=u.getTextContent().length,d=o.offset;let p=r.offset;const h=r.isBefore(o);let m=h?p:d,g=h?d:p;const y=h?r.type:o.type,b=h?o.type:r.type,v=h?o.key:r.key;if(zt(u)&&m===l){const _=u.getNextSibling();zt(_)&&(p=0,m=0,u=_)}if(n.length===1){if(zt(u)&&u.canHaveFormat()){if(m=y==="element"?0:p>d?d:p,g=b==="element"?l:p>d?p:d,m===g)return;if(m===0&&g===l)uc(u,t),u.select(m,g);else{const _=u.splitText(m,g),w=m===0?_[0]:_[1];uc(w,t),w.select(0,g-m)}}}else{if(zt(u)&&m<u.getTextContentSize()&&u.canHaveFormat()&&(m!==0&&(u=u.splitText(m)[1],m=0,r.set(u.getKey(),m,"text")),uc(u,t)),zt(a)&&a.canHaveFormat()){const w=a.getTextContent().length;a.__key!==v&&g!==0&&(g=w),g!==w&&([a]=a.splitText(g)),(g!==0||b==="element")&&uc(a,t)}for(let _=1;_<i;_++){const w=n[_],x=w.getKey();zt(w)&&w.canHaveFormat()&&x!==u.getKey()&&x!==a.getKey()&&!w.isToken()&&uc(w,t)}}}function CI(c,t){if(c===null)return;const n=c.getStartEndPoints(),e=n?n[0]:null;if(e!==null&&e.key==="root"){const o=t(),i=Un(),u=i.getFirstChild();u?u.replace(o,!0):i.append(o);return}const s=c.getNodes(),r=e!==null?MI(e.getNode(),$S):!1;r&&s.indexOf(r)===-1&&s.push(r);for(let o=0;o<s.length;o++){const i=s[o];if(!$S(i))continue;if(!Rt(i))throw Error("Expected block node to be an ElementNode");const u=t();u.setFormat(i.getFormatType()),u.setIndent(i.getIndent()),i.replace(u,!0)}}function LS(c){return c.getNode().isAttached()}function EI(c){let t=c;for(;t!==null&&!Uo(t);){const n=t.getLatest(),e=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=e}}function OI(c,t,n=null){const e=c.getStartEndPoints(),s=e?e[0]:null,r=c.getNodes(),o=r.length;if(s!==null&&(o===0||o===1&&s.type==="element"&&s.getNode().getChildrenSize()===0)){const a=s.type==="text"?s.getNode().getParentOrThrow():s.getNode(),f=a.getChildren();let l=t();l.setFormat(a.getFormatType()),l.setIndent(a.getIndent()),f.forEach(d=>l.append(d)),n&&(l=n.append(l)),a.replace(l);return}let i=null,u=[];for(let a=0;a<o;a++){const f=r[a];Uo(f)?(Ty(c,u,u.length,t,n),u=[],i=f):i===null||i!==null&&uS(f,i)?u.push(f):(Ty(c,u,u.length,t,n),u=[f])}Ty(c,u,u.length,t,n)}function Ty(c,t,n,e,s=null){if(t.length===0)return;const r=t[0],o=new Map,i=[];let u=Rt(r)?r:r.getParentOrThrow();u.isInline()&&(u=u.getParentOrThrow());let a=!1;for(;u!==null;){const h=u.getPreviousSibling();if(h!==null){u=h,a=!0;break}if(u=u.getParentOrThrow(),Uo(u))break}const f=new Set;for(let h=0;h<n;h++){const m=t[h];Rt(m)&&m.getChildrenSize()===0&&f.add(m.getKey())}const l=new Set;for(let h=0;h<n;h++){const m=t[h];let g=m.getParent();if(g!==null&&g.isInline()&&(g=g.getParent()),g!==null&&fS(m)&&!l.has(m.getKey())){const y=g.getKey();if(o.get(y)===void 0){const b=e();b.setFormat(g.getFormatType()),b.setIndent(g.getIndent()),i.push(b),o.set(y,b),g.getChildren().forEach(v=>{b.append(v),l.add(v.getKey()),Rt(v)&&v.getChildrenKeys().forEach(_=>l.add(_))}),EI(g)}}else if(f.has(m.getKey())){if(!Rt(m))throw Error("Expected node in emptyElements to be an ElementNode");const y=e();y.setFormat(m.getFormatType()),y.setIndent(m.getIndent()),i.push(y),m.remove(!0)}}if(s!==null)for(let h=0;h<i.length;h++){const m=i[h];s.append(m)}let d=null;if(Uo(u))if(a)if(s!==null)u.insertAfter(s);else for(let h=i.length-1;h>=0;h--){const m=i[h];u.insertAfter(m)}else{const h=u.getFirstChild();if(Rt(h)&&(u=h),h===null)if(s)u.append(s);else for(let m=0;m<i.length;m++){const g=i[m];u.append(g),d=g}else if(s!==null)h.insertBefore(s);else for(let m=0;m<i.length;m++){const g=i[m];h.insertBefore(g),d=g}}else if(s)u.insertAfter(s);else for(let h=i.length-1;h>=0;h--){const m=i[h];u.insertAfter(m),d=m}const p=Ys();at(p)&&LS(p.anchor)&&LS(p.focus)?kr(p.clone()):d!==null?d.selectEnd():c.dirty=!0}function TI(c,t){const n=oc(c.focus,t);return uo(n)&&!n.isIsolated()||Rt(n)&&!n.isInline()&&!n.canBeEmpty()}function BS(c,t,n,e){c.modify(t?"extend":"move",n,e)}function FS(c){const t=c.anchor.getNode();return(Xs(t)?t:t.getParentOrThrow()).getDirection()==="rtl"}function NI(c,t,n){const e=FS(c);BS(c,t,n?!e:e,"character")}function kI(c){const t=c.anchor,n=c.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let o=r.getFirstDescendant(),i=r.getLastDescendant(),u="element",a="element",f=0;zt(o)?u="text":!Rt(o)&&o!==null&&(o=o.getParentOrThrow()),zt(i)?(a="text",f=i.getTextContentSize()):!Rt(i)&&i!==null&&(i=i.getParentOrThrow()),o&&i&&(t.set(o.getKey(),0,u),n.set(i.getKey(),f,a))}function AI(c,t,n){const e=c.getStyle(),s=ah(e);return s!==null&&s[t]||n}function PI(c,t,n=""){let e=null;const s=c.getNodes(),r=c.anchor,o=c.focus,i=c.isBackward(),u=i?o.offset:r.offset,a=i?o.getNode():r.getNode();if(c.isCollapsed()&&c.style!==""){const f=c.style,l=ah(f);if(l!==null&&t in l)return l[t]}for(let f=0;f<s.length;f++){const l=s[f];if(!(f!==0&&u===0&&l.is(a))&&zt(l)){const d=AI(l,t,n);if(e===null)e=d;else if(e!==d){e="";break}}}return e===null?n:e}function $S(c){if(uo(c)||!Rt(c)||Uo(c))return!1;const t=c.getFirstChild(),n=t===null||dd(t)||zt(t)||t.isInline();return!c.isInline()&&c.canBeEmpty()!==!1&&n}function MI(c,t){let n=c;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const II=Object.freeze(Object.defineProperty({__proto__:null,$addNodeStyle:wI,$cloneWithProperties:bI,$getSelectionStyleValueForProperty:PI,$isAtNodeEnd:_I,$isParentElementRTL:FS,$moveCaretSelection:BS,$moveCharacter:NI,$patchStyleText:SI,$selectAll:kI,$setBlocksType:CI,$shouldOverrideDefaultCharacterSelection:TI,$sliceSelectedTextNodeContent:vI,$wrapNodes:OI,createDOMRange:pI,createRectsFromDOMRange:hI,getStyleObjectFromCSS:ah,trimTextContentFromAnchor:xI},Symbol.toStringTag,{value:"Module"})),lh=new Map;function zS(c){let t=c;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function US(c){const t=c.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(c)]}function RI(c,t,n,e,s){const r=t.getKey(),o=e.getKey(),i=document.createRange();let u=c.getElementByKey(r),a=c.getElementByKey(o),f=n,l=s;if(zt(t)&&(u=zS(u)),zt(e)&&(a=zS(a)),t===void 0||e===void 0||u===null||a===null)return null;u.nodeName==="BR"&&([u,f]=US(u)),a.nodeName==="BR"&&([a,l]=US(a));const d=u.firstChild;u===a&&d!=null&&d.nodeName==="BR"&&f===0&&l===0&&(l=1);try{i.setStart(u,f),i.setEnd(a,l)}catch{return null}return!i.collapsed||f===l&&r===o||(i.setStart(a,l),i.setEnd(u,f)),i}function jI(c,t){const n=c.getRootElement();if(n===null)return[];const e=n.getBoundingClientRect(),s=getComputedStyle(n),r=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),o=Array.from(t.getClientRects());let i,u=o.length;o.sort((a,f)=>{const l=a.top-f.top;return Math.abs(l)<=3?a.left-f.left:l});for(let a=0;a<u;a++){const f=o[a],l=i&&i.top<=f.top&&i.top+i.height>f.top&&i.left+i.width>f.left,d=f.width+r===e.width;l||d?(o.splice(a--,1),u--):i=f}return o}function HS(c){const t={},n=c.split(";");for(const e of n)if(e!==""){const[s,r]=e.split(/:([^]+)/);s&&r&&(t[s.trim()]=r.trim())}return t}function ch(c){let t=lh.get(c);return t===void 0&&(t=HS(c),lh.set(c,t)),t}function DI(c){const t=c.constructor.clone(c);return t.__parent=c.__parent,t.__next=c.__next,t.__prev=c.__prev,Rt(c)&&Rt(t)?(e=c,(n=t).__first=e.__first,n.__last=e.__last,n.__size=e.__size,n.__format=e.__format,n.__indent=e.__indent,n.__dir=e.__dir,n):zt(c)&&zt(t)?function(s,r){return s.__format=r.__format,s.__style=r.__style,s.__mode=r.__mode,s.__detail=r.__detail,s}(t,c):t;var n,e}function LI(c,t){const n=c.getStartEndPoints();if(t.isSelected(c)&&!t.isSegmented()&&!t.isToken()&&n!==null){const[e,s]=n,r=c.isBackward(),o=e.getNode(),i=s.getNode(),u=t.is(o),a=t.is(i);if(u||a){const[f,l]=cS(c),d=o.is(i),p=t.is(r?i:o),h=t.is(r?o:i);let m,g=0;return d?(g=f>l?l:f,m=f>l?f:l):p?(g=r?l:f,m=void 0):h&&(g=0,m=r?f:l),t.__text=t.__text.slice(g,m),t}}return t}function BI(c){if(c.type==="text")return c.offset===c.getNode().getTextContentSize();const t=c.getNode();if(!Rt(t))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return c.offset===t.getChildrenSize()}function FI(c,t,n){let e=t.getNode(),s=n;if(Rt(e)){const r=e.getDescendantByIndex(t.offset);r!==null&&(e=r)}for(;s>0&&e!==null;){if(Rt(e)){const a=e.getLastDescendant();a!==null&&(e=a)}let r=e.getPreviousSibling(),o=0;if(r===null){let a=e.getParentOrThrow(),f=a.getPreviousSibling();for(;f===null;){if(a=a.getParent(),a===null){r=null;break}f=a.getPreviousSibling()}a!==null&&(o=a.isInline()?0:2,r=f)}let i=e.getTextContent();i===""&&Rt(e)&&!e.isInline()&&(i=`
|
|
52
52
|
|
|
53
|
-
`);const u=i.length;if(!zt(e)||s>=u){const a=e.getParent();e.remove(),a==null||a.getChildrenSize()!==0||Xs(a)||a.remove(),s-=u+o,e=r}else{const a=e.getKey(),f=c.getEditorState().read(()=>{const p=Ro(a);return zt(p)&&p.isSimpleText()?p.getTextContent():null}),l=u-s,d=i.slice(0,l);if(f!==null&&f!==i){const p=Ys();let h=e;if(e.isSimpleText())e.setTextContent(f);else{const m=Ei(f);e.replace(m),h=m}if(at(p)&&p.isCollapsed()){const m=p.anchor.offset;h.select(m,m)}}else if(e.isSimpleText()){const p=t.key===a;let h=t.offset;h<s&&(h=u);const m=p?h-s:0,g=p?h:l;if(p&&m===0){const[y]=e.splitText(m,g);y.remove()}else{const[,y]=e.splitText(m,g);y.remove()}}else{const p=Ei(d);e.replace(p)}s=0}}}function zI(c){const t=c.getStyle(),n=KS(t);lh.set(t,n)}function dc(c,t){const n=ch("getStyle"in c?c.getStyle():c.style),e=Object.entries(t).reduce((r,[o,i])=>(i instanceof Function?r[o]=i(n[o]):i===null?delete r[o]:r[o]=i,r),{...n}),s=function(r){let o="";for(const i in r)i&&(o+=`${i}: ${r[i]};`);return o}(e);c.setStyle(s),lh.set(s,e)}function UI(c,t){const n=c.getNodes(),e=n.length,s=c.getStartEndPoints();if(s===null)return;const[r,o]=s,i=e-1;let u=n[0],a=n[i];if(c.isCollapsed()&&at(c))return void dc(c,t);const f=u.getTextContent().length,l=o.offset;let d=r.offset;const p=r.isBefore(o);let h=p?d:l,m=p?l:d;const g=p?r.type:o.type,y=p?o.type:r.type,b=p?o.key:r.key;if(zt(u)&&h===f){const v=u.getNextSibling();zt(v)&&(d=0,h=0,u=v)}if(n.length===1){if(zt(u)&&u.canHaveFormat()){if(h=g==="element"?0:d>l?l:d,m=y==="element"?f:d>l?d:l,h===m)return;if(h===0&&m===f)dc(u,t),u.select(h,m);else{const v=u.splitText(h,m),_=h===0?v[0]:v[1];dc(_,t),_.select(0,m-h)}}}else{if(zt(u)&&h<u.getTextContentSize()&&u.canHaveFormat()&&(h!==0&&(u=u.splitText(h)[1],h=0,r.set(u.getKey(),h,"text")),dc(u,t)),zt(a)&&a.canHaveFormat()){const v=a.getTextContent().length;a.__key!==b&&m!==0&&(m=v),m!==v&&([a]=a.splitText(m)),m===0&&y!=="element"||dc(a,t)}for(let v=1;v<i;v++){const _=n[v],w=_.getKey();zt(_)&&_.canHaveFormat()&&w!==u.getKey()&&w!==a.getKey()&&!_.isToken()&&dc(_,t)}}}function HI(c,t){if(c===null)return;const n=c.getStartEndPoints(),e=n?n[0]:null;if(e!==null&&e.key==="root"){const o=t(),i=Un(),u=i.getFirstChild();return void(u?u.replace(o,!0):i.append(o))}const s=c.getNodes(),r=e!==null&&function(o,i){let u=o;for(;u!==null&&u.getParent()!==null&&!i(u);)u=u.getParentOrThrow();return i(u)?u:null}(e.getNode(),VS);r&&s.indexOf(r)===-1&&s.push(r);for(let o=0;o<s.length;o++){const i=s[o];if(!VS(i))continue;if(!Rt(i))throw Error("Expected block node to be an ElementNode");const u=t();u.setFormat(i.getFormatType()),u.setIndent(i.getIndent()),i.replace(u,!0)}}function WS(c){return c.getNode().isAttached()}function KI(c){let t=c;for(;t!==null&&!Uo(t);){const n=t.getLatest(),e=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=e}}function WI(c,t,n=null){const e=c.getStartEndPoints(),s=e?e[0]:null,r=c.getNodes(),o=r.length;if(s!==null&&(o===0||o===1&&s.type==="element"&&s.getNode().getChildrenSize()===0)){const a=s.type==="text"?s.getNode().getParentOrThrow():s.getNode(),f=a.getChildren();let l=t();return l.setFormat(a.getFormatType()),l.setIndent(a.getIndent()),f.forEach(d=>l.append(d)),n&&(l=n.append(l)),void a.replace(l)}let i=null,u=[];for(let a=0;a<o;a++){const f=r[a];Uo(f)?(Ny(c,u,u.length,t,n),u=[],i=f):i===null||i!==null&&dS(f,i)?u.push(f):(Ny(c,u,u.length,t,n),u=[f])}Ny(c,u,u.length,t,n)}function Ny(c,t,n,e,s=null){if(t.length===0)return;const r=t[0],o=new Map,i=[];let u=Rt(r)?r:r.getParentOrThrow();u.isInline()&&(u=u.getParentOrThrow());let a=!1;for(;u!==null;){const h=u.getPreviousSibling();if(h!==null){u=h,a=!0;break}if(u=u.getParentOrThrow(),Uo(u))break}const f=new Set;for(let h=0;h<n;h++){const m=t[h];Rt(m)&&m.getChildrenSize()===0&&f.add(m.getKey())}const l=new Set;for(let h=0;h<n;h++){const m=t[h];let g=m.getParent();if(g!==null&&g.isInline()&&(g=g.getParent()),g!==null&&pS(m)&&!l.has(m.getKey())){const y=g.getKey();if(o.get(y)===void 0){const b=e();b.setFormat(g.getFormatType()),b.setIndent(g.getIndent()),i.push(b),o.set(y,b),g.getChildren().forEach(v=>{b.append(v),l.add(v.getKey()),Rt(v)&&v.getChildrenKeys().forEach(_=>l.add(_))}),KI(g)}}else if(f.has(m.getKey())){if(!Rt(m))throw Error("Expected node in emptyElements to be an ElementNode");const y=e();y.setFormat(m.getFormatType()),y.setIndent(m.getIndent()),i.push(y),m.remove(!0)}}if(s!==null)for(let h=0;h<i.length;h++){const m=i[h];s.append(m)}let d=null;if(Uo(u))if(a)if(s!==null)u.insertAfter(s);else for(let h=i.length-1;h>=0;h--){const m=i[h];u.insertAfter(m)}else{const h=u.getFirstChild();if(Rt(h)&&(u=h),h===null)if(s)u.append(s);else for(let m=0;m<i.length;m++){const g=i[m];u.append(g),d=g}else if(s!==null)h.insertBefore(s);else for(let m=0;m<i.length;m++){const g=i[m];h.insertBefore(g),d=g}}else if(s)u.insertAfter(s);else for(let h=i.length-1;h>=0;h--){const m=i[h];u.insertAfter(m),d=m}const p=Ys();at(p)&&WS(p.anchor)&&WS(p.focus)?kr(p.clone()):d!==null?d.selectEnd():c.dirty=!0}function qI(c,t){const n=oc(c.focus,t);return uo(n)&&!n.isIsolated()||Rt(n)&&!n.isInline()&&!n.canBeEmpty()}function qS(c,t,n,e){c.modify(t?"extend":"move",n,e)}function JS(c){const t=c.anchor.getNode();return(Xs(t)?t:t.getParentOrThrow()).getDirection()==="rtl"}function JI(c,t,n){const e=JS(c);qS(c,t,n?!e:e,"character")}function VI(c){const t=c.anchor,n=c.focus,e=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let s=e.getFirstDescendant(),r=e.getLastDescendant(),o="element",i="element",u=0;zt(s)?o="text":Rt(s)||s===null||(s=s.getParentOrThrow()),zt(r)?(i="text",u=r.getTextContentSize()):Rt(r)||r===null||(r=r.getParentOrThrow()),s&&r&&(t.set(s.getKey(),0,o),n.set(r.getKey(),u,i))}function GI(c,t,n){const e=ch(c.getStyle());return e!==null&&e[t]||n}function YI(c,t,n=""){let e=null;const s=c.getNodes(),r=c.anchor,o=c.focus,i=c.isBackward(),u=i?o.offset:r.offset,a=i?o.getNode():r.getNode();if(c.isCollapsed()&&c.style!==""){const f=ch(c.style);if(f!==null&&t in f)return f[t]}for(let f=0;f<s.length;f++){const l=s[f];if((f===0||u!==0||!l.is(a))&&zt(l)){const d=GI(l,t,n);if(e===null)e=d;else if(e!==d){e="";break}}}return e===null?n:e}function VS(c){if(uo(c)||!Rt(c)||Uo(c))return!1;const t=c.getFirstChild(),n=t===null||dd(t)||zt(t)||t.isInline();return!c.isInline()&&c.canBeEmpty()!==!1&&n}const XI=Object.freeze(Object.defineProperty({__proto__:null,$addNodeStyle:zI,$cloneWithProperties:LI,$getSelectionStyleValueForProperty:YI,$isAtNodeEnd:FI,$isParentElementRTL:JS,$moveCaretSelection:qS,$moveCharacter:JI,$patchStyleText:UI,$selectAll:VI,$setBlocksType:HI,$shouldOverrideDefaultCharacterSelection:qI,$sliceSelectedTextNodeContent:BI,$wrapNodes:WI,createDOMRange:jI,createRectsFromDOMRange:DI,getStyleObjectFromCSS:ch,trimTextContentFromAnchor:$I},Symbol.toStringTag,{value:"Module"})),rs=process.env.NODE_ENV==="development"?RI:XI,GS=rs.$addNodeStyle,fc=rs.$cloneWithProperties,YS=rs.$getSelectionStyleValueForProperty,na=rs.$moveCharacter,XS=rs.$patchStyleText,ra=rs.$shouldOverrideDefaultCharacterSelection,uh=rs.$sliceSelectedTextNodeContent,ZI=rs.createDOMRange,ky=rs.createRectsFromDOMRange;function ZS(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function QS(...c){return()=>{c.forEach(t=>t())}}function ki(c){return`${c}px`}const QI={attributes:!0,characterData:!0,childList:!0,subtree:!0};function eC(c,t,n){let e=null,s=null,r=null,o=[];const i=document.createElement("div");function u(){if(e===null)throw Error("Unexpected null rootDOMNode");if(s===null)throw Error("Unexpected null parentDOMNode");const{left:d,top:p}=e.getBoundingClientRect(),h=s,m=ky(c,t);i.isConnected||h.append(i);let g=!1;for(let y=0;y<m.length;y++){const b=m[y],v=o[y]||document.createElement("div"),_=v.style;_.position!=="absolute"&&(_.position="absolute",g=!0);const w=ki(b.left-d);_.left!==w&&(_.left=w,g=!0);const x=ki(b.top-p);_.top!==x&&(v.style.top=x,g=!0);const S=ki(b.width);_.width!==S&&(v.style.width=S,g=!0);const E=ki(b.height);_.height!==E&&(v.style.height=E,g=!0),v.parentNode!==i&&(i.append(v),g=!0),o[y]=v}for(;o.length>m.length;)o.pop();g&&n(o)}function a(){s=null,e=null,r!==null&&r.disconnect(),r=null,i.remove();for(const d of o)d.remove();o=[]}function f(){const d=c.getRootElement();if(d===null)return a();const p=d.parentElement;if(!(p instanceof HTMLElement))return a();a(),e=d,s=p,r=new MutationObserver(h=>{const m=c.getRootElement(),g=m&&m.parentElement;if(m!==e||g!==s)return f();for(const y of h)if(!i.contains(y.target))return u()}),r.observe(p,QI),u()}const l=c.registerRootListener(f);return()=>{l(),a()}}function e5(c,t){let n=null,e=null,s=null,r=null,o=()=>{};function i(u){u.read(()=>{const a=st();if(!at(a)){n=null,e=null,s=null,r=null,o(),o=()=>{};return}const{anchor:f,focus:l}=a,d=f.getNode(),p=d.getKey(),h=f.offset,m=l.getNode(),g=m.getKey(),y=l.offset,b=c.getElementByKey(p),v=c.getElementByKey(g),_=n===null||b===null||h!==e||p!==n.getKey()||d!==n&&(!(n instanceof Ya)||d.updateDOM(n,b,c._config)),w=s===null||v===null||y!==r||g!==s.getKey()||m!==s&&(!(s instanceof Ya)||m.updateDOM(s,v,c._config));if(_||w){const x=c.getElementByKey(f.getNode().getKey()),S=c.getElementByKey(l.getNode().getKey());if(x!==null&&S!==null&&x.tagName==="SPAN"&&S.tagName==="SPAN"){const E=document.createRange();let O,j,A,T;l.isBefore(f)?(O=S,j=l.offset,A=x,T=f.offset):(O=x,j=f.offset,A=S,T=l.offset);const I=O.firstChild;if(I===null)throw Error("Expected text node to be first child of span");const k=A.firstChild;if(k===null)throw Error("Expected text node to be first child of span");E.setStart(I,j),E.setEnd(k,T),o(),o=eC(c,E,$=>{for(const H of $){const U=H.style;U.background!=="Highlight"&&(U.background="Highlight"),U.color!=="HighlightText"&&(U.color="HighlightText"),U.zIndex!=="-1"&&(U.zIndex="-1"),U.pointerEvents!=="none"&&(U.pointerEvents="none"),U.marginTop!==ki(-1.5)&&(U.marginTop=ki(-1.5)),U.paddingTop!==ki(4)&&(U.paddingTop=ki(4)),U.paddingBottom!==ki(0)&&(U.paddingBottom=ki(0))}t!==void 0&&t($)})}}n=d,e=h,s=m,r=y})}return i(c.getEditorState()),QS(c.registerUpdateListener(({editorState:u})=>i(u)),o,()=>{o()})}function t5(c,...t){const n=ZS(...t);n.length>0&&c.classList.add(...n)}function n5(c,...t){const n=ZS(...t);n.length>0&&c.classList.remove(...n)}function tC(c,t){for(const n of t)if(c.type.startsWith(n))return!0;return!1}function r5(c,t){const n=c[Symbol.iterator]();return new Promise((e,s)=>{const r=[],o=()=>{const{done:i,value:u}=n.next();if(i)return e(r);const a=new FileReader;a.addEventListener("error",s),a.addEventListener("load",()=>{const f=a.result;typeof f=="string"&&r.push({file:u,result:f}),o()}),tC(u,t)?a.readAsDataURL(u):o()};o()})}function o5(c,t){const n=[],e=(c||Un()).getLatest(),s=t||(Rt(e)?e.getLastDescendant():e);let r=e,o=i5(r);for(;r!==null&&!r.is(s);)if(n.push({depth:o,node:r}),Rt(r)&&r.getChildrenSize()>0)r=r.getFirstChild(),o++;else{let i=null;for(;i===null&&r!==null;)i=r.getNextSibling(),i===null?(r=r.getParent(),o--):r=i}return r!==null&&r.is(s)&&n.push({depth:o,node:r}),n}function i5(c){let t=c,n=0;for(;(t=t.getParent())!==null;)n++;return n}function s5(c,t){let n=c;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function a5(c){const t=nC(c,n=>Rt(n)&&!n.isInline());if(!Rt(t))throw Error(`Expected node ${c.__key} to have closest block element node.`);return t}const nC=(c,t)=>{let n=c;for(;n!==Un()&&n!=null;){if(t(n))return n;n=n.getParent()}return null};function l5(c,t,n,e){const s=i=>i instanceof t,r=i=>{const u=i.getChildren();for(let l=0;l<u.length;l++){const d=u[l];if(s(d))return null}let a=i,f=i;for(;a!==null;)if(f=a,a=a.getParent(),s(a))return{child:f,parent:a};return null},o=i=>{const u=r(i);if(u!==null){const{child:a,parent:f}=u;if(a.is(i)){e(f,i);const l=a.getNextSiblings(),d=l.length;if(f.insertAfter(a),d!==0){const p=n(f);a.insertAfter(p);for(let h=0;h<d;h++)p.append(l[h])}!f.canBeEmpty()&&f.getChildrenSize()===0&&f.remove()}}};return c.registerNodeTransform(t,o)}function c5(c,t){const e=new Map,s=c._pendingEditorState;for(const[o,i]of t._nodeMap){const u=fc(i);if(zt(u)){if(!zt(i))throw Error("Expected node be a TextNode");u.__text=i.__text}e.set(o,u)}s&&(s._nodeMap=e),c._dirtyType=2;const r=t._selection;kr(r===null?null:r.clone())}function u5(c){const t=st()||Ys();if(at(t)){const{focus:n}=t,e=n.getNode(),s=n.offset;if(Uo(e)){const r=e.getChildAtIndex(s);r==null?e.append(c):r.insertBefore(c),c.selectNext()}else{let r,o;zt(e)?(r=e.getParentOrThrow(),o=e.getIndexWithinParent(),s>0&&(o+=1,e.splitText(s))):(r=e,o=s);const[,i]=qp(r,o);i.insertBefore(c),i.selectStart()}}else{if(t!=null){const e=t.getNodes();e[e.length-1].getTopLevelElementOrThrow().insertAfter(c)}else Un().append(c);const n=An();c.insertAfter(n),n.select()}return c.getLatest()}function d5(c,t){const n=t();return c.replace(n),n.append(c),n}function f5(c,t){return c!==null?Object.getPrototypeOf(c).constructor.name===t.name:!1}function p5(c,t){const n=[];for(let e=0;e<c.length;e++){const s=t(c[e]);s!==null&&n.push(s)}return n}function h5(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}const g5=Object.freeze(Object.defineProperty({__proto__:null,$dfs:o5,$filter:p5,$findMatchingParent:nC,$getNearestBlockElementAncestorOrThrow:a5,$getNearestNodeOfType:s5,$insertFirst:h5,$insertNodeToNearestRoot:u5,$restoreEditorState:c5,$splitNode:qp,$wrapNodeInElement:d5,addClassNamesToElement:t5,isHTMLAnchorElement:SS,isHTMLElement:CS,isMimeType:tC,markSelection:e5,mediaFileReader:r5,mergeRegister:QS,objectKlassEquals:f5,positionNodeOnRange:eC,registerNestedElementResolver:l5,removeClassNamesFromElement:n5},Symbol.toStringTag,{value:"Module"}));var m5=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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 rC(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function oC(...c){return()=>{c.forEach(t=>t())}}function Ai(c){return`${c}px`}const y5={attributes:!0,characterData:!0,childList:!0,subtree:!0};function iC(c,t,n){let e=null,s=null,r=null,o=[];const i=document.createElement("div");function u(){if(e===null)throw Error("Unexpected null rootDOMNode");if(s===null)throw Error("Unexpected null parentDOMNode");const{left:l,top:d}=e.getBoundingClientRect(),p=s,h=ky(c,t);i.isConnected||p.append(i);let m=!1;for(let g=0;g<h.length;g++){const y=h[g],b=o[g]||document.createElement("div"),v=b.style;v.position!=="absolute"&&(v.position="absolute",m=!0);const _=Ai(y.left-l);v.left!==_&&(v.left=_,m=!0);const w=Ai(y.top-d);v.top!==w&&(b.style.top=w,m=!0);const x=Ai(y.width);v.width!==x&&(b.style.width=x,m=!0);const S=Ai(y.height);v.height!==S&&(b.style.height=S,m=!0),b.parentNode!==i&&(i.append(b),m=!0),o[g]=b}for(;o.length>h.length;)o.pop();m&&n(o)}function a(){s=null,e=null,r!==null&&r.disconnect(),r=null,i.remove();for(const l of o)l.remove();o=[]}const f=c.registerRootListener(function l(){const d=c.getRootElement();if(d===null)return a();const p=d.parentElement;if(!(p instanceof HTMLElement))return a();a(),e=d,s=p,r=new MutationObserver(h=>{const m=c.getRootElement(),g=m&&m.parentElement;if(m!==e||g!==s)return l();for(const y of h)if(!i.contains(y.target))return u()}),r.observe(p,y5),u()});return()=>{f(),a()}}function b5(c,t){let n=null,e=null,s=null,r=null,o=()=>{};function i(u){u.read(()=>{const a=st();if(!at(a))return n=null,e=null,s=null,r=null,o(),void(o=()=>{});const{anchor:f,focus:l}=a,d=f.getNode(),p=d.getKey(),h=f.offset,m=l.getNode(),g=m.getKey(),y=l.offset,b=c.getElementByKey(p),v=c.getElementByKey(g),_=n===null||b===null||h!==e||p!==n.getKey()||d!==n&&(!(n instanceof Ya)||d.updateDOM(n,b,c._config)),w=s===null||v===null||y!==r||g!==s.getKey()||m!==s&&(!(s instanceof Ya)||m.updateDOM(s,v,c._config));if(_||w){const x=c.getElementByKey(f.getNode().getKey()),S=c.getElementByKey(l.getNode().getKey());if(x!==null&&S!==null&&x.tagName==="SPAN"&&S.tagName==="SPAN"){const E=document.createRange();let O,j,A,T;l.isBefore(f)?(O=S,j=l.offset,A=x,T=f.offset):(O=x,j=f.offset,A=S,T=l.offset);const I=O.firstChild;if(I===null)throw Error("Expected text node to be first child of span");const k=A.firstChild;if(k===null)throw Error("Expected text node to be first child of span");E.setStart(I,j),E.setEnd(k,T),o(),o=iC(c,E,$=>{for(const H of $){const U=H.style;U.background!=="Highlight"&&(U.background="Highlight"),U.color!=="HighlightText"&&(U.color="HighlightText"),U.zIndex!=="-1"&&(U.zIndex="-1"),U.pointerEvents!=="none"&&(U.pointerEvents="none"),U.marginTop!==Ai(-1.5)&&(U.marginTop=Ai(-1.5)),U.paddingTop!==Ai(4)&&(U.paddingTop=Ai(4)),U.paddingBottom!==Ai(0)&&(U.paddingBottom=Ai(0))}t!==void 0&&t($)})}}n=d,e=h,s=m,r=y})}return i(c.getEditorState()),oC(c.registerUpdateListener(({editorState:u})=>i(u)),o,()=>{o()})}function v5(c,...t){const n=rC(...t);n.length>0&&c.classList.add(...n)}function _5(c,...t){const n=rC(...t);n.length>0&&c.classList.remove(...n)}function sC(c,t){for(const n of t)if(c.type.startsWith(n))return!0;return!1}function x5(c,t){const n=c[Symbol.iterator]();return new Promise((e,s)=>{const r=[],o=()=>{const{done:i,value:u}=n.next();if(i)return e(r);const a=new FileReader;a.addEventListener("error",s),a.addEventListener("load",()=>{const f=a.result;typeof f=="string"&&r.push({file:u,result:f}),o()}),sC(u,t)?a.readAsDataURL(u):o()};o()})}function w5(c,t){const n=[],e=(c||Un()).getLatest(),s=t||(Rt(e)?e.getLastDescendant():e);let r=e,o=function(i){let u=i,a=0;for(;(u=u.getParent())!==null;)a++;return a}(r);for(;r!==null&&!r.is(s);)if(n.push({depth:o,node:r}),Rt(r)&&r.getChildrenSize()>0)r=r.getFirstChild(),o++;else{let i=null;for(;i===null&&r!==null;)i=r.getNextSibling(),i===null?(r=r.getParent(),o--):r=i}return r!==null&&r.is(s)&&n.push({depth:o,node:r}),n}function S5(c,t){let n=c;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function C5(c){const t=aC(c,n=>Rt(n)&&!n.isInline());return Rt(t)||m5(4,c.__key),t}const aC=(c,t)=>{let n=c;for(;n!==Un()&&n!=null;){if(t(n))return n;n=n.getParent()}return null};function E5(c,t,n,e){const s=r=>r instanceof t;return c.registerNodeTransform(t,r=>{const o=(i=>{const u=i.getChildren();for(let l=0;l<u.length;l++){const d=u[l];if(s(d))return null}let a=i,f=i;for(;a!==null;)if(f=a,a=a.getParent(),s(a))return{child:f,parent:a};return null})(r);if(o!==null){const{child:i,parent:u}=o;if(i.is(r)){e(u,r);const a=i.getNextSiblings(),f=a.length;if(u.insertAfter(i),f!==0){const l=n(u);i.insertAfter(l);for(let d=0;d<f;d++)l.append(a[d])}u.canBeEmpty()||u.getChildrenSize()!==0||u.remove()}}})}function O5(c,t){const n=new Map,e=c._pendingEditorState;for(const[r,o]of t._nodeMap){const i=fc(o);if(zt(i)){if(!zt(o))throw Error("Expected node be a TextNode");i.__text=o.__text}n.set(r,i)}e&&(e._nodeMap=n),c._dirtyType=2;const s=t._selection;kr(s===null?null:s.clone())}function T5(c){const t=st()||Ys();if(at(t)){const{focus:n}=t,e=n.getNode(),s=n.offset;if(Uo(e)){const r=e.getChildAtIndex(s);r==null?e.append(c):r.insertBefore(c),c.selectNext()}else{let r,o;zt(e)?(r=e.getParentOrThrow(),o=e.getIndexWithinParent(),s>0&&(o+=1,e.splitText(s))):(r=e,o=s);const[,i]=qp(r,o);i.insertBefore(c),i.selectStart()}}else{if(t!=null){const e=t.getNodes();e[e.length-1].getTopLevelElementOrThrow().insertAfter(c)}else Un().append(c);const n=An();c.insertAfter(n),n.select()}return c.getLatest()}function N5(c,t){const n=t();return c.replace(n),n.append(c),n}function k5(c,t){return c!==null&&Object.getPrototypeOf(c).constructor.name===t.name}function A5(c,t){const n=[];for(let e=0;e<c.length;e++){const s=t(c[e]);s!==null&&n.push(s)}return n}function P5(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}const M5=Object.freeze(Object.defineProperty({__proto__:null,$dfs:w5,$filter:A5,$findMatchingParent:aC,$getNearestBlockElementAncestorOrThrow:C5,$getNearestNodeOfType:S5,$insertFirst:P5,$insertNodeToNearestRoot:T5,$restoreEditorState:O5,$splitNode:qp,$wrapNodeInElement:N5,addClassNamesToElement:v5,isHTMLAnchorElement:SS,isHTMLElement:CS,isMimeType:sC,markSelection:b5,mediaFileReader:x5,mergeRegister:oC,objectKlassEquals:k5,positionNodeOnRange:iC,registerNestedElementResolver:E5,removeClassNamesFromElement:_5},Symbol.toStringTag,{value:"Module"})),os=process.env.NODE_ENV==="development"?g5:M5,dn=os.$findMatchingParent,dh=os.$getNearestBlockElementAncestorOrThrow,wr=os.addClassNamesToElement,lC=os.isHTMLAnchorElement,oa=os.isHTMLElement,Xr=os.mergeRegister,Zr=os.objectKlassEquals,I5=os.registerNestedElementResolver,fh=os.removeClassNamesFromElement,ph=0,Ay=1,Py=2,li=0,R5=1,cC=2,j5=3,D5=4;function L5(c,t,n){const e=c._nodeMap,s=[];for(const r of t){const o=e.get(r);o!==void 0&&s.push(o)}for(const[r,o]of n){if(!o)continue;const i=e.get(r);i!==void 0&&!Xs(i)&&s.push(i)}return s}function B5(c,t,n,e,s){if(c===null||n.size===0&&e.size===0&&!s)return li;const r=t._selection,o=c._selection;if(s)return R5;if(!at(r)||!at(o)||!o.isCollapsed()||!r.isCollapsed())return li;const i=L5(t,n,e);if(i.length===0)return li;if(i.length>1){const y=t._nodeMap,b=y.get(r.anchor.key),v=y.get(o.anchor.key);return b&&v&&!c._nodeMap.has(b.__key)&&zt(b)&&b.__text.length===1&&r.anchor.offset===1?cC:li}const u=i[0],a=c._nodeMap.get(u.__key);if(!zt(a)||!zt(u)||a.__mode!==u.__mode)return li;const f=a.__text,l=u.__text;if(f===l)return li;const d=r.anchor,p=o.anchor;if(d.key!==p.key||d.type!=="text")return li;const h=d.offset,m=p.offset,g=l.length-f.length;return g===1&&m===h-1?cC:g===-1&&m===h+1?j5:g===-1&&m===h?D5:li}function F5(c,t,n){const e=t._nodeMap.get(c),s=n._nodeMap.get(c),r=t._selection,o=n._selection;let i=!1;return at(r)&&at(o)&&(i=r.anchor.type==="element"&&r.focus.type==="element"&&o.anchor.type==="text"&&o.focus.type==="text"),!i&&zt(e)&&zt(s)?e.__type===s.__type&&e.__text===s.__text&&e.__mode===s.__mode&&e.__detail===s.__detail&&e.__style===s.__style&&e.__format===s.__format&&e.__parent===s.__parent:!1}function $5(c,t){let n=Date.now(),e=li;return(s,r,o,i,u,a)=>{const f=Date.now();if(a.has("historic"))return e=li,n=f,Py;const l=B5(s,r,i,u,c.isComposing()),d=(()=>{const p=o===null||o.editor===c,h=a.has("history-push");if(!h&&p&&a.has("history-merge"))return ph;if(s===null)return Ay;const g=r._selection;if(!(i.size>0||u.size>0))return g!==null?ph:Py;if(h===!1&&l!==li&&l===e&&f<n+t&&p)return ph;if(i.size===1){const b=Array.from(i)[0];if(F5(b,s,r))return ph}return Ay})();return n=f,e=l,d}}function z5(c,t){const n=t.redoStack,e=t.undoStack;if(n.length!==0){const s=t.current;s!==null&&(e.push(s),c.dispatchCommand(Ti,!0));const r=n.pop();n.length===0&&c.dispatchCommand(Oi,!1),t.current=r||null,r&&r.editor.setEditorState(r.editorState,{tag:"historic"})}}function U5(c,t){const n=t.redoStack,e=t.undoStack;if(e.length!==0){const r=t.current,o=e.pop();r!==null&&(n.push(r),c.dispatchCommand(Oi,!0)),e.length===0&&c.dispatchCommand(Ti,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}function uC(c){c.undoStack=[],c.redoStack=[],c.current=null}function H5(c,t,n){const e=$5(c,n),s=({editorState:i,prevEditorState:u,dirtyLeaves:a,dirtyElements:f,tags:l})=>{const d=t.current,p=t.redoStack,h=t.undoStack,m=d===null?null:d.editorState;if(d!==null&&i===m)return;const g=e(u,i,d,a,f,l);if(g===Ay)p.length!==0&&(t.redoStack=[],c.dispatchCommand(Oi,!1)),d!==null&&(h.push({...d}),c.dispatchCommand(Ti,!0));else if(g===Py)return;t.current={editor:c,editorState:i}},r=Xr(c.registerCommand(rh,()=>(U5(c,t),!0),Ct),c.registerCommand(Qp,()=>(z5(c,t),!0),Ct),c.registerCommand(fd,()=>(uC(t),!1),Ct),c.registerCommand(gS,()=>(uC(t),c.dispatchCommand(Oi,!1),c.dispatchCommand(Ti,!1),!0),Ct),c.registerUpdateListener(s)),o=c.registerUpdateListener(s);return()=>{r(),o()}}function K5(){return{current:null,redoStack:[],undoStack:[]}}const W5=Object.freeze(Object.defineProperty({__proto__:null,createEmptyHistoryState:K5,registerHistory:H5},Symbol.toStringTag,{value:"Module"})),hh=0,My=1,Iy=2,ci=0,q5=1,dC=2,J5=3,V5=4;function G5(c,t,n,e,s){if(c===null||n.size===0&&e.size===0&&!s)return ci;const r=t._selection,o=c._selection;if(s)return q5;if(!(at(r)&&at(o)&&o.isCollapsed()&&r.isCollapsed()))return ci;const i=function(y,b,v){const _=y._nodeMap,w=[];for(const x of b){const S=_.get(x);S!==void 0&&w.push(S)}for(const[x,S]of v){if(!S)continue;const E=_.get(x);E===void 0||Xs(E)||w.push(E)}return w}(t,n,e);if(i.length===0)return ci;if(i.length>1){const y=t._nodeMap,b=y.get(r.anchor.key),v=y.get(o.anchor.key);return b&&v&&!c._nodeMap.has(b.__key)&&zt(b)&&b.__text.length===1&&r.anchor.offset===1?dC:ci}const u=i[0],a=c._nodeMap.get(u.__key);if(!zt(a)||!zt(u)||a.__mode!==u.__mode)return ci;const f=a.__text,l=u.__text;if(f===l)return ci;const d=r.anchor,p=o.anchor;if(d.key!==p.key||d.type!=="text")return ci;const h=d.offset,m=p.offset,g=l.length-f.length;return g===1&&m===h-1?dC:g===-1&&m===h+1?J5:g===-1&&m===h?V5:ci}function Y5(c,t){let n=Date.now(),e=ci;return(s,r,o,i,u,a)=>{const f=Date.now();if(a.has("historic"))return e=ci,n=f,Iy;const l=G5(s,r,i,u,c.isComposing()),d=(()=>{const p=o===null||o.editor===c,h=a.has("history-push");if(!h&&p&&a.has("history-merge"))return hh;if(s===null)return My;const m=r._selection;return i.size>0||u.size>0?h===!1&&l!==ci&&l===e&&f<n+t&&p||i.size===1&&function(g,y,b){const v=y._nodeMap.get(g),_=b._nodeMap.get(g),w=y._selection,x=b._selection;let S=!1;return at(w)&&at(x)&&(S=w.anchor.type==="element"&&w.focus.type==="element"&&x.anchor.type==="text"&&x.focus.type==="text"),!(S||!zt(v)||!zt(_))&&v.__type===_.__type&&v.__text===_.__text&&v.__mode===_.__mode&&v.__detail===_.__detail&&v.__style===_.__style&&v.__format===_.__format&&v.__parent===_.__parent}(Array.from(i)[0],s,r)?hh:My:m!==null?hh:Iy})();return n=f,e=l,d}}function fC(c){c.undoStack=[],c.redoStack=[],c.current=null}function X5(c,t,n){const e=Y5(c,n),s=({editorState:i,prevEditorState:u,dirtyLeaves:a,dirtyElements:f,tags:l})=>{const d=t.current,p=t.redoStack,h=t.undoStack,m=d===null?null:d.editorState;if(d!==null&&i===m)return;const g=e(u,i,d,a,f,l);if(g===My)p.length!==0&&(t.redoStack=[],c.dispatchCommand(Oi,!1)),d!==null&&(h.push({...d}),c.dispatchCommand(Ti,!0));else if(g===Iy)return;t.current={editor:c,editorState:i}},r=Xr(c.registerCommand(rh,()=>(function(i,u){const a=u.redoStack,f=u.undoStack;if(f.length!==0){const l=u.current,d=f.pop();l!==null&&(a.push(l),i.dispatchCommand(Oi,!0)),f.length===0&&i.dispatchCommand(Ti,!1),u.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:"historic"})}}(c,t),!0),Ct),c.registerCommand(Qp,()=>(function(i,u){const a=u.redoStack,f=u.undoStack;if(a.length!==0){const l=u.current;l!==null&&(f.push(l),i.dispatchCommand(Ti,!0));const d=a.pop();a.length===0&&i.dispatchCommand(Oi,!1),u.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:"historic"})}}(c,t),!0),Ct),c.registerCommand(fd,()=>(fC(t),!1),Ct),c.registerCommand(gS,()=>(fC(t),c.dispatchCommand(Oi,!1),c.dispatchCommand(Ti,!1),!0),Ct),c.registerUpdateListener(s)),o=c.registerUpdateListener(s);return()=>{r(),o()}}function Z5(){return{current:null,redoStack:[],undoStack:[]}}const Q5=Object.freeze(Object.defineProperty({__proto__:null,createEmptyHistoryState:Z5,registerHistory:X5},Symbol.toStringTag,{value:"Module"})),pC=process.env.NODE_ENV==="development"?W5:Q5,gh=pC.createEmptyHistoryState,hC=pC.registerHistory;function eR(c,t,n=1e3){const e=St.useMemo(()=>t||gh(),[t]);St.useEffect(()=>hC(c,e,n),[n,c,e])}function tR({externalHistoryState:c}){const[t]=pr();return eR(t,c),null}const nR=Object.freeze(Object.defineProperty({__proto__:null,HistoryPlugin:tR,createEmptyHistoryState:gh},Symbol.toStringTag,{value:"Module"}));function rR({externalHistoryState:c}){const[t]=pr();return function(n,e,s=1e3){const r=St.useMemo(()=>e||gh(),[e]);St.useEffect(()=>hC(n,r,s),[s,n,r])}(t,c),null}const oR=Object.freeze(Object.defineProperty({__proto__:null,HistoryPlugin:rR,createEmptyHistoryState:gh},Symbol.toStringTag,{value:"Module"})),gC=(process.env.NODE_ENV==="development"?nR:oR).HistoryPlugin;var iR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function sR(c){const[t]=pr(),n=St.useMemo(()=>c(t),[t,c]),e=St.useRef(n.initialValueFn()),[s,r]=St.useState(e.current);return iR(()=>{const{initialValueFn:o,subscribe:i}=n,u=o();return e.current!==u&&(e.current=u,r(u)),i(a=>{e.current=a,r(a)})},[n,c]),s}function aR(c){return{initialValueFn:()=>c.isEditable(),subscribe:t=>c.registerEditableListener(t)}}function lR(){return sR(aR)}const cR=Object.freeze(Object.defineProperty({__proto__:null,default:lR},Symbol.toStringTag,{value:"Module"}));var uR=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function dR(c){return{initialValueFn:()=>c.isEditable(),subscribe:t=>c.registerEditableListener(t)}}function fR(){return function(c){const[t]=pr(),n=St.useMemo(()=>c(t),[t,c]),e=St.useRef(n.initialValueFn()),[s,r]=St.useState(e.current);return uR(()=>{const{initialValueFn:o,subscribe:i}=n,u=o();return e.current!==u&&(e.current=u,r(u)),i(a=>{e.current=a,r(a)})},[n,c]),s}(dR)}const pR=Object.freeze(Object.defineProperty({__proto__:null,default:fR},Symbol.toStringTag,{value:"Module"})),mh=(process.env.NODE_ENV==="development"?cR:pR).default;function hR(c,t){let n=c.getFirstChild(),e=0;e:for(;n!==null;){if(Rt(n)){const o=n.getFirstChild();if(o!==null){n=o;continue}}else if(zt(n)){const o=n.getTextContentSize();if(e+o>t)return{node:n,offset:t-e};e+=o}const s=n.getNextSibling();if(s!==null){n=s;continue}let r=n.getParent();for(;r!==null;){const o=r.getNextSibling();if(o!==null){n=o;continue e}r=r.getParent()}break}return null}function Ry(c,t=!0){if(c)return!1;let n=mC();return t&&(n=n.trim()),n===""}function gR(c,t){return()=>Ry(c,t)}function mC(){return Un().getTextContent()}function yC(c){if(!Ry(c,!1))return!1;const n=Un().getChildren(),e=n.length;if(e>1)return!1;for(let s=0;s<e;s++){const r=n[s];if(uo(r))return!1;if(Rt(r)){if(!xy(r)||r.__indent!==0)return!1;const o=r.getChildren(),i=o.length;for(let u=0;u<i;u++){const a=o[s];if(!zt(a))return!1}}}return!0}function mR(c){return()=>yC(c)}function yR(c,t,n,e){const s=l=>l instanceof n,r=l=>{const d=Ei(l.getTextContent());d.setFormat(l.getFormat()),l.replace(d)},o=l=>l.getLatest().__mode,i=l=>{if(!l.isSimpleText())return;const d=l.getPreviousSibling();let p=l.getTextContent(),h=l,m;if(zt(d)){const g=d.getTextContent(),y=g+p,b=t(y);if(s(d))if(b===null||o(d)!==0){r(d);return}else{const v=b.end-g.length;if(v>0){const _=p.slice(0,v),w=g+_;if(d.select(),d.setTextContent(w),v===p.length)l.remove();else{const x=p.slice(v);l.setTextContent(x)}return}}else if(b===null||b.start<g.length)return}for(;;){m=t(p);let g=m===null?"":p.slice(m.end);if(p=g,g===""){const v=h.getNextSibling();if(zt(v)){g=h.getTextContent()+v.getTextContent();const _=t(g);if(_===null){s(v)?r(v):v.markDirty();return}else if(_.start!==0)return}}else{const v=t(g);if(v!==null&&v.start===0)return}if(m===null)return;if(m.start===0&&zt(d)&&d.isTextEntity())continue;let y;m.start===0?[y,h]=h.splitText(m.end):[,y,h]=h.splitText(m.start,m.end);const b=e(y);if(b.setFormat(y.getFormat()),y.replace(b),h==null)return}},u=l=>{const d=l.getTextContent(),p=t(d);if(p===null||p.start!==0){r(l);return}if(d.length>p.end){l.splitText(p.end);return}const h=l.getPreviousSibling();zt(h)&&h.isTextEntity()&&(r(h),r(l));const m=l.getNextSibling();zt(m)&&m.isTextEntity()&&(r(m),s(l)&&r(l))},a=c.registerNodeTransform(Ya,i),f=c.registerNodeTransform(n,u);return[a,f]}const bR=Object.freeze(Object.defineProperty({__proto__:null,$canShowPlaceholder:yC,$canShowPlaceholderCurry:mR,$findTextIntersectionFromCharacters:hR,$isRootTextContentEmpty:Ry,$isRootTextContentEmptyCurry:gR,$rootTextContent:mC,registerLexicalTextEntity:yR},Symbol.toStringTag,{value:"Module"}));function vR(c,t){let n=c.getFirstChild(),e=0;e:for(;n!==null;){if(Rt(n)){const o=n.getFirstChild();if(o!==null){n=o;continue}}else if(zt(n)){const o=n.getTextContentSize();if(e+o>t)return{node:n,offset:t-e};e+=o}const s=n.getNextSibling();if(s!==null){n=s;continue}let r=n.getParent();for(;r!==null;){const o=r.getNextSibling();if(o!==null){n=o;continue e}r=r.getParent()}break}return null}function jy(c,t=!0){if(c)return!1;let n=bC();return t&&(n=n.trim()),n===""}function _R(c,t){return()=>jy(c,t)}function bC(){return Un().getTextContent()}function vC(c){if(!jy(c,!1))return!1;const t=Un().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const s=t[e];if(uo(s))return!1;if(Rt(s)){if(!xy(s)||s.__indent!==0)return!1;const r=s.getChildren(),o=r.length;for(let i=0;i<o;i++){const u=r[e];if(!zt(u))return!1}}}return!0}function xR(c){return()=>vC(c)}function wR(c,t,n,e){const s=o=>o instanceof n,r=o=>{const i=Ei(o.getTextContent());i.setFormat(o.getFormat()),o.replace(i)};return[c.registerNodeTransform(Ya,o=>{if(!o.isSimpleText())return;const i=o.getPreviousSibling();let u,a=o.getTextContent(),f=o;if(zt(i)){const l=i.getTextContent(),d=t(l+a);if(s(i)){if(d===null||(p=>p.getLatest().__mode)(i)!==0)return void r(i);{const p=d.end-l.length;if(p>0){const h=l+a.slice(0,p);if(i.select(),i.setTextContent(h),p===a.length)o.remove();else{const m=a.slice(p);o.setTextContent(m)}return}}}else if(d===null||d.start<l.length)return}for(;;){u=t(a);let l,d=u===null?"":a.slice(u.end);if(a=d,d===""){const h=f.getNextSibling();if(zt(h)){d=f.getTextContent()+h.getTextContent();const m=t(d);if(m===null)return void(s(h)?r(h):h.markDirty());if(m.start!==0)return}}else{const h=t(d);if(h!==null&&h.start===0)return}if(u===null)return;if(u.start===0&&zt(i)&&i.isTextEntity())continue;u.start===0?[l,f]=f.splitText(u.end):[,l,f]=f.splitText(u.start,u.end);const p=e(l);if(p.setFormat(l.getFormat()),l.replace(p),f==null)return}}),c.registerNodeTransform(n,o=>{const i=o.getTextContent(),u=t(i);if(u===null||u.start!==0)return void r(o);if(i.length>u.end)return void o.splitText(u.end);const a=o.getPreviousSibling();zt(a)&&a.isTextEntity()&&(r(a),r(o));const f=o.getNextSibling();zt(f)&&f.isTextEntity()&&(r(f),s(o)&&r(o))})]}const SR=Object.freeze(Object.defineProperty({__proto__:null,$canShowPlaceholder:vC,$canShowPlaceholderCurry:xR,$findTextIntersectionFromCharacters:vR,$isRootTextContentEmpty:jy,$isRootTextContentEmptyCurry:_R,$rootTextContent:bC,registerLexicalTextEntity:wR},Symbol.toStringTag,{value:"Module"})),Dy=process.env.NODE_ENV==="development"?bR:SR,yh=Dy.$canShowPlaceholderCurry,CR=Dy.$isRootTextContentEmpty,ER=Dy.$rootTextContent;function OR(c){const t=window.location.origin,n=e=>{if(e.origin!==t)return;const s=c.getRootElement();if(document.activeElement!==s)return;const r=e.data;if(typeof r=="string"){let o;try{o=JSON.parse(r)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const i=o.payload;if(i&&i.functionId==="makeChanges"){const u=i.args;if(u){const[a,f,l,d,p,h]=u;c.update(()=>{const m=st();if(at(m)){const g=m.anchor;let y=g.getNode(),b=0,v=0;if(zt(y)&&a>=0&&f>=0&&(b=a,v=a+f,m.setTextNodeRange(y,b,y,v)),(b!==v||l!=="")&&(m.insertRawText(l),y=g.getNode()),zt(y)){b=d,v=d+p;const _=y.getTextContentSize();b=b>_?_:b,v=v>_?_:v,m.setTextNodeRange(y,b,y,v)}e.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const TR=Object.freeze(Object.defineProperty({__proto__:null,registerDragonSupport:OR},Symbol.toStringTag,{value:"Module"}));function NR(c){const t=window.location.origin,n=e=>{if(e.origin!==t)return;const s=c.getRootElement();if(document.activeElement!==s)return;const r=e.data;if(typeof r=="string"){let o;try{o=JSON.parse(r)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const i=o.payload;if(i&&i.functionId==="makeChanges"){const u=i.args;if(u){const[a,f,l,d,p,h]=u;c.update(()=>{const m=st();if(at(m)){const g=m.anchor;let y=g.getNode(),b=0,v=0;if(zt(y)&&a>=0&&f>=0&&(b=a,v=a+f,m.setTextNodeRange(y,b,y,v)),b===v&&l===""||(m.insertRawText(l),y=g.getNode()),zt(y)){b=d,v=d+p;const _=y.getTextContentSize();b=b>_?_:b,v=v>_?_:v,m.setTextNodeRange(y,b,y,v)}e.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const kR=Object.freeze(Object.defineProperty({__proto__:null,registerDragonSupport:NR},Symbol.toStringTag,{value:"Module"})),bh=(process.env.NODE_ENV==="development"?TR:kR).registerDragonSupport;function AR(c,t){const n=t.body?t.body.childNodes:[];let e=[];for(let s=0;s<n.length;s++){const r=n[s];if(!xC.has(r.nodeName)){const o=wC(r,c);o!==null&&(e=e.concat(o))}}return e}function PR(c,t){if(typeof document>"u"||typeof window>"u"&&typeof global.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 n=document.createElement("div"),s=Un().getChildren();for(let r=0;r<s.length;r++){const o=s[r];_C(c,o,n,t)}return n.innerHTML}function _C(c,t,n,e=null){let s=e!==null?t.isSelected(e):!0;const r=Rt(t)&&t.excludeFromCopy("html");let o=t;if(e!==null){let p=fc(t);p=zt(p)&&e!==null?uh(e,p):p,o=p}const i=Rt(o)?o.getChildren():[],u=c._nodes.get(o.getType());let a;u&&u.exportDOM!==void 0?a=u.exportDOM(c,o):a=o.exportDOM(c);const{element:f,after:l}=a;if(!f)return!1;const d=document.createDocumentFragment();for(let p=0;p<i.length;p++){const h=i[p],m=_C(c,h,d,e);!s&&Rt(t)&&m&&t.extractWithChild(h,e,"html")&&(s=!0)}if(s&&!r){if(oa(f)&&f.append(d),n.append(f),l){const p=l.call(o,f);p&&f.replaceWith(p)}}else n.append(d);return s}function MR(c,t){const{nodeName:n}=c,e=t._htmlConversions.get(n.toLowerCase());let s=null;if(e!==void 0)for(const r of e){const o=r(c);o!==null&&(s===null||(s.priority||0)<(o.priority||0))&&(s=o)}return s!==null?s.conversion:null}const xC=new Set(["STYLE","SCRIPT"]);function wC(c,t,n=new Map,e){let s=[];if(xC.has(c.nodeName))return s;let r=null;const o=MR(c,t),i=o?o(c):null;let u=null;if(i!==null){u=i.after;const l=i.node;if(r=Array.isArray(l)?l[l.length-1]:l,r!==null){for(const[,d]of n)if(r=d(r,e),!r)break;r&&s.push(...Array.isArray(l)?l:[r])}i.forChild!=null&&n.set(c.nodeName,i.forChild)}const a=c.childNodes;let f=[];for(let l=0;l<a.length;l++)f.push(...wC(a[l],t,new Map(n),r));return u!=null&&(f=u(f)),r==null?s=s.concat(f):Rt(r)&&r.append(...f),s}const IR=Object.freeze(Object.defineProperty({__proto__:null,$generateHtmlFromNodes:PR,$generateNodesFromDOM:AR},Symbol.toStringTag,{value:"Module"}));function RR(c,t){const n=t.body?t.body.childNodes:[];let e=[];for(let s=0;s<n.length;s++){const r=n[s];if(!CC.has(r.nodeName)){const o=EC(r,c);o!==null&&(e=e.concat(o))}}return e}function jR(c,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),e=Un().getChildren();for(let s=0;s<e.length;s++)SC(c,e[s],n,t);return n.innerHTML}function SC(c,t,n,e=null){let s=e===null||t.isSelected(e);const r=Rt(t)&&t.excludeFromCopy("html");let o=t;if(e!==null){let p=fc(t);p=zt(p)&&e!==null?uh(e,p):p,o=p}const i=Rt(o)?o.getChildren():[],u=c._nodes.get(o.getType());let a;a=u&&u.exportDOM!==void 0?u.exportDOM(c,o):o.exportDOM(c);const{element:f,after:l}=a;if(!f)return!1;const d=document.createDocumentFragment();for(let p=0;p<i.length;p++){const h=i[p],m=SC(c,h,d,e);!s&&Rt(t)&&m&&t.extractWithChild(h,e,"html")&&(s=!0)}if(s&&!r){if(oa(f)&&f.append(d),n.append(f),l){const p=l.call(o,f);p&&f.replaceWith(p)}}else n.append(d);return s}const CC=new Set(["STYLE","SCRIPT"]);function EC(c,t,n=new Map,e){let s=[];if(CC.has(c.nodeName))return s;let r=null;const o=function(l,d){const{nodeName:p}=l,h=d._htmlConversions.get(p.toLowerCase());let m=null;if(h!==void 0)for(const g of h){const y=g(l);y!==null&&(m===null||(m.priority||0)<(y.priority||0))&&(m=y)}return m!==null?m.conversion:null}(c,t),i=o?o(c):null;let u=null;if(i!==null){u=i.after;const l=i.node;if(r=Array.isArray(l)?l[l.length-1]:l,r!==null){for(const[,d]of n)if(r=d(r,e),!r)break;r&&s.push(...Array.isArray(l)?l:[r])}i.forChild!=null&&n.set(c.nodeName,i.forChild)}const a=c.childNodes;let f=[];for(let l=0;l<a.length;l++)f.push(...EC(a[l],t,new Map(n),r));return u!=null&&(f=u(f)),r==null?s=s.concat(f):Rt(r)&&r.append(...f),s}const DR=Object.freeze(Object.defineProperty({__proto__:null,$generateHtmlFromNodes:jR,$generateNodesFromDOM:RR},Symbol.toStringTag,{value:"Module"})),OC=process.env.NODE_ENV==="development"?IR:DR,TC=OC.$generateHtmlFromNodes,NC=OC.$generateNodesFromDOM,LR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kC=c=>LR?(c||window).getSelection():null;function AC(c){const t=st();if(t==null)throw Error("Expected valid LexicalSelection");return at(t)&&t.isCollapsed()||t.getNodes().length===0?"":TC(c,t)}function PC(c){const t=st();if(t==null)throw Error("Expected valid LexicalSelection");return at(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(IC(c,t))}function BR(c,t){const n=c.getData("text/plain")||c.getData("text/uri-list");n!=null&&t.insertRawText(n)}function FR(c,t,n){const e=c.getData("application/x-lexical-editor");if(e)try{const o=JSON.parse(e);if(o.namespace===n._config.namespace&&Array.isArray(o.nodes)){const i=RC(o.nodes);return Ly(n,i,t)}}catch{}const s=c.getData("text/html");if(s)try{const i=new DOMParser().parseFromString(s,"text/html"),u=NC(n,i);return Ly(n,u,t)}catch{}const r=c.getData("text/plain")||c.getData("text/uri-list");if(r!=null)if(at(t)){const o=r.split(/(\r?\n|\t)/);o[o.length-1]===""&&o.pop();for(let i=0;i<o.length;i++){const u=o[i];u===`
|
|
53
|
+
`);const u=i.length;if(!zt(e)||s>=u){const a=e.getParent();e.remove(),a==null||a.getChildrenSize()!==0||Xs(a)||a.remove(),s-=u+o,e=r}else{const a=e.getKey(),f=c.getEditorState().read(()=>{const p=Ro(a);return zt(p)&&p.isSimpleText()?p.getTextContent():null}),l=u-s,d=i.slice(0,l);if(f!==null&&f!==i){const p=Ys();let h=e;if(e.isSimpleText())e.setTextContent(f);else{const m=Ei(f);e.replace(m),h=m}if(at(p)&&p.isCollapsed()){const m=p.anchor.offset;h.select(m,m)}}else if(e.isSimpleText()){const p=t.key===a;let h=t.offset;h<s&&(h=u);const m=p?h-s:0,g=p?h:l;if(p&&m===0){const[y]=e.splitText(m,g);y.remove()}else{const[,y]=e.splitText(m,g);y.remove()}}else{const p=Ei(d);e.replace(p)}s=0}}}function $I(c){const t=c.getStyle(),n=HS(t);lh.set(t,n)}function dc(c,t){const n=ch("getStyle"in c?c.getStyle():c.style),e=Object.entries(t).reduce((r,[o,i])=>(i instanceof Function?r[o]=i(n[o]):i===null?delete r[o]:r[o]=i,r),{...n}),s=function(r){let o="";for(const i in r)i&&(o+=`${i}: ${r[i]};`);return o}(e);c.setStyle(s),lh.set(s,e)}function zI(c,t){const n=c.getNodes(),e=n.length,s=c.getStartEndPoints();if(s===null)return;const[r,o]=s,i=e-1;let u=n[0],a=n[i];if(c.isCollapsed()&&at(c))return void dc(c,t);const f=u.getTextContent().length,l=o.offset;let d=r.offset;const p=r.isBefore(o);let h=p?d:l,m=p?l:d;const g=p?r.type:o.type,y=p?o.type:r.type,b=p?o.key:r.key;if(zt(u)&&h===f){const v=u.getNextSibling();zt(v)&&(d=0,h=0,u=v)}if(n.length===1){if(zt(u)&&u.canHaveFormat()){if(h=g==="element"?0:d>l?l:d,m=y==="element"?f:d>l?d:l,h===m)return;if(h===0&&m===f)dc(u,t),u.select(h,m);else{const v=u.splitText(h,m),_=h===0?v[0]:v[1];dc(_,t),_.select(0,m-h)}}}else{if(zt(u)&&h<u.getTextContentSize()&&u.canHaveFormat()&&(h!==0&&(u=u.splitText(h)[1],h=0,r.set(u.getKey(),h,"text")),dc(u,t)),zt(a)&&a.canHaveFormat()){const v=a.getTextContent().length;a.__key!==b&&m!==0&&(m=v),m!==v&&([a]=a.splitText(m)),m===0&&y!=="element"||dc(a,t)}for(let v=1;v<i;v++){const _=n[v],w=_.getKey();zt(_)&&_.canHaveFormat()&&w!==u.getKey()&&w!==a.getKey()&&!_.isToken()&&dc(_,t)}}}function UI(c,t){if(c===null)return;const n=c.getStartEndPoints(),e=n?n[0]:null;if(e!==null&&e.key==="root"){const o=t(),i=Un(),u=i.getFirstChild();return void(u?u.replace(o,!0):i.append(o))}const s=c.getNodes(),r=e!==null&&function(o,i){let u=o;for(;u!==null&&u.getParent()!==null&&!i(u);)u=u.getParentOrThrow();return i(u)?u:null}(e.getNode(),JS);r&&s.indexOf(r)===-1&&s.push(r);for(let o=0;o<s.length;o++){const i=s[o];if(!JS(i))continue;if(!Rt(i))throw Error("Expected block node to be an ElementNode");const u=t();u.setFormat(i.getFormatType()),u.setIndent(i.getIndent()),i.replace(u,!0)}}function KS(c){return c.getNode().isAttached()}function HI(c){let t=c;for(;t!==null&&!Uo(t);){const n=t.getLatest(),e=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=e}}function KI(c,t,n=null){const e=c.getStartEndPoints(),s=e?e[0]:null,r=c.getNodes(),o=r.length;if(s!==null&&(o===0||o===1&&s.type==="element"&&s.getNode().getChildrenSize()===0)){const a=s.type==="text"?s.getNode().getParentOrThrow():s.getNode(),f=a.getChildren();let l=t();return l.setFormat(a.getFormatType()),l.setIndent(a.getIndent()),f.forEach(d=>l.append(d)),n&&(l=n.append(l)),void a.replace(l)}let i=null,u=[];for(let a=0;a<o;a++){const f=r[a];Uo(f)?(Ny(c,u,u.length,t,n),u=[],i=f):i===null||i!==null&&uS(f,i)?u.push(f):(Ny(c,u,u.length,t,n),u=[f])}Ny(c,u,u.length,t,n)}function Ny(c,t,n,e,s=null){if(t.length===0)return;const r=t[0],o=new Map,i=[];let u=Rt(r)?r:r.getParentOrThrow();u.isInline()&&(u=u.getParentOrThrow());let a=!1;for(;u!==null;){const h=u.getPreviousSibling();if(h!==null){u=h,a=!0;break}if(u=u.getParentOrThrow(),Uo(u))break}const f=new Set;for(let h=0;h<n;h++){const m=t[h];Rt(m)&&m.getChildrenSize()===0&&f.add(m.getKey())}const l=new Set;for(let h=0;h<n;h++){const m=t[h];let g=m.getParent();if(g!==null&&g.isInline()&&(g=g.getParent()),g!==null&&fS(m)&&!l.has(m.getKey())){const y=g.getKey();if(o.get(y)===void 0){const b=e();b.setFormat(g.getFormatType()),b.setIndent(g.getIndent()),i.push(b),o.set(y,b),g.getChildren().forEach(v=>{b.append(v),l.add(v.getKey()),Rt(v)&&v.getChildrenKeys().forEach(_=>l.add(_))}),HI(g)}}else if(f.has(m.getKey())){if(!Rt(m))throw Error("Expected node in emptyElements to be an ElementNode");const y=e();y.setFormat(m.getFormatType()),y.setIndent(m.getIndent()),i.push(y),m.remove(!0)}}if(s!==null)for(let h=0;h<i.length;h++){const m=i[h];s.append(m)}let d=null;if(Uo(u))if(a)if(s!==null)u.insertAfter(s);else for(let h=i.length-1;h>=0;h--){const m=i[h];u.insertAfter(m)}else{const h=u.getFirstChild();if(Rt(h)&&(u=h),h===null)if(s)u.append(s);else for(let m=0;m<i.length;m++){const g=i[m];u.append(g),d=g}else if(s!==null)h.insertBefore(s);else for(let m=0;m<i.length;m++){const g=i[m];h.insertBefore(g),d=g}}else if(s)u.insertAfter(s);else for(let h=i.length-1;h>=0;h--){const m=i[h];u.insertAfter(m),d=m}const p=Ys();at(p)&&KS(p.anchor)&&KS(p.focus)?kr(p.clone()):d!==null?d.selectEnd():c.dirty=!0}function WI(c,t){const n=oc(c.focus,t);return uo(n)&&!n.isIsolated()||Rt(n)&&!n.isInline()&&!n.canBeEmpty()}function WS(c,t,n,e){c.modify(t?"extend":"move",n,e)}function qS(c){const t=c.anchor.getNode();return(Xs(t)?t:t.getParentOrThrow()).getDirection()==="rtl"}function qI(c,t,n){const e=qS(c);WS(c,t,n?!e:e,"character")}function JI(c){const t=c.anchor,n=c.focus,e=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let s=e.getFirstDescendant(),r=e.getLastDescendant(),o="element",i="element",u=0;zt(s)?o="text":Rt(s)||s===null||(s=s.getParentOrThrow()),zt(r)?(i="text",u=r.getTextContentSize()):Rt(r)||r===null||(r=r.getParentOrThrow()),s&&r&&(t.set(s.getKey(),0,o),n.set(r.getKey(),u,i))}function VI(c,t,n){const e=ch(c.getStyle());return e!==null&&e[t]||n}function GI(c,t,n=""){let e=null;const s=c.getNodes(),r=c.anchor,o=c.focus,i=c.isBackward(),u=i?o.offset:r.offset,a=i?o.getNode():r.getNode();if(c.isCollapsed()&&c.style!==""){const f=ch(c.style);if(f!==null&&t in f)return f[t]}for(let f=0;f<s.length;f++){const l=s[f];if((f===0||u!==0||!l.is(a))&&zt(l)){const d=VI(l,t,n);if(e===null)e=d;else if(e!==d){e="";break}}}return e===null?n:e}function JS(c){if(uo(c)||!Rt(c)||Uo(c))return!1;const t=c.getFirstChild(),n=t===null||dd(t)||zt(t)||t.isInline();return!c.isInline()&&c.canBeEmpty()!==!1&&n}const YI=Object.freeze(Object.defineProperty({__proto__:null,$addNodeStyle:$I,$cloneWithProperties:DI,$getSelectionStyleValueForProperty:GI,$isAtNodeEnd:BI,$isParentElementRTL:qS,$moveCaretSelection:WS,$moveCharacter:qI,$patchStyleText:zI,$selectAll:JI,$setBlocksType:UI,$shouldOverrideDefaultCharacterSelection:WI,$sliceSelectedTextNodeContent:LI,$wrapNodes:KI,createDOMRange:RI,createRectsFromDOMRange:jI,getStyleObjectFromCSS:ch,trimTextContentFromAnchor:FI},Symbol.toStringTag,{value:"Module"})),rs=process.env.NODE_ENV==="development"?II:YI,VS=rs.$addNodeStyle,fc=rs.$cloneWithProperties,GS=rs.$getSelectionStyleValueForProperty,na=rs.$moveCharacter,YS=rs.$patchStyleText,ra=rs.$shouldOverrideDefaultCharacterSelection,uh=rs.$sliceSelectedTextNodeContent,XI=rs.createDOMRange,ky=rs.createRectsFromDOMRange;function XS(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function ZS(...c){return()=>{c.forEach(t=>t())}}function ki(c){return`${c}px`}const ZI={attributes:!0,characterData:!0,childList:!0,subtree:!0};function QS(c,t,n){let e=null,s=null,r=null,o=[];const i=document.createElement("div");function u(){if(e===null)throw Error("Unexpected null rootDOMNode");if(s===null)throw Error("Unexpected null parentDOMNode");const{left:d,top:p}=e.getBoundingClientRect(),h=s,m=ky(c,t);i.isConnected||h.append(i);let g=!1;for(let y=0;y<m.length;y++){const b=m[y],v=o[y]||document.createElement("div"),_=v.style;_.position!=="absolute"&&(_.position="absolute",g=!0);const w=ki(b.left-d);_.left!==w&&(_.left=w,g=!0);const x=ki(b.top-p);_.top!==x&&(v.style.top=x,g=!0);const S=ki(b.width);_.width!==S&&(v.style.width=S,g=!0);const E=ki(b.height);_.height!==E&&(v.style.height=E,g=!0),v.parentNode!==i&&(i.append(v),g=!0),o[y]=v}for(;o.length>m.length;)o.pop();g&&n(o)}function a(){s=null,e=null,r!==null&&r.disconnect(),r=null,i.remove();for(const d of o)d.remove();o=[]}function f(){const d=c.getRootElement();if(d===null)return a();const p=d.parentElement;if(!(p instanceof HTMLElement))return a();a(),e=d,s=p,r=new MutationObserver(h=>{const m=c.getRootElement(),g=m&&m.parentElement;if(m!==e||g!==s)return f();for(const y of h)if(!i.contains(y.target))return u()}),r.observe(p,ZI),u()}const l=c.registerRootListener(f);return()=>{l(),a()}}function QI(c,t){let n=null,e=null,s=null,r=null,o=()=>{};function i(u){u.read(()=>{const a=st();if(!at(a)){n=null,e=null,s=null,r=null,o(),o=()=>{};return}const{anchor:f,focus:l}=a,d=f.getNode(),p=d.getKey(),h=f.offset,m=l.getNode(),g=m.getKey(),y=l.offset,b=c.getElementByKey(p),v=c.getElementByKey(g),_=n===null||b===null||h!==e||p!==n.getKey()||d!==n&&(!(n instanceof Ya)||d.updateDOM(n,b,c._config)),w=s===null||v===null||y!==r||g!==s.getKey()||m!==s&&(!(s instanceof Ya)||m.updateDOM(s,v,c._config));if(_||w){const x=c.getElementByKey(f.getNode().getKey()),S=c.getElementByKey(l.getNode().getKey());if(x!==null&&S!==null&&x.tagName==="SPAN"&&S.tagName==="SPAN"){const E=document.createRange();let O,j,A,T;l.isBefore(f)?(O=S,j=l.offset,A=x,T=f.offset):(O=x,j=f.offset,A=S,T=l.offset);const I=O.firstChild;if(I===null)throw Error("Expected text node to be first child of span");const k=A.firstChild;if(k===null)throw Error("Expected text node to be first child of span");E.setStart(I,j),E.setEnd(k,T),o(),o=QS(c,E,$=>{for(const H of $){const U=H.style;U.background!=="Highlight"&&(U.background="Highlight"),U.color!=="HighlightText"&&(U.color="HighlightText"),U.zIndex!=="-1"&&(U.zIndex="-1"),U.pointerEvents!=="none"&&(U.pointerEvents="none"),U.marginTop!==ki(-1.5)&&(U.marginTop=ki(-1.5)),U.paddingTop!==ki(4)&&(U.paddingTop=ki(4)),U.paddingBottom!==ki(0)&&(U.paddingBottom=ki(0))}t!==void 0&&t($)})}}n=d,e=h,s=m,r=y})}return i(c.getEditorState()),ZS(c.registerUpdateListener(({editorState:u})=>i(u)),o,()=>{o()})}function e5(c,...t){const n=XS(...t);n.length>0&&c.classList.add(...n)}function t5(c,...t){const n=XS(...t);n.length>0&&c.classList.remove(...n)}function eC(c,t){for(const n of t)if(c.type.startsWith(n))return!0;return!1}function n5(c,t){const n=c[Symbol.iterator]();return new Promise((e,s)=>{const r=[],o=()=>{const{done:i,value:u}=n.next();if(i)return e(r);const a=new FileReader;a.addEventListener("error",s),a.addEventListener("load",()=>{const f=a.result;typeof f=="string"&&r.push({file:u,result:f}),o()}),eC(u,t)?a.readAsDataURL(u):o()};o()})}function r5(c,t){const n=[],e=(c||Un()).getLatest(),s=t||(Rt(e)?e.getLastDescendant():e);let r=e,o=o5(r);for(;r!==null&&!r.is(s);)if(n.push({depth:o,node:r}),Rt(r)&&r.getChildrenSize()>0)r=r.getFirstChild(),o++;else{let i=null;for(;i===null&&r!==null;)i=r.getNextSibling(),i===null?(r=r.getParent(),o--):r=i}return r!==null&&r.is(s)&&n.push({depth:o,node:r}),n}function o5(c){let t=c,n=0;for(;(t=t.getParent())!==null;)n++;return n}function i5(c,t){let n=c;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function s5(c){const t=tC(c,n=>Rt(n)&&!n.isInline());if(!Rt(t))throw Error(`Expected node ${c.__key} to have closest block element node.`);return t}const tC=(c,t)=>{let n=c;for(;n!==Un()&&n!=null;){if(t(n))return n;n=n.getParent()}return null};function a5(c,t,n,e){const s=i=>i instanceof t,r=i=>{const u=i.getChildren();for(let l=0;l<u.length;l++){const d=u[l];if(s(d))return null}let a=i,f=i;for(;a!==null;)if(f=a,a=a.getParent(),s(a))return{child:f,parent:a};return null},o=i=>{const u=r(i);if(u!==null){const{child:a,parent:f}=u;if(a.is(i)){e(f,i);const l=a.getNextSiblings(),d=l.length;if(f.insertAfter(a),d!==0){const p=n(f);a.insertAfter(p);for(let h=0;h<d;h++)p.append(l[h])}!f.canBeEmpty()&&f.getChildrenSize()===0&&f.remove()}}};return c.registerNodeTransform(t,o)}function l5(c,t){const e=new Map,s=c._pendingEditorState;for(const[o,i]of t._nodeMap){const u=fc(i);if(zt(u)){if(!zt(i))throw Error("Expected node be a TextNode");u.__text=i.__text}e.set(o,u)}s&&(s._nodeMap=e),c._dirtyType=2;const r=t._selection;kr(r===null?null:r.clone())}function c5(c){const t=st()||Ys();if(at(t)){const{focus:n}=t,e=n.getNode(),s=n.offset;if(Uo(e)){const r=e.getChildAtIndex(s);r==null?e.append(c):r.insertBefore(c),c.selectNext()}else{let r,o;zt(e)?(r=e.getParentOrThrow(),o=e.getIndexWithinParent(),s>0&&(o+=1,e.splitText(s))):(r=e,o=s);const[,i]=qp(r,o);i.insertBefore(c),i.selectStart()}}else{if(t!=null){const e=t.getNodes();e[e.length-1].getTopLevelElementOrThrow().insertAfter(c)}else Un().append(c);const n=An();c.insertAfter(n),n.select()}return c.getLatest()}function u5(c,t){const n=t();return c.replace(n),n.append(c),n}function d5(c,t){return c!==null?Object.getPrototypeOf(c).constructor.name===t.name:!1}function f5(c,t){const n=[];for(let e=0;e<c.length;e++){const s=t(c[e]);s!==null&&n.push(s)}return n}function p5(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}const h5=Object.freeze(Object.defineProperty({__proto__:null,$dfs:r5,$filter:f5,$findMatchingParent:tC,$getNearestBlockElementAncestorOrThrow:s5,$getNearestNodeOfType:i5,$insertFirst:p5,$insertNodeToNearestRoot:c5,$restoreEditorState:l5,$splitNode:qp,$wrapNodeInElement:u5,addClassNamesToElement:e5,isHTMLAnchorElement:wS,isHTMLElement:SS,isMimeType:eC,markSelection:QI,mediaFileReader:n5,mergeRegister:ZS,objectKlassEquals:d5,positionNodeOnRange:QS,registerNestedElementResolver:a5,removeClassNamesFromElement:t5},Symbol.toStringTag,{value:"Module"}));var g5=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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 nC(...c){const t=[];for(const n of c)if(n&&typeof n=="string")for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function rC(...c){return()=>{c.forEach(t=>t())}}function Ai(c){return`${c}px`}const m5={attributes:!0,characterData:!0,childList:!0,subtree:!0};function oC(c,t,n){let e=null,s=null,r=null,o=[];const i=document.createElement("div");function u(){if(e===null)throw Error("Unexpected null rootDOMNode");if(s===null)throw Error("Unexpected null parentDOMNode");const{left:l,top:d}=e.getBoundingClientRect(),p=s,h=ky(c,t);i.isConnected||p.append(i);let m=!1;for(let g=0;g<h.length;g++){const y=h[g],b=o[g]||document.createElement("div"),v=b.style;v.position!=="absolute"&&(v.position="absolute",m=!0);const _=Ai(y.left-l);v.left!==_&&(v.left=_,m=!0);const w=Ai(y.top-d);v.top!==w&&(b.style.top=w,m=!0);const x=Ai(y.width);v.width!==x&&(b.style.width=x,m=!0);const S=Ai(y.height);v.height!==S&&(b.style.height=S,m=!0),b.parentNode!==i&&(i.append(b),m=!0),o[g]=b}for(;o.length>h.length;)o.pop();m&&n(o)}function a(){s=null,e=null,r!==null&&r.disconnect(),r=null,i.remove();for(const l of o)l.remove();o=[]}const f=c.registerRootListener(function l(){const d=c.getRootElement();if(d===null)return a();const p=d.parentElement;if(!(p instanceof HTMLElement))return a();a(),e=d,s=p,r=new MutationObserver(h=>{const m=c.getRootElement(),g=m&&m.parentElement;if(m!==e||g!==s)return l();for(const y of h)if(!i.contains(y.target))return u()}),r.observe(p,m5),u()});return()=>{f(),a()}}function y5(c,t){let n=null,e=null,s=null,r=null,o=()=>{};function i(u){u.read(()=>{const a=st();if(!at(a))return n=null,e=null,s=null,r=null,o(),void(o=()=>{});const{anchor:f,focus:l}=a,d=f.getNode(),p=d.getKey(),h=f.offset,m=l.getNode(),g=m.getKey(),y=l.offset,b=c.getElementByKey(p),v=c.getElementByKey(g),_=n===null||b===null||h!==e||p!==n.getKey()||d!==n&&(!(n instanceof Ya)||d.updateDOM(n,b,c._config)),w=s===null||v===null||y!==r||g!==s.getKey()||m!==s&&(!(s instanceof Ya)||m.updateDOM(s,v,c._config));if(_||w){const x=c.getElementByKey(f.getNode().getKey()),S=c.getElementByKey(l.getNode().getKey());if(x!==null&&S!==null&&x.tagName==="SPAN"&&S.tagName==="SPAN"){const E=document.createRange();let O,j,A,T;l.isBefore(f)?(O=S,j=l.offset,A=x,T=f.offset):(O=x,j=f.offset,A=S,T=l.offset);const I=O.firstChild;if(I===null)throw Error("Expected text node to be first child of span");const k=A.firstChild;if(k===null)throw Error("Expected text node to be first child of span");E.setStart(I,j),E.setEnd(k,T),o(),o=oC(c,E,$=>{for(const H of $){const U=H.style;U.background!=="Highlight"&&(U.background="Highlight"),U.color!=="HighlightText"&&(U.color="HighlightText"),U.zIndex!=="-1"&&(U.zIndex="-1"),U.pointerEvents!=="none"&&(U.pointerEvents="none"),U.marginTop!==Ai(-1.5)&&(U.marginTop=Ai(-1.5)),U.paddingTop!==Ai(4)&&(U.paddingTop=Ai(4)),U.paddingBottom!==Ai(0)&&(U.paddingBottom=Ai(0))}t!==void 0&&t($)})}}n=d,e=h,s=m,r=y})}return i(c.getEditorState()),rC(c.registerUpdateListener(({editorState:u})=>i(u)),o,()=>{o()})}function b5(c,...t){const n=nC(...t);n.length>0&&c.classList.add(...n)}function v5(c,...t){const n=nC(...t);n.length>0&&c.classList.remove(...n)}function iC(c,t){for(const n of t)if(c.type.startsWith(n))return!0;return!1}function _5(c,t){const n=c[Symbol.iterator]();return new Promise((e,s)=>{const r=[],o=()=>{const{done:i,value:u}=n.next();if(i)return e(r);const a=new FileReader;a.addEventListener("error",s),a.addEventListener("load",()=>{const f=a.result;typeof f=="string"&&r.push({file:u,result:f}),o()}),iC(u,t)?a.readAsDataURL(u):o()};o()})}function x5(c,t){const n=[],e=(c||Un()).getLatest(),s=t||(Rt(e)?e.getLastDescendant():e);let r=e,o=function(i){let u=i,a=0;for(;(u=u.getParent())!==null;)a++;return a}(r);for(;r!==null&&!r.is(s);)if(n.push({depth:o,node:r}),Rt(r)&&r.getChildrenSize()>0)r=r.getFirstChild(),o++;else{let i=null;for(;i===null&&r!==null;)i=r.getNextSibling(),i===null?(r=r.getParent(),o--):r=i}return r!==null&&r.is(s)&&n.push({depth:o,node:r}),n}function w5(c,t){let n=c;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function S5(c){const t=sC(c,n=>Rt(n)&&!n.isInline());return Rt(t)||g5(4,c.__key),t}const sC=(c,t)=>{let n=c;for(;n!==Un()&&n!=null;){if(t(n))return n;n=n.getParent()}return null};function C5(c,t,n,e){const s=r=>r instanceof t;return c.registerNodeTransform(t,r=>{const o=(i=>{const u=i.getChildren();for(let l=0;l<u.length;l++){const d=u[l];if(s(d))return null}let a=i,f=i;for(;a!==null;)if(f=a,a=a.getParent(),s(a))return{child:f,parent:a};return null})(r);if(o!==null){const{child:i,parent:u}=o;if(i.is(r)){e(u,r);const a=i.getNextSiblings(),f=a.length;if(u.insertAfter(i),f!==0){const l=n(u);i.insertAfter(l);for(let d=0;d<f;d++)l.append(a[d])}u.canBeEmpty()||u.getChildrenSize()!==0||u.remove()}}})}function E5(c,t){const n=new Map,e=c._pendingEditorState;for(const[r,o]of t._nodeMap){const i=fc(o);if(zt(i)){if(!zt(o))throw Error("Expected node be a TextNode");i.__text=o.__text}n.set(r,i)}e&&(e._nodeMap=n),c._dirtyType=2;const s=t._selection;kr(s===null?null:s.clone())}function O5(c){const t=st()||Ys();if(at(t)){const{focus:n}=t,e=n.getNode(),s=n.offset;if(Uo(e)){const r=e.getChildAtIndex(s);r==null?e.append(c):r.insertBefore(c),c.selectNext()}else{let r,o;zt(e)?(r=e.getParentOrThrow(),o=e.getIndexWithinParent(),s>0&&(o+=1,e.splitText(s))):(r=e,o=s);const[,i]=qp(r,o);i.insertBefore(c),i.selectStart()}}else{if(t!=null){const e=t.getNodes();e[e.length-1].getTopLevelElementOrThrow().insertAfter(c)}else Un().append(c);const n=An();c.insertAfter(n),n.select()}return c.getLatest()}function T5(c,t){const n=t();return c.replace(n),n.append(c),n}function N5(c,t){return c!==null&&Object.getPrototypeOf(c).constructor.name===t.name}function k5(c,t){const n=[];for(let e=0;e<c.length;e++){const s=t(c[e]);s!==null&&n.push(s)}return n}function A5(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}const P5=Object.freeze(Object.defineProperty({__proto__:null,$dfs:x5,$filter:k5,$findMatchingParent:sC,$getNearestBlockElementAncestorOrThrow:S5,$getNearestNodeOfType:w5,$insertFirst:A5,$insertNodeToNearestRoot:O5,$restoreEditorState:E5,$splitNode:qp,$wrapNodeInElement:T5,addClassNamesToElement:b5,isHTMLAnchorElement:wS,isHTMLElement:SS,isMimeType:iC,markSelection:y5,mediaFileReader:_5,mergeRegister:rC,objectKlassEquals:N5,positionNodeOnRange:oC,registerNestedElementResolver:C5,removeClassNamesFromElement:v5},Symbol.toStringTag,{value:"Module"})),os=process.env.NODE_ENV==="development"?h5:P5,dn=os.$findMatchingParent,dh=os.$getNearestBlockElementAncestorOrThrow,wr=os.addClassNamesToElement,aC=os.isHTMLAnchorElement,oa=os.isHTMLElement,Xr=os.mergeRegister,Zr=os.objectKlassEquals,M5=os.registerNestedElementResolver,fh=os.removeClassNamesFromElement,ph=0,Ay=1,Py=2,li=0,I5=1,lC=2,R5=3,j5=4;function D5(c,t,n){const e=c._nodeMap,s=[];for(const r of t){const o=e.get(r);o!==void 0&&s.push(o)}for(const[r,o]of n){if(!o)continue;const i=e.get(r);i!==void 0&&!Xs(i)&&s.push(i)}return s}function L5(c,t,n,e,s){if(c===null||n.size===0&&e.size===0&&!s)return li;const r=t._selection,o=c._selection;if(s)return I5;if(!at(r)||!at(o)||!o.isCollapsed()||!r.isCollapsed())return li;const i=D5(t,n,e);if(i.length===0)return li;if(i.length>1){const y=t._nodeMap,b=y.get(r.anchor.key),v=y.get(o.anchor.key);return b&&v&&!c._nodeMap.has(b.__key)&&zt(b)&&b.__text.length===1&&r.anchor.offset===1?lC:li}const u=i[0],a=c._nodeMap.get(u.__key);if(!zt(a)||!zt(u)||a.__mode!==u.__mode)return li;const f=a.__text,l=u.__text;if(f===l)return li;const d=r.anchor,p=o.anchor;if(d.key!==p.key||d.type!=="text")return li;const h=d.offset,m=p.offset,g=l.length-f.length;return g===1&&m===h-1?lC:g===-1&&m===h+1?R5:g===-1&&m===h?j5:li}function B5(c,t,n){const e=t._nodeMap.get(c),s=n._nodeMap.get(c),r=t._selection,o=n._selection;let i=!1;return at(r)&&at(o)&&(i=r.anchor.type==="element"&&r.focus.type==="element"&&o.anchor.type==="text"&&o.focus.type==="text"),!i&&zt(e)&&zt(s)?e.__type===s.__type&&e.__text===s.__text&&e.__mode===s.__mode&&e.__detail===s.__detail&&e.__style===s.__style&&e.__format===s.__format&&e.__parent===s.__parent:!1}function F5(c,t){let n=Date.now(),e=li;return(s,r,o,i,u,a)=>{const f=Date.now();if(a.has("historic"))return e=li,n=f,Py;const l=L5(s,r,i,u,c.isComposing()),d=(()=>{const p=o===null||o.editor===c,h=a.has("history-push");if(!h&&p&&a.has("history-merge"))return ph;if(s===null)return Ay;const g=r._selection;if(!(i.size>0||u.size>0))return g!==null?ph:Py;if(h===!1&&l!==li&&l===e&&f<n+t&&p)return ph;if(i.size===1){const b=Array.from(i)[0];if(B5(b,s,r))return ph}return Ay})();return n=f,e=l,d}}function $5(c,t){const n=t.redoStack,e=t.undoStack;if(n.length!==0){const s=t.current;s!==null&&(e.push(s),c.dispatchCommand(Ti,!0));const r=n.pop();n.length===0&&c.dispatchCommand(Oi,!1),t.current=r||null,r&&r.editor.setEditorState(r.editorState,{tag:"historic"})}}function z5(c,t){const n=t.redoStack,e=t.undoStack;if(e.length!==0){const r=t.current,o=e.pop();r!==null&&(n.push(r),c.dispatchCommand(Oi,!0)),e.length===0&&c.dispatchCommand(Ti,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}function cC(c){c.undoStack=[],c.redoStack=[],c.current=null}function U5(c,t,n){const e=F5(c,n),s=({editorState:i,prevEditorState:u,dirtyLeaves:a,dirtyElements:f,tags:l})=>{const d=t.current,p=t.redoStack,h=t.undoStack,m=d===null?null:d.editorState;if(d!==null&&i===m)return;const g=e(u,i,d,a,f,l);if(g===Ay)p.length!==0&&(t.redoStack=[],c.dispatchCommand(Oi,!1)),d!==null&&(h.push({...d}),c.dispatchCommand(Ti,!0));else if(g===Py)return;t.current={editor:c,editorState:i}},r=Xr(c.registerCommand(rh,()=>(z5(c,t),!0),Ct),c.registerCommand(Qp,()=>($5(c,t),!0),Ct),c.registerCommand(fd,()=>(cC(t),!1),Ct),c.registerCommand(hS,()=>(cC(t),c.dispatchCommand(Oi,!1),c.dispatchCommand(Ti,!1),!0),Ct),c.registerUpdateListener(s)),o=c.registerUpdateListener(s);return()=>{r(),o()}}function H5(){return{current:null,redoStack:[],undoStack:[]}}const K5=Object.freeze(Object.defineProperty({__proto__:null,createEmptyHistoryState:H5,registerHistory:U5},Symbol.toStringTag,{value:"Module"})),hh=0,My=1,Iy=2,ci=0,W5=1,uC=2,q5=3,J5=4;function V5(c,t,n,e,s){if(c===null||n.size===0&&e.size===0&&!s)return ci;const r=t._selection,o=c._selection;if(s)return W5;if(!(at(r)&&at(o)&&o.isCollapsed()&&r.isCollapsed()))return ci;const i=function(y,b,v){const _=y._nodeMap,w=[];for(const x of b){const S=_.get(x);S!==void 0&&w.push(S)}for(const[x,S]of v){if(!S)continue;const E=_.get(x);E===void 0||Xs(E)||w.push(E)}return w}(t,n,e);if(i.length===0)return ci;if(i.length>1){const y=t._nodeMap,b=y.get(r.anchor.key),v=y.get(o.anchor.key);return b&&v&&!c._nodeMap.has(b.__key)&&zt(b)&&b.__text.length===1&&r.anchor.offset===1?uC:ci}const u=i[0],a=c._nodeMap.get(u.__key);if(!zt(a)||!zt(u)||a.__mode!==u.__mode)return ci;const f=a.__text,l=u.__text;if(f===l)return ci;const d=r.anchor,p=o.anchor;if(d.key!==p.key||d.type!=="text")return ci;const h=d.offset,m=p.offset,g=l.length-f.length;return g===1&&m===h-1?uC:g===-1&&m===h+1?q5:g===-1&&m===h?J5:ci}function G5(c,t){let n=Date.now(),e=ci;return(s,r,o,i,u,a)=>{const f=Date.now();if(a.has("historic"))return e=ci,n=f,Iy;const l=V5(s,r,i,u,c.isComposing()),d=(()=>{const p=o===null||o.editor===c,h=a.has("history-push");if(!h&&p&&a.has("history-merge"))return hh;if(s===null)return My;const m=r._selection;return i.size>0||u.size>0?h===!1&&l!==ci&&l===e&&f<n+t&&p||i.size===1&&function(g,y,b){const v=y._nodeMap.get(g),_=b._nodeMap.get(g),w=y._selection,x=b._selection;let S=!1;return at(w)&&at(x)&&(S=w.anchor.type==="element"&&w.focus.type==="element"&&x.anchor.type==="text"&&x.focus.type==="text"),!(S||!zt(v)||!zt(_))&&v.__type===_.__type&&v.__text===_.__text&&v.__mode===_.__mode&&v.__detail===_.__detail&&v.__style===_.__style&&v.__format===_.__format&&v.__parent===_.__parent}(Array.from(i)[0],s,r)?hh:My:m!==null?hh:Iy})();return n=f,e=l,d}}function dC(c){c.undoStack=[],c.redoStack=[],c.current=null}function Y5(c,t,n){const e=G5(c,n),s=({editorState:i,prevEditorState:u,dirtyLeaves:a,dirtyElements:f,tags:l})=>{const d=t.current,p=t.redoStack,h=t.undoStack,m=d===null?null:d.editorState;if(d!==null&&i===m)return;const g=e(u,i,d,a,f,l);if(g===My)p.length!==0&&(t.redoStack=[],c.dispatchCommand(Oi,!1)),d!==null&&(h.push({...d}),c.dispatchCommand(Ti,!0));else if(g===Iy)return;t.current={editor:c,editorState:i}},r=Xr(c.registerCommand(rh,()=>(function(i,u){const a=u.redoStack,f=u.undoStack;if(f.length!==0){const l=u.current,d=f.pop();l!==null&&(a.push(l),i.dispatchCommand(Oi,!0)),f.length===0&&i.dispatchCommand(Ti,!1),u.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:"historic"})}}(c,t),!0),Ct),c.registerCommand(Qp,()=>(function(i,u){const a=u.redoStack,f=u.undoStack;if(a.length!==0){const l=u.current;l!==null&&(f.push(l),i.dispatchCommand(Ti,!0));const d=a.pop();a.length===0&&i.dispatchCommand(Oi,!1),u.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:"historic"})}}(c,t),!0),Ct),c.registerCommand(fd,()=>(dC(t),!1),Ct),c.registerCommand(hS,()=>(dC(t),c.dispatchCommand(Oi,!1),c.dispatchCommand(Ti,!1),!0),Ct),c.registerUpdateListener(s)),o=c.registerUpdateListener(s);return()=>{r(),o()}}function X5(){return{current:null,redoStack:[],undoStack:[]}}const Z5=Object.freeze(Object.defineProperty({__proto__:null,createEmptyHistoryState:X5,registerHistory:Y5},Symbol.toStringTag,{value:"Module"})),fC=process.env.NODE_ENV==="development"?K5:Z5,gh=fC.createEmptyHistoryState,pC=fC.registerHistory;function Q5(c,t,n=1e3){const e=St.useMemo(()=>t||gh(),[t]);St.useEffect(()=>pC(c,e,n),[n,c,e])}function eR({externalHistoryState:c}){const[t]=pr();return Q5(t,c),null}const tR=Object.freeze(Object.defineProperty({__proto__:null,HistoryPlugin:eR,createEmptyHistoryState:gh},Symbol.toStringTag,{value:"Module"}));function nR({externalHistoryState:c}){const[t]=pr();return function(n,e,s=1e3){const r=St.useMemo(()=>e||gh(),[e]);St.useEffect(()=>pC(n,r,s),[s,n,r])}(t,c),null}const rR=Object.freeze(Object.defineProperty({__proto__:null,HistoryPlugin:nR,createEmptyHistoryState:gh},Symbol.toStringTag,{value:"Module"})),hC=(process.env.NODE_ENV==="development"?tR:rR).HistoryPlugin;var oR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function iR(c){const[t]=pr(),n=St.useMemo(()=>c(t),[t,c]),e=St.useRef(n.initialValueFn()),[s,r]=St.useState(e.current);return oR(()=>{const{initialValueFn:o,subscribe:i}=n,u=o();return e.current!==u&&(e.current=u,r(u)),i(a=>{e.current=a,r(a)})},[n,c]),s}function sR(c){return{initialValueFn:()=>c.isEditable(),subscribe:t=>c.registerEditableListener(t)}}function aR(){return iR(sR)}const lR=Object.freeze(Object.defineProperty({__proto__:null,default:aR},Symbol.toStringTag,{value:"Module"}));var cR=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function uR(c){return{initialValueFn:()=>c.isEditable(),subscribe:t=>c.registerEditableListener(t)}}function dR(){return function(c){const[t]=pr(),n=St.useMemo(()=>c(t),[t,c]),e=St.useRef(n.initialValueFn()),[s,r]=St.useState(e.current);return cR(()=>{const{initialValueFn:o,subscribe:i}=n,u=o();return e.current!==u&&(e.current=u,r(u)),i(a=>{e.current=a,r(a)})},[n,c]),s}(uR)}const fR=Object.freeze(Object.defineProperty({__proto__:null,default:dR},Symbol.toStringTag,{value:"Module"})),mh=(process.env.NODE_ENV==="development"?lR:fR).default;function pR(c,t){let n=c.getFirstChild(),e=0;e:for(;n!==null;){if(Rt(n)){const o=n.getFirstChild();if(o!==null){n=o;continue}}else if(zt(n)){const o=n.getTextContentSize();if(e+o>t)return{node:n,offset:t-e};e+=o}const s=n.getNextSibling();if(s!==null){n=s;continue}let r=n.getParent();for(;r!==null;){const o=r.getNextSibling();if(o!==null){n=o;continue e}r=r.getParent()}break}return null}function Ry(c,t=!0){if(c)return!1;let n=gC();return t&&(n=n.trim()),n===""}function hR(c,t){return()=>Ry(c,t)}function gC(){return Un().getTextContent()}function mC(c){if(!Ry(c,!1))return!1;const n=Un().getChildren(),e=n.length;if(e>1)return!1;for(let s=0;s<e;s++){const r=n[s];if(uo(r))return!1;if(Rt(r)){if(!xy(r)||r.__indent!==0)return!1;const o=r.getChildren(),i=o.length;for(let u=0;u<i;u++){const a=o[s];if(!zt(a))return!1}}}return!0}function gR(c){return()=>mC(c)}function mR(c,t,n,e){const s=l=>l instanceof n,r=l=>{const d=Ei(l.getTextContent());d.setFormat(l.getFormat()),l.replace(d)},o=l=>l.getLatest().__mode,i=l=>{if(!l.isSimpleText())return;const d=l.getPreviousSibling();let p=l.getTextContent(),h=l,m;if(zt(d)){const g=d.getTextContent(),y=g+p,b=t(y);if(s(d))if(b===null||o(d)!==0){r(d);return}else{const v=b.end-g.length;if(v>0){const _=p.slice(0,v),w=g+_;if(d.select(),d.setTextContent(w),v===p.length)l.remove();else{const x=p.slice(v);l.setTextContent(x)}return}}else if(b===null||b.start<g.length)return}for(;;){m=t(p);let g=m===null?"":p.slice(m.end);if(p=g,g===""){const v=h.getNextSibling();if(zt(v)){g=h.getTextContent()+v.getTextContent();const _=t(g);if(_===null){s(v)?r(v):v.markDirty();return}else if(_.start!==0)return}}else{const v=t(g);if(v!==null&&v.start===0)return}if(m===null)return;if(m.start===0&&zt(d)&&d.isTextEntity())continue;let y;m.start===0?[y,h]=h.splitText(m.end):[,y,h]=h.splitText(m.start,m.end);const b=e(y);if(b.setFormat(y.getFormat()),y.replace(b),h==null)return}},u=l=>{const d=l.getTextContent(),p=t(d);if(p===null||p.start!==0){r(l);return}if(d.length>p.end){l.splitText(p.end);return}const h=l.getPreviousSibling();zt(h)&&h.isTextEntity()&&(r(h),r(l));const m=l.getNextSibling();zt(m)&&m.isTextEntity()&&(r(m),s(l)&&r(l))},a=c.registerNodeTransform(Ya,i),f=c.registerNodeTransform(n,u);return[a,f]}const yR=Object.freeze(Object.defineProperty({__proto__:null,$canShowPlaceholder:mC,$canShowPlaceholderCurry:gR,$findTextIntersectionFromCharacters:pR,$isRootTextContentEmpty:Ry,$isRootTextContentEmptyCurry:hR,$rootTextContent:gC,registerLexicalTextEntity:mR},Symbol.toStringTag,{value:"Module"}));function bR(c,t){let n=c.getFirstChild(),e=0;e:for(;n!==null;){if(Rt(n)){const o=n.getFirstChild();if(o!==null){n=o;continue}}else if(zt(n)){const o=n.getTextContentSize();if(e+o>t)return{node:n,offset:t-e};e+=o}const s=n.getNextSibling();if(s!==null){n=s;continue}let r=n.getParent();for(;r!==null;){const o=r.getNextSibling();if(o!==null){n=o;continue e}r=r.getParent()}break}return null}function jy(c,t=!0){if(c)return!1;let n=yC();return t&&(n=n.trim()),n===""}function vR(c,t){return()=>jy(c,t)}function yC(){return Un().getTextContent()}function bC(c){if(!jy(c,!1))return!1;const t=Un().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const s=t[e];if(uo(s))return!1;if(Rt(s)){if(!xy(s)||s.__indent!==0)return!1;const r=s.getChildren(),o=r.length;for(let i=0;i<o;i++){const u=r[e];if(!zt(u))return!1}}}return!0}function _R(c){return()=>bC(c)}function xR(c,t,n,e){const s=o=>o instanceof n,r=o=>{const i=Ei(o.getTextContent());i.setFormat(o.getFormat()),o.replace(i)};return[c.registerNodeTransform(Ya,o=>{if(!o.isSimpleText())return;const i=o.getPreviousSibling();let u,a=o.getTextContent(),f=o;if(zt(i)){const l=i.getTextContent(),d=t(l+a);if(s(i)){if(d===null||(p=>p.getLatest().__mode)(i)!==0)return void r(i);{const p=d.end-l.length;if(p>0){const h=l+a.slice(0,p);if(i.select(),i.setTextContent(h),p===a.length)o.remove();else{const m=a.slice(p);o.setTextContent(m)}return}}}else if(d===null||d.start<l.length)return}for(;;){u=t(a);let l,d=u===null?"":a.slice(u.end);if(a=d,d===""){const h=f.getNextSibling();if(zt(h)){d=f.getTextContent()+h.getTextContent();const m=t(d);if(m===null)return void(s(h)?r(h):h.markDirty());if(m.start!==0)return}}else{const h=t(d);if(h!==null&&h.start===0)return}if(u===null)return;if(u.start===0&&zt(i)&&i.isTextEntity())continue;u.start===0?[l,f]=f.splitText(u.end):[,l,f]=f.splitText(u.start,u.end);const p=e(l);if(p.setFormat(l.getFormat()),l.replace(p),f==null)return}}),c.registerNodeTransform(n,o=>{const i=o.getTextContent(),u=t(i);if(u===null||u.start!==0)return void r(o);if(i.length>u.end)return void o.splitText(u.end);const a=o.getPreviousSibling();zt(a)&&a.isTextEntity()&&(r(a),r(o));const f=o.getNextSibling();zt(f)&&f.isTextEntity()&&(r(f),s(o)&&r(o))})]}const wR=Object.freeze(Object.defineProperty({__proto__:null,$canShowPlaceholder:bC,$canShowPlaceholderCurry:_R,$findTextIntersectionFromCharacters:bR,$isRootTextContentEmpty:jy,$isRootTextContentEmptyCurry:vR,$rootTextContent:yC,registerLexicalTextEntity:xR},Symbol.toStringTag,{value:"Module"})),Dy=process.env.NODE_ENV==="development"?yR:wR,yh=Dy.$canShowPlaceholderCurry,SR=Dy.$isRootTextContentEmpty,CR=Dy.$rootTextContent;function ER(c){const t=window.location.origin,n=e=>{if(e.origin!==t)return;const s=c.getRootElement();if(document.activeElement!==s)return;const r=e.data;if(typeof r=="string"){let o;try{o=JSON.parse(r)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const i=o.payload;if(i&&i.functionId==="makeChanges"){const u=i.args;if(u){const[a,f,l,d,p,h]=u;c.update(()=>{const m=st();if(at(m)){const g=m.anchor;let y=g.getNode(),b=0,v=0;if(zt(y)&&a>=0&&f>=0&&(b=a,v=a+f,m.setTextNodeRange(y,b,y,v)),(b!==v||l!=="")&&(m.insertRawText(l),y=g.getNode()),zt(y)){b=d,v=d+p;const _=y.getTextContentSize();b=b>_?_:b,v=v>_?_:v,m.setTextNodeRange(y,b,y,v)}e.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const OR=Object.freeze(Object.defineProperty({__proto__:null,registerDragonSupport:ER},Symbol.toStringTag,{value:"Module"}));function TR(c){const t=window.location.origin,n=e=>{if(e.origin!==t)return;const s=c.getRootElement();if(document.activeElement!==s)return;const r=e.data;if(typeof r=="string"){let o;try{o=JSON.parse(r)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const i=o.payload;if(i&&i.functionId==="makeChanges"){const u=i.args;if(u){const[a,f,l,d,p,h]=u;c.update(()=>{const m=st();if(at(m)){const g=m.anchor;let y=g.getNode(),b=0,v=0;if(zt(y)&&a>=0&&f>=0&&(b=a,v=a+f,m.setTextNodeRange(y,b,y,v)),b===v&&l===""||(m.insertRawText(l),y=g.getNode()),zt(y)){b=d,v=d+p;const _=y.getTextContentSize();b=b>_?_:b,v=v>_?_:v,m.setTextNodeRange(y,b,y,v)}e.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const NR=Object.freeze(Object.defineProperty({__proto__:null,registerDragonSupport:TR},Symbol.toStringTag,{value:"Module"})),bh=(process.env.NODE_ENV==="development"?OR:NR).registerDragonSupport;function kR(c,t){const n=t.body?t.body.childNodes:[];let e=[];for(let s=0;s<n.length;s++){const r=n[s];if(!_C.has(r.nodeName)){const o=xC(r,c);o!==null&&(e=e.concat(o))}}return e}function AR(c,t){if(typeof document>"u"||typeof window>"u"&&typeof global.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 n=document.createElement("div"),s=Un().getChildren();for(let r=0;r<s.length;r++){const o=s[r];vC(c,o,n,t)}return n.innerHTML}function vC(c,t,n,e=null){let s=e!==null?t.isSelected(e):!0;const r=Rt(t)&&t.excludeFromCopy("html");let o=t;if(e!==null){let p=fc(t);p=zt(p)&&e!==null?uh(e,p):p,o=p}const i=Rt(o)?o.getChildren():[],u=c._nodes.get(o.getType());let a;u&&u.exportDOM!==void 0?a=u.exportDOM(c,o):a=o.exportDOM(c);const{element:f,after:l}=a;if(!f)return!1;const d=document.createDocumentFragment();for(let p=0;p<i.length;p++){const h=i[p],m=vC(c,h,d,e);!s&&Rt(t)&&m&&t.extractWithChild(h,e,"html")&&(s=!0)}if(s&&!r){if(oa(f)&&f.append(d),n.append(f),l){const p=l.call(o,f);p&&f.replaceWith(p)}}else n.append(d);return s}function PR(c,t){const{nodeName:n}=c,e=t._htmlConversions.get(n.toLowerCase());let s=null;if(e!==void 0)for(const r of e){const o=r(c);o!==null&&(s===null||(s.priority||0)<(o.priority||0))&&(s=o)}return s!==null?s.conversion:null}const _C=new Set(["STYLE","SCRIPT"]);function xC(c,t,n=new Map,e){let s=[];if(_C.has(c.nodeName))return s;let r=null;const o=PR(c,t),i=o?o(c):null;let u=null;if(i!==null){u=i.after;const l=i.node;if(r=Array.isArray(l)?l[l.length-1]:l,r!==null){for(const[,d]of n)if(r=d(r,e),!r)break;r&&s.push(...Array.isArray(l)?l:[r])}i.forChild!=null&&n.set(c.nodeName,i.forChild)}const a=c.childNodes;let f=[];for(let l=0;l<a.length;l++)f.push(...xC(a[l],t,new Map(n),r));return u!=null&&(f=u(f)),r==null?s=s.concat(f):Rt(r)&&r.append(...f),s}const MR=Object.freeze(Object.defineProperty({__proto__:null,$generateHtmlFromNodes:AR,$generateNodesFromDOM:kR},Symbol.toStringTag,{value:"Module"}));function IR(c,t){const n=t.body?t.body.childNodes:[];let e=[];for(let s=0;s<n.length;s++){const r=n[s];if(!SC.has(r.nodeName)){const o=CC(r,c);o!==null&&(e=e.concat(o))}}return e}function RR(c,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),e=Un().getChildren();for(let s=0;s<e.length;s++)wC(c,e[s],n,t);return n.innerHTML}function wC(c,t,n,e=null){let s=e===null||t.isSelected(e);const r=Rt(t)&&t.excludeFromCopy("html");let o=t;if(e!==null){let p=fc(t);p=zt(p)&&e!==null?uh(e,p):p,o=p}const i=Rt(o)?o.getChildren():[],u=c._nodes.get(o.getType());let a;a=u&&u.exportDOM!==void 0?u.exportDOM(c,o):o.exportDOM(c);const{element:f,after:l}=a;if(!f)return!1;const d=document.createDocumentFragment();for(let p=0;p<i.length;p++){const h=i[p],m=wC(c,h,d,e);!s&&Rt(t)&&m&&t.extractWithChild(h,e,"html")&&(s=!0)}if(s&&!r){if(oa(f)&&f.append(d),n.append(f),l){const p=l.call(o,f);p&&f.replaceWith(p)}}else n.append(d);return s}const SC=new Set(["STYLE","SCRIPT"]);function CC(c,t,n=new Map,e){let s=[];if(SC.has(c.nodeName))return s;let r=null;const o=function(l,d){const{nodeName:p}=l,h=d._htmlConversions.get(p.toLowerCase());let m=null;if(h!==void 0)for(const g of h){const y=g(l);y!==null&&(m===null||(m.priority||0)<(y.priority||0))&&(m=y)}return m!==null?m.conversion:null}(c,t),i=o?o(c):null;let u=null;if(i!==null){u=i.after;const l=i.node;if(r=Array.isArray(l)?l[l.length-1]:l,r!==null){for(const[,d]of n)if(r=d(r,e),!r)break;r&&s.push(...Array.isArray(l)?l:[r])}i.forChild!=null&&n.set(c.nodeName,i.forChild)}const a=c.childNodes;let f=[];for(let l=0;l<a.length;l++)f.push(...CC(a[l],t,new Map(n),r));return u!=null&&(f=u(f)),r==null?s=s.concat(f):Rt(r)&&r.append(...f),s}const jR=Object.freeze(Object.defineProperty({__proto__:null,$generateHtmlFromNodes:RR,$generateNodesFromDOM:IR},Symbol.toStringTag,{value:"Module"})),EC=process.env.NODE_ENV==="development"?MR:jR,OC=EC.$generateHtmlFromNodes,TC=EC.$generateNodesFromDOM,DR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",NC=c=>DR?(c||window).getSelection():null;function kC(c){const t=st();if(t==null)throw Error("Expected valid LexicalSelection");return at(t)&&t.isCollapsed()||t.getNodes().length===0?"":OC(c,t)}function AC(c){const t=st();if(t==null)throw Error("Expected valid LexicalSelection");return at(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(MC(c,t))}function LR(c,t){const n=c.getData("text/plain")||c.getData("text/uri-list");n!=null&&t.insertRawText(n)}function BR(c,t,n){const e=c.getData("application/x-lexical-editor");if(e)try{const o=JSON.parse(e);if(o.namespace===n._config.namespace&&Array.isArray(o.nodes)){const i=IC(o.nodes);return Ly(n,i,t)}}catch{}const s=c.getData("text/html");if(s)try{const i=new DOMParser().parseFromString(s,"text/html"),u=TC(n,i);return Ly(n,u,t)}catch{}const r=c.getData("text/plain")||c.getData("text/uri-list");if(r!=null)if(at(t)){const o=r.split(/(\r?\n|\t)/);o[o.length-1]===""&&o.pop();for(let i=0;i<o.length;i++){const u=o[i];u===`
|
|
54
54
|
`||u===`\r
|
|
55
|
-
`?t.insertParagraph():u===" "?t.insertNodes([Hp()]):t.insertText(u)}}else t.insertRawText(r)}function Ly(c,t,n){c.dispatchCommand(th,{nodes:t,selection:n})||n.insertNodes(t)}function
|
|
55
|
+
`?t.insertParagraph():u===" "?t.insertNodes([Hp()]):t.insertText(u)}}else t.insertRawText(r)}function Ly(c,t,n){c.dispatchCommand(th,{nodes:t,selection:n})||n.insertNodes(t)}function FR(c){const t=c.exportJSON(),n=c.constructor;if(t.type!==n.getType())throw Error(`LexicalNode: Node ${n.name} does not implement .exportJSON().`);if(Rt(c)){const e=t.children;if(!Array.isArray(e))throw Error(`LexicalNode: Node ${n.name} is an element but .exportJSON() does not have a children array.`)}return t}function PC(c,t,n,e=[]){let s=t!==null?n.isSelected(t):!0;const r=Rt(n)&&n.excludeFromCopy("html");let o=n;if(t!==null){let a=fc(n);a=zt(a)&&t!==null?uh(t,a):a,o=a}const i=Rt(o)?o.getChildren():[],u=FR(o);if(zt(o)){const a=o.__text;a.length>0?u.text=a:s=!1}for(let a=0;a<i.length;a++){const f=i[a],l=PC(c,t,f,u.children);!s&&Rt(n)&&l&&n.extractWithChild(f,t,"clone")&&(s=!0)}if(s&&!r)e.push(u);else if(Array.isArray(u.children))for(let a=0;a<u.children.length;a++){const f=u.children[a];e.push(f)}return s}function MC(c,t){const n=[],s=Un().getChildren();for(let r=0;r<s.length;r++){const o=s[r];PC(c,t,o,n)}return{namespace:c._config.namespace,nodes:n}}function IC(c){const t=[];for(let n=0;n<c.length;n++){const e=c[n],s=pS(e);zt(s)&&VS(s),t.push(s)}return t}const $R=50;let pc=null;async function zR(c,t){if(pc!==null)return!1;if(t!==null)return new Promise((i,u)=>{c.update(()=>{i(RC(c,t))})});const n=c.getRootElement(),e=c._window==null?window.document:c._window.document,s=NC(c._window);if(n===null||s===null)return!1;const r=e.createElement("span");r.style.cssText="position: fixed; top: -1000px;",r.append(e.createTextNode("#")),n.append(r);const o=new Range;return o.setStart(r,0),o.setEnd(r,1),s.removeAllRanges(),s.addRange(o),new Promise((i,u)=>{const a=c.registerCommand(sc,f=>(Zr(f,ClipboardEvent)&&(a(),pc!==null&&(window.clearTimeout(pc),pc=null),i(RC(c,f))),!0),mr);pc=window.setTimeout(()=>{a(),pc=null,i(!1)},$R),e.execCommand("copy"),r.remove()})}function RC(c,t){const n=NC(c._window);if(!n)return!1;const e=n.anchorNode,s=n.focusNode;if(e!==null&&s!==null&&!ES(c,e,s))return!1;t.preventDefault();const r=t.clipboardData,o=st();if(r===null||o===null)return!1;const i=kC(c),u=AC(c);let a="";return o!==null&&(a=o.getTextContent()),i!==null&&r.setData("text/html",i),u!==null&&r.setData("application/x-lexical-editor",u),r.setData("text/plain",a),!0}const UR=Object.freeze(Object.defineProperty({__proto__:null,$generateJSONFromSelectedNodes:MC,$generateNodesFromSerializedNodes:IC,$getHtmlContent:kC,$getLexicalContent:AC,$insertDataTransferForPlainText:LR,$insertDataTransferForRichText:BR,$insertGeneratedNodes:Ly,copyToClipboard:zR},Symbol.toStringTag,{value:"Module"}));var jC=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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.`)};const HR=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,DC=c=>HR?(c||window).getSelection():null;function LC(c){const t=st();if(t==null)throw Error("Expected valid LexicalSelection");return at(t)&&t.isCollapsed()||t.getNodes().length===0?"":OC(c,t)}function BC(c){const t=st();if(t==null)throw Error("Expected valid LexicalSelection");return at(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify($C(c,t))}function KR(c,t){const n=c.getData("text/plain")||c.getData("text/uri-list");n!=null&&t.insertRawText(n)}function WR(c,t,n){const e=c.getData("application/x-lexical-editor");if(e)try{const o=JSON.parse(e);if(o.namespace===n._config.namespace&&Array.isArray(o.nodes))return By(n,zC(o.nodes),t)}catch{}const s=c.getData("text/html");if(s)try{const o=new DOMParser().parseFromString(s,"text/html");return By(n,TC(n,o),t)}catch{}const r=c.getData("text/plain")||c.getData("text/uri-list");if(r!=null)if(at(t)){const o=r.split(/(\r?\n|\t)/);o[o.length-1]===""&&o.pop();for(let i=0;i<o.length;i++){const u=o[i];u===`
|
|
56
56
|
`||u===`\r
|
|
57
|
-
`?t.insertParagraph():u===" "?t.insertNodes([Hp()]):t.insertText(u)}}else t.insertRawText(r)}function By(c,t,n){c.dispatchCommand(th,{nodes:t,selection:n})||n.insertNodes(t)}function $C(c,t,n,e=[]){let s=t===null||n.isSelected(t);const r=Rt(n)&&n.excludeFromCopy("html");let o=n;if(t!==null){let a=fc(n);a=zt(a)&&t!==null?uh(t,a):a,o=a}const i=Rt(o)?o.getChildren():[],u=function(a){const f=a.exportJSON(),l=a.constructor;if(f.type!==l.getType()&&DC(58,l.name),Rt(a)){const d=f.children;Array.isArray(d)||DC(59,l.name)}return f}(o);if(zt(o)){const a=o.__text;a.length>0?u.text=a:s=!1}for(let a=0;a<i.length;a++){const f=i[a],l=$C(c,t,f,u.children);!s&&Rt(n)&&l&&n.extractWithChild(f,t,"clone")&&(s=!0)}if(s&&!r)e.push(u);else if(Array.isArray(u.children))for(let a=0;a<u.children.length;a++){const f=u.children[a];e.push(f)}return s}function zC(c,t){const n=[],e=Un().getChildren();for(let s=0;s<e.length;s++)$C(c,t,e[s],n);return{namespace:c._config.namespace,nodes:n}}function UC(c){const t=[];for(let n=0;n<c.length;n++){const e=c[n],s=hS(e);zt(s)&&GS(s),t.push(s)}return t}let hc=null;async function JR(c,t){if(hc!==null)return!1;if(t!==null)return new Promise((i,u)=>{c.update(()=>{i(HC(c,t))})});const n=c.getRootElement(),e=c._window==null?window.document:c._window.document,s=LC(c._window);if(n===null||s===null)return!1;const r=e.createElement("span");r.style.cssText="position: fixed; top: -1000px;",r.append(e.createTextNode("#")),n.append(r);const o=new Range;return o.setStart(r,0),o.setEnd(r,1),s.removeAllRanges(),s.addRange(o),new Promise((i,u)=>{const a=c.registerCommand(sc,f=>(Zr(f,ClipboardEvent)&&(a(),hc!==null&&(window.clearTimeout(hc),hc=null),i(HC(c,f))),!0),mr);hc=window.setTimeout(()=>{a(),hc=null,i(!1)},50),e.execCommand("copy"),r.remove()})}function HC(c,t){const n=LC(c._window);if(!n)return!1;const e=n.anchorNode,s=n.focusNode;if(e!==null&&s!==null&&!OS(c,e,s))return!1;t.preventDefault();const r=t.clipboardData,o=st();if(r===null||o===null)return!1;const i=BC(c),u=FC(c);let a="";return o!==null&&(a=o.getTextContent()),i!==null&&r.setData("text/html",i),u!==null&&r.setData("application/x-lexical-editor",u),r.setData("text/plain",a),!0}const VR=Object.freeze(Object.defineProperty({__proto__:null,$generateJSONFromSelectedNodes:zC,$generateNodesFromSerializedNodes:UC,$getHtmlContent:BC,$getLexicalContent:FC,$insertDataTransferForPlainText:WR,$insertDataTransferForRichText:qR,$insertGeneratedNodes:By,copyToClipboard:JR},Symbol.toStringTag,{value:"Module"})),vh=process.env.NODE_ENV==="development"?HR:VR,KC=vh.$getHtmlContent,_h=vh.$insertDataTransferForPlainText,xh=vh.$insertDataTransferForRichText,wh=vh.copyToClipboard;function WC(c,t){if(typeof document.caretRangeFromPoint<"u"){const n=document.caretRangeFromPoint(c,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(c,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}else return null}const gc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",GR=gc&&"documentMode"in document?document.documentMode:null,YR=gc&&"InputEvent"in window&&!GR?"getTargetRanges"in new window.InputEvent("input"):!1,XR=gc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ZR=gc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,QR=gc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ej=gc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!QR,Fy=Xa("DRAG_DROP_PASTE_FILE");class md extends po{static getType(){return"quote"}static clone(t){return new md(t.__key)}constructor(t){super(t)}createDOM(t){const n=document.createElement("blockquote");return wr(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:nj,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=$y();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,n){const e=An(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=An();return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}}function $y(){return Gr(new md)}function tj(c){return c instanceof md}class yd extends po{static getType(){return"heading"}static clone(t){return new yd(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}createDOM(t){const n=this.__tag,e=document.createElement(n),r=t.theme.heading;if(r!==void 0){const o=r[n];wr(e,o)}return e}updateDOM(t,n){return!1}static importDOM(){return{h1:t=>({conversion:mc,priority:0}),h2:t=>({conversion:mc,priority:0}),h3:t=>({conversion:mc,priority:0}),h4:t=>({conversion:mc,priority:0}),h5:t=>({conversion:mc,priority:0}),h6:t=>({conversion:mc,priority:0}),p:t=>{const e=t.firstChild;return e!==null&&qC(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>qC(t)?{conversion:n=>({node:yc("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=yc(t.tag);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,n=!0){const e=t?t.anchor.offset:0,s=e===this.getTextContentSize()||!t?An():yc(this.getTag()),r=this.getDirection();if(s.setDirection(r),this.insertAfter(s,n),e===0&&!this.isEmpty()&&t){const o=An();o.select(),this.replace(o,!0)}return s}collapseAtStart(){const t=this.isEmpty()?An():yc(this.getTag());return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}extractWithChild(){return!0}}function qC(c){return c.nodeName.toLowerCase()==="span"?c.style.fontSize==="26pt":!1}function mc(c){const t=c.nodeName.toLowerCase();let n=null;return(t==="h1"||t==="h2"||t==="h3"||t==="h4"||t==="h5"||t==="h6")&&(n=yc(t),c.style!==null&&n.setFormat(c.style.textAlign)),{node:n}}function nj(c){const t=$y();return c.style!==null&&t.setFormat(c.style.textAlign),{node:t}}function yc(c){return Gr(new yd(c))}function rj(c){return c instanceof yd}function oj(c,t){c.preventDefault(),t.update(()=>{const n=st(),e=Zr(c,InputEvent)||Zr(c,KeyboardEvent)?null:c.clipboardData;e!=null&&n!==null&&xh(e,n,t)},{tag:"paste"})}async function ij(c,t){await wh(t,Zr(c,ClipboardEvent)?c:null),t.update(()=>{const n=st();at(n)?n.removeText():fo(n)&&n.getNodes().forEach(e=>e.remove())})}function bd(c){let t=null;if(Zr(c,DragEvent)?t=c.dataTransfer:Zr(c,ClipboardEvent)&&(t=c.clipboardData),t===null)return[!1,[],!1];const n=t.types,e=n.includes("Files"),s=n.includes("text/html")||n.includes("text/plain");return[e,Array.from(t.files),s]}function JC(c){const t=st();if(!at(t))return!1;const n=new Set,e=t.getNodes();for(let s=0;s<e.length;s++){const r=e[s],o=r.getKey();if(n.has(o))continue;const i=dh(r),u=i.getKey();i.canIndent()&&!n.has(u)&&(n.add(u),c(i))}return n.size>0}function Sh(c){const t=xr(c);return uo(t)}function sj(c){const t=c.focus;return t.key==="root"&&t.offset===Un().getChildrenSize()}function aj(c){return Xr(c.registerCommand(mS,n=>{const e=st();return fo(e)?(e.clear(),!0):!1},0),c.registerCommand(Yr,n=>{const e=st();return at(e)?(e.deleteCharacter(n),!0):!1},Ct),c.registerCommand(Qs,n=>{const e=st();return at(e)?(e.deleteWord(n),!0):!1},Ct),c.registerCommand(Zs,n=>{const e=st();return at(e)?(e.deleteLine(n),!0):!1},Ct),c.registerCommand(ic,n=>{const e=st();if(typeof n=="string")e!==null&&e.insertText(n);else{if(e===null)return!1;const s=n.dataTransfer;if(s!=null)xh(s,e,c);else if(at(e)){const r=n.data;return r&&e.insertText(r),!0}}return!0},Ct),c.registerCommand(eh,()=>{const n=st();return at(n)?(n.removeText(),!0):!1},Ct),c.registerCommand(Ni,n=>{const e=st();return at(e)?(e.formatText(n),!0):!1},Ct),c.registerCommand(ea,n=>{const e=st();if(!at(e)&&!fo(e))return!1;const s=e.getNodes();for(const r of s){const o=dn(r,i=>Rt(i)&&!i.isInline());o!==null&&o.setFormat(n)}return!0},Ct),c.registerCommand(ta,n=>{const e=st();return at(e)?(e.insertLineBreak(n),!0):!1},Ct),c.registerCommand(ac,()=>{const n=st();return at(n)?(n.insertParagraph(),!0):!1},Ct),c.registerCommand(_S,()=>(fS([Hp()]),!0),Ct),c.registerCommand(vS,()=>JC(n=>{const e=n.getIndent();n.setIndent(e+1)}),Ct),c.registerCommand(Zp,()=>JC(n=>{const e=n.getIndent();e>0&&n.setIndent(e-1)}),Ct),c.registerCommand(Yp,n=>{const e=st();if(fo(e)&&!Sh(n.target)){const s=e.getNodes();if(s.length>0)return s[0].selectPrevious(),!0}else if(at(e)){const s=oc(e.focus,!0);if(!n.shiftKey&&uo(s)&&!s.isIsolated()&&!s.isInline())return s.selectPrevious(),n.preventDefault(),!0}return!1},Ct),c.registerCommand(Gp,n=>{const e=st();if(fo(e)){const s=e.getNodes();if(s.length>0)return s[0].selectNext(0,0),!0}else if(at(e)){if(sj(e))return n.preventDefault(),!0;const s=oc(e.focus,!1);if(!n.shiftKey&&uo(s)&&!s.isIsolated()&&!s.isInline())return s.selectNext(),n.preventDefault(),!0}return!1},Ct),c.registerCommand(lc,n=>{const e=st();if(fo(e)){const s=e.getNodes();if(s.length>0)return n.preventDefault(),s[0].selectPrevious(),!0}if(!at(e))return!1;if(ra(e,!0)){const s=n.shiftKey;return n.preventDefault(),na(e,s,!0),!0}return!1},Ct),c.registerCommand(cc,n=>{const e=st();if(fo(e)&&!Sh(n.target)){const r=e.getNodes();if(r.length>0)return n.preventDefault(),r[0].selectNext(0,0),!0}if(!at(e))return!1;const s=n.shiftKey;return ra(e,!1)?(n.preventDefault(),na(e,s,!1),!0):!1},Ct),c.registerCommand(Va,n=>{if(Sh(n.target))return!1;const e=st();if(!at(e))return!1;n.preventDefault();const{anchor:s}=e,r=s.getNode();return e.isCollapsed()&&s.offset===0&&!Xs(r)&&dh(r).getIndent()>0?c.dispatchCommand(Zp,void 0):c.dispatchCommand(Yr,!0)},Ct),c.registerCommand(Ga,n=>{if(Sh(n.target))return!1;const e=st();return at(e)?(n.preventDefault(),c.dispatchCommand(Yr,!1)):!1},Ct),c.registerCommand(Xp,n=>{const e=st();if(!at(e))return!1;if(n!==null){if((ZR||XR||ej)&&YR)return!1;if(n.preventDefault(),n.shiftKey)return c.dispatchCommand(ta,!1)}return c.dispatchCommand(ac,void 0)},Ct),c.registerCommand(hd,()=>{const n=st();return at(n)?(c.blur(),!0):!1},Ct),c.registerCommand(Vp,n=>{const[,e]=bd(n);if(e.length>0){const r=n.clientX,o=n.clientY,i=WC(r,o);if(i!==null){const{offset:u,node:a}=i,f=xr(a);if(f!==null){const l=ud();if(zt(f))l.anchor.set(f.getKey(),u,"text"),l.focus.set(f.getKey(),u,"text");else{const p=f.getParentOrThrow().getKey(),h=f.getIndexWithinParent()+1;l.anchor.set(p,h,"element"),l.focus.set(p,h,"element")}const d=Kp(l);kr(d)}c.dispatchCommand(Fy,e)}return n.preventDefault(),!0}const s=st();return!!at(s)},Ct),c.registerCommand(Jp,n=>{const[e]=bd(n),s=st();return!(e&&!at(s))},Ct),c.registerCommand(yS,n=>{const[e]=bd(n),s=st();if(e&&!at(s))return!1;const r=n.clientX,o=n.clientY,i=WC(r,o);if(i!==null){const u=xr(i.node);uo(u)&&n.preventDefault()}return!0},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,n=>(wh(c,Zr(n,ClipboardEvent)?n:null),!0),Ct),c.registerCommand(pd,n=>(ij(n,c),!0),Ct),c.registerCommand(gd,n=>{const[,e,s]=bd(n);return e.length>0&&!s?(c.dispatchCommand(Fy,e),!0):ES(n.target)?!1:st()!==null?(oj(n,c),!0):!1},Ct))}const lj=Object.freeze(Object.defineProperty({__proto__:null,$createHeadingNode:yc,$createQuoteNode:$y,$isHeadingNode:rj,$isQuoteNode:tj,DRAG_DROP_PASTE:Fy,HeadingNode:yd,QuoteNode:md,eventFiles:bd,registerRichText:aj},Symbol.toStringTag,{value:"Module"}));function VC(c,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(c,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(c,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const bc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,cj=bc&&"documentMode"in document?document.documentMode:null,uj=!(!bc||!("InputEvent"in window)||cj)&&"getTargetRanges"in new window.InputEvent("input"),dj=bc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),fj=bc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,pj=bc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),hj=bc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!pj,zy=Xa("DRAG_DROP_PASTE_FILE");class vd extends po{static getType(){return"quote"}static clone(t){return new vd(t.__key)}constructor(t){super(t)}createDOM(t){const n=document.createElement("blockquote");return wr(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:mj,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=Uy();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,n){const e=An(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=An();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}}function Uy(){return Gr(new vd)}function gj(c){return c instanceof vd}class _d extends po{static getType(){return"heading"}static clone(t){return new _d(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}createDOM(t){const n=this.__tag,e=document.createElement(n),s=t.theme.heading;if(s!==void 0){const r=s[n];wr(e,r)}return e}updateDOM(t,n){return!1}static importDOM(){return{h1:t=>({conversion:vc,priority:0}),h2:t=>({conversion:vc,priority:0}),h3:t=>({conversion:vc,priority:0}),h4:t=>({conversion:vc,priority:0}),h5:t=>({conversion:vc,priority:0}),h6:t=>({conversion:vc,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&GC(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>GC(t)?{conversion:n=>({node:_c("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=_c(t.tag);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,n=!0){const e=t?t.anchor.offset:0,s=e!==this.getTextContentSize()&&t?_c(this.getTag()):An(),r=this.getDirection();if(s.setDirection(r),this.insertAfter(s,n),e===0&&!this.isEmpty()&&t){const o=An();o.select(),this.replace(o,!0)}return s}collapseAtStart(){const t=this.isEmpty()?An():_c(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}}function GC(c){return c.nodeName.toLowerCase()==="span"&&c.style.fontSize==="26pt"}function vc(c){const t=c.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=_c(t),c.style!==null&&n.setFormat(c.style.textAlign)),{node:n}}function mj(c){const t=Uy();return c.style!==null&&t.setFormat(c.style.textAlign),{node:t}}function _c(c){return Gr(new _d(c))}function yj(c){return c instanceof _d}function xd(c){let t=null;if(Zr(c,DragEvent)?t=c.dataTransfer:Zr(c,ClipboardEvent)&&(t=c.clipboardData),t===null)return[!1,[],!1];const n=t.types,e=n.includes("Files"),s=n.includes("text/html")||n.includes("text/plain");return[e,Array.from(t.files),s]}function YC(c){const t=st();if(!at(t))return!1;const n=new Set,e=t.getNodes();for(let s=0;s<e.length;s++){const r=e[s],o=r.getKey();if(n.has(o))continue;const i=dh(r),u=i.getKey();i.canIndent()&&!n.has(u)&&(n.add(u),c(i))}return n.size>0}function Ch(c){const t=xr(c);return uo(t)}function bj(c){return Xr(c.registerCommand(mS,t=>{const n=st();return!!fo(n)&&(n.clear(),!0)},0),c.registerCommand(Yr,t=>{const n=st();return!!at(n)&&(n.deleteCharacter(t),!0)},Ct),c.registerCommand(Qs,t=>{const n=st();return!!at(n)&&(n.deleteWord(t),!0)},Ct),c.registerCommand(Zs,t=>{const n=st();return!!at(n)&&(n.deleteLine(t),!0)},Ct),c.registerCommand(ic,t=>{const n=st();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const e=t.dataTransfer;if(e!=null)xh(e,n,c);else if(at(n)){const s=t.data;return s&&n.insertText(s),!0}}return!0},Ct),c.registerCommand(eh,()=>{const t=st();return!!at(t)&&(t.removeText(),!0)},Ct),c.registerCommand(Ni,t=>{const n=st();return!!at(n)&&(n.formatText(t),!0)},Ct),c.registerCommand(ea,t=>{const n=st();if(!at(n)&&!fo(n))return!1;const e=n.getNodes();for(const s of e){const r=dn(s,o=>Rt(o)&&!o.isInline());r!==null&&r.setFormat(t)}return!0},Ct),c.registerCommand(ta,t=>{const n=st();return!!at(n)&&(n.insertLineBreak(t),!0)},Ct),c.registerCommand(ac,()=>{const t=st();return!!at(t)&&(t.insertParagraph(),!0)},Ct),c.registerCommand(_S,()=>(fS([Hp()]),!0),Ct),c.registerCommand(vS,()=>YC(t=>{const n=t.getIndent();t.setIndent(n+1)}),Ct),c.registerCommand(Zp,()=>YC(t=>{const n=t.getIndent();n>0&&t.setIndent(n-1)}),Ct),c.registerCommand(Yp,t=>{const n=st();if(fo(n)&&!Ch(t.target)){const e=n.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(at(n)){const e=oc(n.focus,!0);if(!t.shiftKey&&uo(e)&&!e.isIsolated()&&!e.isInline())return e.selectPrevious(),t.preventDefault(),!0}return!1},Ct),c.registerCommand(Gp,t=>{const n=st();if(fo(n)){const e=n.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(at(n)){if(function(s){const r=s.focus;return r.key==="root"&&r.offset===Un().getChildrenSize()}(n))return t.preventDefault(),!0;const e=oc(n.focus,!1);if(!t.shiftKey&&uo(e)&&!e.isIsolated()&&!e.isInline())return e.selectNext(),t.preventDefault(),!0}return!1},Ct),c.registerCommand(lc,t=>{const n=st();if(fo(n)){const e=n.getNodes();if(e.length>0)return t.preventDefault(),e[0].selectPrevious(),!0}if(!at(n))return!1;if(ra(n,!0)){const e=t.shiftKey;return t.preventDefault(),na(n,e,!0),!0}return!1},Ct),c.registerCommand(cc,t=>{const n=st();if(fo(n)&&!Ch(t.target)){const s=n.getNodes();if(s.length>0)return t.preventDefault(),s[0].selectNext(0,0),!0}if(!at(n))return!1;const e=t.shiftKey;return!!ra(n,!1)&&(t.preventDefault(),na(n,e,!1),!0)},Ct),c.registerCommand(Va,t=>{if(Ch(t.target))return!1;const n=st();if(!at(n))return!1;t.preventDefault();const{anchor:e}=n,s=e.getNode();return n.isCollapsed()&&e.offset===0&&!Xs(s)&&dh(s).getIndent()>0?c.dispatchCommand(Zp,void 0):c.dispatchCommand(Yr,!0)},Ct),c.registerCommand(Ga,t=>{if(Ch(t.target))return!1;const n=st();return!!at(n)&&(t.preventDefault(),c.dispatchCommand(Yr,!1))},Ct),c.registerCommand(Xp,t=>{const n=st();if(!at(n))return!1;if(t!==null){if((fj||dj||hj)&&uj)return!1;if(t.preventDefault(),t.shiftKey)return c.dispatchCommand(ta,!1)}return c.dispatchCommand(ac,void 0)},Ct),c.registerCommand(hd,()=>{const t=st();return!!at(t)&&(c.blur(),!0)},Ct),c.registerCommand(Vp,t=>{const[,n]=xd(t);if(n.length>0){const s=VC(t.clientX,t.clientY);if(s!==null){const{offset:r,node:o}=s,i=xr(o);if(i!==null){const u=ud();if(zt(i))u.anchor.set(i.getKey(),r,"text"),u.focus.set(i.getKey(),r,"text");else{const f=i.getParentOrThrow().getKey(),l=i.getIndexWithinParent()+1;u.anchor.set(f,l,"element"),u.focus.set(f,l,"element")}const a=Kp(u);kr(a)}c.dispatchCommand(zy,n)}return t.preventDefault(),!0}const e=st();return!!at(e)},Ct),c.registerCommand(Jp,t=>{const[n]=xd(t),e=st();return!(n&&!at(e))},Ct),c.registerCommand(yS,t=>{const[n]=xd(t),e=st();if(n&&!at(e))return!1;const s=VC(t.clientX,t.clientY);if(s!==null){const r=xr(s.node);uo(r)&&t.preventDefault()}return!0},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,t=>(wh(c,Zr(t,ClipboardEvent)?t:null),!0),Ct),c.registerCommand(pd,t=>(async function(n,e){await wh(e,Zr(n,ClipboardEvent)?n:null),e.update(()=>{const s=st();at(s)?s.removeText():fo(s)&&s.getNodes().forEach(r=>r.remove())})}(t,c),!0),Ct),c.registerCommand(gd,t=>{const[,n,e]=xd(t);return n.length>0&&!e?(c.dispatchCommand(zy,n),!0):ES(t.target)?!1:st()!==null&&(function(s,r){s.preventDefault(),r.update(()=>{const o=st(),i=Zr(s,InputEvent)||Zr(s,KeyboardEvent)?null:s.clipboardData;i!=null&&o!==null&&xh(i,o,r)},{tag:"paste"})}(t,c),!0)},Ct))}const vj=Object.freeze(Object.defineProperty({__proto__:null,$createHeadingNode:_c,$createQuoteNode:Uy,$isHeadingNode:yj,$isQuoteNode:gj,DRAG_DROP_PASTE:zy,HeadingNode:_d,QuoteNode:vd,eventFiles:xd,registerRichText:bj},Symbol.toStringTag,{value:"Module"})),XC=(process.env.NODE_ENV==="development"?lj:vj).registerRichText;var Hy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function ZC(c){return c.getEditorState().read(yh(c.isComposing()))}function _j(c){const[t,n]=St.useState(()=>ZC(c));return Hy(()=>{function e(){const s=ZC(c);n(s)}return e(),Xr(c.registerUpdateListener(()=>{e()}),c.registerEditableListener(()=>{e()}))},[c]),t}function xj(c,t){const[n,e]=St.useState(()=>c.getDecorators());return Hy(()=>c.registerDecoratorListener(s=>{oo.flushSync(()=>{e(s)})}),[c]),St.useEffect(()=>{e(c.getDecorators())},[c]),St.useMemo(()=>{const s=[],r=Object.keys(n);for(let o=0;o<r.length;o++){const i=r[o],u=mn.createElement(t,{onError:f=>c._onError(f)},mn.createElement(St.Suspense,{fallback:null},n[i])),a=c.getElementByKey(i);a!==null&&s.push(oo.createPortal(u,a,i))}return s},[t,n,c])}function wj(c){Hy(()=>Xr(XC(c),bh(c)),[c])}function Sj({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=xj(e,n);return wj(e),mn.createElement(mn.Fragment,null,c,mn.createElement(Cj,{content:t}),s)}function Cj({content:c}){const[t]=pr(),n=_j(t),e=mh();return n?typeof c=="function"?c(e):c:null}const Ej=Object.freeze(Object.defineProperty({__proto__:null,RichTextPlugin:Sj},Symbol.toStringTag,{value:"Module"}));var Ky=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function QC(c){return c.getEditorState().read(yh(c.isComposing()))}function Oj({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=function(r,o){const[i,u]=St.useState(()=>r.getDecorators());return Ky(()=>r.registerDecoratorListener(a=>{oo.flushSync(()=>{u(a)})}),[r]),St.useEffect(()=>{u(r.getDecorators())},[r]),St.useMemo(()=>{const a=[],f=Object.keys(i);for(let l=0;l<f.length;l++){const d=f[l],p=mn.createElement(o,{onError:m=>r._onError(m)},mn.createElement(St.Suspense,{fallback:null},i[d])),h=r.getElementByKey(d);h!==null&&a.push(oo.createPortal(p,h,d))}return a},[o,i,r])}(e,n);return function(r){Ky(()=>Xr(XC(r),bh(r)),[r])}(e),mn.createElement(mn.Fragment,null,c,mn.createElement(Tj,{content:t}),s)}function Tj({content:c}){const[t]=pr(),n=function(s){const[r,o]=St.useState(()=>QC(s));return Ky(()=>{function i(){const u=QC(s);o(u)}return i(),Xr(s.registerUpdateListener(()=>{i()}),s.registerEditableListener(()=>{i()}))},[s]),r}(t),e=mh();return n?typeof c=="function"?c(e):c:null}const Nj=Object.freeze(Object.defineProperty({__proto__:null,RichTextPlugin:Oj},Symbol.toStringTag,{value:"Module"})),kj=(process.env.NODE_ENV==="development"?Ej:Nj).RichTextPlugin,Aj=new Set(["http:","https:","mailto:","sms:","tel:"]);class xc extends po{static getType(){return"link"}static clone(t){return new xc(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t,n={},e){super(e);const{target:s=null,rel:r=null,title:o=null}=n;this.__url=t,this.__target=s,this.__rel=r,this.__title=o}createDOM(t){const n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),wr(n,t.theme.link),n}updateDOM(t,n,e){const s=this.__url,r=this.__target,o=this.__rel,i=this.__title;return s!==t.__url&&(n.href=s),r!==t.__target&&(r?n.target=r:n.removeAttribute("target")),o!==t.__rel&&(o?n.rel=o:n.removeAttribute("rel")),i!==t.__title&&(i?n.title=i:n.removeAttribute("title")),!1}static importDOM(){return{a:t=>({conversion:Pj,priority:1})}}static importJSON(t){const n=wd(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}sanitizeUrl(t){try{const n=new URL(t);if(!Aj.has(n.protocol))return"about:blank"}catch{return t}return t}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(t){const n=this.getWritable();n.__url=t}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();n.__target=t}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();n.__rel=t}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();n.__title=t}insertNewAfter(t,n=!0){const e=wd(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n))return!1;const s=n.anchor.getNode(),r=n.focus.getNode();return this.isParentOf(s)&&this.isParentOf(r)&&n.getTextContent().length>0}}function Pj(c){let t=null;if(lC(c)){const n=c.textContent;(n!==null&&n!==""||c.children.length>0)&&(t=wd(c.getAttribute("href")||"",{rel:c.getAttribute("rel"),target:c.getAttribute("target"),title:c.getAttribute("title")}))}return{node:t}}function wd(c,t){return Gr(new xc(c,t))}function wc(c){return c instanceof xc}class Sd extends xc{static getType(){return"autolink"}static clone(t){return new Sd(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}static importJSON(t){const n=Wy(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(t,n=!0){const e=this.getParentOrThrow().insertNewAfter(t,n);if(Rt(e)){const s=Wy(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return e.append(s),s}return null}}function Wy(c,t){return Gr(new Sd(c,t))}function Mj(c){return c instanceof Sd}const Ij=Xa("TOGGLE_LINK_COMMAND");function Rj(c,t={}){const{target:n,title:e}=t,s=t.rel===void 0?"noreferrer":t.rel,r=st();if(!at(r))return;const o=r.extract();if(c===null)o.forEach(i=>{const u=i.getParent();if(wc(u)){const a=u.getChildren();for(let f=0;f<a.length;f++)u.insertBefore(a[f]);u.remove()}});else{if(o.length===1){const a=o[0],f=jj(a,wc);if(f!==null){f.setURL(c),n!==void 0&&f.setTarget(n),s!==null&&f.setRel(s),e!==void 0&&f.setTitle(e);return}}let i=null,u=null;o.forEach(a=>{const f=a.getParent();if(!(f===u||f===null||Rt(a)&&!a.isInline())){if(wc(f)){u=f,f.setURL(c),n!==void 0&&f.setTarget(n),s!==null&&u.setRel(s),e!==void 0&&u.setTitle(e);return}if(f.is(i)||(i=f,u=wd(c,{rel:s,target:n,title:e}),wc(f)?a.getPreviousSibling()===null?f.insertBefore(u):f.insertAfter(u):a.insertBefore(u)),wc(a)){if(a.is(u))return;if(u!==null){const l=a.getChildren();for(let d=0;d<l.length;d++)u.append(l[d])}a.remove();return}u!==null&&u.append(a)}})}}function jj(c,t){let n=c;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Dj=Object.freeze(Object.defineProperty({__proto__:null,$createAutoLinkNode:Wy,$createLinkNode:wd,$isAutoLinkNode:Mj,$isLinkNode:wc,AutoLinkNode:Sd,LinkNode:xc,TOGGLE_LINK_COMMAND:Ij,toggleLink:Rj},Symbol.toStringTag,{value:"Module"})),Lj=new Set(["http:","https:","mailto:","sms:","tel:"]);class Sc extends po{static getType(){return"link"}static clone(t){return new Sc(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t,n={},e){super(e);const{target:s=null,rel:r=null,title:o=null}=n;this.__url=t,this.__target=s,this.__rel=r,this.__title=o}createDOM(t){const n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),wr(n,t.theme.link),n}updateDOM(t,n,e){const s=this.__url,r=this.__target,o=this.__rel,i=this.__title;return s!==t.__url&&(n.href=s),r!==t.__target&&(r?n.target=r:n.removeAttribute("target")),o!==t.__rel&&(o?n.rel=o:n.removeAttribute("rel")),i!==t.__title&&(i?n.title=i:n.removeAttribute("title")),!1}static importDOM(){return{a:t=>({conversion:Bj,priority:1})}}static importJSON(t){const n=Cd(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}sanitizeUrl(t){try{const n=new URL(t);if(!Lj.has(n.protocol))return"about:blank"}catch{return t}return t}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(t){this.getWritable().__url=t}getTarget(){return this.getLatest().__target}setTarget(t){this.getWritable().__target=t}getRel(){return this.getLatest().__rel}setRel(t){this.getWritable().__rel=t}getTitle(){return this.getLatest().__title}setTitle(t){this.getWritable().__title=t}insertNewAfter(t,n=!0){const e=Cd(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n))return!1;const s=n.anchor.getNode(),r=n.focus.getNode();return this.isParentOf(s)&&this.isParentOf(r)&&n.getTextContent().length>0}}function Bj(c){let t=null;if(lC(c)){const n=c.textContent;(n!==null&&n!==""||c.children.length>0)&&(t=Cd(c.getAttribute("href")||"",{rel:c.getAttribute("rel"),target:c.getAttribute("target"),title:c.getAttribute("title")}))}return{node:t}}function Cd(c,t){return Gr(new Sc(c,t))}function Cc(c){return c instanceof Sc}class Ed extends Sc{static getType(){return"autolink"}static clone(t){return new Ed(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}static importJSON(t){const n=qy(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(t,n=!0){const e=this.getParentOrThrow().insertNewAfter(t,n);if(Rt(e)){const s=qy(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return e.append(s),s}return null}}function qy(c,t){return Gr(new Ed(c,t))}function Fj(c){return c instanceof Ed}const $j=Xa("TOGGLE_LINK_COMMAND");function zj(c,t={}){const{target:n,title:e}=t,s=t.rel===void 0?"noreferrer":t.rel,r=st();if(!at(r))return;const o=r.extract();if(c===null)o.forEach(i=>{const u=i.getParent();if(Cc(u)){const a=u.getChildren();for(let f=0;f<a.length;f++)u.insertBefore(a[f]);u.remove()}});else{if(o.length===1){const a=function(f,l){let d=f;for(;d!==null&&d.getParent()!==null&&!l(d);)d=d.getParentOrThrow();return l(d)?d:null}(o[0],Cc);if(a!==null)return a.setURL(c),n!==void 0&&a.setTarget(n),s!==null&&a.setRel(s),void(e!==void 0&&a.setTitle(e))}let i=null,u=null;o.forEach(a=>{const f=a.getParent();if(f!==u&&f!==null&&(!Rt(a)||a.isInline())){if(Cc(f))return u=f,f.setURL(c),n!==void 0&&f.setTarget(n),s!==null&&u.setRel(s),void(e!==void 0&&u.setTitle(e));if(f.is(i)||(i=f,u=Cd(c,{rel:s,target:n,title:e}),Cc(f)?a.getPreviousSibling()===null?f.insertBefore(u):f.insertAfter(u):a.insertBefore(u)),Cc(a)){if(a.is(u))return;if(u!==null){const l=a.getChildren();for(let d=0;d<l.length;d++)u.append(l[d])}a.remove()}else u!==null&&u.append(a)}})}}const Uj=Object.freeze(Object.defineProperty({__proto__:null,$createAutoLinkNode:qy,$createLinkNode:Cd,$isAutoLinkNode:Fj,$isLinkNode:Cc,AutoLinkNode:Ed,LinkNode:Sc,TOGGLE_LINK_COMMAND:$j,toggleLink:zj},Symbol.toStringTag,{value:"Module"})),Hj=(process.env.NODE_ENV==="development"?Dj:Uj).$isLinkNode;let Jy=class gN extends po{static getType(){return"mark"}static clone(t){return new gN(Array.from(t.__ids),t.__key)}static importDOM(){return null}static importJSON(t){const n=Eh(t.ids);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(t,n){super(n),this.__ids=t||[]}createDOM(t){const n=document.createElement("mark");return wr(n,t.theme.mark),this.__ids.length>1&&wr(n,t.theme.markOverlap),n}updateDOM(t,n,e){const s=t.__ids,r=this.__ids,o=s.length,i=r.length,u=e.theme.markOverlap;return o!==i&&(o===1?i===2&&wr(n,u):i===1&&fh(n,u)),!1}hasID(t){const n=this.getIDs();for(let e=0;e<n.length;e++)if(t===n[e])return!0;return!1}getIDs(){const t=this.getLatest();return Za(t)?t.__ids:[]}addID(t){const n=this.getWritable();if(Za(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return;e.push(t)}}deleteID(t){const n=this.getWritable();if(Za(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s]){e.splice(s,1);return}}}insertNewAfter(t,n=!0){const e=Eh(this.__ids);return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n)||e==="html")return!1;const s=n.anchor,r=n.focus,o=s.getNode(),i=r.getNode(),a=n.isBackward()?s.offset-r.offset:r.offset-s.offset;return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===a}excludeFromCopy(t){return t!=="clone"}};function Eh(c){return Gr(new Jy(c))}function Za(c){return c instanceof Jy}function Kj(c){const t=c.getChildren();let n=null;for(let e=0;e<t.length;e++){const s=t[e];n===null?c.insertBefore(s):n.insertAfter(s),n=s}c.remove()}function Wj(c,t,n,e){const s=c.getNodes(),r=c.anchor.offset,o=c.focus.offset,i=s.length,u=t?o:r,a=t?r:o;let f,l;for(let d=0;d<i;d++){const p=s[d];if(Rt(l)&&l.isParentOf(p))continue;const h=d===0,m=d===i-1;let g=null;if(zt(p)){const y=p.getTextContentSize(),b=h?u:0,v=m?a:y;if(b===0&&v===0)continue;const _=p.splitText(b,v);g=_.length>1&&(_.length===3||h&&!m||v===y)?_[1]:_[0]}else{if(Za(p))continue;Rt(p)&&p.isInline()&&(g=p)}if(g!==null){if(g&&g.is(f))continue;const y=g.getParent();(y==null||!y.is(f))&&(l=void 0),f=y,l===void 0&&(l=(e||Eh)([n]),g.insertBefore(l)),l.append(g)}else f=void 0,l=void 0}Rt(l)&&(t?l.selectStart():l.selectEnd())}function qj(c,t){let n=c;for(;n!==null;){if(Za(n))return n.getIDs();if(zt(n)&&t===n.getTextContentSize()){const e=n.getNextSibling();if(Za(e))return e.getIDs()}n=n.getParent()}return null}const Jj=Object.freeze(Object.defineProperty({__proto__:null,$createMarkNode:Eh,$getMarkIDs:qj,$isMarkNode:Za,$unwrapMarkNode:Kj,$wrapSelectionInMarkNode:Wj,MarkNode:Jy},Symbol.toStringTag,{value:"Module"}));let Vy=class mN extends po{static getType(){return"mark"}static clone(t){return new mN(Array.from(t.__ids),t.__key)}static importDOM(){return null}static importJSON(t){const n=Oh(t.ids);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(t,n){super(n),this.__ids=t||[]}createDOM(t){const n=document.createElement("mark");return wr(n,t.theme.mark),this.__ids.length>1&&wr(n,t.theme.markOverlap),n}updateDOM(t,n,e){const s=t.__ids,r=this.__ids,o=s.length,i=r.length,u=e.theme.markOverlap;return o!==i&&(o===1?i===2&&wr(n,u):i===1&&fh(n,u)),!1}hasID(t){const n=this.getIDs();for(let e=0;e<n.length;e++)if(t===n[e])return!0;return!1}getIDs(){const t=this.getLatest();return Qa(t)?t.__ids:[]}addID(t){const n=this.getWritable();if(Qa(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return;e.push(t)}}deleteID(t){const n=this.getWritable();if(Qa(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return void e.splice(s,1)}}insertNewAfter(t,n=!0){const e=Oh(this.__ids);return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n)||e==="html")return!1;const s=n.anchor,r=n.focus,o=s.getNode(),i=r.getNode(),u=n.isBackward()?s.offset-r.offset:r.offset-s.offset;return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===u}excludeFromCopy(t){return t!=="clone"}};function Oh(c){return Gr(new Vy(c))}function Qa(c){return c instanceof Vy}function Vj(c){const t=c.getChildren();let n=null;for(let e=0;e<t.length;e++){const s=t[e];n===null?c.insertBefore(s):n.insertAfter(s),n=s}c.remove()}function Gj(c,t,n,e){const s=c.getNodes(),r=c.anchor.offset,o=c.focus.offset,i=s.length,u=t?o:r,a=t?r:o;let f,l;for(let d=0;d<i;d++){const p=s[d];if(Rt(l)&&l.isParentOf(p))continue;const h=d===0,m=d===i-1;let g=null;if(zt(p)){const y=p.getTextContentSize(),b=h?u:0,v=m?a:y;if(b===0&&v===0)continue;const _=p.splitText(b,v);g=_.length>1&&(_.length===3||h&&!m||v===y)?_[1]:_[0]}else{if(Qa(p))continue;Rt(p)&&p.isInline()&&(g=p)}if(g!==null){if(g&&g.is(f))continue;const y=g.getParent();y!=null&&y.is(f)||(l=void 0),f=y,l===void 0&&(l=(e||Oh)([n]),g.insertBefore(l)),l.append(g)}else f=void 0,l=void 0}Rt(l)&&(t?l.selectStart():l.selectEnd())}function Yj(c,t){let n=c;for(;n!==null;){if(Qa(n))return n.getIDs();if(zt(n)&&t===n.getTextContentSize()){const e=n.getNextSibling();if(Qa(e))return e.getIDs()}n=n.getParent()}return null}const Xj=Object.freeze(Object.defineProperty({__proto__:null,$createMarkNode:Oh,$getMarkIDs:Yj,$isMarkNode:Qa,$unwrapMarkNode:Vj,$wrapSelectionInMarkNode:Gj,MarkNode:Vy},Symbol.toStringTag,{value:"Module"})),Ec=process.env.NODE_ENV==="development"?Jj:Xj,Zj=Ec.$createMarkNode,Qj=Ec.$getMarkIDs,eD=Ec.$isMarkNode,tD=Ec.$unwrapMarkNode,nD=Ec.$wrapSelectionInMarkNode,rD=Ec.MarkNode,eE=/^(\d+(?:\.\d+)?)px$/,Hn={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};let Th=class yN extends po{static getType(){return"tablecell"}static clone(t){const n=new yN(t.__headerState,t.__colSpan,t.__width,t.__key);return n.__rowSpan=t.__rowSpan,n.__backgroundColor=t.__backgroundColor,n}static importDOM(){return{td:t=>({conversion:tE,priority:0}),th:t=>({conversion:tE,priority:0})}}static importJSON(t){const n=t.colSpan||1,e=t.rowSpan||1,s=Ko(t.headerState,n,t.width||void 0);return s.__rowSpan=e,s.__backgroundColor=t.backgroundColor||null,s}constructor(t=Hn.NO_STATUS,n=1,e,s){super(s),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=e,this.__backgroundColor=null}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),wr(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const{element:n}=super.exportDOM(t);if(n){const e=n,s=700,r=this.getParentOrThrow().getChildrenSize();e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||Math.max(90,s/r)}px`,e.style.verticalAlign="top",e.style.textAlign="start";const o=this.getBackgroundColor();o!==null?e.style.backgroundColor=o:this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return{element:n}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(t){return this.getWritable().__colSpan=t,this}getRowSpan(){return this.__rowSpan}setRowSpan(t){return this.getWritable().__rowSpan=t,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t){const n=this.getWritable();return n.__headerState=t,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){this.getWritable().__backgroundColor=t}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==Hn.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function tE(c){const t=c,n=c.nodeName.toLowerCase();let e;eE.test(t.style.width)&&(e=parseFloat(t.style.width));const s=Ko(n==="th"?Hn.ROW:Hn.NO_STATUS,t.colSpan,e);s.__rowSpan=t.rowSpan;const r=t.style.backgroundColor;return r!==""&&(s.__backgroundColor=r),{after:o=>(o.length===0&&o.push(An()),o),forChild:(o,i)=>{if(fn(i)&&!Rt(o)){const u=An();return dd(o)&&o.getTextContent()===`
|
|
58
|
-
`?null:(u.append(o),u)}return o},node:s}}function Ko(c,t=1,n){return Gr(new Th(c,t,n))}function fn(c){return c instanceof Th}const oD=Xa("INSERT_TABLE_COMMAND");let Gy=class bN extends po{static getType(){return"tablerow"}static clone(t){return new bN(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:iD,priority:0})}}static importJSON(t){return el(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),wr(n,t.theme.tableRow),n}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,this.__height}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function iD(c){const t=c;let n;return eE.test(t.style.height)&&(n=parseFloat(t.style.height)),{node:el(n)}}function el(c){return Gr(new Gy(c))}function yr(c){return c instanceof Gy}const sD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function aD(c,t,n=!0){const e=Mh();for(let s=0;s<c;s++){const r=el();for(let o=0;o<t;o++){let i=Hn.NO_STATUS;typeof n=="object"?(s===0&&n.rows&&(i|=Hn.ROW),o===0&&n.columns&&(i|=Hn.COLUMN)):n&&(s===0&&(i|=Hn.ROW),o===0&&(i|=Hn.COLUMN));const u=Ko(i),a=An();a.append(Ei()),u.append(a),r.append(u)}e.append(r)}return e}function lD(c){const t=dn(c,n=>fn(n));return fn(t)?t:null}function Yy(c){const t=dn(c,n=>yr(n));if(yr(t))return t;throw new Error("Expected table cell to be inside of table row.")}function Xy(c){const t=dn(c,n=>xo(n));if(xo(t))return t;throw new Error("Expected table cell to be inside of table.")}function cD(c){const t=Yy(c);return Xy(t).getChildren().findIndex(e=>e.is(t))}function uD(c){return Yy(c).getChildren().findIndex(n=>n.is(c))}function nE(c,t){const n=Xy(c),{x:e,y:s}=n.getCordsFromCellNode(c,t);return{above:n.getCellNodeFromCords(e,s-1,t),below:n.getCellNodeFromCords(e,s+1,t),left:n.getCellNodeFromCords(e-1,s,t),right:n.getCellNodeFromCords(e+1,s,t)}}function dD(c,t){const n=c.getChildren();if(t>=n.length||t<0)throw new Error("Expected table cell to be inside of table row.");return n[t].remove(),c}function fD(c,t,n=!0,e,s){const r=c.getChildren();if(t>=r.length||t<0)throw new Error("Table row target index out of range");const o=r[t];if(yr(o))for(let i=0;i<e;i++){const u=o.getChildren(),a=u.length,f=el();for(let l=0;l<a;l++){const d=u[l];if(!fn(d))throw Error("Expected table cell");const{above:p,below:h}=nE(d,s);let m=Hn.NO_STATUS;const g=p&&p.getWidth()||h&&h.getWidth()||void 0;(p&&p.hasHeaderState(Hn.COLUMN)||h&&h.hasHeaderState(Hn.COLUMN))&&(m|=Hn.COLUMN);const y=Ko(m,1,g);y.append(An()),f.append(y)}n?o.insertAfter(f):o.insertBefore(f)}else throw new Error("Row before insertion index does not exist.");return c}const Zy=(c,t)=>c===Hn.BOTH||c===t?t:Hn.NO_STATUS;function pD(c=!0){const t=st();if(!(at(t)||nr(t)))throw Error("Expected a RangeSelection or GridSelection");const n=t.focus.getNode(),[e,,s]=Pi(n),[r,o]=ia(s,e,e),i=r[0].length,{startRow:u}=o;if(c){const a=u+e.__rowSpan-1,f=r[a],l=el();for(let p=0;p<i;p++){const{cell:h,startRow:m}=f[p];if(m+h.__rowSpan-1<=a){const y=f[p].cell.__headerState,b=Zy(y,Hn.COLUMN);l.append(Ko(b).append(An()))}else h.setRowSpan(h.__rowSpan+1)}const d=s.getChildAtIndex(a);if(!yr(d))throw Error("focusEndRow is not a TableRowNode");d.insertAfter(l)}else{const a=r[u],f=el();for(let d=0;d<i;d++){const{cell:p,startRow:h}=a[d];if(h===u){const g=a[d].cell.__headerState,y=Zy(g,Hn.COLUMN);f.append(Ko(y).append(An()))}else p.setRowSpan(p.__rowSpan+1)}const l=s.getChildAtIndex(u);if(!yr(l))throw Error("focusEndRow is not a TableRowNode");l.insertBefore(f)}}function hD(c,t,n=!0,e,s){const r=c.getChildren(),o=[];for(let i=0;i<r.length;i++){const u=r[i];if(yr(u))for(let a=0;a<e;a++){const f=u.getChildren();if(t>=f.length||t<0)throw new Error("Table column target index out of range");const l=f[t];if(!fn(l))throw Error("Expected table cell");const{left:d,right:p}=nE(l,s);let h=Hn.NO_STATUS;(d&&d.hasHeaderState(Hn.ROW)||p&&p.hasHeaderState(Hn.ROW))&&(h|=Hn.ROW);const m=Ko(h);m.append(An()),o.push({newTableCell:m,targetCell:l})}}return o.forEach(({newTableCell:i,targetCell:u})=>{n?u.insertAfter(i):u.insertBefore(i)}),c}function gD(c=!0){const t=st();if(!(at(t)||nr(t)))throw Error("Expected a RangeSelection or GridSelection");const n=t.anchor.getNode(),e=t.focus.getNode(),[s]=Pi(n),[r,,o]=Pi(e),[i,u,a]=ia(o,r,s),f=i.length,l=c?Math.max(u.startColumn,a.startColumn):Math.min(u.startColumn,a.startColumn),d=c?l+r.__colSpan-1:l-1,p=o.getFirstChild();if(!yr(p))throw Error("Expected firstTable child to be a row");let h=null;function m(y=Hn.NO_STATUS){const b=Ko(y).append(An());return h===null&&(h=b),b}let g=p;e:for(let y=0;y<f;y++){if(y!==0){const E=g.getNextSibling();if(!yr(E))throw Error("Expected row nextSibling to be a row");g=E}const b=i[y],v=b[d<0?0:d].cell.__headerState,_=Zy(v,Hn.ROW);if(d<0){Qy(g,m(_));continue}const{cell:w,startColumn:x,startRow:S}=b[d];if(x+w.__colSpan-1<=d){let E=w,O=S,j=d;for(;O!==y&&E.__rowSpan>1;)if(j-=w.__colSpan,j>=0){const{cell:A,startRow:T}=b[j];E=A,O=T}else{g.append(m(_));continue e}E.insertAfter(m(_))}else w.setColSpan(w.__colSpan+1)}h!==null&&Od(h)}function mD(c,t){const n=c.getChildren();for(let e=0;e<n.length;e++){const s=n[e];if(yr(s)){const r=s.getChildren();if(t>=r.length||t<0)throw new Error("Table column target index out of range");r[t].remove()}}return c}function yD(){const c=st();if(!(at(c)||nr(c)))throw Error("Expected a RangeSelection or GridSelection");const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Pi(t),[r]=Pi(n),[o,i,u]=ia(s,e,r),{startRow:a}=i,{startRow:f}=u,l=f+r.__rowSpan-1;if(o.length===l-a+1){s.remove();return}const d=o[0].length,p=o[l+1],h=s.getChildAtIndex(l+1);for(let m=l;m>=a;m--){for(let y=d-1;y>=0;y--){const{cell:b,startRow:v,startColumn:_}=o[m][y];if(_===y&&(m===a&&v<a&&b.setRowSpan(b.__rowSpan-(v-a)),v>=a&&v+b.__rowSpan-1>l)){if(b.setRowSpan(b.__rowSpan-(l-v+1)),h===null)throw Error("Expected nextRowNode not to be null");if(y===0)Qy(h,b);else{const{cell:w}=p[y-1];w.insertAfter(b)}}}const g=s.getChildAtIndex(m);if(!yr(g))throw Error(`Expected GridNode childAtIndex(${String(m)}) to be RowNode`);g.remove()}if(p!==void 0){const{cell:m}=p[0];Od(m)}else{const m=o[a-1],{cell:g}=m[0];Od(g)}}function bD(){const c=st();if(!(at(c)||nr(c)))throw Error("Expected a RangeSelection or GridSelection");const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Pi(t),[r]=Pi(n),[o,i,u]=ia(s,e,r),{startColumn:a}=i,{startRow:f,startColumn:l}=u,d=Math.min(a,l),p=Math.max(a+e.__colSpan-1,l+r.__colSpan-1),h=p-d+1;if(o[0].length===p-d+1){s.selectPrevious(),s.remove();return}const g=o.length;for(let v=0;v<g;v++)for(let _=d;_<=p;_++){const{cell:w,startColumn:x}=o[v][_];if(x<d){if(_===d){const S=d-x;w.setColSpan(w.__colSpan-Math.min(h,w.__colSpan-S))}}else if(x+w.__colSpan-1>p){if(_===p){const S=p-x+1;w.setColSpan(w.__colSpan-S)}}else w.remove()}const y=o[f],b=y[l+r.__colSpan];if(b!==void 0){const{cell:v}=b;Od(v)}else{const v=y[l-1],{cell:_}=v;Od(_)}}function Od(c){const t=c.getFirstDescendant();t==null?c.selectStart():t.getParentOrThrow().selectStart()}function Qy(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}function vD(){const c=st();if(!(at(c)||nr(c)))throw Error("Expected a RangeSelection or GridSelection");const t=c.anchor.getNode(),[n,e,s]=Pi(t),r=n.__colSpan,o=n.__rowSpan;if(r>1){for(let i=1;i<r;i++)n.insertAfter(Ko(Hn.NO_STATUS));n.setColSpan(1)}if(o>1){const[i,u]=ia(s,n,n),{startColumn:a,startRow:f}=u;let l;for(let d=1;d<o;d++){const p=f+d,h=i[p];if(l=(l||e).getNextSibling(),!yr(l))throw Error("Expected row next sibling to be a row");let m=null;for(let g=0;g<a;g++){const y=h[g],b=y.cell;y.startRow===p&&(m=b),b.__colSpan>1&&(g+=b.__colSpan-1)}if(m===null)for(let g=0;g<r;g++)Qy(l,Ko(Hn.NO_STATUS));else for(let g=0;g<r;g++)m.insertAfter(Ko(Hn.NO_STATUS))}n.setRowSpan(1)}}function ia(c,t,n){const e=[];let s=null,r=null;function o(a,f,l){const d={cell:l,startColumn:f,startRow:a},p=l.__rowSpan,h=l.__colSpan;for(let m=0;m<p;m++){e[a+m]===void 0&&(e[a+m]=[]);for(let g=0;g<h;g++)e[a+m][f+g]=d}t.is(l)&&(s=d),n.is(l)&&(r=d)}function i(a,f){return e[a]===void 0||e[a][f]===void 0}const u=c.getChildren();for(let a=0;a<u.length;a++){const f=u[a];if(!yr(f))throw Error("Expected GridNode children to be TableRowNode");const l=f.getChildren();let d=0;for(const p of l){if(!fn(p))throw Error("Expected TableRowNode children to be TableCellNode");for(;!i(a,d);)d++;o(a,d,p),d+=p.__colSpan}}if(s===null)throw Error("Anchor not found in Grid");if(r===null)throw Error("Focus not found in Grid");return[e,s,r]}function Pi(c){let t;if(c instanceof Th)t=c;else if("__type"in c){const s=dn(c,fn);if(!fn(s))throw Error("Expected to find a parent TableCellNode");t=s}else{const s=dn(c.getNode(),fn);if(!fn(s))throw Error("Expected to find a parent TableCellNode");t=s}const n=t.getParent();if(!yr(n))throw Error("Expected TableCellNode to have a parent TableRowNode");const e=n.getParent();if(!xo(e))throw Error("Expected TableRowNode to have a parent GridNode");return[t,n,e]}function eb(c){const[t,,n]=Pi(c),e=n.getChildren(),s=e.length,r=e[0].getChildren().length,o=new Array(s);for(let i=0;i<s;i++)o[i]=new Array(r);for(let i=0;i<s;i++){const a=e[i].getChildren();let f=0;for(let l=0;l<a.length;l++){for(;o[i][f];)f++;const d=a[l],p=d.__rowSpan||1,h=d.__colSpan||1;for(let m=0;m<p;m++)for(let g=0;g<h;g++)o[i+m][f+g]=d;if(t===d)return{colSpan:h,columnIndex:f,rowIndex:i,rowSpan:p};f+=h}}return null}class Nh{constructor(t,n,e){this.anchor=n,this.focus=e,n._selection=this,e._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return nr(t)?this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus):!1}set(t,n,e){this.dirty=!0,this.tableKey=t,this.anchor.key=n,this.focus.key=e,this._cachedNodes=null}clone(){return new Nh(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.focus.getNode();if(!Rt(n))throw Error("Expected TableSelection focus to be an ElementNode");Kp(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const t=Ro(this.anchor.key);if(!fn(t))throw Error("Expected TableSelection anchor to be (or a child of) TableCellNode");const n=eb(t);if(n===null)throw Error("getCellRect: expected to find AnchorNode");const e=Ro(this.focus.key);if(!fn(e))throw Error("Expected TableSelection focus to be (or a child of) TableCellNode");const s=eb(e);if(s===null)throw Error("getCellRect: expected to find focusCellNode");const r=Math.min(n.columnIndex,s.columnIndex),o=Math.max(n.columnIndex,s.columnIndex),i=Math.min(n.rowIndex,s.rowIndex),u=Math.max(n.rowIndex,s.rowIndex);return{fromX:Math.min(r,o),fromY:Math.min(i,u),toX:Math.max(r,o),toY:Math.max(i,u)}}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this.anchor.getNode(),e=this.focus.getNode(),s=dn(n,fn),r=dn(e,fn);if(!fn(s))throw Error("Expected TableSelection anchor to be (or a child of) TableCellNode");if(!fn(r))throw Error("Expected TableSelection focus to be (or a child of) TableCellNode");const o=s.getParent();if(!yr(o))throw Error("Expected anchorCell to have a parent TableRowNode");const i=o.getParent();if(!xo(i))throw Error("Expected tableNode to have a parent TableNode");const u=r.getParents()[1];if(u!==i){if(i.isParentOf(r)){const S=u.getParent();if(S==null)throw Error("Expected focusCellParent to have a parent");this.set(this.tableKey,r.getKey(),S.getKey())}else{const S=i.getParent();if(S==null)throw Error("Expected gridParent to have a parent");this.set(this.tableKey,S.getKey(),r.getKey())}return this.getNodes()}const[a,f,l]=ia(i,s,r);let d=Math.min(f.startColumn,l.startColumn),p=Math.min(f.startRow,l.startRow),h=Math.max(f.startColumn+f.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),m=Math.max(f.startRow+f.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1),g=d,y=p,b=d,v=p;function _(S){const{cell:E,startColumn:O,startRow:j}=S;d=Math.min(d,O),p=Math.min(p,j),h=Math.max(h,O+E.__colSpan-1),m=Math.max(m,j+E.__rowSpan-1)}for(;d<g||p<y||h>b||m>v;){if(d<g){const S=v-y,E=g-1;for(let O=0;O<=S;O++)_(a[y+O][E]);g=E}if(p<y){const S=b-g,E=y-1;for(let O=0;O<=S;O++)_(a[E][g+O]);y=E}if(h>b){const S=v-y,E=b+1;for(let O=0;O<=S;O++)_(a[y+O][E]);b=E}if(m>v){const S=b-g,E=v+1;for(let O=0;O<=S;O++)_(a[E][g+O]);v=E}}const w=[i];let x=null;for(let S=p;S<=m;S++)for(let E=d;E<=h;E++){const{cell:O}=a[S][E],j=O.getParent();if(!yr(j))throw Error("Expected TableCellNode parent to be a TableRowNode");j!==x&&w.push(j),w.push(O,..._D(O)),x=j}return wS()||(this._cachedNodes=w),w}getTextContent(){const t=this.getNodes();let n="";for(let e=0;e<t.length;e++)n+=t[e].getTextContent();return n}}function nr(c){return c instanceof Nh}function kh(){const c=Up("root",0,"element"),t=Up("root",0,"element");return new Nh("root",c,t)}function _D(c){const t=[],n=[c];for(;n.length>0;){const e=n.pop();if(e===void 0)throw Error("Stack.length > 0; can't be undefined");Rt(e)&&n.unshift(...e.getChildren()),e!==c&&t.push(e)}return t}const xD=c=>sD?(c||window).getSelection():null;class rE{constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable()}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(t=>t())}trackTable(){const t=new MutationObserver(n=>{this.editor.update(()=>{let e=!1;for(let r=0;r<n.length;r++){const u=n[r].target.nodeName;if(u==="TABLE"||u==="TR"){e=!0;break}}if(!e)return;const s=this.editor.getElementByKey(this.tableNodeKey);if(!s)throw new Error("Expected to find TableElement in DOM");this.table=Oc(s)})});this.editor.update(()=>{const n=this.editor.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");this.table=Oc(n),t.observe(n,{childList:!0,subtree:!0})})}clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),t.update(()=>{const n=Ro(this.tableNodeKey);if(!xo(n))throw new Error("Expected TableNode.");const e=t.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");const s=Oc(e);Ah(t,s,null),kr(null),t.dispatchCommand(ai,void 0)})}enableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");fh(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");wr(n,t._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(t){if(t!==null&&t.tableKey===this.tableNodeKey){const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.disableHighlightStyle(),Ah(n,this.table,this.tableSelection)}else t==null?this.clearHighlight():(this.tableNodeKey=t.tableKey,this.updateTableTableSelection(t))}setFocusCellForSelection(t,n=!1){const e=this.editor;e.update(()=>{const s=Ro(this.tableNodeKey);if(!xo(s))throw new Error("Expected TableNode.");if(!e.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const o=t.x,i=t.y;if(this.focusCell=t,this.anchorCell!==null){const u=xD(e._window);u&&u.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==o||this.anchorY!==i||n))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(o===this.focusX&&i===this.focusY)return;if(this.focusX=o,this.focusY=i,this.isHighlightingCells){const u=xr(t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&fn(u)){const a=u.getKey();this.tableSelection=this.tableSelection.clone()||kh(),this.focusCellNodeKey=a,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),kr(this.tableSelection),e.dispatchCommand(ai,void 0),Ah(e,this.table,this.tableSelection)}}})}setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y,this.editor.update(()=>{const n=xr(t.elem);if(fn(n)){const e=n.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():kh(),this.anchorCellNodeKey=e}})}formatCells(t){this.editor.update(()=>{const n=st();if(!nr(n))throw Error("Expected grid selection");const e=ud(),s=e.anchor,r=e.focus;n.getNodes().forEach(o=>{fn(o)&&o.getTextContentSize()!==0&&(s.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),e.formatText(t))}),kr(n),this.editor.dispatchCommand(ai,void 0)})}clearText(){const t=this.editor;t.update(()=>{const n=Ro(this.tableNodeKey);if(!xo(n))throw new Error("Expected TableNode.");const e=st();if(!nr(e))throw Error("Expected grid selection");const s=e.getNodes().filter(fn);if(s.length===this.table.columns*this.table.rows){n.selectPrevious(),n.remove(),Un().selectStart();return}s.forEach(r=>{if(Rt(r)){const o=An(),i=Ei();o.append(i),r.append(o),r.getChildren().forEach(u=>{u!==o&&u.remove()})}}),Ah(t,this.table,null),kr(null),t.dispatchCommand(ai,void 0)})}}const oE="__lexicalTableSelection";function wD(c,t,n,e){const s=n.getRootElement();if(s===null)throw new Error("No root element.");const r=new rE(n,c.getKey()),o=n._window||window;SD(t,r),t.addEventListener("mousedown",l=>{setTimeout(()=>{if(l.button!==0||!o)return;const d=tb(l.target);d!==null&&(Nd(l),r.setAnchorCellForSelection(d));const p=()=>{o.removeEventListener("mouseup",p),o.removeEventListener("mousemove",h)},h=m=>{const g=tb(m.target);g!==null&&(r.anchorX!==g.x||r.anchorY!==g.y)&&(m.preventDefault(),r.setFocusCellForSelection(g))};o.addEventListener("mouseup",p),o.addEventListener("mousemove",h)},0)});const i=l=>{l.button===0&&n.update(()=>{const d=st(),p=l.target;nr(d)&&d.tableKey===r.tableNodeKey&&s.contains(p)&&r.clearHighlight()})};o.addEventListener("mousedown",i),r.listenersToRemove.add(()=>o.removeEventListener("mousedown",i)),r.listenersToRemove.add(n.registerCommand(Gp,l=>Td(n,l,"down",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(Yp,l=>Td(n,l,"up",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(lc,l=>Td(n,l,"backward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(cc,l=>Td(n,l,"forward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(hd,l=>{const d=st();if(nr(d)){const p=dn(d.focus.getNode(),fn);if(fn(p))return Nd(l),p.selectEnd(),!0}return!1},Ho));const u=l=>()=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return r.clearText(),!0;if(at(d)){const p=dn(d.anchor.getNode(),w=>fn(w));if(!fn(p))return!1;const h=d.anchor.getNode(),m=d.focus.getNode(),g=c.isParentOf(h),y=c.isParentOf(m);if(g&&!y||y&&!g)return r.clearText(),!0;const v=dn(d.anchor.getNode(),w=>Rt(w)),_=v&&dn(v,w=>Rt(w)&&fn(w.getParent()));if(!Rt(_)||!Rt(v))return!1;if(l===Zs&&_.getPreviousSibling()===null)return!0;if((l===Yr||l===Qs)&&d.isCollapsed()&&d.anchor.offset===0&&v!==_){const w=v.getChildren(),x=An();return w.forEach(S=>x.append(S)),v.replace(x),v.getWritable().__parent=p.getKey(),!0}}return!1};[Qs,Zs,Yr].forEach(l=>{r.listenersToRemove.add(n.registerCommand(l,u(l),mr))});const a=l=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return l.preventDefault(),l.stopPropagation(),r.clearText(),!0;if(at(d)){const p=dn(d.anchor.getNode(),h=>fn(h));if(!fn(p))return!1}return!1};r.listenersToRemove.add(n.registerCommand(Va,a,mr)),r.listenersToRemove.add(n.registerCommand(Ga,a,mr)),r.listenersToRemove.add(n.registerCommand(Ni,l=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return r.formatCells(l),!0;if(at(d)){const p=dn(d.anchor.getNode(),h=>fn(h));if(!fn(p))return!1}return!1},mr)),r.listenersToRemove.add(n.registerCommand(ea,l=>{const d=st();if(!nr(d)||!tl(d,c))return!1;const p=d.anchor.getNode(),h=d.focus.getNode();if(!fn(p)||!fn(h))return!1;const[m,g,y]=ia(c,p,h),b=Math.max(g.startRow,y.startRow),v=Math.max(g.startColumn,y.startColumn),_=Math.min(g.startRow,y.startRow),w=Math.min(g.startColumn,y.startColumn);for(let x=_;x<=b;x++)for(let S=w;S<=v;S++){const E=m[x][S].cell;E.setFormat(l);const O=E.getChildren();for(let j=0;j<O.length;j++){const A=O[j];Rt(A)&&!A.isInline()&&A.setFormat(l)}}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ic,l=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return r.clearHighlight(),!1;if(at(d)){const p=dn(d.anchor.getNode(),h=>fn(h));if(!fn(p))return!1}return!1},mr)),e&&r.listenersToRemove.add(n.registerCommand(xS,l=>{const d=st();if(!at(d)||!d.isCollapsed()||!tl(d,c))return!1;const p=ob(d.anchor.getNode());if(p===null)return!1;Nd(l);const h=c.getCordsFromCellNode(p,r.table);return sE(r,c,h.x,h.y,l.shiftKey?"backward":"forward"),!0},mr)),r.listenersToRemove.add(n.registerCommand(bS,l=>c.isSelected(),Ho));function f(l){const d=c.getCordsFromCellNode(l,r.table);return c.getDOMCellFromCordsOrThrow(d.x,d.y,r.table)}return r.listenersToRemove.add(n.registerCommand(th,l=>{const{nodes:d,selection:p}=l,h=p.getStartEndPoints(),m=nr(p),y=at(p)&&dn(p.anchor.getNode(),z=>fn(z))!==null&&dn(p.focus.getNode(),z=>fn(z))!==null||m;if(d.length!==1||!xo(d[0])||!y||h===null)return!1;const[b]=h,v=d[0],_=v.getChildren(),w=v.getFirstChildOrThrow().getChildrenSize(),x=v.getChildrenSize(),S=dn(b.getNode(),z=>fn(z)),E=S&&dn(S,z=>yr(z)),O=E&&dn(E,z=>xo(z));if(!fn(S)||!yr(E)||!xo(O))return!1;const j=E.getIndexWithinParent(),A=Math.min(O.getChildrenSize()-1,j+x-1),T=S.getIndexWithinParent(),I=Math.min(E.getChildrenSize()-1,T+w-1),k=Math.min(T,I),$=Math.min(j,A),H=Math.max(T,I),U=Math.max(j,A),D=O.getChildren();let W=0,J,M;for(let z=$;z<=U;z++){const V=D[z];if(!yr(V))return!1;const G=_[W];if(!yr(G))return!1;const F=V.getChildren(),K=G.getChildren();let N=0;for(let R=k;R<=H;R++){const L=F[R];if(!fn(L))return!1;const B=K[N];if(!fn(B))return!1;z===$&&R===k?J=L.getKey():z===U&&R===H&&(M=L.getKey());const Y=L.getChildren();B.getChildren().forEach(X=>{zt(X)&&An().append(X),L.append(X)}),Y.forEach(X=>X.remove()),N++}W++}if(J&&M){const z=kh();z.set(d[0].getKey(),J,M),kr(z)}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ai,()=>{const l=st(),d=Ys();if(at(l)){const{anchor:p,focus:h}=l,m=p.getNode(),g=h.getNode(),y=ob(m),b=ob(g),v=!!(y&&c.is(ib(y))),_=!!(b&&c.is(ib(b))),w=v!==_,x=v&&_,S=l.isBackward();if(w){const E=l.clone();E.focus.set(c.getKey(),S?0:c.getChildrenSize(),"element"),kr(E),iE(n,r)}else x&&(y.is(b)||(r.setAnchorCellForSelection(f(y)),r.setFocusCellForSelection(f(b),!0)))}return l&&!l.is(d)&&(nr(l)||nr(d))&&r.tableSelection&&!r.tableSelection.is(d)?(nr(l)&&l.tableKey===r.tableNodeKey?r.updateTableTableSelection(l):!nr(l)&&nr(d)&&d.tableKey===r.tableNodeKey&&r.updateTableTableSelection(null),!1):(r.hasHijackedSelectionStyles&&!c.isSelected()?ED(n,r):!r.hasHijackedSelectionStyles&&c.isSelected()&&iE(n,r),!1)},mr)),r}function SD(c,t){c[oE]=t}function CD(c){return c[oE]}function tb(c){let t=c;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function Oc(c){const t=[],n={columns:0,domRows:t,rows:0};let e=c.firstChild,s=0,r=0;for(t.length=0;e!=null;){const o=e.nodeName;if(o==="TD"||o==="TH"){const a=e,f={elem:a,hasBackgroundColor:a.style.backgroundColor!=="",highlighted:!1,x:s,y:r};e._cell=f;let l=t[r];l===void 0&&(l=t[r]=[]),l[s]=f}else{const a=e.firstChild;if(a!=null){e=a;continue}}const i=e.nextSibling;if(i!=null){s++,e=i;continue}const u=e.parentNode;if(u!=null){const a=u.nextSibling;if(a==null)break;r++,s=0,e=a}}return n.columns=s+1,n.rows=r+1,n}function Ah(c,t,n){const e=new Set(n?n.getNodes():[]);nb(t,(s,r)=>{const o=s.elem;e.has(r)?(s.highlighted=!0,aE(c,s)):(s.highlighted=!1,lE(c,s),o.getAttribute("style")||o.removeAttribute("style"))})}function nb(c,t){const{domRows:n}=c;for(let e=0;e<n.length;e++){const s=n[e];if(s)for(let r=0;r<s.length;r++){const o=s[r];if(!o)continue;const i=xr(o.elem);i!==null&&t(o,i,{x:r,y:e})}}}function iE(c,t){t.disableHighlightStyle(),nb(t.table,n=>{n.highlighted=!0,aE(c,n)})}function ED(c,t){t.enableHighlightStyle(),nb(t.table,n=>{const e=n.elem;n.highlighted=!1,lE(c,n),e.getAttribute("style")||e.removeAttribute("style")})}const sE=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)?Ph(t.getCellNodeFromCordsOrThrow(n+(r?1:-1),e,c.table),r):e!==(r?c.table.rows-1:0)?Ph(t.getCellNodeFromCordsOrThrow(r?0:c.table.columns-1,e+(r?1:-1),c.table),r):r?t.selectNext():t.selectPrevious(),!0;case"up":return e!==0?Ph(t.getCellNodeFromCordsOrThrow(n,e-1,c.table),!1):t.selectPrevious(),!0;case"down":return e!==c.table.rows-1?Ph(t.getCellNodeFromCordsOrThrow(n,e+1,c.table),!0):t.selectNext(),!0;default:return!1}},OD=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)&&c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n+(r?1:-1),e,c.table)),!0;case"up":return e!==0?(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e-1,c.table)),!0):!1;case"down":return e!==c.table.rows-1?(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e+1,c.table)),!0):!1;default:return!1}};function tl(c,t){if(at(c)||nr(c)){const n=t.isParentOf(c.anchor.getNode()),e=t.isParentOf(c.focus.getNode());return n&&e}return!1}function Ph(c,t){t?c.selectStart():c.selectEnd()}const rb="172,206,247";function aE(c,t){const n=t.elem,e=xr(n);if(!fn(e))throw Error("Expected to find LexicalNode from Table Cell DOMNode");e.getBackgroundColor()===null?n.style.setProperty("background-color",`rgb(${rb})`):n.style.setProperty("background-image",`linear-gradient(to right, rgba(${rb},0.85), rgba(${rb},0.85))`),n.style.setProperty("caret-color","transparent")}function lE(c,t){const n=t.elem,e=xr(n);if(!fn(e))throw Error("Expected to find LexicalNode from Table Cell DOMNode");e.getBackgroundColor()===null&&n.style.removeProperty("background-color"),n.style.removeProperty("background-image"),n.style.removeProperty("caret-color")}function ob(c){const t=dn(c,fn);return fn(t)?t:null}function ib(c){const t=dn(c,xo);return xo(t)?t:null}function Td(c,t,n,e,s){const r=st();if(!tl(r,e))return!1;if(at(r)&&r.isCollapsed()){if(n==="backward"||n==="forward")return!1;const{anchor:o,focus:i}=r,u=dn(o.getNode(),fn),a=dn(i.getNode(),fn);if(!fn(u)||!u.is(a))return!1;const f=ib(u);if(f!==e&&f!=null){const b=c.getElementByKey(f.getKey());if(b!=null)return s.table=Oc(b),Td(c,t,n,f,s)}const l=c.getElementByKey(u.__key),d=c.getElementByKey(o.key);if(d==null||l==null)return!1;let p;if(o.type==="element")p=d.getBoundingClientRect();else{const b=window.getSelection();if(b===null||b.rangeCount===0)return!1;p=b.getRangeAt(0).getBoundingClientRect()}const h=n==="up"?u.getFirstChild():u.getLastChild();if(h==null)return!1;const m=c.getElementByKey(h.__key);if(m==null)return!1;const g=m.getBoundingClientRect();if(n==="up"?g.top>p.top-p.height:p.bottom+p.height>g.bottom){Nd(t);const b=e.getCordsFromCellNode(u,s.table);if(t.shiftKey){const v=e.getDOMCellFromCordsOrThrow(b.x,b.y,s.table);s.setAnchorCellForSelection(v),s.setFocusCellForSelection(v,!0)}else return sE(s,e,b.x,b.y,n);return!0}}else if(nr(r)){const{anchor:o,focus:i}=r,u=dn(o.getNode(),fn),a=dn(i.getNode(),fn),[f]=r.getNodes(),l=c.getElementByKey(f.getKey());if(!fn(u)||!fn(a)||!xo(f)||l==null)return!1;s.updateTableTableSelection(r);const d=Oc(l),p=e.getCordsFromCellNode(u,d),h=e.getDOMCellFromCordsOrThrow(p.x,p.y,d);if(s.setAnchorCellForSelection(h),Nd(t),t.shiftKey){const m=e.getCordsFromCellNode(a,d);return OD(s,f,m.x,m.y,n)}else a.selectEnd();return!0}return!1}function Nd(c){c.preventDefault(),c.stopImmediatePropagation(),c.stopPropagation()}let sb=class vN extends po{static getType(){return"table"}static clone(t){return new vN(t.__key)}static importDOM(){return{table:t=>({conversion:ND,priority:1})}}static importJSON(t){return Mh()}constructor(t){super(t)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(t,n){const e=document.createElement("table");return wr(e,t.theme.table),e}updateDOM(){return!1}exportDOM(t){return{...super.exportDOM(t),after:n=>{if(n){const e=n.cloneNode(),s=document.createElement("colgroup"),r=document.createElement("tbody");oa(n)&&r.append(...n.children);const o=this.getFirstChildOrThrow();if(!yr(o))throw new Error("Expected to find row node.");const i=o.getChildrenSize();for(let u=0;u<i;u++){const a=document.createElement("col");s.append(a)}return e.replaceChildren(s,r),e}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:e,domRows:s}=n;for(let r=0;r<e;r++){const o=s[r];if(o==null)continue;const i=o.findIndex(u=>{if(!u)return;const{elem:a}=u;return xr(a)===t});if(i!==-1)return{x:i,y:r}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,e){const{domRows:s}=e,r=s[n];if(r==null)return null;const o=r[t];return o??null}getDOMCellFromCordsOrThrow(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(!s)throw new Error("Cell not found at cords.");return s}getCellNodeFromCords(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(s==null)return null;const r=xr(s.elem);return fn(r)?r:null}getCellNodeFromCordsOrThrow(t,n,e){const s=this.getCellNodeFromCords(t,n,e);if(!s)throw new Error("Node at cords not TableCellNode.");return s}canSelectBefore(){return!0}canIndent(){return!1}};function TD(c,t){const n=c.getElementByKey(t.getKey());if(n==null)throw new Error("Table Element Not Found");return Oc(n)}function ND(c){return{node:Mh()}}function Mh(){return Gr(new sb)}function xo(c){return c instanceof sb}const kD=Object.freeze(Object.defineProperty({__proto__:null,$computeTableMap:ia,$createTableCellNode:Ko,$createTableNode:Mh,$createTableNodeWithDimensions:aD,$createTableRowNode:el,$createTableSelection:kh,$deleteTableColumn:mD,$deleteTableColumn__EXPERIMENTAL:bD,$deleteTableRow__EXPERIMENTAL:yD,$getElementForTableNode:TD,$getNodeTriplet:Pi,$getTableCellNodeFromLexicalNode:lD,$getTableCellNodeRect:eb,$getTableColumnIndexFromTableCellNode:uD,$getTableNodeFromLexicalNodeOrThrow:Xy,$getTableRowIndexFromTableCellNode:cD,$getTableRowNodeFromTableCellNodeOrThrow:Yy,$insertTableColumn:hD,$insertTableColumn__EXPERIMENTAL:gD,$insertTableRow:fD,$insertTableRow__EXPERIMENTAL:pD,$isTableCellNode:fn,$isTableNode:xo,$isTableRowNode:yr,$isTableSelection:nr,$removeTableRowAtIndex:dD,$unmergeCell:vD,INSERT_TABLE_COMMAND:oD,TableCellHeaderStates:Hn,TableCellNode:Th,TableNode:sb,TableObserver:rE,TableRowNode:Gy,applyTableHandlers:wD,getDOMCellFromTarget:tb,getTableObserverFromTableElement:CD},Symbol.toStringTag,{value:"Module"})),cE=/^(\d+(?:\.\d+)?)px$/,Kn={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Tc extends po{static getType(){return"tablecell"}static clone(t){const n=new Tc(t.__headerState,t.__colSpan,t.__width,t.__key);return n.__rowSpan=t.__rowSpan,n.__backgroundColor=t.__backgroundColor,n}static importDOM(){return{td:t=>({conversion:uE,priority:0}),th:t=>({conversion:uE,priority:0})}}static importJSON(t){const n=t.colSpan||1,e=t.rowSpan||1,s=Wo(t.headerState,n,t.width||void 0);return s.__rowSpan=e,s.__backgroundColor=t.backgroundColor||null,s}constructor(t=Kn.NO_STATUS,n=1,e,s){super(s),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=e,this.__backgroundColor=null}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),wr(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const{element:n}=super.exportDOM(t);if(n){const e=n,s=700,r=this.getParentOrThrow().getChildrenSize();e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||Math.max(90,s/r)}px`,e.style.verticalAlign="top",e.style.textAlign="start";const o=this.getBackgroundColor();o!==null?e.style.backgroundColor=o:this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return{element:n}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(t){return this.getWritable().__colSpan=t,this}getRowSpan(){return this.__rowSpan}setRowSpan(t){return this.getWritable().__rowSpan=t,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t){return this.getWritable().__headerState=t,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){return this.getWritable().__width=t,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){this.getWritable().__backgroundColor=t}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==Kn.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function uE(c){const t=c,n=c.nodeName.toLowerCase();let e;cE.test(t.style.width)&&(e=parseFloat(t.style.width));const s=Wo(n==="th"?Kn.ROW:Kn.NO_STATUS,t.colSpan,e);s.__rowSpan=t.rowSpan;const r=t.style.backgroundColor;return r!==""&&(s.__backgroundColor=r),{after:o=>(o.length===0&&o.push(An()),o),forChild:(o,i)=>{if(pn(i)&&!Rt(o)){const u=An();return dd(o)&&o.getTextContent()===`
|
|
59
|
-
`?null:(u.append(o),u)}return o},node:s}}function Wo(c,t=1,n){return Gr(new Tc(c,t,n))}function pn(c){return c instanceof Tc}const AD=Xa("INSERT_TABLE_COMMAND");class kd extends po{static getType(){return"tablerow"}static clone(t){return new kd(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:PD,priority:0})}}static importJSON(t){return nl(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),wr(n,t.theme.tableRow),n}isShadowRoot(){return!0}setHeight(t){return this.getWritable().__height=t,this.__height}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function PD(c){const t=c;let n;return cE.test(t.style.height)&&(n=parseFloat(t.style.height)),{node:nl(n)}}function nl(c){return Gr(new kd(c))}function br(c){return c instanceof kd}var Pn=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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.`)};const MD=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function ID(c,t,n=!0){const e=Lh();for(let s=0;s<c;s++){const r=nl();for(let o=0;o<t;o++){let i=Kn.NO_STATUS;typeof n=="object"?(s===0&&n.rows&&(i|=Kn.ROW),o===0&&n.columns&&(i|=Kn.COLUMN)):n&&(s===0&&(i|=Kn.ROW),o===0&&(i|=Kn.COLUMN));const u=Wo(i),a=An();a.append(Ei()),u.append(a),r.append(u)}e.append(r)}return e}function RD(c){const t=dn(c,n=>pn(n));return pn(t)?t:null}function ab(c){const t=dn(c,n=>br(n));if(br(t))return t;throw new Error("Expected table cell to be inside of table row.")}function lb(c){const t=dn(c,n=>wo(n));if(wo(t))return t;throw new Error("Expected table cell to be inside of table.")}function jD(c){const t=ab(c);return lb(t).getChildren().findIndex(n=>n.is(t))}function DD(c){return ab(c).getChildren().findIndex(t=>t.is(c))}function dE(c,t){const n=lb(c),{x:e,y:s}=n.getCordsFromCellNode(c,t);return{above:n.getCellNodeFromCords(e,s-1,t),below:n.getCellNodeFromCords(e,s+1,t),left:n.getCellNodeFromCords(e-1,s,t),right:n.getCellNodeFromCords(e+1,s,t)}}function LD(c,t){const n=c.getChildren();if(t>=n.length||t<0)throw new Error("Expected table cell to be inside of table row.");return n[t].remove(),c}function BD(c,t,n=!0,e,s){const r=c.getChildren();if(t>=r.length||t<0)throw new Error("Table row target index out of range");const o=r[t];if(!br(o))throw new Error("Row before insertion index does not exist.");for(let i=0;i<e;i++){const u=o.getChildren(),a=u.length,f=nl();for(let l=0;l<a;l++){const d=u[l];pn(d)||Pn(12);const{above:p,below:h}=dE(d,s);let m=Kn.NO_STATUS;const g=p&&p.getWidth()||h&&h.getWidth()||void 0;(p&&p.hasHeaderState(Kn.COLUMN)||h&&h.hasHeaderState(Kn.COLUMN))&&(m|=Kn.COLUMN);const y=Wo(m,1,g);y.append(An()),f.append(y)}n?o.insertAfter(f):o.insertBefore(f)}return c}const cb=(c,t)=>c===Kn.BOTH||c===t?t:Kn.NO_STATUS;function FD(c=!0){const t=st();at(t)||rr(t)||Pn(118);const n=t.focus.getNode(),[e,,s]=Mi(n),[r,o]=sa(s,e,e),i=r[0].length,{startRow:u}=o;if(c){const a=u+e.__rowSpan-1,f=r[a],l=nl();for(let p=0;p<i;p++){const{cell:h,startRow:m}=f[p];if(m+h.__rowSpan-1<=a){const g=f[p].cell.__headerState,y=cb(g,Kn.COLUMN);l.append(Wo(y).append(An()))}else h.setRowSpan(h.__rowSpan+1)}const d=s.getChildAtIndex(a);br(d)||Pn(145),d.insertAfter(l)}else{const a=r[u],f=nl();for(let d=0;d<i;d++){const{cell:p,startRow:h}=a[d];if(h===u){const m=a[d].cell.__headerState,g=cb(m,Kn.COLUMN);f.append(Wo(g).append(An()))}else p.setRowSpan(p.__rowSpan+1)}const l=s.getChildAtIndex(u);br(l)||Pn(145),l.insertBefore(f)}}function $D(c,t,n=!0,e,s){const r=c.getChildren(),o=[];for(let i=0;i<r.length;i++){const u=r[i];if(br(u))for(let a=0;a<e;a++){const f=u.getChildren();if(t>=f.length||t<0)throw new Error("Table column target index out of range");const l=f[t];pn(l)||Pn(12);const{left:d,right:p}=dE(l,s);let h=Kn.NO_STATUS;(d&&d.hasHeaderState(Kn.ROW)||p&&p.hasHeaderState(Kn.ROW))&&(h|=Kn.ROW);const m=Wo(h);m.append(An()),o.push({newTableCell:m,targetCell:l})}}return o.forEach(({newTableCell:i,targetCell:u})=>{n?u.insertAfter(i):u.insertBefore(i)}),c}function zD(c=!0){const t=st();at(t)||rr(t)||Pn(118);const n=t.anchor.getNode(),e=t.focus.getNode(),[s]=Mi(n),[r,,o]=Mi(e),[i,u,a]=sa(o,r,s),f=i.length,l=c?Math.max(u.startColumn,a.startColumn):Math.min(u.startColumn,a.startColumn),d=c?l+r.__colSpan-1:l-1,p=o.getFirstChild();br(p)||Pn(120);let h=null;function m(y=Kn.NO_STATUS){const b=Wo(y).append(An());return h===null&&(h=b),b}let g=p;e:for(let y=0;y<f;y++){if(y!==0){const E=g.getNextSibling();br(E)||Pn(121),g=E}const b=i[y],v=b[d<0?0:d].cell.__headerState,_=cb(v,Kn.ROW);if(d<0){ub(g,m(_));continue}const{cell:w,startColumn:x,startRow:S}=b[d];if(x+w.__colSpan-1<=d){let E=w,O=S,j=d;for(;O!==y&&E.__rowSpan>1;){if(j-=w.__colSpan,!(j>=0)){g.append(m(_));continue e}{const{cell:A,startRow:T}=b[j];E=A,O=T}}E.insertAfter(m(_))}else w.setColSpan(w.__colSpan+1)}h!==null&&Ad(h)}function UD(c,t){const n=c.getChildren();for(let e=0;e<n.length;e++){const s=n[e];if(br(s)){const r=s.getChildren();if(t>=r.length||t<0)throw new Error("Table column target index out of range");r[t].remove()}}return c}function HD(){const c=st();at(c)||rr(c)||Pn(118);const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Mi(t),[r]=Mi(n),[o,i,u]=sa(s,e,r),{startRow:a}=i,{startRow:f}=u,l=f+r.__rowSpan-1;if(o.length===l-a+1)return void s.remove();const d=o[0].length,p=o[l+1],h=s.getChildAtIndex(l+1);for(let m=l;m>=a;m--){for(let y=d-1;y>=0;y--){const{cell:b,startRow:v,startColumn:_}=o[m][y];if(_===y&&(m===a&&v<a&&b.setRowSpan(b.__rowSpan-(v-a)),v>=a&&v+b.__rowSpan-1>l))if(b.setRowSpan(b.__rowSpan-(l-v+1)),h===null&&Pn(122),y===0)ub(h,b);else{const{cell:w}=p[y-1];w.insertAfter(b)}}const g=s.getChildAtIndex(m);br(g)||Pn(123,String(m)),g.remove()}if(p!==void 0){const{cell:m}=p[0];Ad(m)}else{const m=o[a-1],{cell:g}=m[0];Ad(g)}}function KD(){const c=st();at(c)||rr(c)||Pn(118);const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Mi(t),[r]=Mi(n),[o,i,u]=sa(s,e,r),{startColumn:a}=i,{startRow:f,startColumn:l}=u,d=Math.min(a,l),p=Math.max(a+e.__colSpan-1,l+r.__colSpan-1),h=p-d+1;if(o[0].length===p-d+1)return s.selectPrevious(),void s.remove();const m=o.length;for(let b=0;b<m;b++)for(let v=d;v<=p;v++){const{cell:_,startColumn:w}=o[b][v];if(w<d){if(v===d){const x=d-w;_.setColSpan(_.__colSpan-Math.min(h,_.__colSpan-x))}}else if(w+_.__colSpan-1>p){if(v===p){const x=p-w+1;_.setColSpan(_.__colSpan-x)}}else _.remove()}const g=o[f],y=g[l+r.__colSpan];if(y!==void 0){const{cell:b}=y;Ad(b)}else{const b=g[l-1],{cell:v}=b;Ad(v)}}function Ad(c){const t=c.getFirstDescendant();t==null?c.selectStart():t.getParentOrThrow().selectStart()}function ub(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}function WD(){const c=st();at(c)||rr(c)||Pn(118);const t=c.anchor.getNode(),[n,e,s]=Mi(t),r=n.__colSpan,o=n.__rowSpan;if(r>1){for(let i=1;i<r;i++)n.insertAfter(Wo(Kn.NO_STATUS));n.setColSpan(1)}if(o>1){const[i,u]=sa(s,n,n),{startColumn:a,startRow:f}=u;let l;for(let d=1;d<o;d++){const p=f+d,h=i[p];l=(l||e).getNextSibling(),br(l)||Pn(125);let m=null;for(let g=0;g<a;g++){const y=h[g],b=y.cell;y.startRow===p&&(m=b),b.__colSpan>1&&(g+=b.__colSpan-1)}if(m===null)for(let g=0;g<r;g++)ub(l,Wo(Kn.NO_STATUS));else for(let g=0;g<r;g++)m.insertAfter(Wo(Kn.NO_STATUS))}n.setRowSpan(1)}}function sa(c,t,n){const e=[];let s=null,r=null;function o(a,f,l){const d={cell:l,startColumn:f,startRow:a},p=l.__rowSpan,h=l.__colSpan;for(let m=0;m<p;m++){e[a+m]===void 0&&(e[a+m]=[]);for(let g=0;g<h;g++)e[a+m][f+g]=d}t.is(l)&&(s=d),n.is(l)&&(r=d)}function i(a,f){return e[a]===void 0||e[a][f]===void 0}const u=c.getChildren();for(let a=0;a<u.length;a++){const f=u[a];br(f)||Pn(146);const l=f.getChildren();let d=0;for(const p of l){for(pn(p)||Pn(147);!i(a,d);)d++;o(a,d,p),d+=p.__colSpan}}return s===null&&Pn(110),r===null&&Pn(111),[e,s,r]}function Mi(c){let t;if(c instanceof Tc)t=c;else if("__type"in c){const s=dn(c,pn);pn(s)||Pn(148),t=s}else{const s=dn(c.getNode(),pn);pn(s)||Pn(148),t=s}const n=t.getParent();br(n)||Pn(149);const e=n.getParent();return wo(e)||Pn(150),[t,n,e]}function db(c){const[t,,n]=Mi(c),e=n.getChildren(),s=e.length,r=e[0].getChildren().length,o=new Array(s);for(let i=0;i<s;i++)o[i]=new Array(r);for(let i=0;i<s;i++){const u=e[i].getChildren();let a=0;for(let f=0;f<u.length;f++){for(;o[i][a];)a++;const l=u[f],d=l.__rowSpan||1,p=l.__colSpan||1;for(let h=0;h<d;h++)for(let m=0;m<p;m++)o[i+h][a+m]=l;if(t===l)return{colSpan:p,columnIndex:a,rowIndex:i,rowSpan:d};a+=p}}return null}class Ih{constructor(t,n,e){this.anchor=n,this.focus=e,n._selection=this,e._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!rr(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,e){this.dirty=!0,this.tableKey=t,this.anchor.key=n,this.focus.key=e,this._cachedNodes=null}clone(){return new Ih(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.focus.getNode();Rt(n)||Pn(151),Kp(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const t=Ro(this.anchor.key);pn(t)||Pn(152);const n=db(t);n===null&&Pn(153);const e=Ro(this.focus.key);pn(e)||Pn(154);const s=db(e);s===null&&Pn(155);const r=Math.min(n.columnIndex,s.columnIndex),o=Math.max(n.columnIndex,s.columnIndex),i=Math.min(n.rowIndex,s.rowIndex),u=Math.max(n.rowIndex,s.rowIndex);return{fromX:Math.min(r,o),fromY:Math.min(i,u),toX:Math.max(r,o),toY:Math.max(i,u)}}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this.anchor.getNode(),e=this.focus.getNode(),s=dn(n,pn),r=dn(e,pn);pn(s)||Pn(152),pn(r)||Pn(154);const o=s.getParent();br(o)||Pn(156);const i=o.getParent();wo(i)||Pn(157);const u=r.getParents()[1];if(u!==i){if(i.isParentOf(r)){const S=u.getParent();S==null&&Pn(159),this.set(this.tableKey,r.getKey(),S.getKey())}else{const S=i.getParent();S==null&&Pn(158),this.set(this.tableKey,S.getKey(),r.getKey())}return this.getNodes()}const[a,f,l]=sa(i,s,r);let d=Math.min(f.startColumn,l.startColumn),p=Math.min(f.startRow,l.startRow),h=Math.max(f.startColumn+f.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),m=Math.max(f.startRow+f.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1),g=d,y=p,b=d,v=p;function _(S){const{cell:E,startColumn:O,startRow:j}=S;d=Math.min(d,O),p=Math.min(p,j),h=Math.max(h,O+E.__colSpan-1),m=Math.max(m,j+E.__rowSpan-1)}for(;d<g||p<y||h>b||m>v;){if(d<g){const S=v-y,E=g-1;for(let O=0;O<=S;O++)_(a[y+O][E]);g=E}if(p<y){const S=b-g,E=y-1;for(let O=0;O<=S;O++)_(a[E][g+O]);y=E}if(h>b){const S=v-y,E=b+1;for(let O=0;O<=S;O++)_(a[y+O][E]);b=E}if(m>v){const S=b-g,E=v+1;for(let O=0;O<=S;O++)_(a[E][g+O]);v=E}}const w=[i];let x=null;for(let S=p;S<=m;S++)for(let E=d;E<=h;E++){const{cell:O}=a[S][E],j=O.getParent();br(j)||Pn(160),j!==x&&w.push(j),w.push(O,...qD(O)),x=j}return wS()||(this._cachedNodes=w),w}getTextContent(){const t=this.getNodes();let n="";for(let e=0;e<t.length;e++)n+=t[e].getTextContent();return n}}function rr(c){return c instanceof Ih}function Rh(){const c=Up("root",0,"element"),t=Up("root",0,"element");return new Ih("root",c,t)}function qD(c){const t=[],n=[c];for(;n.length>0;){const e=n.pop();e===void 0&&Pn(112),Rt(e)&&n.unshift(...e.getChildren()),e!==c&&t.push(e)}return t}class fE{constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable()}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(t=>t())}trackTable(){const t=new MutationObserver(n=>{this.editor.update(()=>{let e=!1;for(let r=0;r<n.length;r++){const o=n[r].target.nodeName;if(o==="TABLE"||o==="TR"){e=!0;break}}if(!e)return;const s=this.editor.getElementByKey(this.tableNodeKey);if(!s)throw new Error("Expected to find TableElement in DOM");this.table=Nc(s)})});this.editor.update(()=>{const n=this.editor.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");this.table=Nc(n),t.observe(n,{childList:!0,subtree:!0})})}clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),t.update(()=>{if(!wo(Ro(this.tableNodeKey)))throw new Error("Expected TableNode.");const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");const e=Nc(n);jh(t,e,null),kr(null),t.dispatchCommand(ai,void 0)})}enableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");fh(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");wr(n,t._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(t){if(t!==null&&t.tableKey===this.tableNodeKey){const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.disableHighlightStyle(),jh(n,this.table,this.tableSelection)}else t==null?this.clearHighlight():(this.tableNodeKey=t.tableKey,this.updateTableTableSelection(t))}setFocusCellForSelection(t,n=!1){const e=this.editor;e.update(()=>{if(!wo(Ro(this.tableNodeKey)))throw new Error("Expected TableNode.");if(!e.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const s=t.x,r=t.y;if(this.focusCell=t,this.anchorCell!==null){const i=(o=e._window,MD?(o||window).getSelection():null);i&&i.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}var o;if(this.isHighlightingCells||this.anchorX===s&&this.anchorY===r&&!n){if(s===this.focusX&&r===this.focusY)return}else this.isHighlightingCells=!0,this.disableHighlightStyle();if(this.focusX=s,this.focusY=r,this.isHighlightingCells){const i=xr(t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&pn(i)){const u=i.getKey();this.tableSelection=this.tableSelection.clone()||Rh(),this.focusCellNodeKey=u,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),kr(this.tableSelection),e.dispatchCommand(ai,void 0),jh(e,this.table,this.tableSelection)}}})}setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y,this.editor.update(()=>{const n=xr(t.elem);if(pn(n)){const e=n.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():Rh(),this.anchorCellNodeKey=e}})}formatCells(t){this.editor.update(()=>{const n=st();rr(n)||Pn(11);const e=ud(),s=e.anchor,r=e.focus;n.getNodes().forEach(o=>{pn(o)&&o.getTextContentSize()!==0&&(s.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),e.formatText(t))}),kr(n),this.editor.dispatchCommand(ai,void 0)})}clearText(){const t=this.editor;t.update(()=>{const n=Ro(this.tableNodeKey);if(!wo(n))throw new Error("Expected TableNode.");const e=st();rr(e)||Pn(11);const s=e.getNodes().filter(pn);s.length!==this.table.columns*this.table.rows?(s.forEach(r=>{if(Rt(r)){const o=An(),i=Ei();o.append(i),r.append(o),r.getChildren().forEach(u=>{u!==o&&u.remove()})}}),jh(t,this.table,null),kr(null),t.dispatchCommand(ai,void 0)):(n.selectPrevious(),n.remove(),Un().selectStart())})}}const pE="__lexicalTableSelection";function JD(c,t,n,e){const s=n.getRootElement();if(s===null)throw new Error("No root element.");const r=new fE(n,c.getKey()),o=n._window||window;(function(f,l){f[pE]=l})(t,r),t.addEventListener("mousedown",f=>{setTimeout(()=>{if(f.button!==0||!o)return;const l=fb(f.target);l!==null&&(Md(f),r.setAnchorCellForSelection(l));const d=()=>{o.removeEventListener("mouseup",d),o.removeEventListener("mousemove",p)},p=h=>{const m=fb(h.target);m===null||r.anchorX===m.x&&r.anchorY===m.y||(h.preventDefault(),r.setFocusCellForSelection(m))};o.addEventListener("mouseup",d),o.addEventListener("mousemove",p)},0)});const i=f=>{f.button===0&&n.update(()=>{const l=st(),d=f.target;rr(l)&&l.tableKey===r.tableNodeKey&&s.contains(d)&&r.clearHighlight()})};o.addEventListener("mousedown",i),r.listenersToRemove.add(()=>o.removeEventListener("mousedown",i)),r.listenersToRemove.add(n.registerCommand(Gp,f=>Pd(n,f,"down",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(Yp,f=>Pd(n,f,"up",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(lc,f=>Pd(n,f,"backward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(cc,f=>Pd(n,f,"forward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(hd,f=>{const l=st();if(rr(l)){const d=dn(l.focus.getNode(),pn);if(pn(d))return Md(f),d.selectEnd(),!0}return!1},Ho)),[Qs,Zs,Yr].forEach(f=>{r.listenersToRemove.add(n.registerCommand(f,(l=>()=>{const d=st();if(!rl(d,c))return!1;if(rr(d))return r.clearText(),!0;if(at(d)){const p=dn(d.anchor.getNode(),_=>pn(_));if(!pn(p))return!1;const h=d.anchor.getNode(),m=d.focus.getNode(),g=c.isParentOf(h),y=c.isParentOf(m);if(g&&!y||y&&!g)return r.clearText(),!0;const b=dn(d.anchor.getNode(),_=>Rt(_)),v=b&&dn(b,_=>Rt(_)&&pn(_.getParent()));if(!Rt(v)||!Rt(b))return!1;if(l===Zs&&v.getPreviousSibling()===null)return!0;if((l===Yr||l===Qs)&&d.isCollapsed()&&d.anchor.offset===0&&b!==v){const _=b.getChildren(),w=An();return _.forEach(x=>w.append(x)),b.replace(w),b.getWritable().__parent=p.getKey(),!0}}return!1})(f),mr))});const u=f=>{const l=st();if(!rl(l,c))return!1;if(rr(l))return f.preventDefault(),f.stopPropagation(),r.clearText(),!0;if(at(l)){const d=dn(l.anchor.getNode(),p=>pn(p));if(!pn(d))return!1}return!1};function a(f){const l=c.getCordsFromCellNode(f,r.table);return c.getDOMCellFromCordsOrThrow(l.x,l.y,r.table)}return r.listenersToRemove.add(n.registerCommand(Va,u,mr)),r.listenersToRemove.add(n.registerCommand(Ga,u,mr)),r.listenersToRemove.add(n.registerCommand(Ni,f=>{const l=st();if(!rl(l,c))return!1;if(rr(l))return r.formatCells(f),!0;if(at(l)){const d=dn(l.anchor.getNode(),p=>pn(p));if(!pn(d))return!1}return!1},mr)),r.listenersToRemove.add(n.registerCommand(ea,f=>{const l=st();if(!rr(l)||!rl(l,c))return!1;const d=l.anchor.getNode(),p=l.focus.getNode();if(!pn(d)||!pn(p))return!1;const[h,m,g]=sa(c,d,p),y=Math.max(m.startRow,g.startRow),b=Math.max(m.startColumn,g.startColumn),v=Math.min(m.startRow,g.startRow),_=Math.min(m.startColumn,g.startColumn);for(let w=v;w<=y;w++)for(let x=_;x<=b;x++){const S=h[w][x].cell;S.setFormat(f);const E=S.getChildren();for(let O=0;O<E.length;O++){const j=E[O];Rt(j)&&!j.isInline()&&j.setFormat(f)}}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ic,f=>{const l=st();if(!rl(l,c))return!1;if(rr(l))return r.clearHighlight(),!1;if(at(l)){const d=dn(l.anchor.getNode(),p=>pn(p));if(!pn(d))return!1}return!1},mr)),e&&r.listenersToRemove.add(n.registerCommand(xS,f=>{const l=st();if(!at(l)||!l.isCollapsed()||!rl(l,c))return!1;const d=gb(l.anchor.getNode());if(d===null)return!1;Md(f);const p=c.getCordsFromCellNode(d,r.table);return gE(r,c,p.x,p.y,f.shiftKey?"backward":"forward"),!0},mr)),r.listenersToRemove.add(n.registerCommand(bS,f=>c.isSelected(),Ho)),r.listenersToRemove.add(n.registerCommand(th,f=>{const{nodes:l,selection:d}=f,p=d.getStartEndPoints(),h=rr(d),m=at(d)&&dn(d.anchor.getNode(),J=>pn(J))!==null&&dn(d.focus.getNode(),J=>pn(J))!==null||h;if(l.length!==1||!wo(l[0])||!m||p===null)return!1;const[g]=p,y=l[0],b=y.getChildren(),v=y.getFirstChildOrThrow().getChildrenSize(),_=y.getChildrenSize(),w=dn(g.getNode(),J=>pn(J)),x=w&&dn(w,J=>br(J)),S=x&&dn(x,J=>wo(J));if(!pn(w)||!br(x)||!wo(S))return!1;const E=x.getIndexWithinParent(),O=Math.min(S.getChildrenSize()-1,E+_-1),j=w.getIndexWithinParent(),A=Math.min(x.getChildrenSize()-1,j+v-1),T=Math.min(j,A),I=Math.min(E,O),k=Math.max(j,A),$=Math.max(E,O),H=S.getChildren();let U,D,W=0;for(let J=I;J<=$;J++){const M=H[J];if(!br(M))return!1;const z=b[W];if(!br(z))return!1;const V=M.getChildren(),G=z.getChildren();let F=0;for(let K=T;K<=k;K++){const N=V[K];if(!pn(N))return!1;const R=G[F];if(!pn(R))return!1;J===I&&K===T?U=N.getKey():J===$&&K===k&&(D=N.getKey());const L=N.getChildren();R.getChildren().forEach(B=>{zt(B)&&An().append(B),N.append(B)}),L.forEach(B=>B.remove()),F++}W++}if(U&&D){const J=Rh();J.set(l[0].getKey(),U,D),kr(J)}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ai,()=>{const f=st(),l=Ys();if(at(f)){const{anchor:d,focus:p}=f,h=d.getNode(),m=p.getNode(),g=gb(h),y=gb(m),b=!(!g||!c.is(mb(g))),v=!(!y||!c.is(mb(y))),_=b!==v,w=b&&v,x=f.isBackward();if(_){const S=f.clone();S.focus.set(c.getKey(),x?0:c.getChildrenSize(),"element"),kr(S),hE(n,r)}else w&&(g.is(y)||(r.setAnchorCellForSelection(a(g)),r.setFocusCellForSelection(a(y),!0)))}return f&&!f.is(l)&&(rr(f)||rr(l))&&r.tableSelection&&!r.tableSelection.is(l)?(rr(f)&&f.tableKey===r.tableNodeKey?r.updateTableTableSelection(f):!rr(f)&&rr(l)&&l.tableKey===r.tableNodeKey&&r.updateTableTableSelection(null),!1):(r.hasHijackedSelectionStyles&&!c.isSelected()?function(d,p){p.enableHighlightStyle(),pb(p.table,h=>{const m=h.elem;h.highlighted=!1,yE(d,h),m.getAttribute("style")||m.removeAttribute("style")})}(n,r):!r.hasHijackedSelectionStyles&&c.isSelected()&&hE(n,r),!1)},mr)),r}function VD(c){return c[pE]}function fb(c){let t=c;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function Nc(c){const t=[],n={columns:0,domRows:t,rows:0};let e=c.firstChild,s=0,r=0;for(t.length=0;e!=null;){const o=e.nodeName;if(o==="TD"||o==="TH"){const a={elem:e,hasBackgroundColor:e.style.backgroundColor!=="",highlighted:!1,x:s,y:r};e._cell=a;let f=t[r];f===void 0&&(f=t[r]=[]),f[s]=a}else{const a=e.firstChild;if(a!=null){e=a;continue}}const i=e.nextSibling;if(i!=null){s++,e=i;continue}const u=e.parentNode;if(u!=null){const a=u.nextSibling;if(a==null)break;r++,s=0,e=a}}return n.columns=s+1,n.rows=r+1,n}function jh(c,t,n){const e=new Set(n?n.getNodes():[]);pb(t,(s,r)=>{const o=s.elem;e.has(r)?(s.highlighted=!0,mE(c,s)):(s.highlighted=!1,yE(c,s),o.getAttribute("style")||o.removeAttribute("style"))})}function pb(c,t){const{domRows:n}=c;for(let e=0;e<n.length;e++){const s=n[e];if(s)for(let r=0;r<s.length;r++){const o=s[r];if(!o)continue;const i=xr(o.elem);i!==null&&t(o,i,{x:r,y:e})}}}function hE(c,t){t.disableHighlightStyle(),pb(t.table,n=>{n.highlighted=!0,mE(c,n)})}const gE=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)?Dh(t.getCellNodeFromCordsOrThrow(n+(r?1:-1),e,c.table),r):e!==(r?c.table.rows-1:0)?Dh(t.getCellNodeFromCordsOrThrow(r?0:c.table.columns-1,e+(r?1:-1),c.table),r):r?t.selectNext():t.selectPrevious(),!0;case"up":return e!==0?Dh(t.getCellNodeFromCordsOrThrow(n,e-1,c.table),!1):t.selectPrevious(),!0;case"down":return e!==c.table.rows-1?Dh(t.getCellNodeFromCordsOrThrow(n,e+1,c.table),!0):t.selectNext(),!0;default:return!1}},GD=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)&&c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n+(r?1:-1),e,c.table)),!0;case"up":return e!==0&&(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e-1,c.table)),!0);case"down":return e!==c.table.rows-1&&(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e+1,c.table)),!0);default:return!1}};function rl(c,t){if(at(c)||rr(c)){const n=t.isParentOf(c.anchor.getNode()),e=t.isParentOf(c.focus.getNode());return n&&e}return!1}function Dh(c,t){t?c.selectStart():c.selectEnd()}const hb="172,206,247";function mE(c,t){const n=t.elem,e=xr(n);pn(e)||Pn(131),e.getBackgroundColor()===null?n.style.setProperty("background-color",`rgb(${hb})`):n.style.setProperty("background-image",`linear-gradient(to right, rgba(${hb},0.85), rgba(${hb},0.85))`),n.style.setProperty("caret-color","transparent")}function yE(c,t){const n=t.elem,e=xr(n);pn(e)||Pn(131),e.getBackgroundColor()===null&&n.style.removeProperty("background-color"),n.style.removeProperty("background-image"),n.style.removeProperty("caret-color")}function gb(c){const t=dn(c,pn);return pn(t)?t:null}function mb(c){const t=dn(c,wo);return wo(t)?t:null}function Pd(c,t,n,e,s){const r=st();if(!rl(r,e))return!1;if(at(r)&&r.isCollapsed()){if(n==="backward"||n==="forward")return!1;const{anchor:o,focus:i}=r,u=dn(o.getNode(),pn),a=dn(i.getNode(),pn);if(!pn(u)||!u.is(a))return!1;const f=mb(u);if(f!==e&&f!=null){const y=c.getElementByKey(f.getKey());if(y!=null)return s.table=Nc(y),Pd(c,t,n,f,s)}const l=c.getElementByKey(u.__key),d=c.getElementByKey(o.key);if(d==null||l==null)return!1;let p;if(o.type==="element")p=d.getBoundingClientRect();else{const y=window.getSelection();if(y===null||y.rangeCount===0)return!1;p=y.getRangeAt(0).getBoundingClientRect()}const h=n==="up"?u.getFirstChild():u.getLastChild();if(h==null)return!1;const m=c.getElementByKey(h.__key);if(m==null)return!1;const g=m.getBoundingClientRect();if(n==="up"?g.top>p.top-p.height:p.bottom+p.height>g.bottom){Md(t);const y=e.getCordsFromCellNode(u,s.table);if(!t.shiftKey)return gE(s,e,y.x,y.y,n);{const b=e.getDOMCellFromCordsOrThrow(y.x,y.y,s.table);s.setAnchorCellForSelection(b),s.setFocusCellForSelection(b,!0)}return!0}}else if(rr(r)){const{anchor:o,focus:i}=r,u=dn(o.getNode(),pn),a=dn(i.getNode(),pn),[f]=r.getNodes(),l=c.getElementByKey(f.getKey());if(!pn(u)||!pn(a)||!wo(f)||l==null)return!1;s.updateTableTableSelection(r);const d=Nc(l),p=e.getCordsFromCellNode(u,d),h=e.getDOMCellFromCordsOrThrow(p.x,p.y,d);if(s.setAnchorCellForSelection(h),Md(t),t.shiftKey){const m=e.getCordsFromCellNode(a,d);return GD(s,f,m.x,m.y,n)}return a.selectEnd(),!0}return!1}function Md(c){c.preventDefault(),c.stopImmediatePropagation(),c.stopPropagation()}class Id extends po{static getType(){return"table"}static clone(t){return new Id(t.__key)}static importDOM(){return{table:t=>({conversion:XD,priority:1})}}static importJSON(t){return Lh()}constructor(t){super(t)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(t,n){const e=document.createElement("table");return wr(e,t.theme.table),e}updateDOM(){return!1}exportDOM(t){return{...super.exportDOM(t),after:n=>{if(n){const e=n.cloneNode(),s=document.createElement("colgroup"),r=document.createElement("tbody");oa(n)&&r.append(...n.children);const o=this.getFirstChildOrThrow();if(!br(o))throw new Error("Expected to find row node.");const i=o.getChildrenSize();for(let u=0;u<i;u++){const a=document.createElement("col");s.append(a)}return e.replaceChildren(s,r),e}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:e,domRows:s}=n;for(let r=0;r<e;r++){const o=s[r];if(o==null)continue;const i=o.findIndex(u=>{if(!u)return;const{elem:a}=u;return xr(a)===t});if(i!==-1)return{x:i,y:r}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,e){const{domRows:s}=e,r=s[n];if(r==null)return null;const o=r[t];return o??null}getDOMCellFromCordsOrThrow(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(!s)throw new Error("Cell not found at cords.");return s}getCellNodeFromCords(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(s==null)return null;const r=xr(s.elem);return pn(r)?r:null}getCellNodeFromCordsOrThrow(t,n,e){const s=this.getCellNodeFromCords(t,n,e);if(!s)throw new Error("Node at cords not TableCellNode.");return s}canSelectBefore(){return!0}canIndent(){return!1}}function YD(c,t){const n=c.getElementByKey(t.getKey());if(n==null)throw new Error("Table Element Not Found");return Nc(n)}function XD(c){return{node:Lh()}}function Lh(){return Gr(new Id)}function wo(c){return c instanceof Id}const ZD=Object.freeze(Object.defineProperty({__proto__:null,$computeTableMap:sa,$createTableCellNode:Wo,$createTableNode:Lh,$createTableNodeWithDimensions:ID,$createTableRowNode:nl,$createTableSelection:Rh,$deleteTableColumn:UD,$deleteTableColumn__EXPERIMENTAL:KD,$deleteTableRow__EXPERIMENTAL:HD,$getElementForTableNode:YD,$getNodeTriplet:Mi,$getTableCellNodeFromLexicalNode:RD,$getTableCellNodeRect:db,$getTableColumnIndexFromTableCellNode:DD,$getTableNodeFromLexicalNodeOrThrow:lb,$getTableRowIndexFromTableCellNode:jD,$getTableRowNodeFromTableCellNodeOrThrow:ab,$insertTableColumn:$D,$insertTableColumn__EXPERIMENTAL:zD,$insertTableRow:BD,$insertTableRow__EXPERIMENTAL:FD,$isTableCellNode:pn,$isTableNode:wo,$isTableRowNode:br,$isTableSelection:rr,$removeTableRowAtIndex:LD,$unmergeCell:WD,INSERT_TABLE_COMMAND:AD,TableCellHeaderStates:Kn,TableCellNode:Tc,TableNode:Id,TableObserver:fE,TableRowNode:kd,applyTableHandlers:JD,getDOMCellFromTarget:fb,getTableObserverFromTableElement:VD},Symbol.toStringTag,{value:"Module"})),ui=process.env.NODE_ENV==="development"?kD:ZD,QD=ui.$createTableCellNode,e3=ui.$createTableRowNode,t3=ui.$createTableSelection,n3=ui.$getTableColumnIndexFromTableCellNode,r3=ui.$isTableCellNode,o3=ui.$isTableNode,i3=ui.$isTableRowNode,s3=ui.$isTableSelection,a3=ui.TableCellNode,l3=ui.TableNode,c3=ui.TableRowNode,bE=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],vE=bE[Math.floor(Math.random()*bE.length)],_E=St.createContext({clientID:0,color:vE[1],isCollabActive:!1,name:vE[0],yjsDocMap:new Map});function u3(c,t){const n=St.useContext(_E);return c!=null&&(n.name=c),t!=null&&(n.color=t),n}const d3=Object.freeze(Object.defineProperty({__proto__:null,CollaborationContext:_E,useCollaborationContext:u3},Symbol.toStringTag,{value:"Module"})),xE=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],wE=xE[Math.floor(Math.random()*xE.length)],SE=St.createContext({clientID:0,color:wE[1],isCollabActive:!1,name:wE[0],yjsDocMap:new Map});function f3(c,t){const n=St.useContext(SE);return c!=null&&(n.name=c),t!=null&&(n.color=t),n}const p3=Object.freeze(Object.defineProperty({__proto__:null,CollaborationContext:SE,useCollaborationContext:f3},Symbol.toStringTag,{value:"Module"})),h3=(process.env.NODE_ENV==="development"?d3:p3).useCollaborationContext;var g3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function m3({onClear:c}){const[t]=pr();return g3(()=>t.registerCommand(fd,n=>(t.update(()=>{if(c==null){const e=Un(),s=st(),r=An();e.clear(),e.append(r),s!==null&&r.select()}else c()}),!0),Ct),[t,c]),null}const y3=Object.freeze(Object.defineProperty({__proto__:null,ClearEditorPlugin:m3},Symbol.toStringTag,{value:"Module"}));var b3=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function v3({onClear:c}){const[t]=pr();return b3(()=>t.registerCommand(fd,n=>(t.update(()=>{if(c==null){const e=Un(),s=st(),r=An();e.clear(),e.append(r),s!==null&&r.select()}else c()}),!0),Ct),[t,c]),null}const _3=Object.freeze(Object.defineProperty({__proto__:null,ClearEditorPlugin:v3},Symbol.toStringTag,{value:"Module"})),x3=(process.env.NODE_ENV==="development"?y3:_3).ClearEditorPlugin;function yb(c,t){return yb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,s){return e.__proto__=s,e},yb(c,t)}function w3(c,t){c.prototype=Object.create(t.prototype),c.prototype.constructor=c,yb(c,t)}var S3=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(e,s){return!Object.is(e,n[s])})},CE={error:null},C3=function(c){w3(t,c);function t(){for(var e,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return e=c.call.apply(c,[this].concat(r))||this,e.state=CE,e.resetErrorBoundary=function(){for(var i,u=arguments.length,a=new Array(u),f=0;f<u;f++)a[f]=arguments[f];e.props.onReset==null||(i=e.props).onReset.apply(i,a),e.reset()},e}t.getDerivedStateFromError=function(s){return{error:s}};var n=t.prototype;return n.reset=function(){this.setState(CE)},n.componentDidCatch=function(s,r){var o,i;(o=(i=this.props).onError)==null||o.call(i,s,r)},n.componentDidUpdate=function(s,r){var o=this.state.error,i=this.props.resetKeys;if(o!==null&&r.error!==null&&S3(s.resetKeys,i)){var u,a;(u=(a=this.props).onResetKeysChange)==null||u.call(a,s.resetKeys,i),this.reset()}},n.render=function(){var s=this.state.error,r=this.props,o=r.fallbackRender,i=r.FallbackComponent,u=r.fallback;if(s!==null){var a={error:s,resetErrorBoundary:this.resetErrorBoundary};if(mn.isValidElement(u))return u;if(typeof o=="function")return o(a);if(i)return mn.createElement(i,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(mn.Component);function E3({children:c,onError:t}){return mn.createElement(C3,{fallback:mn.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},c)}const O3=Object.freeze(Object.defineProperty({__proto__:null,default:E3},Symbol.toStringTag,{value:"Module"}));function bb(c,t){return bb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},bb(c,t)}var EE={error:null},T3=function(c){var t,n;function e(){for(var r,o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];return(r=c.call.apply(c,[this].concat(i))||this).state=EE,r.resetErrorBoundary=function(){for(var a,f=arguments.length,l=new Array(f),d=0;d<f;d++)l[d]=arguments[d];r.props.onReset==null||(a=r.props).onReset.apply(a,l),r.reset()},r}n=c,(t=e).prototype=Object.create(n.prototype),t.prototype.constructor=t,bb(t,n),e.getDerivedStateFromError=function(r){return{error:r}};var s=e.prototype;return s.reset=function(){this.setState(EE)},s.componentDidCatch=function(r,o){var i,u;(i=(u=this.props).onError)==null||i.call(u,r,o)},s.componentDidUpdate=function(r,o){var i,u,a,f,l=this.state.error,d=this.props.resetKeys;l!==null&&o.error!==null&&((a=r.resetKeys)===void 0&&(a=[]),(f=d)===void 0&&(f=[]),a.length!==f.length||a.some(function(p,h){return!Object.is(p,f[h])}))&&((i=(u=this.props).onResetKeysChange)==null||i.call(u,r.resetKeys,d),this.reset())},s.render=function(){var r=this.state.error,o=this.props,i=o.fallbackRender,u=o.FallbackComponent,a=o.fallback;if(r!==null){var f={error:r,resetErrorBoundary:this.resetErrorBoundary};if(mn.isValidElement(a))return a;if(typeof i=="function")return i(f);if(u)return mn.createElement(u,f);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(mn.Component);function N3({children:c,onError:t}){return mn.createElement(T3,{fallback:mn.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},c)}const k3=Object.freeze(Object.defineProperty({__proto__:null,default:N3},Symbol.toStringTag,{value:"Module"})),A3=(process.env.NODE_ENV==="development"?O3:k3).default;var P3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function M3({ignoreHistoryMergeTagChange:c=!0,ignoreSelectionChange:t=!1,onChange:n}){const[e]=pr();return P3(()=>{if(n)return e.registerUpdateListener(({editorState:s,dirtyElements:r,dirtyLeaves:o,prevEditorState:i,tags:u})=>{t&&r.size===0&&o.size===0||c&&u.has("history-merge")||i.isEmpty()||n(s,e,u)})},[e,c,t,n]),null}const I3=Object.freeze(Object.defineProperty({__proto__:null,OnChangePlugin:M3},Symbol.toStringTag,{value:"Module"}));var R3=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function j3({ignoreHistoryMergeTagChange:c=!0,ignoreSelectionChange:t=!1,onChange:n}){const[e]=pr();return R3(()=>{if(n)return e.registerUpdateListener(({editorState:s,dirtyElements:r,dirtyLeaves:o,prevEditorState:i,tags:u})=>{t&&r.size===0&&o.size===0||c&&u.has("history-merge")||i.isEmpty()||n(s,e,u)})},[e,c,t,n]),null}const D3=Object.freeze(Object.defineProperty({__proto__:null,OnChangePlugin:j3},Symbol.toStringTag,{value:"Module"})),L3=(process.env.NODE_ENV==="development"?I3:D3).OnChangePlugin,kc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",B3=kc&&"documentMode"in document?document.documentMode:null,F3=kc&&"InputEvent"in window&&!B3?"getTargetRanges"in new window.InputEvent("input"):!1,$3=kc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),z3=kc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U3=kc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),H3=kc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!U3;function OE(c,t){t.update(()=>{if(c!==null){const n=Zr(c,KeyboardEvent)?null:c.clipboardData,e=st();if(e!==null&&n!=null){c.preventDefault();const s=KC(t);s!==null&&n.setData("text/html",s),n.setData("text/plain",e.getTextContent())}}})}function K3(c,t){c.preventDefault(),t.update(()=>{const n=st(),{clipboardData:e}=c;e!=null&&at(n)&&_h(e,n)},{tag:"paste"})}function W3(c,t){OE(c,t),t.update(()=>{const n=st();at(n)&&n.removeText()})}function q3(c){return Xr(c.registerCommand(Yr,n=>{const e=st();return at(e)?(e.deleteCharacter(n),!0):!1},Ct),c.registerCommand(Qs,n=>{const e=st();return at(e)?(e.deleteWord(n),!0):!1},Ct),c.registerCommand(Zs,n=>{const e=st();return at(e)?(e.deleteLine(n),!0):!1},Ct),c.registerCommand(ic,n=>{const e=st();if(!at(e))return!1;if(typeof n=="string")e.insertText(n);else{const s=n.dataTransfer;if(s!=null)_h(s,e);else{const r=n.data;r&&e.insertText(r)}}return!0},Ct),c.registerCommand(eh,()=>{const n=st();return at(n)?(n.removeText(),!0):!1},Ct),c.registerCommand(ta,n=>{const e=st();return at(e)?(e.insertLineBreak(n),!0):!1},Ct),c.registerCommand(ac,()=>{const n=st();return at(n)?(n.insertLineBreak(),!0):!1},Ct),c.registerCommand(lc,n=>{const e=st();if(!at(e))return!1;const s=n,r=s.shiftKey;return ra(e,!0)?(s.preventDefault(),na(e,r,!0),!0):!1},Ct),c.registerCommand(cc,n=>{const e=st();if(!at(e))return!1;const s=n,r=s.shiftKey;return ra(e,!1)?(s.preventDefault(),na(e,r,!1),!0):!1},Ct),c.registerCommand(Va,n=>{const e=st();return at(e)?(n.preventDefault(),c.dispatchCommand(Yr,!0)):!1},Ct),c.registerCommand(Ga,n=>{const e=st();return at(e)?(n.preventDefault(),c.dispatchCommand(Yr,!1)):!1},Ct),c.registerCommand(Xp,n=>{const e=st();if(!at(e))return!1;if(n!==null){if((z3||$3||H3)&&F3)return!1;n.preventDefault()}return c.dispatchCommand(ta,!1)},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,n=>{const e=st();return at(e)?(OE(n,c),!0):!1},Ct),c.registerCommand(pd,n=>{const e=st();return at(e)?(W3(n,c),!0):!1},Ct),c.registerCommand(gd,n=>{const e=st();return at(e)?(K3(n,c),!0):!1},Ct),c.registerCommand(Vp,n=>{const e=st();return at(e)?(n.preventDefault(),!0):!1},Ct),c.registerCommand(Jp,n=>{const e=st();return at(e)?(n.preventDefault(),!0):!1},Ct))}const J3=Object.freeze(Object.defineProperty({__proto__:null,registerPlainText:q3},Symbol.toStringTag,{value:"Module"})),Ac=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,V3=Ac&&"documentMode"in document?document.documentMode:null,G3=!(!Ac||!("InputEvent"in window)||V3)&&"getTargetRanges"in new window.InputEvent("input"),Y3=Ac&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),X3=Ac&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Z3=Ac&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Q3=Ac&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Z3;function TE(c,t){t.update(()=>{if(c!==null){const n=Zr(c,KeyboardEvent)?null:c.clipboardData,e=st();if(e!==null&&n!=null){c.preventDefault();const s=KC(t);s!==null&&n.setData("text/html",s),n.setData("text/plain",e.getTextContent())}}})}function e4(c){return Xr(c.registerCommand(Yr,t=>{const n=st();return!!at(n)&&(n.deleteCharacter(t),!0)},Ct),c.registerCommand(Qs,t=>{const n=st();return!!at(n)&&(n.deleteWord(t),!0)},Ct),c.registerCommand(Zs,t=>{const n=st();return!!at(n)&&(n.deleteLine(t),!0)},Ct),c.registerCommand(ic,t=>{const n=st();if(!at(n))return!1;if(typeof t=="string")n.insertText(t);else{const e=t.dataTransfer;if(e!=null)_h(e,n);else{const s=t.data;s&&n.insertText(s)}}return!0},Ct),c.registerCommand(eh,()=>{const t=st();return!!at(t)&&(t.removeText(),!0)},Ct),c.registerCommand(ta,t=>{const n=st();return!!at(n)&&(n.insertLineBreak(t),!0)},Ct),c.registerCommand(ac,()=>{const t=st();return!!at(t)&&(t.insertLineBreak(),!0)},Ct),c.registerCommand(lc,t=>{const n=st();if(!at(n))return!1;const e=t,s=e.shiftKey;return!!ra(n,!0)&&(e.preventDefault(),na(n,s,!0),!0)},Ct),c.registerCommand(cc,t=>{const n=st();if(!at(n))return!1;const e=t,s=e.shiftKey;return!!ra(n,!1)&&(e.preventDefault(),na(n,s,!1),!0)},Ct),c.registerCommand(Va,t=>{const n=st();return!!at(n)&&(t.preventDefault(),c.dispatchCommand(Yr,!0))},Ct),c.registerCommand(Ga,t=>{const n=st();return!!at(n)&&(t.preventDefault(),c.dispatchCommand(Yr,!1))},Ct),c.registerCommand(Xp,t=>{const n=st();if(!at(n))return!1;if(t!==null){if((X3||Y3||Q3)&&G3)return!1;t.preventDefault()}return c.dispatchCommand(ta,!1)},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,t=>{const n=st();return!!at(n)&&(TE(t,c),!0)},Ct),c.registerCommand(pd,t=>{const n=st();return!!at(n)&&(function(e,s){TE(e,s),s.update(()=>{const r=st();at(r)&&r.removeText()})}(t,c),!0)},Ct),c.registerCommand(gd,t=>{const n=st();return!!at(n)&&(function(e,s){e.preventDefault(),s.update(()=>{const r=st(),{clipboardData:o}=e;o!=null&&at(r)&&_h(o,r)},{tag:"paste"})}(t,c),!0)},Ct),c.registerCommand(Vp,t=>{const n=st();return!!at(n)&&(t.preventDefault(),!0)},Ct),c.registerCommand(Jp,t=>{const n=st();return!!at(n)&&(t.preventDefault(),!0)},Ct))}const t4=Object.freeze(Object.defineProperty({__proto__:null,registerPlainText:e4},Symbol.toStringTag,{value:"Module"})),NE=(process.env.NODE_ENV==="development"?J3:t4).registerPlainText;var vb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function kE(c){return c.getEditorState().read(yh(c.isComposing()))}function n4(c){const[t,n]=St.useState(()=>kE(c));return vb(()=>{function e(){const s=kE(c);n(s)}return e(),Xr(c.registerUpdateListener(()=>{e()}),c.registerEditableListener(()=>{e()}))},[c]),t}function r4(c,t){const[n,e]=St.useState(()=>c.getDecorators());return vb(()=>c.registerDecoratorListener(s=>{oo.flushSync(()=>{e(s)})}),[c]),St.useEffect(()=>{e(c.getDecorators())},[c]),St.useMemo(()=>{const s=[],r=Object.keys(n);for(let o=0;o<r.length;o++){const i=r[o],u=mn.createElement(t,{onError:f=>c._onError(f)},mn.createElement(St.Suspense,{fallback:null},n[i])),a=c.getElementByKey(i);a!==null&&s.push(oo.createPortal(u,a,i))}return s},[t,n,c])}function o4(c){vb(()=>Xr(NE(c),bh(c)),[c])}function i4({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=r4(e,n);return o4(e),mn.createElement(mn.Fragment,null,c,mn.createElement(s4,{content:t}),s)}function s4({content:c}){const[t]=pr(),n=n4(t),e=mh();return n?typeof c=="function"?c(e):c:null}const a4=Object.freeze(Object.defineProperty({__proto__:null,PlainTextPlugin:i4},Symbol.toStringTag,{value:"Module"}));var _b=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function AE(c){return c.getEditorState().read(yh(c.isComposing()))}function l4({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=function(r,o){const[i,u]=St.useState(()=>r.getDecorators());return _b(()=>r.registerDecoratorListener(a=>{oo.flushSync(()=>{u(a)})}),[r]),St.useEffect(()=>{u(r.getDecorators())},[r]),St.useMemo(()=>{const a=[],f=Object.keys(i);for(let l=0;l<f.length;l++){const d=f[l],p=mn.createElement(o,{onError:m=>r._onError(m)},mn.createElement(St.Suspense,{fallback:null},i[d])),h=r.getElementByKey(d);h!==null&&a.push(oo.createPortal(p,h,d))}return a},[o,i,r])}(e,n);return function(r){_b(()=>Xr(NE(r),bh(r)),[r])}(e),mn.createElement(mn.Fragment,null,c,mn.createElement(c4,{content:t}),s)}function c4({content:c}){const[t]=pr(),n=function(s){const[r,o]=St.useState(()=>AE(s));return _b(()=>{function i(){const u=AE(s);o(u)}return i(),Xr(s.registerUpdateListener(()=>{i()}),s.registerEditableListener(()=>{i()}))},[s]),r}(t),e=mh();return n?typeof c=="function"?c(e):c:null}const u4=Object.freeze(Object.defineProperty({__proto__:null,PlainTextPlugin:l4},Symbol.toStringTag,{value:"Module"})),d4=(process.env.NODE_ENV==="development"?a4:u4).PlainTextPlugin;var f4={967:(c,t,n)=>{const e=["docId","username","apiKey","domain","hooks","editorInstanceHooks","appServer","demo"];function s(p,h){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(p);h&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(p,y).enumerable})),m.push.apply(m,g)}return m}function r(p){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?s(Object(m),!0).forEach(function(g){o(p,g,m[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):s(Object(m)).forEach(function(g){Object.defineProperty(p,g,Object.getOwnPropertyDescriptor(m,g))})}return p}function o(p,h,m){return(h=function(g){var y=function(b,v){if(typeof b!="object"||!b)return b;var _=b[Symbol.toPrimitive];if(_!==void 0){var w=_.call(b,"string");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}(g);return typeof y=="symbol"?y:y+""}(h))in p?Object.defineProperty(p,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[h]=m,p}let i;i=n(668);let u=null;t.conf=function(p){p.autoStart=!1,u&&u.init(p)};const a=async function(p){if(u)return u.start(p)};t.start=a;const f=function(p){u&&(u.stop(),u=null)};t.stop=f;const l=function(p,h){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(u)return u.diff({state1:p,state2:h,config:m})};t.diff=l;const d=function(){if(u)return u.sync(...arguments)};t.sync=d,t.initSync=function(p){return u?u.initSync(p):p},c.exports={start:a,sync:d,diff:l,stop:f,createConfig:p=>{let{docId:h,username:m,apiKey:g,domain:y,hooks:b,editorInstanceHooks:v,appServer:_={},demo:w=!1}=p;return r(r({},function(x,S){if(x==null)return{};var E,O,j=function(T,I){if(T==null)return{};var k={};for(var $ in T)if({}.hasOwnProperty.call(T,$)){if(I.indexOf($)>=0)continue;k[$]=T[$]}return k}(x,S);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(x);for(O=0;O<A.length;O++)E=A[O],S.indexOf(E)>=0||{}.propertyIsEnumerable.call(x,E)&&(j[E]=x[E])}return j}(p,e)),{},{docId:h,username:m,apiKey:g,autoStart:!0,demo:w,domain:y,hooks:b,editorInstance:r({type:"lexical"},v),app:"json",json:{keyNames:{default:"codoxId"},filters:{version:!0},appServer:_,semantics:{paths:{"state.root.children.children.text":"MERGE","state.root.children.children.children.text":"MERGE"},string:"MERGE"}}})},get instance(){return u},createNewInstance:()=>{u=new i}}},668:(c,t,n)=>{c.exports=function e(s,r,o){function i(f,l){if(!r[f]){if(!s[f]){var d=void 0;if(!l&&d)return require(f,!0);if(u)return u(f,!0);throw(l=new Error("Cannot find module '"+f+"'")).code="MODULE_NOT_FOUND",l}d=r[f]={exports:{}},s[f][0].call(d.exports,function(p){return i(s[f][1][p]||p)},d,d.exports,e,s,r,o)}return r[f].exports}for(var u=void 0,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(e,s,r){s.exports=function(o,i){(i==null||i>o.length)&&(i=o.length);for(var u=0,a=new Array(i);u<i;u++)a[u]=o[u];return a},s.exports.__esModule=!0,s.exports.default=s.exports},{}],2:[function(e,s,r){s.exports=function(o){if(Array.isArray(o))return o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],3:[function(e,s,r){var o=e("./arrayLikeToArray.js");s.exports=function(i){if(Array.isArray(i))return o(i)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayLikeToArray.js":1}],4:[function(e,s,r){s.exports=function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],5:[function(e,s,r){s.exports=function(o,i){if(!(o instanceof i))throw new TypeError("Cannot call a class as a function")},s.exports.__esModule=!0,s.exports.default=s.exports},{}],6:[function(e,s,r){var o=e("./setPrototypeOf.js"),i=e("./isNativeReflectConstruct.js");function u(a,f,l){return i()?s.exports=u=Reflect.construct.bind():s.exports=u=function(d,p,h){var m=[null];return m.push.apply(m,p),p=new(Function.bind.apply(d,m)),h&&o(p,h.prototype),p},s.exports.__esModule=!0,s.exports.default=s.exports,u.apply(null,arguments)}s.exports=u,s.exports.__esModule=!0,s.exports.default=s.exports},{"./isNativeReflectConstruct.js":13,"./setPrototypeOf.js":19}],7:[function(e,s,r){function o(i,u){for(var a=0;a<u.length;a++){var f=u[a];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(i,f.key,f)}}s.exports=function(i,u,a){return u&&o(i.prototype,u),a&&o(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i},s.exports.__esModule=!0,s.exports.default=s.exports},{}],8:[function(e,s,r){s.exports=function(o,i,u){return i in o?Object.defineProperty(o,i,{value:u,enumerable:!0,configurable:!0,writable:!0}):o[i]=u,o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],9:[function(e,s,r){function o(i){return s.exports=o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(u){return u.__proto__||Object.getPrototypeOf(u)},s.exports.__esModule=!0,s.exports.default=s.exports,o(i)}s.exports=o,s.exports.__esModule=!0,s.exports.default=s.exports},{}],10:[function(e,s,r){var o=e("./setPrototypeOf.js");s.exports=function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&o(i,u)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./setPrototypeOf.js":19}],11:[function(e,s,r){s.exports=function(o){return o&&o.__esModule?o:{default:o}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],12:[function(e,s,r){s.exports=function(o){return Function.toString.call(o).indexOf("[native code]")!==-1},s.exports.__esModule=!0,s.exports.default=s.exports},{}],13:[function(e,s,r){s.exports=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],14:[function(e,s,r){s.exports=function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],15:[function(e,s,r){s.exports=function(o,i){var u=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(u!=null){var a,f,l=[],d=!0,p=!1;try{for(u=u.call(o);!(d=(a=u.next()).done)&&(l.push(a.value),!i||l.length!==i);d=!0);}catch(h){p=!0,f=h}finally{try{d||u.return==null||u.return()}finally{if(p)throw f}}return l}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],16:[function(e,s,r){s.exports=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
+
`?t.insertParagraph():u===" "?t.insertNodes([Hp()]):t.insertText(u)}}else t.insertRawText(r)}function By(c,t,n){c.dispatchCommand(th,{nodes:t,selection:n})||n.insertNodes(t)}function FC(c,t,n,e=[]){let s=t===null||n.isSelected(t);const r=Rt(n)&&n.excludeFromCopy("html");let o=n;if(t!==null){let a=fc(n);a=zt(a)&&t!==null?uh(t,a):a,o=a}const i=Rt(o)?o.getChildren():[],u=function(a){const f=a.exportJSON(),l=a.constructor;if(f.type!==l.getType()&&jC(58,l.name),Rt(a)){const d=f.children;Array.isArray(d)||jC(59,l.name)}return f}(o);if(zt(o)){const a=o.__text;a.length>0?u.text=a:s=!1}for(let a=0;a<i.length;a++){const f=i[a],l=FC(c,t,f,u.children);!s&&Rt(n)&&l&&n.extractWithChild(f,t,"clone")&&(s=!0)}if(s&&!r)e.push(u);else if(Array.isArray(u.children))for(let a=0;a<u.children.length;a++){const f=u.children[a];e.push(f)}return s}function $C(c,t){const n=[],e=Un().getChildren();for(let s=0;s<e.length;s++)FC(c,t,e[s],n);return{namespace:c._config.namespace,nodes:n}}function zC(c){const t=[];for(let n=0;n<c.length;n++){const e=c[n],s=pS(e);zt(s)&&VS(s),t.push(s)}return t}let hc=null;async function qR(c,t){if(hc!==null)return!1;if(t!==null)return new Promise((i,u)=>{c.update(()=>{i(UC(c,t))})});const n=c.getRootElement(),e=c._window==null?window.document:c._window.document,s=DC(c._window);if(n===null||s===null)return!1;const r=e.createElement("span");r.style.cssText="position: fixed; top: -1000px;",r.append(e.createTextNode("#")),n.append(r);const o=new Range;return o.setStart(r,0),o.setEnd(r,1),s.removeAllRanges(),s.addRange(o),new Promise((i,u)=>{const a=c.registerCommand(sc,f=>(Zr(f,ClipboardEvent)&&(a(),hc!==null&&(window.clearTimeout(hc),hc=null),i(UC(c,f))),!0),mr);hc=window.setTimeout(()=>{a(),hc=null,i(!1)},50),e.execCommand("copy"),r.remove()})}function UC(c,t){const n=DC(c._window);if(!n)return!1;const e=n.anchorNode,s=n.focusNode;if(e!==null&&s!==null&&!ES(c,e,s))return!1;t.preventDefault();const r=t.clipboardData,o=st();if(r===null||o===null)return!1;const i=LC(c),u=BC(c);let a="";return o!==null&&(a=o.getTextContent()),i!==null&&r.setData("text/html",i),u!==null&&r.setData("application/x-lexical-editor",u),r.setData("text/plain",a),!0}const JR=Object.freeze(Object.defineProperty({__proto__:null,$generateJSONFromSelectedNodes:$C,$generateNodesFromSerializedNodes:zC,$getHtmlContent:LC,$getLexicalContent:BC,$insertDataTransferForPlainText:KR,$insertDataTransferForRichText:WR,$insertGeneratedNodes:By,copyToClipboard:qR},Symbol.toStringTag,{value:"Module"})),vh=process.env.NODE_ENV==="development"?UR:JR,HC=vh.$getHtmlContent,_h=vh.$insertDataTransferForPlainText,xh=vh.$insertDataTransferForRichText,wh=vh.copyToClipboard;function KC(c,t){if(typeof document.caretRangeFromPoint<"u"){const n=document.caretRangeFromPoint(c,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(c,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}else return null}const gc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",VR=gc&&"documentMode"in document?document.documentMode:null,GR=gc&&"InputEvent"in window&&!VR?"getTargetRanges"in new window.InputEvent("input"):!1,YR=gc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),XR=gc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ZR=gc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),QR=gc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ZR,Fy=Xa("DRAG_DROP_PASTE_FILE");class md extends po{static getType(){return"quote"}static clone(t){return new md(t.__key)}constructor(t){super(t)}createDOM(t){const n=document.createElement("blockquote");return wr(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:tj,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=$y();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,n){const e=An(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=An();return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}}function $y(){return Gr(new md)}function ej(c){return c instanceof md}class yd extends po{static getType(){return"heading"}static clone(t){return new yd(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}createDOM(t){const n=this.__tag,e=document.createElement(n),r=t.theme.heading;if(r!==void 0){const o=r[n];wr(e,o)}return e}updateDOM(t,n){return!1}static importDOM(){return{h1:t=>({conversion:mc,priority:0}),h2:t=>({conversion:mc,priority:0}),h3:t=>({conversion:mc,priority:0}),h4:t=>({conversion:mc,priority:0}),h5:t=>({conversion:mc,priority:0}),h6:t=>({conversion:mc,priority:0}),p:t=>{const e=t.firstChild;return e!==null&&WC(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>WC(t)?{conversion:n=>({node:yc("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=yc(t.tag);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,n=!0){const e=t?t.anchor.offset:0,s=e===this.getTextContentSize()||!t?An():yc(this.getTag()),r=this.getDirection();if(s.setDirection(r),this.insertAfter(s,n),e===0&&!this.isEmpty()&&t){const o=An();o.select(),this.replace(o,!0)}return s}collapseAtStart(){const t=this.isEmpty()?An():yc(this.getTag());return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}extractWithChild(){return!0}}function WC(c){return c.nodeName.toLowerCase()==="span"?c.style.fontSize==="26pt":!1}function mc(c){const t=c.nodeName.toLowerCase();let n=null;return(t==="h1"||t==="h2"||t==="h3"||t==="h4"||t==="h5"||t==="h6")&&(n=yc(t),c.style!==null&&n.setFormat(c.style.textAlign)),{node:n}}function tj(c){const t=$y();return c.style!==null&&t.setFormat(c.style.textAlign),{node:t}}function yc(c){return Gr(new yd(c))}function nj(c){return c instanceof yd}function rj(c,t){c.preventDefault(),t.update(()=>{const n=st(),e=Zr(c,InputEvent)||Zr(c,KeyboardEvent)?null:c.clipboardData;e!=null&&n!==null&&xh(e,n,t)},{tag:"paste"})}async function oj(c,t){await wh(t,Zr(c,ClipboardEvent)?c:null),t.update(()=>{const n=st();at(n)?n.removeText():fo(n)&&n.getNodes().forEach(e=>e.remove())})}function bd(c){let t=null;if(Zr(c,DragEvent)?t=c.dataTransfer:Zr(c,ClipboardEvent)&&(t=c.clipboardData),t===null)return[!1,[],!1];const n=t.types,e=n.includes("Files"),s=n.includes("text/html")||n.includes("text/plain");return[e,Array.from(t.files),s]}function qC(c){const t=st();if(!at(t))return!1;const n=new Set,e=t.getNodes();for(let s=0;s<e.length;s++){const r=e[s],o=r.getKey();if(n.has(o))continue;const i=dh(r),u=i.getKey();i.canIndent()&&!n.has(u)&&(n.add(u),c(i))}return n.size>0}function Sh(c){const t=xr(c);return uo(t)}function ij(c){const t=c.focus;return t.key==="root"&&t.offset===Un().getChildrenSize()}function sj(c){return Xr(c.registerCommand(gS,n=>{const e=st();return fo(e)?(e.clear(),!0):!1},0),c.registerCommand(Yr,n=>{const e=st();return at(e)?(e.deleteCharacter(n),!0):!1},Ct),c.registerCommand(Qs,n=>{const e=st();return at(e)?(e.deleteWord(n),!0):!1},Ct),c.registerCommand(Zs,n=>{const e=st();return at(e)?(e.deleteLine(n),!0):!1},Ct),c.registerCommand(ic,n=>{const e=st();if(typeof n=="string")e!==null&&e.insertText(n);else{if(e===null)return!1;const s=n.dataTransfer;if(s!=null)xh(s,e,c);else if(at(e)){const r=n.data;return r&&e.insertText(r),!0}}return!0},Ct),c.registerCommand(eh,()=>{const n=st();return at(n)?(n.removeText(),!0):!1},Ct),c.registerCommand(Ni,n=>{const e=st();return at(e)?(e.formatText(n),!0):!1},Ct),c.registerCommand(ea,n=>{const e=st();if(!at(e)&&!fo(e))return!1;const s=e.getNodes();for(const r of s){const o=dn(r,i=>Rt(i)&&!i.isInline());o!==null&&o.setFormat(n)}return!0},Ct),c.registerCommand(ta,n=>{const e=st();return at(e)?(e.insertLineBreak(n),!0):!1},Ct),c.registerCommand(ac,()=>{const n=st();return at(n)?(n.insertParagraph(),!0):!1},Ct),c.registerCommand(vS,()=>(dS([Hp()]),!0),Ct),c.registerCommand(bS,()=>qC(n=>{const e=n.getIndent();n.setIndent(e+1)}),Ct),c.registerCommand(Zp,()=>qC(n=>{const e=n.getIndent();e>0&&n.setIndent(e-1)}),Ct),c.registerCommand(Yp,n=>{const e=st();if(fo(e)&&!Sh(n.target)){const s=e.getNodes();if(s.length>0)return s[0].selectPrevious(),!0}else if(at(e)){const s=oc(e.focus,!0);if(!n.shiftKey&&uo(s)&&!s.isIsolated()&&!s.isInline())return s.selectPrevious(),n.preventDefault(),!0}return!1},Ct),c.registerCommand(Gp,n=>{const e=st();if(fo(e)){const s=e.getNodes();if(s.length>0)return s[0].selectNext(0,0),!0}else if(at(e)){if(ij(e))return n.preventDefault(),!0;const s=oc(e.focus,!1);if(!n.shiftKey&&uo(s)&&!s.isIsolated()&&!s.isInline())return s.selectNext(),n.preventDefault(),!0}return!1},Ct),c.registerCommand(lc,n=>{const e=st();if(fo(e)){const s=e.getNodes();if(s.length>0)return n.preventDefault(),s[0].selectPrevious(),!0}if(!at(e))return!1;if(ra(e,!0)){const s=n.shiftKey;return n.preventDefault(),na(e,s,!0),!0}return!1},Ct),c.registerCommand(cc,n=>{const e=st();if(fo(e)&&!Sh(n.target)){const r=e.getNodes();if(r.length>0)return n.preventDefault(),r[0].selectNext(0,0),!0}if(!at(e))return!1;const s=n.shiftKey;return ra(e,!1)?(n.preventDefault(),na(e,s,!1),!0):!1},Ct),c.registerCommand(Va,n=>{if(Sh(n.target))return!1;const e=st();if(!at(e))return!1;n.preventDefault();const{anchor:s}=e,r=s.getNode();return e.isCollapsed()&&s.offset===0&&!Xs(r)&&dh(r).getIndent()>0?c.dispatchCommand(Zp,void 0):c.dispatchCommand(Yr,!0)},Ct),c.registerCommand(Ga,n=>{if(Sh(n.target))return!1;const e=st();return at(e)?(n.preventDefault(),c.dispatchCommand(Yr,!1)):!1},Ct),c.registerCommand(Xp,n=>{const e=st();if(!at(e))return!1;if(n!==null){if((XR||YR||QR)&&GR)return!1;if(n.preventDefault(),n.shiftKey)return c.dispatchCommand(ta,!1)}return c.dispatchCommand(ac,void 0)},Ct),c.registerCommand(hd,()=>{const n=st();return at(n)?(c.blur(),!0):!1},Ct),c.registerCommand(Vp,n=>{const[,e]=bd(n);if(e.length>0){const r=n.clientX,o=n.clientY,i=KC(r,o);if(i!==null){const{offset:u,node:a}=i,f=xr(a);if(f!==null){const l=ud();if(zt(f))l.anchor.set(f.getKey(),u,"text"),l.focus.set(f.getKey(),u,"text");else{const p=f.getParentOrThrow().getKey(),h=f.getIndexWithinParent()+1;l.anchor.set(p,h,"element"),l.focus.set(p,h,"element")}const d=Kp(l);kr(d)}c.dispatchCommand(Fy,e)}return n.preventDefault(),!0}const s=st();return!!at(s)},Ct),c.registerCommand(Jp,n=>{const[e]=bd(n),s=st();return!(e&&!at(s))},Ct),c.registerCommand(mS,n=>{const[e]=bd(n),s=st();if(e&&!at(s))return!1;const r=n.clientX,o=n.clientY,i=KC(r,o);if(i!==null){const u=xr(i.node);uo(u)&&n.preventDefault()}return!0},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,n=>(wh(c,Zr(n,ClipboardEvent)?n:null),!0),Ct),c.registerCommand(pd,n=>(oj(n,c),!0),Ct),c.registerCommand(gd,n=>{const[,e,s]=bd(n);return e.length>0&&!s?(c.dispatchCommand(Fy,e),!0):CS(n.target)?!1:st()!==null?(rj(n,c),!0):!1},Ct))}const aj=Object.freeze(Object.defineProperty({__proto__:null,$createHeadingNode:yc,$createQuoteNode:$y,$isHeadingNode:nj,$isQuoteNode:ej,DRAG_DROP_PASTE:Fy,HeadingNode:yd,QuoteNode:md,eventFiles:bd,registerRichText:sj},Symbol.toStringTag,{value:"Module"}));function JC(c,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(c,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(c,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const bc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,lj=bc&&"documentMode"in document?document.documentMode:null,cj=!(!bc||!("InputEvent"in window)||lj)&&"getTargetRanges"in new window.InputEvent("input"),uj=bc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),dj=bc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,fj=bc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),pj=bc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!fj,zy=Xa("DRAG_DROP_PASTE_FILE");class vd extends po{static getType(){return"quote"}static clone(t){return new vd(t.__key)}constructor(t){super(t)}createDOM(t){const n=document.createElement("blockquote");return wr(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:gj,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=Uy();return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,n){const e=An(),s=this.getDirection();return e.setDirection(s),this.insertAfter(e,n),e}collapseAtStart(){const t=An();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}}function Uy(){return Gr(new vd)}function hj(c){return c instanceof vd}class _d extends po{static getType(){return"heading"}static clone(t){return new _d(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}createDOM(t){const n=this.__tag,e=document.createElement(n),s=t.theme.heading;if(s!==void 0){const r=s[n];wr(e,r)}return e}updateDOM(t,n){return!1}static importDOM(){return{h1:t=>({conversion:vc,priority:0}),h2:t=>({conversion:vc,priority:0}),h3:t=>({conversion:vc,priority:0}),h4:t=>({conversion:vc,priority:0}),h5:t=>({conversion:vc,priority:0}),h6:t=>({conversion:vc,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&VC(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>VC(t)?{conversion:n=>({node:_c("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(n&&oa(n)){this.isEmpty()&&n.append(document.createElement("br"));const e=this.getFormatType();n.style.textAlign=e;const s=this.getDirection();s&&(n.dir=s)}return{element:n}}static importJSON(t){const n=_c(t.tag);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,n=!0){const e=t?t.anchor.offset:0,s=e!==this.getTextContentSize()&&t?_c(this.getTag()):An(),r=this.getDirection();if(s.setDirection(r),this.insertAfter(s,n),e===0&&!this.isEmpty()&&t){const o=An();o.select(),this.replace(o,!0)}return s}collapseAtStart(){const t=this.isEmpty()?An():_c(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}}function VC(c){return c.nodeName.toLowerCase()==="span"&&c.style.fontSize==="26pt"}function vc(c){const t=c.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=_c(t),c.style!==null&&n.setFormat(c.style.textAlign)),{node:n}}function gj(c){const t=Uy();return c.style!==null&&t.setFormat(c.style.textAlign),{node:t}}function _c(c){return Gr(new _d(c))}function mj(c){return c instanceof _d}function xd(c){let t=null;if(Zr(c,DragEvent)?t=c.dataTransfer:Zr(c,ClipboardEvent)&&(t=c.clipboardData),t===null)return[!1,[],!1];const n=t.types,e=n.includes("Files"),s=n.includes("text/html")||n.includes("text/plain");return[e,Array.from(t.files),s]}function GC(c){const t=st();if(!at(t))return!1;const n=new Set,e=t.getNodes();for(let s=0;s<e.length;s++){const r=e[s],o=r.getKey();if(n.has(o))continue;const i=dh(r),u=i.getKey();i.canIndent()&&!n.has(u)&&(n.add(u),c(i))}return n.size>0}function Ch(c){const t=xr(c);return uo(t)}function yj(c){return Xr(c.registerCommand(gS,t=>{const n=st();return!!fo(n)&&(n.clear(),!0)},0),c.registerCommand(Yr,t=>{const n=st();return!!at(n)&&(n.deleteCharacter(t),!0)},Ct),c.registerCommand(Qs,t=>{const n=st();return!!at(n)&&(n.deleteWord(t),!0)},Ct),c.registerCommand(Zs,t=>{const n=st();return!!at(n)&&(n.deleteLine(t),!0)},Ct),c.registerCommand(ic,t=>{const n=st();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const e=t.dataTransfer;if(e!=null)xh(e,n,c);else if(at(n)){const s=t.data;return s&&n.insertText(s),!0}}return!0},Ct),c.registerCommand(eh,()=>{const t=st();return!!at(t)&&(t.removeText(),!0)},Ct),c.registerCommand(Ni,t=>{const n=st();return!!at(n)&&(n.formatText(t),!0)},Ct),c.registerCommand(ea,t=>{const n=st();if(!at(n)&&!fo(n))return!1;const e=n.getNodes();for(const s of e){const r=dn(s,o=>Rt(o)&&!o.isInline());r!==null&&r.setFormat(t)}return!0},Ct),c.registerCommand(ta,t=>{const n=st();return!!at(n)&&(n.insertLineBreak(t),!0)},Ct),c.registerCommand(ac,()=>{const t=st();return!!at(t)&&(t.insertParagraph(),!0)},Ct),c.registerCommand(vS,()=>(dS([Hp()]),!0),Ct),c.registerCommand(bS,()=>GC(t=>{const n=t.getIndent();t.setIndent(n+1)}),Ct),c.registerCommand(Zp,()=>GC(t=>{const n=t.getIndent();n>0&&t.setIndent(n-1)}),Ct),c.registerCommand(Yp,t=>{const n=st();if(fo(n)&&!Ch(t.target)){const e=n.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(at(n)){const e=oc(n.focus,!0);if(!t.shiftKey&&uo(e)&&!e.isIsolated()&&!e.isInline())return e.selectPrevious(),t.preventDefault(),!0}return!1},Ct),c.registerCommand(Gp,t=>{const n=st();if(fo(n)){const e=n.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(at(n)){if(function(s){const r=s.focus;return r.key==="root"&&r.offset===Un().getChildrenSize()}(n))return t.preventDefault(),!0;const e=oc(n.focus,!1);if(!t.shiftKey&&uo(e)&&!e.isIsolated()&&!e.isInline())return e.selectNext(),t.preventDefault(),!0}return!1},Ct),c.registerCommand(lc,t=>{const n=st();if(fo(n)){const e=n.getNodes();if(e.length>0)return t.preventDefault(),e[0].selectPrevious(),!0}if(!at(n))return!1;if(ra(n,!0)){const e=t.shiftKey;return t.preventDefault(),na(n,e,!0),!0}return!1},Ct),c.registerCommand(cc,t=>{const n=st();if(fo(n)&&!Ch(t.target)){const s=n.getNodes();if(s.length>0)return t.preventDefault(),s[0].selectNext(0,0),!0}if(!at(n))return!1;const e=t.shiftKey;return!!ra(n,!1)&&(t.preventDefault(),na(n,e,!1),!0)},Ct),c.registerCommand(Va,t=>{if(Ch(t.target))return!1;const n=st();if(!at(n))return!1;t.preventDefault();const{anchor:e}=n,s=e.getNode();return n.isCollapsed()&&e.offset===0&&!Xs(s)&&dh(s).getIndent()>0?c.dispatchCommand(Zp,void 0):c.dispatchCommand(Yr,!0)},Ct),c.registerCommand(Ga,t=>{if(Ch(t.target))return!1;const n=st();return!!at(n)&&(t.preventDefault(),c.dispatchCommand(Yr,!1))},Ct),c.registerCommand(Xp,t=>{const n=st();if(!at(n))return!1;if(t!==null){if((dj||uj||pj)&&cj)return!1;if(t.preventDefault(),t.shiftKey)return c.dispatchCommand(ta,!1)}return c.dispatchCommand(ac,void 0)},Ct),c.registerCommand(hd,()=>{const t=st();return!!at(t)&&(c.blur(),!0)},Ct),c.registerCommand(Vp,t=>{const[,n]=xd(t);if(n.length>0){const s=JC(t.clientX,t.clientY);if(s!==null){const{offset:r,node:o}=s,i=xr(o);if(i!==null){const u=ud();if(zt(i))u.anchor.set(i.getKey(),r,"text"),u.focus.set(i.getKey(),r,"text");else{const f=i.getParentOrThrow().getKey(),l=i.getIndexWithinParent()+1;u.anchor.set(f,l,"element"),u.focus.set(f,l,"element")}const a=Kp(u);kr(a)}c.dispatchCommand(zy,n)}return t.preventDefault(),!0}const e=st();return!!at(e)},Ct),c.registerCommand(Jp,t=>{const[n]=xd(t),e=st();return!(n&&!at(e))},Ct),c.registerCommand(mS,t=>{const[n]=xd(t),e=st();if(n&&!at(e))return!1;const s=JC(t.clientX,t.clientY);if(s!==null){const r=xr(s.node);uo(r)&&t.preventDefault()}return!0},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,t=>(wh(c,Zr(t,ClipboardEvent)?t:null),!0),Ct),c.registerCommand(pd,t=>(async function(n,e){await wh(e,Zr(n,ClipboardEvent)?n:null),e.update(()=>{const s=st();at(s)?s.removeText():fo(s)&&s.getNodes().forEach(r=>r.remove())})}(t,c),!0),Ct),c.registerCommand(gd,t=>{const[,n,e]=xd(t);return n.length>0&&!e?(c.dispatchCommand(zy,n),!0):CS(t.target)?!1:st()!==null&&(function(s,r){s.preventDefault(),r.update(()=>{const o=st(),i=Zr(s,InputEvent)||Zr(s,KeyboardEvent)?null:s.clipboardData;i!=null&&o!==null&&xh(i,o,r)},{tag:"paste"})}(t,c),!0)},Ct))}const bj=Object.freeze(Object.defineProperty({__proto__:null,$createHeadingNode:_c,$createQuoteNode:Uy,$isHeadingNode:mj,$isQuoteNode:hj,DRAG_DROP_PASTE:zy,HeadingNode:_d,QuoteNode:vd,eventFiles:xd,registerRichText:yj},Symbol.toStringTag,{value:"Module"})),YC=(process.env.NODE_ENV==="development"?aj:bj).registerRichText;var Hy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function XC(c){return c.getEditorState().read(yh(c.isComposing()))}function vj(c){const[t,n]=St.useState(()=>XC(c));return Hy(()=>{function e(){const s=XC(c);n(s)}return e(),Xr(c.registerUpdateListener(()=>{e()}),c.registerEditableListener(()=>{e()}))},[c]),t}function _j(c,t){const[n,e]=St.useState(()=>c.getDecorators());return Hy(()=>c.registerDecoratorListener(s=>{oo.flushSync(()=>{e(s)})}),[c]),St.useEffect(()=>{e(c.getDecorators())},[c]),St.useMemo(()=>{const s=[],r=Object.keys(n);for(let o=0;o<r.length;o++){const i=r[o],u=gn.createElement(t,{onError:f=>c._onError(f)},gn.createElement(St.Suspense,{fallback:null},n[i])),a=c.getElementByKey(i);a!==null&&s.push(oo.createPortal(u,a,i))}return s},[t,n,c])}function xj(c){Hy(()=>Xr(YC(c),bh(c)),[c])}function wj({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=_j(e,n);return xj(e),gn.createElement(gn.Fragment,null,c,gn.createElement(Sj,{content:t}),s)}function Sj({content:c}){const[t]=pr(),n=vj(t),e=mh();return n?typeof c=="function"?c(e):c:null}const Cj=Object.freeze(Object.defineProperty({__proto__:null,RichTextPlugin:wj},Symbol.toStringTag,{value:"Module"}));var Ky=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function ZC(c){return c.getEditorState().read(yh(c.isComposing()))}function Ej({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=function(r,o){const[i,u]=St.useState(()=>r.getDecorators());return Ky(()=>r.registerDecoratorListener(a=>{oo.flushSync(()=>{u(a)})}),[r]),St.useEffect(()=>{u(r.getDecorators())},[r]),St.useMemo(()=>{const a=[],f=Object.keys(i);for(let l=0;l<f.length;l++){const d=f[l],p=gn.createElement(o,{onError:m=>r._onError(m)},gn.createElement(St.Suspense,{fallback:null},i[d])),h=r.getElementByKey(d);h!==null&&a.push(oo.createPortal(p,h,d))}return a},[o,i,r])}(e,n);return function(r){Ky(()=>Xr(YC(r),bh(r)),[r])}(e),gn.createElement(gn.Fragment,null,c,gn.createElement(Oj,{content:t}),s)}function Oj({content:c}){const[t]=pr(),n=function(s){const[r,o]=St.useState(()=>ZC(s));return Ky(()=>{function i(){const u=ZC(s);o(u)}return i(),Xr(s.registerUpdateListener(()=>{i()}),s.registerEditableListener(()=>{i()}))},[s]),r}(t),e=mh();return n?typeof c=="function"?c(e):c:null}const Tj=Object.freeze(Object.defineProperty({__proto__:null,RichTextPlugin:Ej},Symbol.toStringTag,{value:"Module"})),Nj=(process.env.NODE_ENV==="development"?Cj:Tj).RichTextPlugin,kj=new Set(["http:","https:","mailto:","sms:","tel:"]);class xc extends po{static getType(){return"link"}static clone(t){return new xc(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t,n={},e){super(e);const{target:s=null,rel:r=null,title:o=null}=n;this.__url=t,this.__target=s,this.__rel=r,this.__title=o}createDOM(t){const n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),wr(n,t.theme.link),n}updateDOM(t,n,e){const s=this.__url,r=this.__target,o=this.__rel,i=this.__title;return s!==t.__url&&(n.href=s),r!==t.__target&&(r?n.target=r:n.removeAttribute("target")),o!==t.__rel&&(o?n.rel=o:n.removeAttribute("rel")),i!==t.__title&&(i?n.title=i:n.removeAttribute("title")),!1}static importDOM(){return{a:t=>({conversion:Aj,priority:1})}}static importJSON(t){const n=wd(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}sanitizeUrl(t){try{const n=new URL(t);if(!kj.has(n.protocol))return"about:blank"}catch{return t}return t}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(t){const n=this.getWritable();n.__url=t}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();n.__target=t}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();n.__rel=t}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();n.__title=t}insertNewAfter(t,n=!0){const e=wd(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n))return!1;const s=n.anchor.getNode(),r=n.focus.getNode();return this.isParentOf(s)&&this.isParentOf(r)&&n.getTextContent().length>0}}function Aj(c){let t=null;if(aC(c)){const n=c.textContent;(n!==null&&n!==""||c.children.length>0)&&(t=wd(c.getAttribute("href")||"",{rel:c.getAttribute("rel"),target:c.getAttribute("target"),title:c.getAttribute("title")}))}return{node:t}}function wd(c,t){return Gr(new xc(c,t))}function wc(c){return c instanceof xc}class Sd extends xc{static getType(){return"autolink"}static clone(t){return new Sd(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}static importJSON(t){const n=Wy(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(t,n=!0){const e=this.getParentOrThrow().insertNewAfter(t,n);if(Rt(e)){const s=Wy(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return e.append(s),s}return null}}function Wy(c,t){return Gr(new Sd(c,t))}function Pj(c){return c instanceof Sd}const Mj=Xa("TOGGLE_LINK_COMMAND");function Ij(c,t={}){const{target:n,title:e}=t,s=t.rel===void 0?"noreferrer":t.rel,r=st();if(!at(r))return;const o=r.extract();if(c===null)o.forEach(i=>{const u=i.getParent();if(wc(u)){const a=u.getChildren();for(let f=0;f<a.length;f++)u.insertBefore(a[f]);u.remove()}});else{if(o.length===1){const a=o[0],f=Rj(a,wc);if(f!==null){f.setURL(c),n!==void 0&&f.setTarget(n),s!==null&&f.setRel(s),e!==void 0&&f.setTitle(e);return}}let i=null,u=null;o.forEach(a=>{const f=a.getParent();if(!(f===u||f===null||Rt(a)&&!a.isInline())){if(wc(f)){u=f,f.setURL(c),n!==void 0&&f.setTarget(n),s!==null&&u.setRel(s),e!==void 0&&u.setTitle(e);return}if(f.is(i)||(i=f,u=wd(c,{rel:s,target:n,title:e}),wc(f)?a.getPreviousSibling()===null?f.insertBefore(u):f.insertAfter(u):a.insertBefore(u)),wc(a)){if(a.is(u))return;if(u!==null){const l=a.getChildren();for(let d=0;d<l.length;d++)u.append(l[d])}a.remove();return}u!==null&&u.append(a)}})}}function Rj(c,t){let n=c;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const jj=Object.freeze(Object.defineProperty({__proto__:null,$createAutoLinkNode:Wy,$createLinkNode:wd,$isAutoLinkNode:Pj,$isLinkNode:wc,AutoLinkNode:Sd,LinkNode:xc,TOGGLE_LINK_COMMAND:Mj,toggleLink:Ij},Symbol.toStringTag,{value:"Module"})),Dj=new Set(["http:","https:","mailto:","sms:","tel:"]);class Sc extends po{static getType(){return"link"}static clone(t){return new Sc(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t,n={},e){super(e);const{target:s=null,rel:r=null,title:o=null}=n;this.__url=t,this.__target=s,this.__rel=r,this.__title=o}createDOM(t){const n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),wr(n,t.theme.link),n}updateDOM(t,n,e){const s=this.__url,r=this.__target,o=this.__rel,i=this.__title;return s!==t.__url&&(n.href=s),r!==t.__target&&(r?n.target=r:n.removeAttribute("target")),o!==t.__rel&&(o?n.rel=o:n.removeAttribute("rel")),i!==t.__title&&(i?n.title=i:n.removeAttribute("title")),!1}static importDOM(){return{a:t=>({conversion:Lj,priority:1})}}static importJSON(t){const n=Cd(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}sanitizeUrl(t){try{const n=new URL(t);if(!Dj.has(n.protocol))return"about:blank"}catch{return t}return t}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(t){this.getWritable().__url=t}getTarget(){return this.getLatest().__target}setTarget(t){this.getWritable().__target=t}getRel(){return this.getLatest().__rel}setRel(t){this.getWritable().__rel=t}getTitle(){return this.getLatest().__title}setTitle(t){this.getWritable().__title=t}insertNewAfter(t,n=!0){const e=Cd(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n))return!1;const s=n.anchor.getNode(),r=n.focus.getNode();return this.isParentOf(s)&&this.isParentOf(r)&&n.getTextContent().length>0}}function Lj(c){let t=null;if(aC(c)){const n=c.textContent;(n!==null&&n!==""||c.children.length>0)&&(t=Cd(c.getAttribute("href")||"",{rel:c.getAttribute("rel"),target:c.getAttribute("target"),title:c.getAttribute("title")}))}return{node:t}}function Cd(c,t){return Gr(new Sc(c,t))}function Cc(c){return c instanceof Sc}class Ed extends Sc{static getType(){return"autolink"}static clone(t){return new Ed(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}static importJSON(t){const n=qy(t.url,{rel:t.rel,target:t.target,title:t.title});return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(t,n=!0){const e=this.getParentOrThrow().insertNewAfter(t,n);if(Rt(e)){const s=qy(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return e.append(s),s}return null}}function qy(c,t){return Gr(new Ed(c,t))}function Bj(c){return c instanceof Ed}const Fj=Xa("TOGGLE_LINK_COMMAND");function $j(c,t={}){const{target:n,title:e}=t,s=t.rel===void 0?"noreferrer":t.rel,r=st();if(!at(r))return;const o=r.extract();if(c===null)o.forEach(i=>{const u=i.getParent();if(Cc(u)){const a=u.getChildren();for(let f=0;f<a.length;f++)u.insertBefore(a[f]);u.remove()}});else{if(o.length===1){const a=function(f,l){let d=f;for(;d!==null&&d.getParent()!==null&&!l(d);)d=d.getParentOrThrow();return l(d)?d:null}(o[0],Cc);if(a!==null)return a.setURL(c),n!==void 0&&a.setTarget(n),s!==null&&a.setRel(s),void(e!==void 0&&a.setTitle(e))}let i=null,u=null;o.forEach(a=>{const f=a.getParent();if(f!==u&&f!==null&&(!Rt(a)||a.isInline())){if(Cc(f))return u=f,f.setURL(c),n!==void 0&&f.setTarget(n),s!==null&&u.setRel(s),void(e!==void 0&&u.setTitle(e));if(f.is(i)||(i=f,u=Cd(c,{rel:s,target:n,title:e}),Cc(f)?a.getPreviousSibling()===null?f.insertBefore(u):f.insertAfter(u):a.insertBefore(u)),Cc(a)){if(a.is(u))return;if(u!==null){const l=a.getChildren();for(let d=0;d<l.length;d++)u.append(l[d])}a.remove()}else u!==null&&u.append(a)}})}}const zj=Object.freeze(Object.defineProperty({__proto__:null,$createAutoLinkNode:qy,$createLinkNode:Cd,$isAutoLinkNode:Bj,$isLinkNode:Cc,AutoLinkNode:Ed,LinkNode:Sc,TOGGLE_LINK_COMMAND:Fj,toggleLink:$j},Symbol.toStringTag,{value:"Module"})),Uj=(process.env.NODE_ENV==="development"?jj:zj).$isLinkNode;let Jy=class hN extends po{static getType(){return"mark"}static clone(t){return new hN(Array.from(t.__ids),t.__key)}static importDOM(){return null}static importJSON(t){const n=Eh(t.ids);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(t,n){super(n),this.__ids=t||[]}createDOM(t){const n=document.createElement("mark");return wr(n,t.theme.mark),this.__ids.length>1&&wr(n,t.theme.markOverlap),n}updateDOM(t,n,e){const s=t.__ids,r=this.__ids,o=s.length,i=r.length,u=e.theme.markOverlap;return o!==i&&(o===1?i===2&&wr(n,u):i===1&&fh(n,u)),!1}hasID(t){const n=this.getIDs();for(let e=0;e<n.length;e++)if(t===n[e])return!0;return!1}getIDs(){const t=this.getLatest();return Za(t)?t.__ids:[]}addID(t){const n=this.getWritable();if(Za(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return;e.push(t)}}deleteID(t){const n=this.getWritable();if(Za(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s]){e.splice(s,1);return}}}insertNewAfter(t,n=!0){const e=Eh(this.__ids);return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n)||e==="html")return!1;const s=n.anchor,r=n.focus,o=s.getNode(),i=r.getNode(),a=n.isBackward()?s.offset-r.offset:r.offset-s.offset;return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===a}excludeFromCopy(t){return t!=="clone"}};function Eh(c){return Gr(new Jy(c))}function Za(c){return c instanceof Jy}function Hj(c){const t=c.getChildren();let n=null;for(let e=0;e<t.length;e++){const s=t[e];n===null?c.insertBefore(s):n.insertAfter(s),n=s}c.remove()}function Kj(c,t,n,e){const s=c.getNodes(),r=c.anchor.offset,o=c.focus.offset,i=s.length,u=t?o:r,a=t?r:o;let f,l;for(let d=0;d<i;d++){const p=s[d];if(Rt(l)&&l.isParentOf(p))continue;const h=d===0,m=d===i-1;let g=null;if(zt(p)){const y=p.getTextContentSize(),b=h?u:0,v=m?a:y;if(b===0&&v===0)continue;const _=p.splitText(b,v);g=_.length>1&&(_.length===3||h&&!m||v===y)?_[1]:_[0]}else{if(Za(p))continue;Rt(p)&&p.isInline()&&(g=p)}if(g!==null){if(g&&g.is(f))continue;const y=g.getParent();(y==null||!y.is(f))&&(l=void 0),f=y,l===void 0&&(l=(e||Eh)([n]),g.insertBefore(l)),l.append(g)}else f=void 0,l=void 0}Rt(l)&&(t?l.selectStart():l.selectEnd())}function Wj(c,t){let n=c;for(;n!==null;){if(Za(n))return n.getIDs();if(zt(n)&&t===n.getTextContentSize()){const e=n.getNextSibling();if(Za(e))return e.getIDs()}n=n.getParent()}return null}const qj=Object.freeze(Object.defineProperty({__proto__:null,$createMarkNode:Eh,$getMarkIDs:Wj,$isMarkNode:Za,$unwrapMarkNode:Hj,$wrapSelectionInMarkNode:Kj,MarkNode:Jy},Symbol.toStringTag,{value:"Module"}));let Vy=class gN extends po{static getType(){return"mark"}static clone(t){return new gN(Array.from(t.__ids),t.__key)}static importDOM(){return null}static importJSON(t){const n=Oh(t.ids);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(t,n){super(n),this.__ids=t||[]}createDOM(t){const n=document.createElement("mark");return wr(n,t.theme.mark),this.__ids.length>1&&wr(n,t.theme.markOverlap),n}updateDOM(t,n,e){const s=t.__ids,r=this.__ids,o=s.length,i=r.length,u=e.theme.markOverlap;return o!==i&&(o===1?i===2&&wr(n,u):i===1&&fh(n,u)),!1}hasID(t){const n=this.getIDs();for(let e=0;e<n.length;e++)if(t===n[e])return!0;return!1}getIDs(){const t=this.getLatest();return Qa(t)?t.__ids:[]}addID(t){const n=this.getWritable();if(Qa(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return;e.push(t)}}deleteID(t){const n=this.getWritable();if(Qa(n)){const e=n.__ids;n.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return void e.splice(s,1)}}insertNewAfter(t,n=!0){const e=Oh(this.__ids);return this.insertAfter(e,n),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,e){if(!at(n)||e==="html")return!1;const s=n.anchor,r=n.focus,o=s.getNode(),i=r.getNode(),u=n.isBackward()?s.offset-r.offset:r.offset-s.offset;return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===u}excludeFromCopy(t){return t!=="clone"}};function Oh(c){return Gr(new Vy(c))}function Qa(c){return c instanceof Vy}function Jj(c){const t=c.getChildren();let n=null;for(let e=0;e<t.length;e++){const s=t[e];n===null?c.insertBefore(s):n.insertAfter(s),n=s}c.remove()}function Vj(c,t,n,e){const s=c.getNodes(),r=c.anchor.offset,o=c.focus.offset,i=s.length,u=t?o:r,a=t?r:o;let f,l;for(let d=0;d<i;d++){const p=s[d];if(Rt(l)&&l.isParentOf(p))continue;const h=d===0,m=d===i-1;let g=null;if(zt(p)){const y=p.getTextContentSize(),b=h?u:0,v=m?a:y;if(b===0&&v===0)continue;const _=p.splitText(b,v);g=_.length>1&&(_.length===3||h&&!m||v===y)?_[1]:_[0]}else{if(Qa(p))continue;Rt(p)&&p.isInline()&&(g=p)}if(g!==null){if(g&&g.is(f))continue;const y=g.getParent();y!=null&&y.is(f)||(l=void 0),f=y,l===void 0&&(l=(e||Oh)([n]),g.insertBefore(l)),l.append(g)}else f=void 0,l=void 0}Rt(l)&&(t?l.selectStart():l.selectEnd())}function Gj(c,t){let n=c;for(;n!==null;){if(Qa(n))return n.getIDs();if(zt(n)&&t===n.getTextContentSize()){const e=n.getNextSibling();if(Qa(e))return e.getIDs()}n=n.getParent()}return null}const Yj=Object.freeze(Object.defineProperty({__proto__:null,$createMarkNode:Oh,$getMarkIDs:Gj,$isMarkNode:Qa,$unwrapMarkNode:Jj,$wrapSelectionInMarkNode:Vj,MarkNode:Vy},Symbol.toStringTag,{value:"Module"})),Ec=process.env.NODE_ENV==="development"?qj:Yj,Xj=Ec.$createMarkNode,Zj=Ec.$getMarkIDs,Qj=Ec.$isMarkNode,eD=Ec.$unwrapMarkNode,tD=Ec.$wrapSelectionInMarkNode,nD=Ec.MarkNode,QC=/^(\d+(?:\.\d+)?)px$/,Hn={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};let Th=class mN extends po{static getType(){return"tablecell"}static clone(t){const n=new mN(t.__headerState,t.__colSpan,t.__width,t.__key);return n.__rowSpan=t.__rowSpan,n.__backgroundColor=t.__backgroundColor,n}static importDOM(){return{td:t=>({conversion:eE,priority:0}),th:t=>({conversion:eE,priority:0})}}static importJSON(t){const n=t.colSpan||1,e=t.rowSpan||1,s=Ko(t.headerState,n,t.width||void 0);return s.__rowSpan=e,s.__backgroundColor=t.backgroundColor||null,s}constructor(t=Hn.NO_STATUS,n=1,e,s){super(s),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=e,this.__backgroundColor=null}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),wr(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const{element:n}=super.exportDOM(t);if(n){const e=n,s=700,r=this.getParentOrThrow().getChildrenSize();e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||Math.max(90,s/r)}px`,e.style.verticalAlign="top",e.style.textAlign="start";const o=this.getBackgroundColor();o!==null?e.style.backgroundColor=o:this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return{element:n}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(t){return this.getWritable().__colSpan=t,this}getRowSpan(){return this.__rowSpan}setRowSpan(t){return this.getWritable().__rowSpan=t,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t){const n=this.getWritable();return n.__headerState=t,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){this.getWritable().__backgroundColor=t}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==Hn.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function eE(c){const t=c,n=c.nodeName.toLowerCase();let e;QC.test(t.style.width)&&(e=parseFloat(t.style.width));const s=Ko(n==="th"?Hn.ROW:Hn.NO_STATUS,t.colSpan,e);s.__rowSpan=t.rowSpan;const r=t.style.backgroundColor;return r!==""&&(s.__backgroundColor=r),{after:o=>(o.length===0&&o.push(An()),o),forChild:(o,i)=>{if(fn(i)&&!Rt(o)){const u=An();return dd(o)&&o.getTextContent()===`
|
|
58
|
+
`?null:(u.append(o),u)}return o},node:s}}function Ko(c,t=1,n){return Gr(new Th(c,t,n))}function fn(c){return c instanceof Th}const rD=Xa("INSERT_TABLE_COMMAND");let Gy=class yN extends po{static getType(){return"tablerow"}static clone(t){return new yN(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:oD,priority:0})}}static importJSON(t){return el(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),wr(n,t.theme.tableRow),n}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,this.__height}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function oD(c){const t=c;let n;return QC.test(t.style.height)&&(n=parseFloat(t.style.height)),{node:el(n)}}function el(c){return Gr(new Gy(c))}function yr(c){return c instanceof Gy}const iD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sD(c,t,n=!0){const e=Mh();for(let s=0;s<c;s++){const r=el();for(let o=0;o<t;o++){let i=Hn.NO_STATUS;typeof n=="object"?(s===0&&n.rows&&(i|=Hn.ROW),o===0&&n.columns&&(i|=Hn.COLUMN)):n&&(s===0&&(i|=Hn.ROW),o===0&&(i|=Hn.COLUMN));const u=Ko(i),a=An();a.append(Ei()),u.append(a),r.append(u)}e.append(r)}return e}function aD(c){const t=dn(c,n=>fn(n));return fn(t)?t:null}function Yy(c){const t=dn(c,n=>yr(n));if(yr(t))return t;throw new Error("Expected table cell to be inside of table row.")}function Xy(c){const t=dn(c,n=>xo(n));if(xo(t))return t;throw new Error("Expected table cell to be inside of table.")}function lD(c){const t=Yy(c);return Xy(t).getChildren().findIndex(e=>e.is(t))}function cD(c){return Yy(c).getChildren().findIndex(n=>n.is(c))}function tE(c,t){const n=Xy(c),{x:e,y:s}=n.getCordsFromCellNode(c,t);return{above:n.getCellNodeFromCords(e,s-1,t),below:n.getCellNodeFromCords(e,s+1,t),left:n.getCellNodeFromCords(e-1,s,t),right:n.getCellNodeFromCords(e+1,s,t)}}function uD(c,t){const n=c.getChildren();if(t>=n.length||t<0)throw new Error("Expected table cell to be inside of table row.");return n[t].remove(),c}function dD(c,t,n=!0,e,s){const r=c.getChildren();if(t>=r.length||t<0)throw new Error("Table row target index out of range");const o=r[t];if(yr(o))for(let i=0;i<e;i++){const u=o.getChildren(),a=u.length,f=el();for(let l=0;l<a;l++){const d=u[l];if(!fn(d))throw Error("Expected table cell");const{above:p,below:h}=tE(d,s);let m=Hn.NO_STATUS;const g=p&&p.getWidth()||h&&h.getWidth()||void 0;(p&&p.hasHeaderState(Hn.COLUMN)||h&&h.hasHeaderState(Hn.COLUMN))&&(m|=Hn.COLUMN);const y=Ko(m,1,g);y.append(An()),f.append(y)}n?o.insertAfter(f):o.insertBefore(f)}else throw new Error("Row before insertion index does not exist.");return c}const Zy=(c,t)=>c===Hn.BOTH||c===t?t:Hn.NO_STATUS;function fD(c=!0){const t=st();if(!(at(t)||nr(t)))throw Error("Expected a RangeSelection or GridSelection");const n=t.focus.getNode(),[e,,s]=Pi(n),[r,o]=ia(s,e,e),i=r[0].length,{startRow:u}=o;if(c){const a=u+e.__rowSpan-1,f=r[a],l=el();for(let p=0;p<i;p++){const{cell:h,startRow:m}=f[p];if(m+h.__rowSpan-1<=a){const y=f[p].cell.__headerState,b=Zy(y,Hn.COLUMN);l.append(Ko(b).append(An()))}else h.setRowSpan(h.__rowSpan+1)}const d=s.getChildAtIndex(a);if(!yr(d))throw Error("focusEndRow is not a TableRowNode");d.insertAfter(l)}else{const a=r[u],f=el();for(let d=0;d<i;d++){const{cell:p,startRow:h}=a[d];if(h===u){const g=a[d].cell.__headerState,y=Zy(g,Hn.COLUMN);f.append(Ko(y).append(An()))}else p.setRowSpan(p.__rowSpan+1)}const l=s.getChildAtIndex(u);if(!yr(l))throw Error("focusEndRow is not a TableRowNode");l.insertBefore(f)}}function pD(c,t,n=!0,e,s){const r=c.getChildren(),o=[];for(let i=0;i<r.length;i++){const u=r[i];if(yr(u))for(let a=0;a<e;a++){const f=u.getChildren();if(t>=f.length||t<0)throw new Error("Table column target index out of range");const l=f[t];if(!fn(l))throw Error("Expected table cell");const{left:d,right:p}=tE(l,s);let h=Hn.NO_STATUS;(d&&d.hasHeaderState(Hn.ROW)||p&&p.hasHeaderState(Hn.ROW))&&(h|=Hn.ROW);const m=Ko(h);m.append(An()),o.push({newTableCell:m,targetCell:l})}}return o.forEach(({newTableCell:i,targetCell:u})=>{n?u.insertAfter(i):u.insertBefore(i)}),c}function hD(c=!0){const t=st();if(!(at(t)||nr(t)))throw Error("Expected a RangeSelection or GridSelection");const n=t.anchor.getNode(),e=t.focus.getNode(),[s]=Pi(n),[r,,o]=Pi(e),[i,u,a]=ia(o,r,s),f=i.length,l=c?Math.max(u.startColumn,a.startColumn):Math.min(u.startColumn,a.startColumn),d=c?l+r.__colSpan-1:l-1,p=o.getFirstChild();if(!yr(p))throw Error("Expected firstTable child to be a row");let h=null;function m(y=Hn.NO_STATUS){const b=Ko(y).append(An());return h===null&&(h=b),b}let g=p;e:for(let y=0;y<f;y++){if(y!==0){const E=g.getNextSibling();if(!yr(E))throw Error("Expected row nextSibling to be a row");g=E}const b=i[y],v=b[d<0?0:d].cell.__headerState,_=Zy(v,Hn.ROW);if(d<0){Qy(g,m(_));continue}const{cell:w,startColumn:x,startRow:S}=b[d];if(x+w.__colSpan-1<=d){let E=w,O=S,j=d;for(;O!==y&&E.__rowSpan>1;)if(j-=w.__colSpan,j>=0){const{cell:A,startRow:T}=b[j];E=A,O=T}else{g.append(m(_));continue e}E.insertAfter(m(_))}else w.setColSpan(w.__colSpan+1)}h!==null&&Od(h)}function gD(c,t){const n=c.getChildren();for(let e=0;e<n.length;e++){const s=n[e];if(yr(s)){const r=s.getChildren();if(t>=r.length||t<0)throw new Error("Table column target index out of range");r[t].remove()}}return c}function mD(){const c=st();if(!(at(c)||nr(c)))throw Error("Expected a RangeSelection or GridSelection");const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Pi(t),[r]=Pi(n),[o,i,u]=ia(s,e,r),{startRow:a}=i,{startRow:f}=u,l=f+r.__rowSpan-1;if(o.length===l-a+1){s.remove();return}const d=o[0].length,p=o[l+1],h=s.getChildAtIndex(l+1);for(let m=l;m>=a;m--){for(let y=d-1;y>=0;y--){const{cell:b,startRow:v,startColumn:_}=o[m][y];if(_===y&&(m===a&&v<a&&b.setRowSpan(b.__rowSpan-(v-a)),v>=a&&v+b.__rowSpan-1>l)){if(b.setRowSpan(b.__rowSpan-(l-v+1)),h===null)throw Error("Expected nextRowNode not to be null");if(y===0)Qy(h,b);else{const{cell:w}=p[y-1];w.insertAfter(b)}}}const g=s.getChildAtIndex(m);if(!yr(g))throw Error(`Expected GridNode childAtIndex(${String(m)}) to be RowNode`);g.remove()}if(p!==void 0){const{cell:m}=p[0];Od(m)}else{const m=o[a-1],{cell:g}=m[0];Od(g)}}function yD(){const c=st();if(!(at(c)||nr(c)))throw Error("Expected a RangeSelection or GridSelection");const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Pi(t),[r]=Pi(n),[o,i,u]=ia(s,e,r),{startColumn:a}=i,{startRow:f,startColumn:l}=u,d=Math.min(a,l),p=Math.max(a+e.__colSpan-1,l+r.__colSpan-1),h=p-d+1;if(o[0].length===p-d+1){s.selectPrevious(),s.remove();return}const g=o.length;for(let v=0;v<g;v++)for(let _=d;_<=p;_++){const{cell:w,startColumn:x}=o[v][_];if(x<d){if(_===d){const S=d-x;w.setColSpan(w.__colSpan-Math.min(h,w.__colSpan-S))}}else if(x+w.__colSpan-1>p){if(_===p){const S=p-x+1;w.setColSpan(w.__colSpan-S)}}else w.remove()}const y=o[f],b=y[l+r.__colSpan];if(b!==void 0){const{cell:v}=b;Od(v)}else{const v=y[l-1],{cell:_}=v;Od(_)}}function Od(c){const t=c.getFirstDescendant();t==null?c.selectStart():t.getParentOrThrow().selectStart()}function Qy(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}function bD(){const c=st();if(!(at(c)||nr(c)))throw Error("Expected a RangeSelection or GridSelection");const t=c.anchor.getNode(),[n,e,s]=Pi(t),r=n.__colSpan,o=n.__rowSpan;if(r>1){for(let i=1;i<r;i++)n.insertAfter(Ko(Hn.NO_STATUS));n.setColSpan(1)}if(o>1){const[i,u]=ia(s,n,n),{startColumn:a,startRow:f}=u;let l;for(let d=1;d<o;d++){const p=f+d,h=i[p];if(l=(l||e).getNextSibling(),!yr(l))throw Error("Expected row next sibling to be a row");let m=null;for(let g=0;g<a;g++){const y=h[g],b=y.cell;y.startRow===p&&(m=b),b.__colSpan>1&&(g+=b.__colSpan-1)}if(m===null)for(let g=0;g<r;g++)Qy(l,Ko(Hn.NO_STATUS));else for(let g=0;g<r;g++)m.insertAfter(Ko(Hn.NO_STATUS))}n.setRowSpan(1)}}function ia(c,t,n){const e=[];let s=null,r=null;function o(a,f,l){const d={cell:l,startColumn:f,startRow:a},p=l.__rowSpan,h=l.__colSpan;for(let m=0;m<p;m++){e[a+m]===void 0&&(e[a+m]=[]);for(let g=0;g<h;g++)e[a+m][f+g]=d}t.is(l)&&(s=d),n.is(l)&&(r=d)}function i(a,f){return e[a]===void 0||e[a][f]===void 0}const u=c.getChildren();for(let a=0;a<u.length;a++){const f=u[a];if(!yr(f))throw Error("Expected GridNode children to be TableRowNode");const l=f.getChildren();let d=0;for(const p of l){if(!fn(p))throw Error("Expected TableRowNode children to be TableCellNode");for(;!i(a,d);)d++;o(a,d,p),d+=p.__colSpan}}if(s===null)throw Error("Anchor not found in Grid");if(r===null)throw Error("Focus not found in Grid");return[e,s,r]}function Pi(c){let t;if(c instanceof Th)t=c;else if("__type"in c){const s=dn(c,fn);if(!fn(s))throw Error("Expected to find a parent TableCellNode");t=s}else{const s=dn(c.getNode(),fn);if(!fn(s))throw Error("Expected to find a parent TableCellNode");t=s}const n=t.getParent();if(!yr(n))throw Error("Expected TableCellNode to have a parent TableRowNode");const e=n.getParent();if(!xo(e))throw Error("Expected TableRowNode to have a parent GridNode");return[t,n,e]}function eb(c){const[t,,n]=Pi(c),e=n.getChildren(),s=e.length,r=e[0].getChildren().length,o=new Array(s);for(let i=0;i<s;i++)o[i]=new Array(r);for(let i=0;i<s;i++){const a=e[i].getChildren();let f=0;for(let l=0;l<a.length;l++){for(;o[i][f];)f++;const d=a[l],p=d.__rowSpan||1,h=d.__colSpan||1;for(let m=0;m<p;m++)for(let g=0;g<h;g++)o[i+m][f+g]=d;if(t===d)return{colSpan:h,columnIndex:f,rowIndex:i,rowSpan:p};f+=h}}return null}class Nh{constructor(t,n,e){this.anchor=n,this.focus=e,n._selection=this,e._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return nr(t)?this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus):!1}set(t,n,e){this.dirty=!0,this.tableKey=t,this.anchor.key=n,this.focus.key=e,this._cachedNodes=null}clone(){return new Nh(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.focus.getNode();if(!Rt(n))throw Error("Expected TableSelection focus to be an ElementNode");Kp(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const t=Ro(this.anchor.key);if(!fn(t))throw Error("Expected TableSelection anchor to be (or a child of) TableCellNode");const n=eb(t);if(n===null)throw Error("getCellRect: expected to find AnchorNode");const e=Ro(this.focus.key);if(!fn(e))throw Error("Expected TableSelection focus to be (or a child of) TableCellNode");const s=eb(e);if(s===null)throw Error("getCellRect: expected to find focusCellNode");const r=Math.min(n.columnIndex,s.columnIndex),o=Math.max(n.columnIndex,s.columnIndex),i=Math.min(n.rowIndex,s.rowIndex),u=Math.max(n.rowIndex,s.rowIndex);return{fromX:Math.min(r,o),fromY:Math.min(i,u),toX:Math.max(r,o),toY:Math.max(i,u)}}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this.anchor.getNode(),e=this.focus.getNode(),s=dn(n,fn),r=dn(e,fn);if(!fn(s))throw Error("Expected TableSelection anchor to be (or a child of) TableCellNode");if(!fn(r))throw Error("Expected TableSelection focus to be (or a child of) TableCellNode");const o=s.getParent();if(!yr(o))throw Error("Expected anchorCell to have a parent TableRowNode");const i=o.getParent();if(!xo(i))throw Error("Expected tableNode to have a parent TableNode");const u=r.getParents()[1];if(u!==i){if(i.isParentOf(r)){const S=u.getParent();if(S==null)throw Error("Expected focusCellParent to have a parent");this.set(this.tableKey,r.getKey(),S.getKey())}else{const S=i.getParent();if(S==null)throw Error("Expected gridParent to have a parent");this.set(this.tableKey,S.getKey(),r.getKey())}return this.getNodes()}const[a,f,l]=ia(i,s,r);let d=Math.min(f.startColumn,l.startColumn),p=Math.min(f.startRow,l.startRow),h=Math.max(f.startColumn+f.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),m=Math.max(f.startRow+f.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1),g=d,y=p,b=d,v=p;function _(S){const{cell:E,startColumn:O,startRow:j}=S;d=Math.min(d,O),p=Math.min(p,j),h=Math.max(h,O+E.__colSpan-1),m=Math.max(m,j+E.__rowSpan-1)}for(;d<g||p<y||h>b||m>v;){if(d<g){const S=v-y,E=g-1;for(let O=0;O<=S;O++)_(a[y+O][E]);g=E}if(p<y){const S=b-g,E=y-1;for(let O=0;O<=S;O++)_(a[E][g+O]);y=E}if(h>b){const S=v-y,E=b+1;for(let O=0;O<=S;O++)_(a[y+O][E]);b=E}if(m>v){const S=b-g,E=v+1;for(let O=0;O<=S;O++)_(a[E][g+O]);v=E}}const w=[i];let x=null;for(let S=p;S<=m;S++)for(let E=d;E<=h;E++){const{cell:O}=a[S][E],j=O.getParent();if(!yr(j))throw Error("Expected TableCellNode parent to be a TableRowNode");j!==x&&w.push(j),w.push(O,...vD(O)),x=j}return xS()||(this._cachedNodes=w),w}getTextContent(){const t=this.getNodes();let n="";for(let e=0;e<t.length;e++)n+=t[e].getTextContent();return n}}function nr(c){return c instanceof Nh}function kh(){const c=Up("root",0,"element"),t=Up("root",0,"element");return new Nh("root",c,t)}function vD(c){const t=[],n=[c];for(;n.length>0;){const e=n.pop();if(e===void 0)throw Error("Stack.length > 0; can't be undefined");Rt(e)&&n.unshift(...e.getChildren()),e!==c&&t.push(e)}return t}const _D=c=>iD?(c||window).getSelection():null;class nE{constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable()}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(t=>t())}trackTable(){const t=new MutationObserver(n=>{this.editor.update(()=>{let e=!1;for(let r=0;r<n.length;r++){const u=n[r].target.nodeName;if(u==="TABLE"||u==="TR"){e=!0;break}}if(!e)return;const s=this.editor.getElementByKey(this.tableNodeKey);if(!s)throw new Error("Expected to find TableElement in DOM");this.table=Oc(s)})});this.editor.update(()=>{const n=this.editor.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");this.table=Oc(n),t.observe(n,{childList:!0,subtree:!0})})}clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),t.update(()=>{const n=Ro(this.tableNodeKey);if(!xo(n))throw new Error("Expected TableNode.");const e=t.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");const s=Oc(e);Ah(t,s,null),kr(null),t.dispatchCommand(ai,void 0)})}enableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");fh(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");wr(n,t._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(t){if(t!==null&&t.tableKey===this.tableNodeKey){const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.disableHighlightStyle(),Ah(n,this.table,this.tableSelection)}else t==null?this.clearHighlight():(this.tableNodeKey=t.tableKey,this.updateTableTableSelection(t))}setFocusCellForSelection(t,n=!1){const e=this.editor;e.update(()=>{const s=Ro(this.tableNodeKey);if(!xo(s))throw new Error("Expected TableNode.");if(!e.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const o=t.x,i=t.y;if(this.focusCell=t,this.anchorCell!==null){const u=_D(e._window);u&&u.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==o||this.anchorY!==i||n))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(o===this.focusX&&i===this.focusY)return;if(this.focusX=o,this.focusY=i,this.isHighlightingCells){const u=xr(t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&fn(u)){const a=u.getKey();this.tableSelection=this.tableSelection.clone()||kh(),this.focusCellNodeKey=a,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),kr(this.tableSelection),e.dispatchCommand(ai,void 0),Ah(e,this.table,this.tableSelection)}}})}setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y,this.editor.update(()=>{const n=xr(t.elem);if(fn(n)){const e=n.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():kh(),this.anchorCellNodeKey=e}})}formatCells(t){this.editor.update(()=>{const n=st();if(!nr(n))throw Error("Expected grid selection");const e=ud(),s=e.anchor,r=e.focus;n.getNodes().forEach(o=>{fn(o)&&o.getTextContentSize()!==0&&(s.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),e.formatText(t))}),kr(n),this.editor.dispatchCommand(ai,void 0)})}clearText(){const t=this.editor;t.update(()=>{const n=Ro(this.tableNodeKey);if(!xo(n))throw new Error("Expected TableNode.");const e=st();if(!nr(e))throw Error("Expected grid selection");const s=e.getNodes().filter(fn);if(s.length===this.table.columns*this.table.rows){n.selectPrevious(),n.remove(),Un().selectStart();return}s.forEach(r=>{if(Rt(r)){const o=An(),i=Ei();o.append(i),r.append(o),r.getChildren().forEach(u=>{u!==o&&u.remove()})}}),Ah(t,this.table,null),kr(null),t.dispatchCommand(ai,void 0)})}}const rE="__lexicalTableSelection";function xD(c,t,n,e){const s=n.getRootElement();if(s===null)throw new Error("No root element.");const r=new nE(n,c.getKey()),o=n._window||window;wD(t,r),t.addEventListener("mousedown",l=>{setTimeout(()=>{if(l.button!==0||!o)return;const d=tb(l.target);d!==null&&(Nd(l),r.setAnchorCellForSelection(d));const p=()=>{o.removeEventListener("mouseup",p),o.removeEventListener("mousemove",h)},h=m=>{const g=tb(m.target);g!==null&&(r.anchorX!==g.x||r.anchorY!==g.y)&&(m.preventDefault(),r.setFocusCellForSelection(g))};o.addEventListener("mouseup",p),o.addEventListener("mousemove",h)},0)});const i=l=>{l.button===0&&n.update(()=>{const d=st(),p=l.target;nr(d)&&d.tableKey===r.tableNodeKey&&s.contains(p)&&r.clearHighlight()})};o.addEventListener("mousedown",i),r.listenersToRemove.add(()=>o.removeEventListener("mousedown",i)),r.listenersToRemove.add(n.registerCommand(Gp,l=>Td(n,l,"down",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(Yp,l=>Td(n,l,"up",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(lc,l=>Td(n,l,"backward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(cc,l=>Td(n,l,"forward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(hd,l=>{const d=st();if(nr(d)){const p=dn(d.focus.getNode(),fn);if(fn(p))return Nd(l),p.selectEnd(),!0}return!1},Ho));const u=l=>()=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return r.clearText(),!0;if(at(d)){const p=dn(d.anchor.getNode(),w=>fn(w));if(!fn(p))return!1;const h=d.anchor.getNode(),m=d.focus.getNode(),g=c.isParentOf(h),y=c.isParentOf(m);if(g&&!y||y&&!g)return r.clearText(),!0;const v=dn(d.anchor.getNode(),w=>Rt(w)),_=v&&dn(v,w=>Rt(w)&&fn(w.getParent()));if(!Rt(_)||!Rt(v))return!1;if(l===Zs&&_.getPreviousSibling()===null)return!0;if((l===Yr||l===Qs)&&d.isCollapsed()&&d.anchor.offset===0&&v!==_){const w=v.getChildren(),x=An();return w.forEach(S=>x.append(S)),v.replace(x),v.getWritable().__parent=p.getKey(),!0}}return!1};[Qs,Zs,Yr].forEach(l=>{r.listenersToRemove.add(n.registerCommand(l,u(l),mr))});const a=l=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return l.preventDefault(),l.stopPropagation(),r.clearText(),!0;if(at(d)){const p=dn(d.anchor.getNode(),h=>fn(h));if(!fn(p))return!1}return!1};r.listenersToRemove.add(n.registerCommand(Va,a,mr)),r.listenersToRemove.add(n.registerCommand(Ga,a,mr)),r.listenersToRemove.add(n.registerCommand(Ni,l=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return r.formatCells(l),!0;if(at(d)){const p=dn(d.anchor.getNode(),h=>fn(h));if(!fn(p))return!1}return!1},mr)),r.listenersToRemove.add(n.registerCommand(ea,l=>{const d=st();if(!nr(d)||!tl(d,c))return!1;const p=d.anchor.getNode(),h=d.focus.getNode();if(!fn(p)||!fn(h))return!1;const[m,g,y]=ia(c,p,h),b=Math.max(g.startRow,y.startRow),v=Math.max(g.startColumn,y.startColumn),_=Math.min(g.startRow,y.startRow),w=Math.min(g.startColumn,y.startColumn);for(let x=_;x<=b;x++)for(let S=w;S<=v;S++){const E=m[x][S].cell;E.setFormat(l);const O=E.getChildren();for(let j=0;j<O.length;j++){const A=O[j];Rt(A)&&!A.isInline()&&A.setFormat(l)}}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ic,l=>{const d=st();if(!tl(d,c))return!1;if(nr(d))return r.clearHighlight(),!1;if(at(d)){const p=dn(d.anchor.getNode(),h=>fn(h));if(!fn(p))return!1}return!1},mr)),e&&r.listenersToRemove.add(n.registerCommand(_S,l=>{const d=st();if(!at(d)||!d.isCollapsed()||!tl(d,c))return!1;const p=ob(d.anchor.getNode());if(p===null)return!1;Nd(l);const h=c.getCordsFromCellNode(p,r.table);return iE(r,c,h.x,h.y,l.shiftKey?"backward":"forward"),!0},mr)),r.listenersToRemove.add(n.registerCommand(yS,l=>c.isSelected(),Ho));function f(l){const d=c.getCordsFromCellNode(l,r.table);return c.getDOMCellFromCordsOrThrow(d.x,d.y,r.table)}return r.listenersToRemove.add(n.registerCommand(th,l=>{const{nodes:d,selection:p}=l,h=p.getStartEndPoints(),m=nr(p),y=at(p)&&dn(p.anchor.getNode(),z=>fn(z))!==null&&dn(p.focus.getNode(),z=>fn(z))!==null||m;if(d.length!==1||!xo(d[0])||!y||h===null)return!1;const[b]=h,v=d[0],_=v.getChildren(),w=v.getFirstChildOrThrow().getChildrenSize(),x=v.getChildrenSize(),S=dn(b.getNode(),z=>fn(z)),E=S&&dn(S,z=>yr(z)),O=E&&dn(E,z=>xo(z));if(!fn(S)||!yr(E)||!xo(O))return!1;const j=E.getIndexWithinParent(),A=Math.min(O.getChildrenSize()-1,j+x-1),T=S.getIndexWithinParent(),I=Math.min(E.getChildrenSize()-1,T+w-1),k=Math.min(T,I),$=Math.min(j,A),H=Math.max(T,I),U=Math.max(j,A),D=O.getChildren();let W=0,J,M;for(let z=$;z<=U;z++){const V=D[z];if(!yr(V))return!1;const G=_[W];if(!yr(G))return!1;const F=V.getChildren(),K=G.getChildren();let N=0;for(let R=k;R<=H;R++){const L=F[R];if(!fn(L))return!1;const B=K[N];if(!fn(B))return!1;z===$&&R===k?J=L.getKey():z===U&&R===H&&(M=L.getKey());const Y=L.getChildren();B.getChildren().forEach(X=>{zt(X)&&An().append(X),L.append(X)}),Y.forEach(X=>X.remove()),N++}W++}if(J&&M){const z=kh();z.set(d[0].getKey(),J,M),kr(z)}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ai,()=>{const l=st(),d=Ys();if(at(l)){const{anchor:p,focus:h}=l,m=p.getNode(),g=h.getNode(),y=ob(m),b=ob(g),v=!!(y&&c.is(ib(y))),_=!!(b&&c.is(ib(b))),w=v!==_,x=v&&_,S=l.isBackward();if(w){const E=l.clone();E.focus.set(c.getKey(),S?0:c.getChildrenSize(),"element"),kr(E),oE(n,r)}else x&&(y.is(b)||(r.setAnchorCellForSelection(f(y)),r.setFocusCellForSelection(f(b),!0)))}return l&&!l.is(d)&&(nr(l)||nr(d))&&r.tableSelection&&!r.tableSelection.is(d)?(nr(l)&&l.tableKey===r.tableNodeKey?r.updateTableTableSelection(l):!nr(l)&&nr(d)&&d.tableKey===r.tableNodeKey&&r.updateTableTableSelection(null),!1):(r.hasHijackedSelectionStyles&&!c.isSelected()?CD(n,r):!r.hasHijackedSelectionStyles&&c.isSelected()&&oE(n,r),!1)},mr)),r}function wD(c,t){c[rE]=t}function SD(c){return c[rE]}function tb(c){let t=c;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function Oc(c){const t=[],n={columns:0,domRows:t,rows:0};let e=c.firstChild,s=0,r=0;for(t.length=0;e!=null;){const o=e.nodeName;if(o==="TD"||o==="TH"){const a=e,f={elem:a,hasBackgroundColor:a.style.backgroundColor!=="",highlighted:!1,x:s,y:r};e._cell=f;let l=t[r];l===void 0&&(l=t[r]=[]),l[s]=f}else{const a=e.firstChild;if(a!=null){e=a;continue}}const i=e.nextSibling;if(i!=null){s++,e=i;continue}const u=e.parentNode;if(u!=null){const a=u.nextSibling;if(a==null)break;r++,s=0,e=a}}return n.columns=s+1,n.rows=r+1,n}function Ah(c,t,n){const e=new Set(n?n.getNodes():[]);nb(t,(s,r)=>{const o=s.elem;e.has(r)?(s.highlighted=!0,sE(c,s)):(s.highlighted=!1,aE(c,s),o.getAttribute("style")||o.removeAttribute("style"))})}function nb(c,t){const{domRows:n}=c;for(let e=0;e<n.length;e++){const s=n[e];if(s)for(let r=0;r<s.length;r++){const o=s[r];if(!o)continue;const i=xr(o.elem);i!==null&&t(o,i,{x:r,y:e})}}}function oE(c,t){t.disableHighlightStyle(),nb(t.table,n=>{n.highlighted=!0,sE(c,n)})}function CD(c,t){t.enableHighlightStyle(),nb(t.table,n=>{const e=n.elem;n.highlighted=!1,aE(c,n),e.getAttribute("style")||e.removeAttribute("style")})}const iE=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)?Ph(t.getCellNodeFromCordsOrThrow(n+(r?1:-1),e,c.table),r):e!==(r?c.table.rows-1:0)?Ph(t.getCellNodeFromCordsOrThrow(r?0:c.table.columns-1,e+(r?1:-1),c.table),r):r?t.selectNext():t.selectPrevious(),!0;case"up":return e!==0?Ph(t.getCellNodeFromCordsOrThrow(n,e-1,c.table),!1):t.selectPrevious(),!0;case"down":return e!==c.table.rows-1?Ph(t.getCellNodeFromCordsOrThrow(n,e+1,c.table),!0):t.selectNext(),!0;default:return!1}},ED=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)&&c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n+(r?1:-1),e,c.table)),!0;case"up":return e!==0?(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e-1,c.table)),!0):!1;case"down":return e!==c.table.rows-1?(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e+1,c.table)),!0):!1;default:return!1}};function tl(c,t){if(at(c)||nr(c)){const n=t.isParentOf(c.anchor.getNode()),e=t.isParentOf(c.focus.getNode());return n&&e}return!1}function Ph(c,t){t?c.selectStart():c.selectEnd()}const rb="172,206,247";function sE(c,t){const n=t.elem,e=xr(n);if(!fn(e))throw Error("Expected to find LexicalNode from Table Cell DOMNode");e.getBackgroundColor()===null?n.style.setProperty("background-color",`rgb(${rb})`):n.style.setProperty("background-image",`linear-gradient(to right, rgba(${rb},0.85), rgba(${rb},0.85))`),n.style.setProperty("caret-color","transparent")}function aE(c,t){const n=t.elem,e=xr(n);if(!fn(e))throw Error("Expected to find LexicalNode from Table Cell DOMNode");e.getBackgroundColor()===null&&n.style.removeProperty("background-color"),n.style.removeProperty("background-image"),n.style.removeProperty("caret-color")}function ob(c){const t=dn(c,fn);return fn(t)?t:null}function ib(c){const t=dn(c,xo);return xo(t)?t:null}function Td(c,t,n,e,s){const r=st();if(!tl(r,e))return!1;if(at(r)&&r.isCollapsed()){if(n==="backward"||n==="forward")return!1;const{anchor:o,focus:i}=r,u=dn(o.getNode(),fn),a=dn(i.getNode(),fn);if(!fn(u)||!u.is(a))return!1;const f=ib(u);if(f!==e&&f!=null){const b=c.getElementByKey(f.getKey());if(b!=null)return s.table=Oc(b),Td(c,t,n,f,s)}const l=c.getElementByKey(u.__key),d=c.getElementByKey(o.key);if(d==null||l==null)return!1;let p;if(o.type==="element")p=d.getBoundingClientRect();else{const b=window.getSelection();if(b===null||b.rangeCount===0)return!1;p=b.getRangeAt(0).getBoundingClientRect()}const h=n==="up"?u.getFirstChild():u.getLastChild();if(h==null)return!1;const m=c.getElementByKey(h.__key);if(m==null)return!1;const g=m.getBoundingClientRect();if(n==="up"?g.top>p.top-p.height:p.bottom+p.height>g.bottom){Nd(t);const b=e.getCordsFromCellNode(u,s.table);if(t.shiftKey){const v=e.getDOMCellFromCordsOrThrow(b.x,b.y,s.table);s.setAnchorCellForSelection(v),s.setFocusCellForSelection(v,!0)}else return iE(s,e,b.x,b.y,n);return!0}}else if(nr(r)){const{anchor:o,focus:i}=r,u=dn(o.getNode(),fn),a=dn(i.getNode(),fn),[f]=r.getNodes(),l=c.getElementByKey(f.getKey());if(!fn(u)||!fn(a)||!xo(f)||l==null)return!1;s.updateTableTableSelection(r);const d=Oc(l),p=e.getCordsFromCellNode(u,d),h=e.getDOMCellFromCordsOrThrow(p.x,p.y,d);if(s.setAnchorCellForSelection(h),Nd(t),t.shiftKey){const m=e.getCordsFromCellNode(a,d);return ED(s,f,m.x,m.y,n)}else a.selectEnd();return!0}return!1}function Nd(c){c.preventDefault(),c.stopImmediatePropagation(),c.stopPropagation()}let sb=class bN extends po{static getType(){return"table"}static clone(t){return new bN(t.__key)}static importDOM(){return{table:t=>({conversion:TD,priority:1})}}static importJSON(t){return Mh()}constructor(t){super(t)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(t,n){const e=document.createElement("table");return wr(e,t.theme.table),e}updateDOM(){return!1}exportDOM(t){return{...super.exportDOM(t),after:n=>{if(n){const e=n.cloneNode(),s=document.createElement("colgroup"),r=document.createElement("tbody");oa(n)&&r.append(...n.children);const o=this.getFirstChildOrThrow();if(!yr(o))throw new Error("Expected to find row node.");const i=o.getChildrenSize();for(let u=0;u<i;u++){const a=document.createElement("col");s.append(a)}return e.replaceChildren(s,r),e}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:e,domRows:s}=n;for(let r=0;r<e;r++){const o=s[r];if(o==null)continue;const i=o.findIndex(u=>{if(!u)return;const{elem:a}=u;return xr(a)===t});if(i!==-1)return{x:i,y:r}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,e){const{domRows:s}=e,r=s[n];if(r==null)return null;const o=r[t];return o??null}getDOMCellFromCordsOrThrow(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(!s)throw new Error("Cell not found at cords.");return s}getCellNodeFromCords(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(s==null)return null;const r=xr(s.elem);return fn(r)?r:null}getCellNodeFromCordsOrThrow(t,n,e){const s=this.getCellNodeFromCords(t,n,e);if(!s)throw new Error("Node at cords not TableCellNode.");return s}canSelectBefore(){return!0}canIndent(){return!1}};function OD(c,t){const n=c.getElementByKey(t.getKey());if(n==null)throw new Error("Table Element Not Found");return Oc(n)}function TD(c){return{node:Mh()}}function Mh(){return Gr(new sb)}function xo(c){return c instanceof sb}const ND=Object.freeze(Object.defineProperty({__proto__:null,$computeTableMap:ia,$createTableCellNode:Ko,$createTableNode:Mh,$createTableNodeWithDimensions:sD,$createTableRowNode:el,$createTableSelection:kh,$deleteTableColumn:gD,$deleteTableColumn__EXPERIMENTAL:yD,$deleteTableRow__EXPERIMENTAL:mD,$getElementForTableNode:OD,$getNodeTriplet:Pi,$getTableCellNodeFromLexicalNode:aD,$getTableCellNodeRect:eb,$getTableColumnIndexFromTableCellNode:cD,$getTableNodeFromLexicalNodeOrThrow:Xy,$getTableRowIndexFromTableCellNode:lD,$getTableRowNodeFromTableCellNodeOrThrow:Yy,$insertTableColumn:pD,$insertTableColumn__EXPERIMENTAL:hD,$insertTableRow:dD,$insertTableRow__EXPERIMENTAL:fD,$isTableCellNode:fn,$isTableNode:xo,$isTableRowNode:yr,$isTableSelection:nr,$removeTableRowAtIndex:uD,$unmergeCell:bD,INSERT_TABLE_COMMAND:rD,TableCellHeaderStates:Hn,TableCellNode:Th,TableNode:sb,TableObserver:nE,TableRowNode:Gy,applyTableHandlers:xD,getDOMCellFromTarget:tb,getTableObserverFromTableElement:SD},Symbol.toStringTag,{value:"Module"})),lE=/^(\d+(?:\.\d+)?)px$/,Kn={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Tc extends po{static getType(){return"tablecell"}static clone(t){const n=new Tc(t.__headerState,t.__colSpan,t.__width,t.__key);return n.__rowSpan=t.__rowSpan,n.__backgroundColor=t.__backgroundColor,n}static importDOM(){return{td:t=>({conversion:cE,priority:0}),th:t=>({conversion:cE,priority:0})}}static importJSON(t){const n=t.colSpan||1,e=t.rowSpan||1,s=Wo(t.headerState,n,t.width||void 0);return s.__rowSpan=e,s.__backgroundColor=t.backgroundColor||null,s}constructor(t=Kn.NO_STATUS,n=1,e,s){super(s),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=e,this.__backgroundColor=null}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),wr(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const{element:n}=super.exportDOM(t);if(n){const e=n,s=700,r=this.getParentOrThrow().getChildrenSize();e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||Math.max(90,s/r)}px`,e.style.verticalAlign="top",e.style.textAlign="start";const o=this.getBackgroundColor();o!==null?e.style.backgroundColor=o:this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return{element:n}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(t){return this.getWritable().__colSpan=t,this}getRowSpan(){return this.__rowSpan}setRowSpan(t){return this.getWritable().__rowSpan=t,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t){return this.getWritable().__headerState=t,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){return this.getWritable().__width=t,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){this.getWritable().__backgroundColor=t}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==Kn.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function cE(c){const t=c,n=c.nodeName.toLowerCase();let e;lE.test(t.style.width)&&(e=parseFloat(t.style.width));const s=Wo(n==="th"?Kn.ROW:Kn.NO_STATUS,t.colSpan,e);s.__rowSpan=t.rowSpan;const r=t.style.backgroundColor;return r!==""&&(s.__backgroundColor=r),{after:o=>(o.length===0&&o.push(An()),o),forChild:(o,i)=>{if(pn(i)&&!Rt(o)){const u=An();return dd(o)&&o.getTextContent()===`
|
|
59
|
+
`?null:(u.append(o),u)}return o},node:s}}function Wo(c,t=1,n){return Gr(new Tc(c,t,n))}function pn(c){return c instanceof Tc}const kD=Xa("INSERT_TABLE_COMMAND");class kd extends po{static getType(){return"tablerow"}static clone(t){return new kd(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:AD,priority:0})}}static importJSON(t){return nl(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),wr(n,t.theme.tableRow),n}isShadowRoot(){return!0}setHeight(t){return this.getWritable().__height=t,this.__height}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function AD(c){const t=c;let n;return lE.test(t.style.height)&&(n=parseFloat(t.style.height)),{node:nl(n)}}function nl(c){return Gr(new kd(c))}function br(c){return c instanceof kd}var Pn=function(c){const t=new URLSearchParams;t.append("code",c);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${c}; 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.`)};const PD=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function MD(c,t,n=!0){const e=Lh();for(let s=0;s<c;s++){const r=nl();for(let o=0;o<t;o++){let i=Kn.NO_STATUS;typeof n=="object"?(s===0&&n.rows&&(i|=Kn.ROW),o===0&&n.columns&&(i|=Kn.COLUMN)):n&&(s===0&&(i|=Kn.ROW),o===0&&(i|=Kn.COLUMN));const u=Wo(i),a=An();a.append(Ei()),u.append(a),r.append(u)}e.append(r)}return e}function ID(c){const t=dn(c,n=>pn(n));return pn(t)?t:null}function ab(c){const t=dn(c,n=>br(n));if(br(t))return t;throw new Error("Expected table cell to be inside of table row.")}function lb(c){const t=dn(c,n=>wo(n));if(wo(t))return t;throw new Error("Expected table cell to be inside of table.")}function RD(c){const t=ab(c);return lb(t).getChildren().findIndex(n=>n.is(t))}function jD(c){return ab(c).getChildren().findIndex(t=>t.is(c))}function uE(c,t){const n=lb(c),{x:e,y:s}=n.getCordsFromCellNode(c,t);return{above:n.getCellNodeFromCords(e,s-1,t),below:n.getCellNodeFromCords(e,s+1,t),left:n.getCellNodeFromCords(e-1,s,t),right:n.getCellNodeFromCords(e+1,s,t)}}function DD(c,t){const n=c.getChildren();if(t>=n.length||t<0)throw new Error("Expected table cell to be inside of table row.");return n[t].remove(),c}function LD(c,t,n=!0,e,s){const r=c.getChildren();if(t>=r.length||t<0)throw new Error("Table row target index out of range");const o=r[t];if(!br(o))throw new Error("Row before insertion index does not exist.");for(let i=0;i<e;i++){const u=o.getChildren(),a=u.length,f=nl();for(let l=0;l<a;l++){const d=u[l];pn(d)||Pn(12);const{above:p,below:h}=uE(d,s);let m=Kn.NO_STATUS;const g=p&&p.getWidth()||h&&h.getWidth()||void 0;(p&&p.hasHeaderState(Kn.COLUMN)||h&&h.hasHeaderState(Kn.COLUMN))&&(m|=Kn.COLUMN);const y=Wo(m,1,g);y.append(An()),f.append(y)}n?o.insertAfter(f):o.insertBefore(f)}return c}const cb=(c,t)=>c===Kn.BOTH||c===t?t:Kn.NO_STATUS;function BD(c=!0){const t=st();at(t)||rr(t)||Pn(118);const n=t.focus.getNode(),[e,,s]=Mi(n),[r,o]=sa(s,e,e),i=r[0].length,{startRow:u}=o;if(c){const a=u+e.__rowSpan-1,f=r[a],l=nl();for(let p=0;p<i;p++){const{cell:h,startRow:m}=f[p];if(m+h.__rowSpan-1<=a){const g=f[p].cell.__headerState,y=cb(g,Kn.COLUMN);l.append(Wo(y).append(An()))}else h.setRowSpan(h.__rowSpan+1)}const d=s.getChildAtIndex(a);br(d)||Pn(145),d.insertAfter(l)}else{const a=r[u],f=nl();for(let d=0;d<i;d++){const{cell:p,startRow:h}=a[d];if(h===u){const m=a[d].cell.__headerState,g=cb(m,Kn.COLUMN);f.append(Wo(g).append(An()))}else p.setRowSpan(p.__rowSpan+1)}const l=s.getChildAtIndex(u);br(l)||Pn(145),l.insertBefore(f)}}function FD(c,t,n=!0,e,s){const r=c.getChildren(),o=[];for(let i=0;i<r.length;i++){const u=r[i];if(br(u))for(let a=0;a<e;a++){const f=u.getChildren();if(t>=f.length||t<0)throw new Error("Table column target index out of range");const l=f[t];pn(l)||Pn(12);const{left:d,right:p}=uE(l,s);let h=Kn.NO_STATUS;(d&&d.hasHeaderState(Kn.ROW)||p&&p.hasHeaderState(Kn.ROW))&&(h|=Kn.ROW);const m=Wo(h);m.append(An()),o.push({newTableCell:m,targetCell:l})}}return o.forEach(({newTableCell:i,targetCell:u})=>{n?u.insertAfter(i):u.insertBefore(i)}),c}function $D(c=!0){const t=st();at(t)||rr(t)||Pn(118);const n=t.anchor.getNode(),e=t.focus.getNode(),[s]=Mi(n),[r,,o]=Mi(e),[i,u,a]=sa(o,r,s),f=i.length,l=c?Math.max(u.startColumn,a.startColumn):Math.min(u.startColumn,a.startColumn),d=c?l+r.__colSpan-1:l-1,p=o.getFirstChild();br(p)||Pn(120);let h=null;function m(y=Kn.NO_STATUS){const b=Wo(y).append(An());return h===null&&(h=b),b}let g=p;e:for(let y=0;y<f;y++){if(y!==0){const E=g.getNextSibling();br(E)||Pn(121),g=E}const b=i[y],v=b[d<0?0:d].cell.__headerState,_=cb(v,Kn.ROW);if(d<0){ub(g,m(_));continue}const{cell:w,startColumn:x,startRow:S}=b[d];if(x+w.__colSpan-1<=d){let E=w,O=S,j=d;for(;O!==y&&E.__rowSpan>1;){if(j-=w.__colSpan,!(j>=0)){g.append(m(_));continue e}{const{cell:A,startRow:T}=b[j];E=A,O=T}}E.insertAfter(m(_))}else w.setColSpan(w.__colSpan+1)}h!==null&&Ad(h)}function zD(c,t){const n=c.getChildren();for(let e=0;e<n.length;e++){const s=n[e];if(br(s)){const r=s.getChildren();if(t>=r.length||t<0)throw new Error("Table column target index out of range");r[t].remove()}}return c}function UD(){const c=st();at(c)||rr(c)||Pn(118);const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Mi(t),[r]=Mi(n),[o,i,u]=sa(s,e,r),{startRow:a}=i,{startRow:f}=u,l=f+r.__rowSpan-1;if(o.length===l-a+1)return void s.remove();const d=o[0].length,p=o[l+1],h=s.getChildAtIndex(l+1);for(let m=l;m>=a;m--){for(let y=d-1;y>=0;y--){const{cell:b,startRow:v,startColumn:_}=o[m][y];if(_===y&&(m===a&&v<a&&b.setRowSpan(b.__rowSpan-(v-a)),v>=a&&v+b.__rowSpan-1>l))if(b.setRowSpan(b.__rowSpan-(l-v+1)),h===null&&Pn(122),y===0)ub(h,b);else{const{cell:w}=p[y-1];w.insertAfter(b)}}const g=s.getChildAtIndex(m);br(g)||Pn(123,String(m)),g.remove()}if(p!==void 0){const{cell:m}=p[0];Ad(m)}else{const m=o[a-1],{cell:g}=m[0];Ad(g)}}function HD(){const c=st();at(c)||rr(c)||Pn(118);const t=c.anchor.getNode(),n=c.focus.getNode(),[e,,s]=Mi(t),[r]=Mi(n),[o,i,u]=sa(s,e,r),{startColumn:a}=i,{startRow:f,startColumn:l}=u,d=Math.min(a,l),p=Math.max(a+e.__colSpan-1,l+r.__colSpan-1),h=p-d+1;if(o[0].length===p-d+1)return s.selectPrevious(),void s.remove();const m=o.length;for(let b=0;b<m;b++)for(let v=d;v<=p;v++){const{cell:_,startColumn:w}=o[b][v];if(w<d){if(v===d){const x=d-w;_.setColSpan(_.__colSpan-Math.min(h,_.__colSpan-x))}}else if(w+_.__colSpan-1>p){if(v===p){const x=p-w+1;_.setColSpan(_.__colSpan-x)}}else _.remove()}const g=o[f],y=g[l+r.__colSpan];if(y!==void 0){const{cell:b}=y;Ad(b)}else{const b=g[l-1],{cell:v}=b;Ad(v)}}function Ad(c){const t=c.getFirstDescendant();t==null?c.selectStart():t.getParentOrThrow().selectStart()}function ub(c,t){const n=c.getFirstChild();n!==null?n.insertBefore(t):c.append(t)}function KD(){const c=st();at(c)||rr(c)||Pn(118);const t=c.anchor.getNode(),[n,e,s]=Mi(t),r=n.__colSpan,o=n.__rowSpan;if(r>1){for(let i=1;i<r;i++)n.insertAfter(Wo(Kn.NO_STATUS));n.setColSpan(1)}if(o>1){const[i,u]=sa(s,n,n),{startColumn:a,startRow:f}=u;let l;for(let d=1;d<o;d++){const p=f+d,h=i[p];l=(l||e).getNextSibling(),br(l)||Pn(125);let m=null;for(let g=0;g<a;g++){const y=h[g],b=y.cell;y.startRow===p&&(m=b),b.__colSpan>1&&(g+=b.__colSpan-1)}if(m===null)for(let g=0;g<r;g++)ub(l,Wo(Kn.NO_STATUS));else for(let g=0;g<r;g++)m.insertAfter(Wo(Kn.NO_STATUS))}n.setRowSpan(1)}}function sa(c,t,n){const e=[];let s=null,r=null;function o(a,f,l){const d={cell:l,startColumn:f,startRow:a},p=l.__rowSpan,h=l.__colSpan;for(let m=0;m<p;m++){e[a+m]===void 0&&(e[a+m]=[]);for(let g=0;g<h;g++)e[a+m][f+g]=d}t.is(l)&&(s=d),n.is(l)&&(r=d)}function i(a,f){return e[a]===void 0||e[a][f]===void 0}const u=c.getChildren();for(let a=0;a<u.length;a++){const f=u[a];br(f)||Pn(146);const l=f.getChildren();let d=0;for(const p of l){for(pn(p)||Pn(147);!i(a,d);)d++;o(a,d,p),d+=p.__colSpan}}return s===null&&Pn(110),r===null&&Pn(111),[e,s,r]}function Mi(c){let t;if(c instanceof Tc)t=c;else if("__type"in c){const s=dn(c,pn);pn(s)||Pn(148),t=s}else{const s=dn(c.getNode(),pn);pn(s)||Pn(148),t=s}const n=t.getParent();br(n)||Pn(149);const e=n.getParent();return wo(e)||Pn(150),[t,n,e]}function db(c){const[t,,n]=Mi(c),e=n.getChildren(),s=e.length,r=e[0].getChildren().length,o=new Array(s);for(let i=0;i<s;i++)o[i]=new Array(r);for(let i=0;i<s;i++){const u=e[i].getChildren();let a=0;for(let f=0;f<u.length;f++){for(;o[i][a];)a++;const l=u[f],d=l.__rowSpan||1,p=l.__colSpan||1;for(let h=0;h<d;h++)for(let m=0;m<p;m++)o[i+h][a+m]=l;if(t===l)return{colSpan:p,columnIndex:a,rowIndex:i,rowSpan:d};a+=p}}return null}class Ih{constructor(t,n,e){this.anchor=n,this.focus=e,n._selection=this,e._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!rr(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,e){this.dirty=!0,this.tableKey=t,this.anchor.key=n,this.focus.key=e,this._cachedNodes=null}clone(){return new Ih(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.focus.getNode();Rt(n)||Pn(151),Kp(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const t=Ro(this.anchor.key);pn(t)||Pn(152);const n=db(t);n===null&&Pn(153);const e=Ro(this.focus.key);pn(e)||Pn(154);const s=db(e);s===null&&Pn(155);const r=Math.min(n.columnIndex,s.columnIndex),o=Math.max(n.columnIndex,s.columnIndex),i=Math.min(n.rowIndex,s.rowIndex),u=Math.max(n.rowIndex,s.rowIndex);return{fromX:Math.min(r,o),fromY:Math.min(i,u),toX:Math.max(r,o),toY:Math.max(i,u)}}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this.anchor.getNode(),e=this.focus.getNode(),s=dn(n,pn),r=dn(e,pn);pn(s)||Pn(152),pn(r)||Pn(154);const o=s.getParent();br(o)||Pn(156);const i=o.getParent();wo(i)||Pn(157);const u=r.getParents()[1];if(u!==i){if(i.isParentOf(r)){const S=u.getParent();S==null&&Pn(159),this.set(this.tableKey,r.getKey(),S.getKey())}else{const S=i.getParent();S==null&&Pn(158),this.set(this.tableKey,S.getKey(),r.getKey())}return this.getNodes()}const[a,f,l]=sa(i,s,r);let d=Math.min(f.startColumn,l.startColumn),p=Math.min(f.startRow,l.startRow),h=Math.max(f.startColumn+f.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),m=Math.max(f.startRow+f.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1),g=d,y=p,b=d,v=p;function _(S){const{cell:E,startColumn:O,startRow:j}=S;d=Math.min(d,O),p=Math.min(p,j),h=Math.max(h,O+E.__colSpan-1),m=Math.max(m,j+E.__rowSpan-1)}for(;d<g||p<y||h>b||m>v;){if(d<g){const S=v-y,E=g-1;for(let O=0;O<=S;O++)_(a[y+O][E]);g=E}if(p<y){const S=b-g,E=y-1;for(let O=0;O<=S;O++)_(a[E][g+O]);y=E}if(h>b){const S=v-y,E=b+1;for(let O=0;O<=S;O++)_(a[y+O][E]);b=E}if(m>v){const S=b-g,E=v+1;for(let O=0;O<=S;O++)_(a[E][g+O]);v=E}}const w=[i];let x=null;for(let S=p;S<=m;S++)for(let E=d;E<=h;E++){const{cell:O}=a[S][E],j=O.getParent();br(j)||Pn(160),j!==x&&w.push(j),w.push(O,...WD(O)),x=j}return xS()||(this._cachedNodes=w),w}getTextContent(){const t=this.getNodes();let n="";for(let e=0;e<t.length;e++)n+=t[e].getTextContent();return n}}function rr(c){return c instanceof Ih}function Rh(){const c=Up("root",0,"element"),t=Up("root",0,"element");return new Ih("root",c,t)}function WD(c){const t=[],n=[c];for(;n.length>0;){const e=n.pop();e===void 0&&Pn(112),Rt(e)&&n.unshift(...e.getChildren()),e!==c&&t.push(e)}return t}class dE{constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable()}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(t=>t())}trackTable(){const t=new MutationObserver(n=>{this.editor.update(()=>{let e=!1;for(let r=0;r<n.length;r++){const o=n[r].target.nodeName;if(o==="TABLE"||o==="TR"){e=!0;break}}if(!e)return;const s=this.editor.getElementByKey(this.tableNodeKey);if(!s)throw new Error("Expected to find TableElement in DOM");this.table=Nc(s)})});this.editor.update(()=>{const n=this.editor.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");this.table=Nc(n),t.observe(n,{childList:!0,subtree:!0})})}clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),t.update(()=>{if(!wo(Ro(this.tableNodeKey)))throw new Error("Expected TableNode.");const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");const e=Nc(n);jh(t,e,null),kr(null),t.dispatchCommand(ai,void 0)})}enableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");fh(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");wr(n,t._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(t){if(t!==null&&t.tableKey===this.tableNodeKey){const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.disableHighlightStyle(),jh(n,this.table,this.tableSelection)}else t==null?this.clearHighlight():(this.tableNodeKey=t.tableKey,this.updateTableTableSelection(t))}setFocusCellForSelection(t,n=!1){const e=this.editor;e.update(()=>{if(!wo(Ro(this.tableNodeKey)))throw new Error("Expected TableNode.");if(!e.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const s=t.x,r=t.y;if(this.focusCell=t,this.anchorCell!==null){const i=(o=e._window,PD?(o||window).getSelection():null);i&&i.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}var o;if(this.isHighlightingCells||this.anchorX===s&&this.anchorY===r&&!n){if(s===this.focusX&&r===this.focusY)return}else this.isHighlightingCells=!0,this.disableHighlightStyle();if(this.focusX=s,this.focusY=r,this.isHighlightingCells){const i=xr(t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&pn(i)){const u=i.getKey();this.tableSelection=this.tableSelection.clone()||Rh(),this.focusCellNodeKey=u,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),kr(this.tableSelection),e.dispatchCommand(ai,void 0),jh(e,this.table,this.tableSelection)}}})}setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y,this.editor.update(()=>{const n=xr(t.elem);if(pn(n)){const e=n.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():Rh(),this.anchorCellNodeKey=e}})}formatCells(t){this.editor.update(()=>{const n=st();rr(n)||Pn(11);const e=ud(),s=e.anchor,r=e.focus;n.getNodes().forEach(o=>{pn(o)&&o.getTextContentSize()!==0&&(s.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),e.formatText(t))}),kr(n),this.editor.dispatchCommand(ai,void 0)})}clearText(){const t=this.editor;t.update(()=>{const n=Ro(this.tableNodeKey);if(!wo(n))throw new Error("Expected TableNode.");const e=st();rr(e)||Pn(11);const s=e.getNodes().filter(pn);s.length!==this.table.columns*this.table.rows?(s.forEach(r=>{if(Rt(r)){const o=An(),i=Ei();o.append(i),r.append(o),r.getChildren().forEach(u=>{u!==o&&u.remove()})}}),jh(t,this.table,null),kr(null),t.dispatchCommand(ai,void 0)):(n.selectPrevious(),n.remove(),Un().selectStart())})}}const fE="__lexicalTableSelection";function qD(c,t,n,e){const s=n.getRootElement();if(s===null)throw new Error("No root element.");const r=new dE(n,c.getKey()),o=n._window||window;(function(f,l){f[fE]=l})(t,r),t.addEventListener("mousedown",f=>{setTimeout(()=>{if(f.button!==0||!o)return;const l=fb(f.target);l!==null&&(Md(f),r.setAnchorCellForSelection(l));const d=()=>{o.removeEventListener("mouseup",d),o.removeEventListener("mousemove",p)},p=h=>{const m=fb(h.target);m===null||r.anchorX===m.x&&r.anchorY===m.y||(h.preventDefault(),r.setFocusCellForSelection(m))};o.addEventListener("mouseup",d),o.addEventListener("mousemove",p)},0)});const i=f=>{f.button===0&&n.update(()=>{const l=st(),d=f.target;rr(l)&&l.tableKey===r.tableNodeKey&&s.contains(d)&&r.clearHighlight()})};o.addEventListener("mousedown",i),r.listenersToRemove.add(()=>o.removeEventListener("mousedown",i)),r.listenersToRemove.add(n.registerCommand(Gp,f=>Pd(n,f,"down",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(Yp,f=>Pd(n,f,"up",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(lc,f=>Pd(n,f,"backward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(cc,f=>Pd(n,f,"forward",c,r),Ho)),r.listenersToRemove.add(n.registerCommand(hd,f=>{const l=st();if(rr(l)){const d=dn(l.focus.getNode(),pn);if(pn(d))return Md(f),d.selectEnd(),!0}return!1},Ho)),[Qs,Zs,Yr].forEach(f=>{r.listenersToRemove.add(n.registerCommand(f,(l=>()=>{const d=st();if(!rl(d,c))return!1;if(rr(d))return r.clearText(),!0;if(at(d)){const p=dn(d.anchor.getNode(),_=>pn(_));if(!pn(p))return!1;const h=d.anchor.getNode(),m=d.focus.getNode(),g=c.isParentOf(h),y=c.isParentOf(m);if(g&&!y||y&&!g)return r.clearText(),!0;const b=dn(d.anchor.getNode(),_=>Rt(_)),v=b&&dn(b,_=>Rt(_)&&pn(_.getParent()));if(!Rt(v)||!Rt(b))return!1;if(l===Zs&&v.getPreviousSibling()===null)return!0;if((l===Yr||l===Qs)&&d.isCollapsed()&&d.anchor.offset===0&&b!==v){const _=b.getChildren(),w=An();return _.forEach(x=>w.append(x)),b.replace(w),b.getWritable().__parent=p.getKey(),!0}}return!1})(f),mr))});const u=f=>{const l=st();if(!rl(l,c))return!1;if(rr(l))return f.preventDefault(),f.stopPropagation(),r.clearText(),!0;if(at(l)){const d=dn(l.anchor.getNode(),p=>pn(p));if(!pn(d))return!1}return!1};function a(f){const l=c.getCordsFromCellNode(f,r.table);return c.getDOMCellFromCordsOrThrow(l.x,l.y,r.table)}return r.listenersToRemove.add(n.registerCommand(Va,u,mr)),r.listenersToRemove.add(n.registerCommand(Ga,u,mr)),r.listenersToRemove.add(n.registerCommand(Ni,f=>{const l=st();if(!rl(l,c))return!1;if(rr(l))return r.formatCells(f),!0;if(at(l)){const d=dn(l.anchor.getNode(),p=>pn(p));if(!pn(d))return!1}return!1},mr)),r.listenersToRemove.add(n.registerCommand(ea,f=>{const l=st();if(!rr(l)||!rl(l,c))return!1;const d=l.anchor.getNode(),p=l.focus.getNode();if(!pn(d)||!pn(p))return!1;const[h,m,g]=sa(c,d,p),y=Math.max(m.startRow,g.startRow),b=Math.max(m.startColumn,g.startColumn),v=Math.min(m.startRow,g.startRow),_=Math.min(m.startColumn,g.startColumn);for(let w=v;w<=y;w++)for(let x=_;x<=b;x++){const S=h[w][x].cell;S.setFormat(f);const E=S.getChildren();for(let O=0;O<E.length;O++){const j=E[O];Rt(j)&&!j.isInline()&&j.setFormat(f)}}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ic,f=>{const l=st();if(!rl(l,c))return!1;if(rr(l))return r.clearHighlight(),!1;if(at(l)){const d=dn(l.anchor.getNode(),p=>pn(p));if(!pn(d))return!1}return!1},mr)),e&&r.listenersToRemove.add(n.registerCommand(_S,f=>{const l=st();if(!at(l)||!l.isCollapsed()||!rl(l,c))return!1;const d=gb(l.anchor.getNode());if(d===null)return!1;Md(f);const p=c.getCordsFromCellNode(d,r.table);return hE(r,c,p.x,p.y,f.shiftKey?"backward":"forward"),!0},mr)),r.listenersToRemove.add(n.registerCommand(yS,f=>c.isSelected(),Ho)),r.listenersToRemove.add(n.registerCommand(th,f=>{const{nodes:l,selection:d}=f,p=d.getStartEndPoints(),h=rr(d),m=at(d)&&dn(d.anchor.getNode(),J=>pn(J))!==null&&dn(d.focus.getNode(),J=>pn(J))!==null||h;if(l.length!==1||!wo(l[0])||!m||p===null)return!1;const[g]=p,y=l[0],b=y.getChildren(),v=y.getFirstChildOrThrow().getChildrenSize(),_=y.getChildrenSize(),w=dn(g.getNode(),J=>pn(J)),x=w&&dn(w,J=>br(J)),S=x&&dn(x,J=>wo(J));if(!pn(w)||!br(x)||!wo(S))return!1;const E=x.getIndexWithinParent(),O=Math.min(S.getChildrenSize()-1,E+_-1),j=w.getIndexWithinParent(),A=Math.min(x.getChildrenSize()-1,j+v-1),T=Math.min(j,A),I=Math.min(E,O),k=Math.max(j,A),$=Math.max(E,O),H=S.getChildren();let U,D,W=0;for(let J=I;J<=$;J++){const M=H[J];if(!br(M))return!1;const z=b[W];if(!br(z))return!1;const V=M.getChildren(),G=z.getChildren();let F=0;for(let K=T;K<=k;K++){const N=V[K];if(!pn(N))return!1;const R=G[F];if(!pn(R))return!1;J===I&&K===T?U=N.getKey():J===$&&K===k&&(D=N.getKey());const L=N.getChildren();R.getChildren().forEach(B=>{zt(B)&&An().append(B),N.append(B)}),L.forEach(B=>B.remove()),F++}W++}if(U&&D){const J=Rh();J.set(l[0].getKey(),U,D),kr(J)}return!0},mr)),r.listenersToRemove.add(n.registerCommand(ai,()=>{const f=st(),l=Ys();if(at(f)){const{anchor:d,focus:p}=f,h=d.getNode(),m=p.getNode(),g=gb(h),y=gb(m),b=!(!g||!c.is(mb(g))),v=!(!y||!c.is(mb(y))),_=b!==v,w=b&&v,x=f.isBackward();if(_){const S=f.clone();S.focus.set(c.getKey(),x?0:c.getChildrenSize(),"element"),kr(S),pE(n,r)}else w&&(g.is(y)||(r.setAnchorCellForSelection(a(g)),r.setFocusCellForSelection(a(y),!0)))}return f&&!f.is(l)&&(rr(f)||rr(l))&&r.tableSelection&&!r.tableSelection.is(l)?(rr(f)&&f.tableKey===r.tableNodeKey?r.updateTableTableSelection(f):!rr(f)&&rr(l)&&l.tableKey===r.tableNodeKey&&r.updateTableTableSelection(null),!1):(r.hasHijackedSelectionStyles&&!c.isSelected()?function(d,p){p.enableHighlightStyle(),pb(p.table,h=>{const m=h.elem;h.highlighted=!1,mE(d,h),m.getAttribute("style")||m.removeAttribute("style")})}(n,r):!r.hasHijackedSelectionStyles&&c.isSelected()&&pE(n,r),!1)},mr)),r}function JD(c){return c[fE]}function fb(c){let t=c;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function Nc(c){const t=[],n={columns:0,domRows:t,rows:0};let e=c.firstChild,s=0,r=0;for(t.length=0;e!=null;){const o=e.nodeName;if(o==="TD"||o==="TH"){const a={elem:e,hasBackgroundColor:e.style.backgroundColor!=="",highlighted:!1,x:s,y:r};e._cell=a;let f=t[r];f===void 0&&(f=t[r]=[]),f[s]=a}else{const a=e.firstChild;if(a!=null){e=a;continue}}const i=e.nextSibling;if(i!=null){s++,e=i;continue}const u=e.parentNode;if(u!=null){const a=u.nextSibling;if(a==null)break;r++,s=0,e=a}}return n.columns=s+1,n.rows=r+1,n}function jh(c,t,n){const e=new Set(n?n.getNodes():[]);pb(t,(s,r)=>{const o=s.elem;e.has(r)?(s.highlighted=!0,gE(c,s)):(s.highlighted=!1,mE(c,s),o.getAttribute("style")||o.removeAttribute("style"))})}function pb(c,t){const{domRows:n}=c;for(let e=0;e<n.length;e++){const s=n[e];if(s)for(let r=0;r<s.length;r++){const o=s[r];if(!o)continue;const i=xr(o.elem);i!==null&&t(o,i,{x:r,y:e})}}}function pE(c,t){t.disableHighlightStyle(),pb(t.table,n=>{n.highlighted=!0,gE(c,n)})}const hE=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)?Dh(t.getCellNodeFromCordsOrThrow(n+(r?1:-1),e,c.table),r):e!==(r?c.table.rows-1:0)?Dh(t.getCellNodeFromCordsOrThrow(r?0:c.table.columns-1,e+(r?1:-1),c.table),r):r?t.selectNext():t.selectPrevious(),!0;case"up":return e!==0?Dh(t.getCellNodeFromCordsOrThrow(n,e-1,c.table),!1):t.selectPrevious(),!0;case"down":return e!==c.table.rows-1?Dh(t.getCellNodeFromCordsOrThrow(n,e+1,c.table),!0):t.selectNext(),!0;default:return!1}},VD=(c,t,n,e,s)=>{const r=s==="forward";switch(s){case"backward":case"forward":return n!==(r?c.table.columns-1:0)&&c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n+(r?1:-1),e,c.table)),!0;case"up":return e!==0&&(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e-1,c.table)),!0);case"down":return e!==c.table.rows-1&&(c.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,e+1,c.table)),!0);default:return!1}};function rl(c,t){if(at(c)||rr(c)){const n=t.isParentOf(c.anchor.getNode()),e=t.isParentOf(c.focus.getNode());return n&&e}return!1}function Dh(c,t){t?c.selectStart():c.selectEnd()}const hb="172,206,247";function gE(c,t){const n=t.elem,e=xr(n);pn(e)||Pn(131),e.getBackgroundColor()===null?n.style.setProperty("background-color",`rgb(${hb})`):n.style.setProperty("background-image",`linear-gradient(to right, rgba(${hb},0.85), rgba(${hb},0.85))`),n.style.setProperty("caret-color","transparent")}function mE(c,t){const n=t.elem,e=xr(n);pn(e)||Pn(131),e.getBackgroundColor()===null&&n.style.removeProperty("background-color"),n.style.removeProperty("background-image"),n.style.removeProperty("caret-color")}function gb(c){const t=dn(c,pn);return pn(t)?t:null}function mb(c){const t=dn(c,wo);return wo(t)?t:null}function Pd(c,t,n,e,s){const r=st();if(!rl(r,e))return!1;if(at(r)&&r.isCollapsed()){if(n==="backward"||n==="forward")return!1;const{anchor:o,focus:i}=r,u=dn(o.getNode(),pn),a=dn(i.getNode(),pn);if(!pn(u)||!u.is(a))return!1;const f=mb(u);if(f!==e&&f!=null){const y=c.getElementByKey(f.getKey());if(y!=null)return s.table=Nc(y),Pd(c,t,n,f,s)}const l=c.getElementByKey(u.__key),d=c.getElementByKey(o.key);if(d==null||l==null)return!1;let p;if(o.type==="element")p=d.getBoundingClientRect();else{const y=window.getSelection();if(y===null||y.rangeCount===0)return!1;p=y.getRangeAt(0).getBoundingClientRect()}const h=n==="up"?u.getFirstChild():u.getLastChild();if(h==null)return!1;const m=c.getElementByKey(h.__key);if(m==null)return!1;const g=m.getBoundingClientRect();if(n==="up"?g.top>p.top-p.height:p.bottom+p.height>g.bottom){Md(t);const y=e.getCordsFromCellNode(u,s.table);if(!t.shiftKey)return hE(s,e,y.x,y.y,n);{const b=e.getDOMCellFromCordsOrThrow(y.x,y.y,s.table);s.setAnchorCellForSelection(b),s.setFocusCellForSelection(b,!0)}return!0}}else if(rr(r)){const{anchor:o,focus:i}=r,u=dn(o.getNode(),pn),a=dn(i.getNode(),pn),[f]=r.getNodes(),l=c.getElementByKey(f.getKey());if(!pn(u)||!pn(a)||!wo(f)||l==null)return!1;s.updateTableTableSelection(r);const d=Nc(l),p=e.getCordsFromCellNode(u,d),h=e.getDOMCellFromCordsOrThrow(p.x,p.y,d);if(s.setAnchorCellForSelection(h),Md(t),t.shiftKey){const m=e.getCordsFromCellNode(a,d);return VD(s,f,m.x,m.y,n)}return a.selectEnd(),!0}return!1}function Md(c){c.preventDefault(),c.stopImmediatePropagation(),c.stopPropagation()}class Id extends po{static getType(){return"table"}static clone(t){return new Id(t.__key)}static importDOM(){return{table:t=>({conversion:YD,priority:1})}}static importJSON(t){return Lh()}constructor(t){super(t)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(t,n){const e=document.createElement("table");return wr(e,t.theme.table),e}updateDOM(){return!1}exportDOM(t){return{...super.exportDOM(t),after:n=>{if(n){const e=n.cloneNode(),s=document.createElement("colgroup"),r=document.createElement("tbody");oa(n)&&r.append(...n.children);const o=this.getFirstChildOrThrow();if(!br(o))throw new Error("Expected to find row node.");const i=o.getChildrenSize();for(let u=0;u<i;u++){const a=document.createElement("col");s.append(a)}return e.replaceChildren(s,r),e}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:e,domRows:s}=n;for(let r=0;r<e;r++){const o=s[r];if(o==null)continue;const i=o.findIndex(u=>{if(!u)return;const{elem:a}=u;return xr(a)===t});if(i!==-1)return{x:i,y:r}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,e){const{domRows:s}=e,r=s[n];if(r==null)return null;const o=r[t];return o??null}getDOMCellFromCordsOrThrow(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(!s)throw new Error("Cell not found at cords.");return s}getCellNodeFromCords(t,n,e){const s=this.getDOMCellFromCords(t,n,e);if(s==null)return null;const r=xr(s.elem);return pn(r)?r:null}getCellNodeFromCordsOrThrow(t,n,e){const s=this.getCellNodeFromCords(t,n,e);if(!s)throw new Error("Node at cords not TableCellNode.");return s}canSelectBefore(){return!0}canIndent(){return!1}}function GD(c,t){const n=c.getElementByKey(t.getKey());if(n==null)throw new Error("Table Element Not Found");return Nc(n)}function YD(c){return{node:Lh()}}function Lh(){return Gr(new Id)}function wo(c){return c instanceof Id}const XD=Object.freeze(Object.defineProperty({__proto__:null,$computeTableMap:sa,$createTableCellNode:Wo,$createTableNode:Lh,$createTableNodeWithDimensions:MD,$createTableRowNode:nl,$createTableSelection:Rh,$deleteTableColumn:zD,$deleteTableColumn__EXPERIMENTAL:HD,$deleteTableRow__EXPERIMENTAL:UD,$getElementForTableNode:GD,$getNodeTriplet:Mi,$getTableCellNodeFromLexicalNode:ID,$getTableCellNodeRect:db,$getTableColumnIndexFromTableCellNode:jD,$getTableNodeFromLexicalNodeOrThrow:lb,$getTableRowIndexFromTableCellNode:RD,$getTableRowNodeFromTableCellNodeOrThrow:ab,$insertTableColumn:FD,$insertTableColumn__EXPERIMENTAL:$D,$insertTableRow:LD,$insertTableRow__EXPERIMENTAL:BD,$isTableCellNode:pn,$isTableNode:wo,$isTableRowNode:br,$isTableSelection:rr,$removeTableRowAtIndex:DD,$unmergeCell:KD,INSERT_TABLE_COMMAND:kD,TableCellHeaderStates:Kn,TableCellNode:Tc,TableNode:Id,TableObserver:dE,TableRowNode:kd,applyTableHandlers:qD,getDOMCellFromTarget:fb,getTableObserverFromTableElement:JD},Symbol.toStringTag,{value:"Module"})),ui=process.env.NODE_ENV==="development"?ND:XD,ZD=ui.$createTableCellNode,QD=ui.$createTableRowNode,e3=ui.$createTableSelection,t3=ui.$getTableColumnIndexFromTableCellNode,n3=ui.$isTableCellNode,r3=ui.$isTableNode,o3=ui.$isTableRowNode,i3=ui.$isTableSelection,s3=ui.TableCellNode,a3=ui.TableNode,l3=ui.TableRowNode,yE=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],bE=yE[Math.floor(Math.random()*yE.length)],vE=St.createContext({clientID:0,color:bE[1],isCollabActive:!1,name:bE[0],yjsDocMap:new Map});function c3(c,t){const n=St.useContext(vE);return c!=null&&(n.name=c),t!=null&&(n.color=t),n}const u3=Object.freeze(Object.defineProperty({__proto__:null,CollaborationContext:vE,useCollaborationContext:c3},Symbol.toStringTag,{value:"Module"})),_E=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],xE=_E[Math.floor(Math.random()*_E.length)],wE=St.createContext({clientID:0,color:xE[1],isCollabActive:!1,name:xE[0],yjsDocMap:new Map});function d3(c,t){const n=St.useContext(wE);return c!=null&&(n.name=c),t!=null&&(n.color=t),n}const f3=Object.freeze(Object.defineProperty({__proto__:null,CollaborationContext:wE,useCollaborationContext:d3},Symbol.toStringTag,{value:"Module"})),p3=(process.env.NODE_ENV==="development"?u3:f3).useCollaborationContext;var h3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function g3({onClear:c}){const[t]=pr();return h3(()=>t.registerCommand(fd,n=>(t.update(()=>{if(c==null){const e=Un(),s=st(),r=An();e.clear(),e.append(r),s!==null&&r.select()}else c()}),!0),Ct),[t,c]),null}const m3=Object.freeze(Object.defineProperty({__proto__:null,ClearEditorPlugin:g3},Symbol.toStringTag,{value:"Module"}));var y3=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function b3({onClear:c}){const[t]=pr();return y3(()=>t.registerCommand(fd,n=>(t.update(()=>{if(c==null){const e=Un(),s=st(),r=An();e.clear(),e.append(r),s!==null&&r.select()}else c()}),!0),Ct),[t,c]),null}const v3=Object.freeze(Object.defineProperty({__proto__:null,ClearEditorPlugin:b3},Symbol.toStringTag,{value:"Module"})),_3=(process.env.NODE_ENV==="development"?m3:v3).ClearEditorPlugin;function yb(c,t){return yb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,s){return e.__proto__=s,e},yb(c,t)}function x3(c,t){c.prototype=Object.create(t.prototype),c.prototype.constructor=c,yb(c,t)}var w3=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(e,s){return!Object.is(e,n[s])})},SE={error:null},S3=function(c){x3(t,c);function t(){for(var e,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return e=c.call.apply(c,[this].concat(r))||this,e.state=SE,e.resetErrorBoundary=function(){for(var i,u=arguments.length,a=new Array(u),f=0;f<u;f++)a[f]=arguments[f];e.props.onReset==null||(i=e.props).onReset.apply(i,a),e.reset()},e}t.getDerivedStateFromError=function(s){return{error:s}};var n=t.prototype;return n.reset=function(){this.setState(SE)},n.componentDidCatch=function(s,r){var o,i;(o=(i=this.props).onError)==null||o.call(i,s,r)},n.componentDidUpdate=function(s,r){var o=this.state.error,i=this.props.resetKeys;if(o!==null&&r.error!==null&&w3(s.resetKeys,i)){var u,a;(u=(a=this.props).onResetKeysChange)==null||u.call(a,s.resetKeys,i),this.reset()}},n.render=function(){var s=this.state.error,r=this.props,o=r.fallbackRender,i=r.FallbackComponent,u=r.fallback;if(s!==null){var a={error:s,resetErrorBoundary:this.resetErrorBoundary};if(gn.isValidElement(u))return u;if(typeof o=="function")return o(a);if(i)return gn.createElement(i,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(gn.Component);function C3({children:c,onError:t}){return gn.createElement(S3,{fallback:gn.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},c)}const E3=Object.freeze(Object.defineProperty({__proto__:null,default:C3},Symbol.toStringTag,{value:"Module"}));function bb(c,t){return bb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},bb(c,t)}var CE={error:null},O3=function(c){var t,n;function e(){for(var r,o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];return(r=c.call.apply(c,[this].concat(i))||this).state=CE,r.resetErrorBoundary=function(){for(var a,f=arguments.length,l=new Array(f),d=0;d<f;d++)l[d]=arguments[d];r.props.onReset==null||(a=r.props).onReset.apply(a,l),r.reset()},r}n=c,(t=e).prototype=Object.create(n.prototype),t.prototype.constructor=t,bb(t,n),e.getDerivedStateFromError=function(r){return{error:r}};var s=e.prototype;return s.reset=function(){this.setState(CE)},s.componentDidCatch=function(r,o){var i,u;(i=(u=this.props).onError)==null||i.call(u,r,o)},s.componentDidUpdate=function(r,o){var i,u,a,f,l=this.state.error,d=this.props.resetKeys;l!==null&&o.error!==null&&((a=r.resetKeys)===void 0&&(a=[]),(f=d)===void 0&&(f=[]),a.length!==f.length||a.some(function(p,h){return!Object.is(p,f[h])}))&&((i=(u=this.props).onResetKeysChange)==null||i.call(u,r.resetKeys,d),this.reset())},s.render=function(){var r=this.state.error,o=this.props,i=o.fallbackRender,u=o.FallbackComponent,a=o.fallback;if(r!==null){var f={error:r,resetErrorBoundary:this.resetErrorBoundary};if(gn.isValidElement(a))return a;if(typeof i=="function")return i(f);if(u)return gn.createElement(u,f);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(gn.Component);function T3({children:c,onError:t}){return gn.createElement(O3,{fallback:gn.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},c)}const N3=Object.freeze(Object.defineProperty({__proto__:null,default:T3},Symbol.toStringTag,{value:"Module"})),k3=(process.env.NODE_ENV==="development"?E3:N3).default;var A3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function P3({ignoreHistoryMergeTagChange:c=!0,ignoreSelectionChange:t=!1,onChange:n}){const[e]=pr();return A3(()=>{if(n)return e.registerUpdateListener(({editorState:s,dirtyElements:r,dirtyLeaves:o,prevEditorState:i,tags:u})=>{t&&r.size===0&&o.size===0||c&&u.has("history-merge")||i.isEmpty()||n(s,e,u)})},[e,c,t,n]),null}const M3=Object.freeze(Object.defineProperty({__proto__:null,OnChangePlugin:P3},Symbol.toStringTag,{value:"Module"}));var I3=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function R3({ignoreHistoryMergeTagChange:c=!0,ignoreSelectionChange:t=!1,onChange:n}){const[e]=pr();return I3(()=>{if(n)return e.registerUpdateListener(({editorState:s,dirtyElements:r,dirtyLeaves:o,prevEditorState:i,tags:u})=>{t&&r.size===0&&o.size===0||c&&u.has("history-merge")||i.isEmpty()||n(s,e,u)})},[e,c,t,n]),null}const j3=Object.freeze(Object.defineProperty({__proto__:null,OnChangePlugin:R3},Symbol.toStringTag,{value:"Module"})),D3=(process.env.NODE_ENV==="development"?M3:j3).OnChangePlugin,kc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L3=kc&&"documentMode"in document?document.documentMode:null,B3=kc&&"InputEvent"in window&&!L3?"getTargetRanges"in new window.InputEvent("input"):!1,F3=kc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),$3=kc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,z3=kc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),U3=kc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!z3;function EE(c,t){t.update(()=>{if(c!==null){const n=Zr(c,KeyboardEvent)?null:c.clipboardData,e=st();if(e!==null&&n!=null){c.preventDefault();const s=HC(t);s!==null&&n.setData("text/html",s),n.setData("text/plain",e.getTextContent())}}})}function H3(c,t){c.preventDefault(),t.update(()=>{const n=st(),{clipboardData:e}=c;e!=null&&at(n)&&_h(e,n)},{tag:"paste"})}function K3(c,t){EE(c,t),t.update(()=>{const n=st();at(n)&&n.removeText()})}function W3(c){return Xr(c.registerCommand(Yr,n=>{const e=st();return at(e)?(e.deleteCharacter(n),!0):!1},Ct),c.registerCommand(Qs,n=>{const e=st();return at(e)?(e.deleteWord(n),!0):!1},Ct),c.registerCommand(Zs,n=>{const e=st();return at(e)?(e.deleteLine(n),!0):!1},Ct),c.registerCommand(ic,n=>{const e=st();if(!at(e))return!1;if(typeof n=="string")e.insertText(n);else{const s=n.dataTransfer;if(s!=null)_h(s,e);else{const r=n.data;r&&e.insertText(r)}}return!0},Ct),c.registerCommand(eh,()=>{const n=st();return at(n)?(n.removeText(),!0):!1},Ct),c.registerCommand(ta,n=>{const e=st();return at(e)?(e.insertLineBreak(n),!0):!1},Ct),c.registerCommand(ac,()=>{const n=st();return at(n)?(n.insertLineBreak(),!0):!1},Ct),c.registerCommand(lc,n=>{const e=st();if(!at(e))return!1;const s=n,r=s.shiftKey;return ra(e,!0)?(s.preventDefault(),na(e,r,!0),!0):!1},Ct),c.registerCommand(cc,n=>{const e=st();if(!at(e))return!1;const s=n,r=s.shiftKey;return ra(e,!1)?(s.preventDefault(),na(e,r,!1),!0):!1},Ct),c.registerCommand(Va,n=>{const e=st();return at(e)?(n.preventDefault(),c.dispatchCommand(Yr,!0)):!1},Ct),c.registerCommand(Ga,n=>{const e=st();return at(e)?(n.preventDefault(),c.dispatchCommand(Yr,!1)):!1},Ct),c.registerCommand(Xp,n=>{const e=st();if(!at(e))return!1;if(n!==null){if(($3||F3||U3)&&B3)return!1;n.preventDefault()}return c.dispatchCommand(ta,!1)},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,n=>{const e=st();return at(e)?(EE(n,c),!0):!1},Ct),c.registerCommand(pd,n=>{const e=st();return at(e)?(K3(n,c),!0):!1},Ct),c.registerCommand(gd,n=>{const e=st();return at(e)?(H3(n,c),!0):!1},Ct),c.registerCommand(Vp,n=>{const e=st();return at(e)?(n.preventDefault(),!0):!1},Ct),c.registerCommand(Jp,n=>{const e=st();return at(e)?(n.preventDefault(),!0):!1},Ct))}const q3=Object.freeze(Object.defineProperty({__proto__:null,registerPlainText:W3},Symbol.toStringTag,{value:"Module"})),Ac=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,J3=Ac&&"documentMode"in document?document.documentMode:null,V3=!(!Ac||!("InputEvent"in window)||J3)&&"getTargetRanges"in new window.InputEvent("input"),G3=Ac&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Y3=Ac&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,X3=Ac&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Z3=Ac&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!X3;function OE(c,t){t.update(()=>{if(c!==null){const n=Zr(c,KeyboardEvent)?null:c.clipboardData,e=st();if(e!==null&&n!=null){c.preventDefault();const s=HC(t);s!==null&&n.setData("text/html",s),n.setData("text/plain",e.getTextContent())}}})}function Q3(c){return Xr(c.registerCommand(Yr,t=>{const n=st();return!!at(n)&&(n.deleteCharacter(t),!0)},Ct),c.registerCommand(Qs,t=>{const n=st();return!!at(n)&&(n.deleteWord(t),!0)},Ct),c.registerCommand(Zs,t=>{const n=st();return!!at(n)&&(n.deleteLine(t),!0)},Ct),c.registerCommand(ic,t=>{const n=st();if(!at(n))return!1;if(typeof t=="string")n.insertText(t);else{const e=t.dataTransfer;if(e!=null)_h(e,n);else{const s=t.data;s&&n.insertText(s)}}return!0},Ct),c.registerCommand(eh,()=>{const t=st();return!!at(t)&&(t.removeText(),!0)},Ct),c.registerCommand(ta,t=>{const n=st();return!!at(n)&&(n.insertLineBreak(t),!0)},Ct),c.registerCommand(ac,()=>{const t=st();return!!at(t)&&(t.insertLineBreak(),!0)},Ct),c.registerCommand(lc,t=>{const n=st();if(!at(n))return!1;const e=t,s=e.shiftKey;return!!ra(n,!0)&&(e.preventDefault(),na(n,s,!0),!0)},Ct),c.registerCommand(cc,t=>{const n=st();if(!at(n))return!1;const e=t,s=e.shiftKey;return!!ra(n,!1)&&(e.preventDefault(),na(n,s,!1),!0)},Ct),c.registerCommand(Va,t=>{const n=st();return!!at(n)&&(t.preventDefault(),c.dispatchCommand(Yr,!0))},Ct),c.registerCommand(Ga,t=>{const n=st();return!!at(n)&&(t.preventDefault(),c.dispatchCommand(Yr,!1))},Ct),c.registerCommand(Xp,t=>{const n=st();if(!at(n))return!1;if(t!==null){if((Y3||G3||Z3)&&V3)return!1;t.preventDefault()}return c.dispatchCommand(ta,!1)},Ct),c.registerCommand(nh,()=>(Wp(),!0),Ct),c.registerCommand(sc,t=>{const n=st();return!!at(n)&&(OE(t,c),!0)},Ct),c.registerCommand(pd,t=>{const n=st();return!!at(n)&&(function(e,s){OE(e,s),s.update(()=>{const r=st();at(r)&&r.removeText()})}(t,c),!0)},Ct),c.registerCommand(gd,t=>{const n=st();return!!at(n)&&(function(e,s){e.preventDefault(),s.update(()=>{const r=st(),{clipboardData:o}=e;o!=null&&at(r)&&_h(o,r)},{tag:"paste"})}(t,c),!0)},Ct),c.registerCommand(Vp,t=>{const n=st();return!!at(n)&&(t.preventDefault(),!0)},Ct),c.registerCommand(Jp,t=>{const n=st();return!!at(n)&&(t.preventDefault(),!0)},Ct))}const e4=Object.freeze(Object.defineProperty({__proto__:null,registerPlainText:Q3},Symbol.toStringTag,{value:"Module"})),TE=(process.env.NODE_ENV==="development"?q3:e4).registerPlainText;var vb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?St.useLayoutEffect:St.useEffect;function NE(c){return c.getEditorState().read(yh(c.isComposing()))}function t4(c){const[t,n]=St.useState(()=>NE(c));return vb(()=>{function e(){const s=NE(c);n(s)}return e(),Xr(c.registerUpdateListener(()=>{e()}),c.registerEditableListener(()=>{e()}))},[c]),t}function n4(c,t){const[n,e]=St.useState(()=>c.getDecorators());return vb(()=>c.registerDecoratorListener(s=>{oo.flushSync(()=>{e(s)})}),[c]),St.useEffect(()=>{e(c.getDecorators())},[c]),St.useMemo(()=>{const s=[],r=Object.keys(n);for(let o=0;o<r.length;o++){const i=r[o],u=gn.createElement(t,{onError:f=>c._onError(f)},gn.createElement(St.Suspense,{fallback:null},n[i])),a=c.getElementByKey(i);a!==null&&s.push(oo.createPortal(u,a,i))}return s},[t,n,c])}function r4(c){vb(()=>Xr(TE(c),bh(c)),[c])}function o4({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=n4(e,n);return r4(e),gn.createElement(gn.Fragment,null,c,gn.createElement(i4,{content:t}),s)}function i4({content:c}){const[t]=pr(),n=t4(t),e=mh();return n?typeof c=="function"?c(e):c:null}const s4=Object.freeze(Object.defineProperty({__proto__:null,PlainTextPlugin:o4},Symbol.toStringTag,{value:"Module"}));var _b=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?St.useLayoutEffect:St.useEffect;function kE(c){return c.getEditorState().read(yh(c.isComposing()))}function a4({contentEditable:c,placeholder:t,ErrorBoundary:n}){const[e]=pr(),s=function(r,o){const[i,u]=St.useState(()=>r.getDecorators());return _b(()=>r.registerDecoratorListener(a=>{oo.flushSync(()=>{u(a)})}),[r]),St.useEffect(()=>{u(r.getDecorators())},[r]),St.useMemo(()=>{const a=[],f=Object.keys(i);for(let l=0;l<f.length;l++){const d=f[l],p=gn.createElement(o,{onError:m=>r._onError(m)},gn.createElement(St.Suspense,{fallback:null},i[d])),h=r.getElementByKey(d);h!==null&&a.push(oo.createPortal(p,h,d))}return a},[o,i,r])}(e,n);return function(r){_b(()=>Xr(TE(r),bh(r)),[r])}(e),gn.createElement(gn.Fragment,null,c,gn.createElement(l4,{content:t}),s)}function l4({content:c}){const[t]=pr(),n=function(s){const[r,o]=St.useState(()=>kE(s));return _b(()=>{function i(){const u=kE(s);o(u)}return i(),Xr(s.registerUpdateListener(()=>{i()}),s.registerEditableListener(()=>{i()}))},[s]),r}(t),e=mh();return n?typeof c=="function"?c(e):c:null}const c4=Object.freeze(Object.defineProperty({__proto__:null,PlainTextPlugin:a4},Symbol.toStringTag,{value:"Module"})),u4=(process.env.NODE_ENV==="development"?s4:c4).PlainTextPlugin;var d4={967:(c,t,n)=>{const e=["docId","username","apiKey","domain","hooks","editorInstanceHooks","appServer","demo"];function s(p,h){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(p);h&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(p,y).enumerable})),m.push.apply(m,g)}return m}function r(p){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?s(Object(m),!0).forEach(function(g){o(p,g,m[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):s(Object(m)).forEach(function(g){Object.defineProperty(p,g,Object.getOwnPropertyDescriptor(m,g))})}return p}function o(p,h,m){return(h=function(g){var y=function(b,v){if(typeof b!="object"||!b)return b;var _=b[Symbol.toPrimitive];if(_!==void 0){var w=_.call(b,"string");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}(g);return typeof y=="symbol"?y:y+""}(h))in p?Object.defineProperty(p,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[h]=m,p}let i;i=n(668);let u=null;t.conf=function(p){p.autoStart=!1,u&&u.init(p)};const a=async function(p){if(u)return u.start(p)};t.start=a;const f=function(p){u&&(u.stop(),u=null)};t.stop=f;const l=function(p,h){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(u)return u.diff({state1:p,state2:h,config:m})};t.diff=l;const d=function(){if(u)return u.sync(...arguments)};t.sync=d,t.initSync=function(p){return u?u.initSync(p):p},c.exports={start:a,sync:d,diff:l,stop:f,createConfig:p=>{let{docId:h,username:m,apiKey:g,domain:y,hooks:b,editorInstanceHooks:v,appServer:_={},demo:w=!1}=p;return r(r({},function(x,S){if(x==null)return{};var E,O,j=function(T,I){if(T==null)return{};var k={};for(var $ in T)if({}.hasOwnProperty.call(T,$)){if(I.indexOf($)>=0)continue;k[$]=T[$]}return k}(x,S);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(x);for(O=0;O<A.length;O++)E=A[O],S.indexOf(E)>=0||{}.propertyIsEnumerable.call(x,E)&&(j[E]=x[E])}return j}(p,e)),{},{docId:h,username:m,apiKey:g,autoStart:!0,demo:w,domain:y,hooks:b,editorInstance:r({type:"lexical"},v),app:"json",json:{keyNames:{default:"codoxId"},filters:{version:!0},appServer:_,semantics:{paths:{"state.root.children.children.text":"MERGE","state.root.children.children.children.text":"MERGE"},string:"MERGE"}}})},get instance(){return u},createNewInstance:()=>{u=new i}}},668:(c,t,n)=>{c.exports=function e(s,r,o){function i(f,l){if(!r[f]){if(!s[f]){var d=void 0;if(!l&&d)return require(f,!0);if(u)return u(f,!0);throw(l=new Error("Cannot find module '"+f+"'")).code="MODULE_NOT_FOUND",l}d=r[f]={exports:{}},s[f][0].call(d.exports,function(p){return i(s[f][1][p]||p)},d,d.exports,e,s,r,o)}return r[f].exports}for(var u=void 0,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(e,s,r){s.exports=function(o,i){(i==null||i>o.length)&&(i=o.length);for(var u=0,a=new Array(i);u<i;u++)a[u]=o[u];return a},s.exports.__esModule=!0,s.exports.default=s.exports},{}],2:[function(e,s,r){s.exports=function(o){if(Array.isArray(o))return o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],3:[function(e,s,r){var o=e("./arrayLikeToArray.js");s.exports=function(i){if(Array.isArray(i))return o(i)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayLikeToArray.js":1}],4:[function(e,s,r){s.exports=function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],5:[function(e,s,r){s.exports=function(o,i){if(!(o instanceof i))throw new TypeError("Cannot call a class as a function")},s.exports.__esModule=!0,s.exports.default=s.exports},{}],6:[function(e,s,r){var o=e("./setPrototypeOf.js"),i=e("./isNativeReflectConstruct.js");function u(a,f,l){return i()?s.exports=u=Reflect.construct.bind():s.exports=u=function(d,p,h){var m=[null];return m.push.apply(m,p),p=new(Function.bind.apply(d,m)),h&&o(p,h.prototype),p},s.exports.__esModule=!0,s.exports.default=s.exports,u.apply(null,arguments)}s.exports=u,s.exports.__esModule=!0,s.exports.default=s.exports},{"./isNativeReflectConstruct.js":13,"./setPrototypeOf.js":19}],7:[function(e,s,r){function o(i,u){for(var a=0;a<u.length;a++){var f=u[a];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(i,f.key,f)}}s.exports=function(i,u,a){return u&&o(i.prototype,u),a&&o(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i},s.exports.__esModule=!0,s.exports.default=s.exports},{}],8:[function(e,s,r){s.exports=function(o,i,u){return i in o?Object.defineProperty(o,i,{value:u,enumerable:!0,configurable:!0,writable:!0}):o[i]=u,o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],9:[function(e,s,r){function o(i){return s.exports=o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(u){return u.__proto__||Object.getPrototypeOf(u)},s.exports.__esModule=!0,s.exports.default=s.exports,o(i)}s.exports=o,s.exports.__esModule=!0,s.exports.default=s.exports},{}],10:[function(e,s,r){var o=e("./setPrototypeOf.js");s.exports=function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&o(i,u)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./setPrototypeOf.js":19}],11:[function(e,s,r){s.exports=function(o){return o&&o.__esModule?o:{default:o}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],12:[function(e,s,r){s.exports=function(o){return Function.toString.call(o).indexOf("[native code]")!==-1},s.exports.__esModule=!0,s.exports.default=s.exports},{}],13:[function(e,s,r){s.exports=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],14:[function(e,s,r){s.exports=function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],15:[function(e,s,r){s.exports=function(o,i){var u=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(u!=null){var a,f,l=[],d=!0,p=!1;try{for(u=u.call(o);!(d=(a=u.next()).done)&&(l.push(a.value),!i||l.length!==i);d=!0);}catch(h){p=!0,f=h}finally{try{d||u.return==null||u.return()}finally{if(p)throw f}}return l}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],16:[function(e,s,r){s.exports=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
60
60
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],17:[function(e,s,r){s.exports=function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
61
61
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],18:[function(e,s,r){var o=e("./typeof.js").default,i=e("./assertThisInitialized.js");s.exports=function(u,a){if(a&&(o(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(u)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./assertThisInitialized.js":4,"./typeof.js":22}],19:[function(e,s,r){function o(i,u){return s.exports=o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,f){return a.__proto__=f,a},s.exports.__esModule=!0,s.exports.default=s.exports,o(i,u)}s.exports=o,s.exports.__esModule=!0,s.exports.default=s.exports},{}],20:[function(e,s,r){var o=e("./arrayWithHoles.js"),i=e("./iterableToArrayLimit.js"),u=e("./unsupportedIterableToArray.js"),a=e("./nonIterableRest.js");s.exports=function(f,l){return o(f)||i(f,l)||u(f,l)||a()},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayWithHoles.js":2,"./iterableToArrayLimit.js":15,"./nonIterableRest.js":16,"./unsupportedIterableToArray.js":23}],21:[function(e,s,r){var o=e("./arrayWithoutHoles.js"),i=e("./iterableToArray.js"),u=e("./unsupportedIterableToArray.js"),a=e("./nonIterableSpread.js");s.exports=function(f){return o(f)||i(f)||u(f)||a()},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayWithoutHoles.js":3,"./iterableToArray.js":14,"./nonIterableSpread.js":17,"./unsupportedIterableToArray.js":23}],22:[function(e,s,r){function o(i){return s.exports=o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},s.exports.__esModule=!0,s.exports.default=s.exports,o(i)}s.exports=o,s.exports.__esModule=!0,s.exports.default=s.exports},{}],23:[function(e,s,r){var o=e("./arrayLikeToArray.js");s.exports=function(i,u){if(i){if(typeof i=="string")return o(i,u);var a=Object.prototype.toString.call(i).slice(8,-1);return(a=a==="Object"&&i.constructor?i.constructor.name:a)==="Map"||a==="Set"?Array.from(i):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?o(i,u):void 0}},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayLikeToArray.js":1}],24:[function(e,s,r){var o=e("./getPrototypeOf.js"),i=e("./setPrototypeOf.js"),u=e("./isNativeFunction.js"),a=e("./construct.js");function f(l){var d=typeof Map=="function"?new Map:void 0;return s.exports=f=function(p){if(p===null||!u(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(d!==void 0){if(d.has(p))return d.get(p);d.set(p,h)}function h(){return a(p,arguments,o(this).constructor)}return h.prototype=Object.create(p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),i(h,p)},s.exports.__esModule=!0,s.exports.default=s.exports,f(l)}s.exports=f,s.exports.__esModule=!0,s.exports.default=s.exports},{"./construct.js":6,"./getPrototypeOf.js":9,"./isNativeFunction.js":12,"./setPrototypeOf.js":19}],25:[function(e,s,r){s.exports=function o(i,u){if(i===u)return!0;if(i&&u&&typeof i=="object"&&typeof u=="object"){if(i.constructor!==u.constructor)return!1;var a,f,l;if(Array.isArray(i)){if((a=i.length)!=u.length)return!1;for(f=a;f--!=0;)if(!o(i[f],u[f]))return!1;return!0}if(i.constructor===RegExp)return i.source===u.source&&i.flags===u.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===u.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===u.toString();if((a=(l=Object.keys(i)).length)!==Object.keys(u).length)return!1;for(f=a;f--!=0;)if(!Object.prototype.hasOwnProperty.call(u,l[f]))return!1;for(f=a;f--!=0;){var d=l[f];if(!o(i[d],u[d]))return!1}return!0}return i!=i&&u!=u}},{}],26:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return h.default}});var o=m(e("./v1.js")),i=m(e("./v3.js")),u=m(e("./v4.js")),a=m(e("./v5.js")),f=m(e("./nil.js")),l=m(e("./version.js")),d=m(e("./validate.js")),p=m(e("./stringify.js")),h=m(e("./parse.js"));function m(g){return g&&g.__esModule?g:{default:g}}},{"./nil.js":28,"./parse.js":29,"./stringify.js":33,"./v1.js":34,"./v3.js":35,"./v4.js":37,"./v5.js":38,"./validate.js":39,"./version.js":40}],27:[function(e,s,r){function o(p){return 14+(p+64>>>9<<4)+1}function i(p,h){var m=(65535&p)+(65535&h);return(p>>16)+(h>>16)+(m>>16)<<16|65535&m}function u(p,h,m,g,y,b){return i((h=i(i(h,p),i(g,b)))<<y|h>>>32-y,m)}function a(p,h,m,g,y,b,v){return u(h&m|~h&g,p,h,y,b,v)}function f(p,h,m,g,y,b,v){return u(h&g|m&~g,p,h,y,b,v)}function l(p,h,m,g,y,b,v){return u(h^m^g,p,h,y,b,v)}function d(p,h,m,g,y,b,v){return u(m^(h|~g),p,h,y,b,v)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=function(p){if(typeof p=="string"){const g=unescape(encodeURIComponent(p));p=new Uint8Array(g.length);for(let y=0;y<g.length;++y)p[y]=g.charCodeAt(y)}{var h=function(v,_){v[_>>5]|=128<<_%32,v[o(_)-1]=_;let w=1732584193,x=-271733879,S=-1732584194,E=271733878;for(let I=0;I<v.length;I+=16){var O=w,j=x,A=S,T=E;w=a(w,x,S,E,v[I],7,-680876936),E=a(E,w,x,S,v[I+1],12,-389564586),S=a(S,E,w,x,v[I+2],17,606105819),x=a(x,S,E,w,v[I+3],22,-1044525330),w=a(w,x,S,E,v[I+4],7,-176418897),E=a(E,w,x,S,v[I+5],12,1200080426),S=a(S,E,w,x,v[I+6],17,-1473231341),x=a(x,S,E,w,v[I+7],22,-45705983),w=a(w,x,S,E,v[I+8],7,1770035416),E=a(E,w,x,S,v[I+9],12,-1958414417),S=a(S,E,w,x,v[I+10],17,-42063),x=a(x,S,E,w,v[I+11],22,-1990404162),w=a(w,x,S,E,v[I+12],7,1804603682),E=a(E,w,x,S,v[I+13],12,-40341101),S=a(S,E,w,x,v[I+14],17,-1502002290),x=a(x,S,E,w,v[I+15],22,1236535329),w=f(w,x,S,E,v[I+1],5,-165796510),E=f(E,w,x,S,v[I+6],9,-1069501632),S=f(S,E,w,x,v[I+11],14,643717713),x=f(x,S,E,w,v[I],20,-373897302),w=f(w,x,S,E,v[I+5],5,-701558691),E=f(E,w,x,S,v[I+10],9,38016083),S=f(S,E,w,x,v[I+15],14,-660478335),x=f(x,S,E,w,v[I+4],20,-405537848),w=f(w,x,S,E,v[I+9],5,568446438),E=f(E,w,x,S,v[I+14],9,-1019803690),S=f(S,E,w,x,v[I+3],14,-187363961),x=f(x,S,E,w,v[I+8],20,1163531501),w=f(w,x,S,E,v[I+13],5,-1444681467),E=f(E,w,x,S,v[I+2],9,-51403784),S=f(S,E,w,x,v[I+7],14,1735328473),x=f(x,S,E,w,v[I+12],20,-1926607734),w=l(w,x,S,E,v[I+5],4,-378558),E=l(E,w,x,S,v[I+8],11,-2022574463),S=l(S,E,w,x,v[I+11],16,1839030562),x=l(x,S,E,w,v[I+14],23,-35309556),w=l(w,x,S,E,v[I+1],4,-1530992060),E=l(E,w,x,S,v[I+4],11,1272893353),S=l(S,E,w,x,v[I+7],16,-155497632),x=l(x,S,E,w,v[I+10],23,-1094730640),w=l(w,x,S,E,v[I+13],4,681279174),E=l(E,w,x,S,v[I],11,-358537222),S=l(S,E,w,x,v[I+3],16,-722521979),x=l(x,S,E,w,v[I+6],23,76029189),w=l(w,x,S,E,v[I+9],4,-640364487),E=l(E,w,x,S,v[I+12],11,-421815835),S=l(S,E,w,x,v[I+15],16,530742520),x=l(x,S,E,w,v[I+2],23,-995338651),w=d(w,x,S,E,v[I],6,-198630844),E=d(E,w,x,S,v[I+7],10,1126891415),S=d(S,E,w,x,v[I+14],15,-1416354905),x=d(x,S,E,w,v[I+5],21,-57434055),w=d(w,x,S,E,v[I+12],6,1700485571),E=d(E,w,x,S,v[I+3],10,-1894986606),S=d(S,E,w,x,v[I+10],15,-1051523),x=d(x,S,E,w,v[I+1],21,-2054922799),w=d(w,x,S,E,v[I+8],6,1873313359),E=d(E,w,x,S,v[I+15],10,-30611744),S=d(S,E,w,x,v[I+6],15,-1560198380),x=d(x,S,E,w,v[I+13],21,1309151649),w=d(w,x,S,E,v[I+4],6,-145523070),E=d(E,w,x,S,v[I+11],10,-1120210379),S=d(S,E,w,x,v[I+2],15,718787259),x=d(x,S,E,w,v[I+9],21,-343485551),w=i(w,O),x=i(x,j),S=i(S,A),E=i(E,T)}return[w,x,S,E]}(function(v){if(v.length===0)return[];const _=8*v.length,w=new Uint32Array(o(_));for(let x=0;x<_;x+=8)w[x>>5]|=(255&v[x/8])<<x%32;return w}(p),8*p.length);const g=[],y=32*h.length,b="0123456789abcdef";for(let v=0;v<y;v+=8){var m=h[v>>5]>>>v%32&255;m=parseInt(b.charAt(m>>>4&15)+b.charAt(15&m),16),g.push(m)}return g}}},{}],28:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default="00000000-0000-0000-0000-000000000000"},{}],29:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("./validate.js"))&&e.__esModule?e:{default:e};r.default=function(i){if(!(0,o.default)(i))throw TypeError("Invalid UUID");var u;const a=new Uint8Array(16);return a[0]=(u=parseInt(i.slice(0,8),16))>>>24,a[1]=u>>>16&255,a[2]=u>>>8&255,a[3]=255&u,a[4]=(u=parseInt(i.slice(9,13),16))>>>8,a[5]=255&u,a[6]=(u=parseInt(i.slice(14,18),16))>>>8,a[7]=255&u,a[8]=(u=parseInt(i.slice(19,23),16))>>>8,a[9]=255&u,a[10]=(u=parseInt(i.slice(24,36),16))/1099511627776&255,a[11]=u/4294967296&255,a[12]=u>>>24&255,a[13]=u>>>16&255,a[14]=u>>>8&255,a[15]=255&u,a}},{"./validate.js":39}],30:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],31:[function(e,s,r){let o;Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!o&&!(o=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(i)};const i=new Uint8Array(16)},{}],32:[function(e,s,r){function o(i,u){return i<<u|i>>>32-u}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=function(i){var u=[1518500249,1859775393,2400959708,3395469782];const a=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const h=unescape(encodeURIComponent(i));i=[];for(let m=0;m<h.length;++m)i.push(h.charCodeAt(m))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);var f=i.length/4+2,l=Math.ceil(f/16);const d=new Array(l);for(let h=0;h<l;++h){const m=new Uint32Array(16);for(let g=0;g<16;++g)m[g]=i[64*h+4*g]<<24|i[64*h+4*g+1]<<16|i[64*h+4*g+2]<<8|i[64*h+4*g+3];d[h]=m}d[l-1][14]=8*(i.length-1)/Math.pow(2,32),d[l-1][14]=Math.floor(d[l-1][14]),d[l-1][15]=8*(i.length-1)&4294967295;for(let h=0;h<l;++h){const m=new Uint32Array(80);for(let w=0;w<16;++w)m[w]=d[h][w];for(let w=16;w<80;++w)m[w]=o(m[w-3]^m[w-8]^m[w-14]^m[w-16],1);let g=a[0],y=a[1],b=a[2],v=a[3],_=a[4];for(let w=0;w<80;++w){var p=Math.floor(w/20);p=o(g,5)+function(x,S,E,O){switch(x){case 0:return S&E^~S&O;case 1:case 3:return S^E^O;case 2:return S&E^S&O^E&O}}(p,y,b,v)+_+u[p]+m[w]>>>0,_=v,v=b,b=o(y,30)>>>0,y=g,g=p}a[0]=a[0]+g>>>0,a[1]=a[1]+y>>>0,a[2]=a[2]+b>>>0,a[3]=a[3]+v>>>0,a[4]=a[4]+_>>>0}return[a[0]>>24&255,a[0]>>16&255,a[0]>>8&255,255&a[0],a[1]>>24&255,a[1]>>16&255,a[1]>>8&255,255&a[1],a[2]>>24&255,a[2]>>16&255,a[2]>>8&255,255&a[2],a[3]>>24&255,a[3]>>16&255,a[3]>>8&255,255&a[3],a[4]>>24&255,a[4]>>16&255,a[4]>>8&255,255&a[4]]}},{}],33:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("./validate.js"))&&e.__esModule?e:{default:e};const i=[];for(let u=0;u<256;++u)i.push((u+256).toString(16).substr(1));r.default=function(u){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(u=(i[u[a+0]]+i[u[a+1]]+i[u[a+2]]+i[u[a+3]]+"-"+i[u[a+4]]+i[u[a+5]]+"-"+i[u[a+6]]+i[u[a+7]]+"-"+i[u[a+8]]+i[u[a+9]]+"-"+i[u[a+10]]+i[u[a+11]]+i[u[a+12]]+i[u[a+13]]+i[u[a+14]]+i[u[a+15]]).toLowerCase(),(0,o.default)(u))return u;throw TypeError("Stringified UUID is invalid")}},{"./validate.js":39}],34:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=u(e("./rng.js")),i=u(e("./stringify.js"));function u(p){return p&&p.__esModule?p:{default:p}}let a,f,l=0,d=0;r.default=function(p,h,m){var g=h&&m||0;const y=h||new Array(16);let b=(p=p||{}).node||a,v=p.clockseq!==void 0?p.clockseq:f,_=(b!=null&&v!=null||(m=p.random||(p.rng||o.default)(),b==null&&(b=a=[1|m[0],m[1],m[2],m[3],m[4],m[5]]),v==null&&(v=f=16383&(m[6]<<8|m[7]))),p.msecs!==void 0?p.msecs:Date.now()),w=p.nsecs!==void 0?p.nsecs:d+1;if((m=_-l+(w-d)/1e4)<0&&p.clockseq===void 0&&(v=v+1&16383),1e4<=(w=(m<0||_>l)&&p.nsecs===void 0?0:w))throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=_,d=w,f=v,m=(1e4*(268435455&(_+=122192928e5))+w)%4294967296,y[g++]=m>>>24&255,y[g++]=m>>>16&255,y[g++]=m>>>8&255,y[g++]=255&m,p=_/4294967296*1e4&268435455,y[g++]=p>>>8&255,y[g++]=255&p,y[g++]=p>>>24&15|16,y[g++]=p>>>16&255,y[g++]=v>>>8|128,y[g++]=255&v;for(let x=0;x<6;++x)y[g+x]=b[x];return h||(0,i.default)(y)}},{"./rng.js":31,"./stringify.js":33}],35:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=i(e("./v35.js"));function i(u){return u&&u.__esModule?u:{default:u}}e=i(e("./md5.js")),o=(0,o.default)("v3",48,e.default),r.default=o},{"./md5.js":27,"./v35.js":36}],36:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(l,d,p){function h(m,g,y,b){if(typeof m=="string"&&(m=function(_){_=unescape(encodeURIComponent(_));const w=[];for(let x=0;x<_.length;++x)w.push(_.charCodeAt(x));return w}(m)),(g=typeof g=="string"?(0,i.default)(g):g).length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let v=new Uint8Array(16+m.length);if(v.set(g),v.set(m,g.length),(v=p(v))[6]=15&v[6]|d,v[8]=63&v[8]|128,y){b=b||0;for(let _=0;_<16;++_)y[b+_]=v[_];return y}return(0,o.default)(v)}try{h.name=l}catch{}return h.DNS=a,h.URL=f,h},r.URL=r.DNS=void 0;var o=u(e("./stringify.js")),i=u(e("./parse.js"));function u(l){return l&&l.__esModule?l:{default:l}}const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8",f=(r.DNS=a,"6ba7b811-9dad-11d1-80b4-00c04fd430c8");r.URL=f},{"./parse.js":29,"./stringify.js":33}],37:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=u(e("./rng.js")),i=u(e("./stringify.js"));function u(a){return a&&a.__esModule?a:{default:a}}r.default=function(a,f,l){const d=(a=a||{}).random||(a.rng||o.default)();if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,f){l=l||0;for(let p=0;p<16;++p)f[l+p]=d[p];return f}return(0,i.default)(d)}},{"./rng.js":31,"./stringify.js":33}],38:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=i(e("./v35.js"));function i(u){return u&&u.__esModule?u:{default:u}}e=i(e("./sha1.js")),o=(0,o.default)("v5",80,e.default),r.default=o},{"./sha1.js":32,"./v35.js":36}],39:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("./regex.js"))&&e.__esModule?e:{default:e};r.default=function(i){return typeof i=="string"&&o.default.test(i)}},{"./regex.js":30}],40:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("./validate.js"))&&e.__esModule?e:{default:e};r.default=function(i){if((0,o.default)(i))return parseInt(i.substr(14,1),16);throw TypeError("Invalid UUID")}},{"./validate.js":39}],41:[function(e,s,r){var o=(u=e("@babel/runtime/helpers/interopRequireDefault"))(e("@babel/runtime/helpers/toConsumableArray")),i=u(e("@babel/runtime/helpers/classCallCheck")),u=u(e("@babel/runtime/helpers/createClass")),a=e("./logger").log4,f=(b=e("./type")).isRealObject,l=b.isObjectId,d=b.isDefined,p=b.isPrimitiveArray,h=b.getType,m=e("./utils"),g=e("./path").samePath,y=e("./errors").OperationError,b=((0,u.default)(v,[{key:"isMatchingObjects",value:function(_,w,x){return w=(_=this._utils.getObjectIdentifiers({input:_,output:w,path:x})).inputId,x=_.outputId,_=_.sameId,l(w)&&l(x)&&_}},{key:"haveObjectIds",value:function(_,w,x){return!!(_.li&&w.ld||_.ld&&w.li)&&(!!(Array.isArray(_.ld)&&Array.isArray(w.li)||Array.isArray(w.ld)&&Array.isArray(_.li))||(_=this._utils.getOpTargetObject(_),w=this._utils.getOpTargetObject(w),w=(_=this._utils.getObjectIdentifiers({input:_,output:w,path:x})).inputId,x=_.outputId,_.sameId,l(w)&&l(x)))}},{key:"isMatchingOpPair",value:function(_,w,x){return!!((_.li&&w.ld||_.ld&&w.li)&&(Array.isArray(_.ld)&&Array.isArray(w.li)&&this.sameTargetArray(_.ld,w.li)||Array.isArray(w.ld)&&Array.isArray(_.li)&&this.sameTargetArray(w.ld,_.li)||this.isMatchingObjects(this._utils.getOpTargetObject(_),this._utils.getOpTargetObject(w),x)))}},{key:"isObjReplace",value:function(_,w){return!(!_||!w||_.oi!=null||_.od===void 0||w.od!=null||w.oi===void 0||!g(_.p,w.p))}},{key:"isReplace",value:function(_,w){var x,S=["list","code","table"];return!(!_||!w||!((_.li&&w.ld||_.ld&&w.li)&&g(_.p,w.p)&&this.haveObjectIds(_,w,_.p))||(x=(_.ld!==void 0?_:w).ld,_=(_.li!==void 0?_:w).li,x.type=="paragraph"&&x.children!==void 0&&x.children.length==0&&_.type=="paragraph"&&_.children!==void 0&&0<_.children.length||!S.includes(x.type)&&S.includes(_.type)||S.includes(x.type)&&!S.includes(_.type)))}},{key:"isMove",value:function(_,w){return!(!_||!w||g(_.p,w.p)||!this.isMatchingOpPair(_,w,_.p))}},{key:"isIdentity",value:function(_,w){return a("isIdentity",_,w,!0),!(!_||!w)&&g(_.p,w.p)&&this.isMatchingOpPair(_,w,_.p)}},{key:"arrayDiff",value:function(_,w){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:[],S=3<arguments.length?arguments[3]:void 0;if(a("Start performing arrayDiff: beforeState = ",_,!0),a("Start performing arrayDiff: afterState",w,!0),!Array.isArray(_))throw new y("beforeState snapshot is not an array");if(!Array.isArray(w))throw new y("afterState snapshot is not an array");var E=[],O=0,j=0,A=0,T=0;for(O=0,j=0;j<w.length&&O<_.length;O++){a("arrayDiff: loop at",{i:O,j},!0);var I,k=_[O],$=O-A;$=[].concat((0,o.default)(x),[$]),this.isMatchingObjects(_[O],w[j],x)?(I=S(k,w[j],$),a("arrayDiff: same target object (id) -> recursively diff result = ",{r:I},!0),E=E.concat(I),j++):(I={p:$,ld:this._utils.deLabel(k)},E.push(I),a("arrayDiff: different target object (id) -> create a ld op = ",{op:I,i:O,dCount:++A},!0))}for(var H=O;H<_.length;H++){var U=_[H],D=H-A;D={p:[].concat((0,o.default)(x),[D]),ld:deLabel(U)},E.push(D),a("arrayDiff: handle beforeState tail, create a ld op",{op:D,pos:H},!0),A++}for(var W=j;W<w.length;W++){var J=w[W],M=W;M={p:[].concat((0,o.default)(x),[M]),li:deLabel(J)},E.push(M),a("arrayDiff: handle afterState tail, create a li op",{op:M,pos:W},!0),T++}return{ops:E,dCount:A,iCount:T}}},{key:"arrayOfArrayDiff",value:function(){var _,w,x=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},S=x.before,E=x.after,O=x.path,j=x.commonHeaderLen,A=x.diff,T=x.isObjectArray,I=x.isInternal,k=[],$=0,H=0,U=0;for($=0,H=0;H<E.length&&$<S.length;$++)!T&&(this.sameTargetArray(S[$],E[H])||p(S[$])&&p(E[H])||h(S[$])=="array"&&h(E[H]=="array"))||T&&this.isMatchingObjects(S[$],E[H],O)?(a(`
|
|
62
62
|
arrayOfArrayDiff: the same array -> recursive invocation of diff: i = `+$+"; j = "+H),a("before[i] = ",S[$]),a("after[j] = ",E[H]),_=A(S[$],E[H],[].concat((0,o.default)(O),[$+j-U]),I),k=k.concat(_),a("arrayOfArrayDiff: the same array -> recursively generate r = ",_),a("arrayOfArrayDiff: the same array -> ops = ",k),H++):(_=$-U+j,w={p:[].concat((0,o.default)(O),[_]),ld:S[$]},k.push(w),a(`
|
|
@@ -121,11 +121,11 @@ Valid keys: `+JSON.stringify(Object.keys(E),null," "));if(U=U($,k,A,T,I+"."+k,u
|
|
|
121
121
|
`+S+C}var L=!1;function B(C,P){if(!C||L)return"";L=!0;var q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(P)if(P=function(){throw Error()},Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(me){var ie=me}Reflect.construct(C,[],P)}else{try{P.call()}catch(me){ie=me}C.call(P.prototype)}else{try{throw Error()}catch(me){ie=me}C()}}catch(me){if(me&&ie&&typeof me.stack=="string"){for(var oe=me.stack.split(`
|
|
122
122
|
`),ae=ie.stack.split(`
|
|
123
123
|
`),ue=oe.length-1,_e=ae.length-1;1<=ue&&0<=_e&&oe[ue]!==ae[_e];)_e--;for(;1<=ue&&0<=_e;ue--,_e--)if(oe[ue]!==ae[_e]){if(ue!==1||_e!==1)do if(ue--,--_e<0||oe[ue]!==ae[_e])return`
|
|
124
|
-
`+oe[ue].replace(" at new "," at ");while(1<=ue&&0<=_e);break}}}finally{L=!1,Error.prepareStackTrace=q}return(C=C?C.displayName||C.name:"")?R(C):""}function Y(C){if(C==null)return null;if(typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case A:return"Fragment";case j:return"Portal";case I:return"Profiler";case T:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case $:return(C.displayName||"Context")+".Consumer";case k:return(C._context.displayName||"Context")+".Provider";case H:var P=(P=C.render).displayName||P.name||"";return C.displayName||(P!==""?"ForwardRef("+P+")":"ForwardRef");case W:return Y(C.type);case M:return Y(C._render);case J:P=C._payload,C=C._init;try{return Y(C(P))}catch{}}return null}function X(C){switch(typeof C){case"boolean":case"number":case"object":case"string":case"undefined":return C;default:return""}}function re(C){var P=C.type;return(C=C.nodeName)&&C.toLowerCase()==="input"&&(P==="checkbox"||P==="radio")}function Z(C){C._valueTracker||(C._valueTracker=function(P){var q,ie,oe=re(P)?"checked":"value",ae=Object.getOwnPropertyDescriptor(P.constructor.prototype,oe),ue=""+P[oe];if(!P.hasOwnProperty(oe)&&ae!==void 0&&typeof ae.get=="function"&&typeof ae.set=="function")return q=ae.get,ie=ae.set,Object.defineProperty(P,oe,{configurable:!0,get:function(){return q.call(this)},set:function(_e){ue=""+_e,ie.call(this,_e)}}),Object.defineProperty(P,oe,{enumerable:ae.enumerable}),{getValue:function(){return ue},setValue:function(_e){ue=""+_e},stopTracking:function(){P._valueTracker=null,delete P[oe]}}}(C))}function ee(C){if(C){var P=C._valueTracker;if(!P)return 1;var q=P.getValue(),ie="";return(C=ie=C?re(C)?C.checked?"true":"false":C.value:ie)!==q&&(P.setValue(C),1)}}function ne(C){if((C=C||(typeof document<"u"?document:void 0))===void 0)return null;try{return C.activeElement||C.body}catch{return C.body}}function te(C,P){var q=P.checked;return i({},P,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:q??C._wrapperState.initialChecked})}function se(C,P){var q=P.defaultValue==null?"":P.defaultValue,ie=P.checked!=null?P.checked:P.defaultChecked;q=X(P.value!=null?P.value:q),C._wrapperState={initialChecked:ie,initialValue:q,controlled:P.type==="checkbox"||P.type==="radio"?P.checked!=null:P.value!=null}}function ce(C,P){(P=P.checked)!=null&&x(C,"checked",P,!1)}function ge(C,P){ce(C,P);var q=X(P.value),ie=P.type;if(q!=null)ie==="number"?(q===0&&C.value===""||C.value!=q)&&(C.value=""+q):C.value!==""+q&&(C.value=""+q);else if(ie==="submit"||ie==="reset")return void C.removeAttribute("value");P.hasOwnProperty("value")?Se(C,P.type,q):P.hasOwnProperty("defaultValue")&&Se(C,P.type,X(P.defaultValue)),P.checked==null&&P.defaultChecked!=null&&(C.defaultChecked=!!P.defaultChecked)}function we(C,P,q){if(P.hasOwnProperty("value")||P.hasOwnProperty("defaultValue")){var ie=P.type;if(!(ie!=="submit"&&ie!=="reset"||P.value!==void 0&&P.value!==null))return;P=""+C._wrapperState.initialValue,q||P===C.value||(C.value=P),C.defaultValue=P}(q=C.name)!==""&&(C.name=""),C.defaultChecked=!!C._wrapperState.initialChecked,q!==""&&(C.name=q)}function Se(C,P,q){P==="number"&&ne(C.ownerDocument)===C||(q==null?C.defaultValue=""+C._wrapperState.initialValue:C.defaultValue!==""+q&&(C.defaultValue=""+q))}function je(C,P){var q,ie;return C=i({children:void 0},P),q=P.children,ie="",o.Children.forEach(q,function(oe){oe!=null&&(ie+=oe)}),(P=ie)&&(C.children=P),C}function Le(C,P,q,ie){if(C=C.options,P){P={};for(var oe=0;oe<q.length;oe++)P["$"+q[oe]]=!0;for(q=0;q<C.length;q++)oe=P.hasOwnProperty("$"+C[q].value),C[q].selected!==oe&&(C[q].selected=oe),oe&&ie&&(C[q].defaultSelected=!0)}else{for(q=""+X(q),P=null,oe=0;oe<C.length;oe++){if(C[oe].value===q)return C[oe].selected=!0,void(ie&&(C[oe].defaultSelected=!0));P!==null||C[oe].disabled||(P=C[oe])}P!==null&&(P.selected=!0)}}function Me(C,P){if(P.dangerouslySetInnerHTML!=null)throw Error(a(91));return i({},P,{value:void 0,defaultValue:void 0,children:""+C._wrapperState.initialValue})}function ye(C,P){var q=P.value;if(q==null){if(q=P.children,P=P.defaultValue,q!=null){if(P!=null)throw Error(a(92));if(Array.isArray(q)){if(!(q.length<=1))throw Error(a(93));q=q[0]}P=q}q=P=P??""}C._wrapperState={initialValue:X(q)}}function ke(C,P){var q=X(P.value),ie=X(P.defaultValue);q!=null&&((q=""+q)!==C.value&&(C.value=q),P.defaultValue==null&&C.defaultValue!==q&&(C.defaultValue=q)),ie!=null&&(C.defaultValue=""+ie)}function Ae(C){var P=C.textContent;P===C._wrapperState.initialValue&&P!==""&&P!==null&&(C.value=P)}var Ie="http://www.w3.org/1999/xhtml";function Te(C){switch(C){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ee(C,P){return C==null||C==="http://www.w3.org/1999/xhtml"?Te(P):C==="http://www.w3.org/2000/svg"&&P==="foreignObject"?"http://www.w3.org/1999/xhtml":C}Pe=function(C,P){if(C.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in C)C.innerHTML=P;else{for((Ce=Ce||document.createElement("div")).innerHTML="<svg>"+P.valueOf().toString()+"</svg>",P=Ce.firstChild;C.firstChild;)C.removeChild(C.firstChild);for(;P.firstChild;)C.appendChild(P.firstChild)}};var Ce,Pe,he=typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(C,P,q,ie){MSApp.execUnsafeLocalFunction(function(){return Pe(C,P)})}:Pe;function de(C,P){if(P){var q=C.firstChild;if(q&&q===C.lastChild&&q.nodeType===3)return void(q.nodeValue=P)}C.textContent=P}var Fe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},We=["Webkit","ms","Moz","O"];function Qe(C,P,q){return P==null||typeof P=="boolean"||P===""?"":q||typeof P!="number"||P===0||Fe.hasOwnProperty(C)&&Fe[C]?(""+P).trim():P+"px"}function Ze(C,P){for(var q in C=C.style,P){var ie,oe;P.hasOwnProperty(q)&&(ie=q.indexOf("--")===0,oe=Qe(q,P[q],ie),q==="float"&&(q="cssFloat"),ie?C.setProperty(q,oe):C[q]=oe)}}Object.keys(Fe).forEach(function(C){We.forEach(function(P){P=P+C.charAt(0).toUpperCase()+C.substring(1),Fe[P]=Fe[C]})});var _t=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oe(C,P){if(P){if(_t[C]&&(P.children!=null||P.dangerouslySetInnerHTML!=null))throw Error(a(137,C));if(P.dangerouslySetInnerHTML!=null){if(P.children!=null)throw Error(a(60));if(typeof P.dangerouslySetInnerHTML!="object"||!("__html"in P.dangerouslySetInnerHTML))throw Error(a(61))}if(P.style!=null&&typeof P.style!="object")throw Error(a(62))}}function tt(C,P){if(C.indexOf("-")===-1)return typeof P.is=="string";switch(C){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function gt(C){return(C=(C=C.target||C.srcElement||window).correspondingUseElement?C.correspondingUseElement:C).nodeType===3?C.parentNode:C}var $t=null,Ut=null,Jt=null;function Ht(C){if(C=af(C)){if(typeof $t!="function")throw Error(a(280));var P=C.stateNode;P&&(P=Tg(P),$t(C.stateNode,C.type,P))}}function jt(C){Ut?Jt?Jt.push(C):Jt=[C]:Ut=C}function qt(){if(Ut){var C=Ut,P=Jt;if(Jt=Ut=null,Ht(C),P)for(C=0;C<P.length;C++)Ht(P[C])}}function Tn(C,P){return C(P)}function Ne(C,P,q,ie,oe){return C(P,q,ie,oe)}function lt(){}var pt=!1,wt=!1;function Nt(){Ut===null&&Jt===null||(lt(),qt())}function Re(C,P){var q=C.stateNode;if(q===null)return null;var ie=Tg(q);if(ie===null)return null;switch(q=ie[P],P){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":C=!(ie=(ie=!ie.disabled)?ie:!((C=C.type)==="button"||C==="input"||C==="select"||C==="textarea"));break;default:C=!1}if(C)return null;if(q&&typeof q!="function")throw Error(a(231,P,typeof q));return q}var ze=!1;if(e)try{var ct={};Object.defineProperty(ct,"passive",{get:function(){ze=!0}}),window.addEventListener("test",ct,ct),window.removeEventListener("test",ct,ct)}catch{ze=!1}var be=!1,fe=null,xe=!1,Be=null,dt={onError:function(C){be=!0,fe=C}};function Et(C,P,q,ie,oe,ae,ue,_e,me){be=!1,fe=null,(function(He,it,ft,Lt,kn,Ve,rt,mt,Bt){var Dt=Array.prototype.slice.call(arguments,3);try{it.apply(ft,Dt)}catch(tn){this.onError(tn)}}).apply(dt,arguments)}function kt(C){var P=C,q=C;if(C.alternate)for(;P.return;)P=P.return;else for(C=P;1026&(P=C).flags&&(q=P.return),C=P.return;);return P.tag===3?q:null}function It(C){if(C.tag===13){var P=C.memoizedState;if(P===null&&(C=C.alternate)!==null&&(P=C.memoizedState),P!==null)return P.dehydrated}return null}function Qt(C){if(kt(C)!==C)throw Error(a(188))}function vt(C){if(!(C=function(q){var ie=q.alternate;if(!ie){if((ie=kt(q))===null)throw Error(a(188));return ie!==q?null:q}for(var oe=q,ae=ie;;){var ue=oe.return;if(ue===null)break;var _e=ue.alternate;if(_e===null){if((ae=ue.return)===null)break;oe=ae}else{if(ue.child===_e.child){for(_e=ue.child;_e;){if(_e===oe)return Qt(ue),q;if(_e===ae)return Qt(ue),ie;_e=_e.sibling}throw Error(a(188))}if(oe.return!==ae.return)oe=ue,ae=_e;else{for(var me=!1,He=ue.child;He;){if(He===oe){me=!0,oe=ue,ae=_e;break}if(He===ae){me=!0,ae=ue,oe=_e;break}He=He.sibling}if(!me){for(He=_e.child;He;){if(He===oe){me=!0,oe=_e,ae=ue;break}if(He===ae){me=!0,ae=_e,oe=ue;break}He=He.sibling}if(!me)throw Error(a(189))}}if(oe.alternate!==ae)throw Error(a(190))}}if(oe.tag!==3)throw Error(a(188));return oe.stateNode.current===oe?q:ie}(C)))return null;for(var P=C;;){if(P.tag===5||P.tag===6)return P;if(P.child)P=(P.child.return=P).child;else{if(P===C)break;for(;!P.sibling;){if(!P.return||P.return===C)return null;P=P.return}P.sibling.return=P.return,P=P.sibling}}return null}function pe(C,P){for(var q=C.alternate;P!==null;){if(P===C||P===q)return 1;P=P.return}}var De,Ue,Ke,qe=!1,ot=[],Q=null,le=null,ve=null,Je=new Map,et=new Map,Xe=[],Ye="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function yt(C,P,q,ie,oe){return{blockedOn:C,domEventName:P,eventSystemFlags:16|q,nativeEvent:oe,targetContainers:[ie]}}function Ot(C,P){switch(C){case"focusin":case"focusout":Q=null;break;case"dragenter":case"dragleave":le=null;break;case"mouseover":case"mouseout":ve=null;break;case"pointerover":case"pointerout":Je.delete(P.pointerId);break;case"gotpointercapture":case"lostpointercapture":et.delete(P.pointerId)}}function Kt(C,P,q,ie,oe,ae){return C===null||C.nativeEvent!==ae?(C=yt(P,q,ie,oe,ae),P===null||(P=af(P))!==null&&Ue(P)):(C.eventSystemFlags|=ie,P=C.targetContainers,oe!==null&&P.indexOf(oe)===-1&&P.push(oe)),C}function Mt(C){if(C.blockedOn===null){for(var P=C.targetContainers;0<P.length;){var q=Di(C.domEventName,C.eventSystemFlags,P[0],C.nativeEvent);if(q!==null)return(P=af(q))!==null&&Ue(P),C.blockedOn=q,0;P.shift()}return 1}}function Vt(C,P,q){Mt(C)&&q.delete(P)}function cn(){for(qe=!1;0<ot.length;){var C=ot[0];if(C.blockedOn!==null){(C=af(C.blockedOn))!==null&&De(C);break}for(var P=C.targetContainers;0<P.length;){var q=Di(C.domEventName,C.eventSystemFlags,P[0],C.nativeEvent);if(q!==null){C.blockedOn=q;break}P.shift()}C.blockedOn===null&&ot.shift()}Q!==null&&Mt(Q)&&(Q=null),le!==null&&Mt(le)&&(le=null),ve!==null&&Mt(ve)&&(ve=null),Je.forEach(Vt),et.forEach(Vt)}function _n(C,P){C.blockedOn===P&&(C.blockedOn=null,qe||(qe=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,cn)))}function Gn(C){function P(oe){return _n(oe,C)}if(0<ot.length){_n(ot[0],C);for(var q=1;q<ot.length;q++){var ie=ot[q];ie.blockedOn===C&&(ie.blockedOn=null)}}for(Q!==null&&_n(Q,C),le!==null&&_n(le,C),ve!==null&&_n(ve,C),Je.forEach(P),et.forEach(P),q=0;q<Xe.length;q++)(ie=Xe[q]).blockedOn===C&&(ie.blockedOn=null);for(;0<Xe.length&&(q=Xe[0]).blockedOn===null;)(function(oe){var ae=Ol(oe.target);if(ae!==null){var ue=kt(ae);if(ue!==null){if((ae=ue.tag)===13){if((ae=It(ue))!==null)return oe.blockedOn=ae,oe.lanePriority,u.unstable_runWithPriority(oe.priority,function(){Ke(ue)})}else if(ae===3&&ue.stateNode.hydrate)return oe.blockedOn=ue.tag===3?ue.stateNode.containerInfo:null}}oe.blockedOn=null})(q),q.blockedOn===null&&Xe.shift()}function wn(C,P){var q={};return q[C.toLowerCase()]=P.toLowerCase(),q["Webkit"+C]="webkit"+P,q["Moz"+C]="moz"+P,q}var In={animationend:wn("Animation","AnimationEnd"),animationiteration:wn("Animation","AnimationIteration"),animationstart:wn("Animation","AnimationStart"),transitionend:wn("Transition","TransitionEnd")},Yn={},ir={};function Cr(C){if(Yn[C])return Yn[C];if(!In[C])return C;var P,q=In[C];for(P in q)if(q.hasOwnProperty(P)&&P in ir)return Yn[C]=q[P];return C}e&&(ir=document.createElement("div").style,"AnimationEvent"in window||(delete In.animationend.animation,delete In.animationiteration.animation,delete In.animationstart.animation),"TransitionEvent"in window||delete In.transitionend.transition);var Er=Cr("animationend"),dl=Cr("animationiteration"),ga=Cr("animationstart"),Vo=Cr("transitionend"),Co=new Map,Do=new Map,Dn=["abort","abort",Er,"animationEnd",dl,"animationIteration",ga,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Vo,"transitionEnd","waiting","waiting"];function ma(C,P){for(var q=0;q<C.length;q+=2){var ie=C[q],oe="on"+((oe=C[q+1])[0].toUpperCase()+oe.slice(1));Do.set(ie,P),Co.set(ie,oe),d(oe,[ie])}}(0,u.unstable_now)();var Nn=8;function Zn(C){if(1&C)return Nn=15,1;if(2&C)return Nn=14,2;if(4&C)return Nn=13,4;var P=24&C;return P!==0?(Nn=12,P):32&C?(Nn=11,32):(P=192&C)!=0?(Nn=10,P):256&C?(Nn=9,256):(P=3584&C)!=0?(Nn=8,P):4096&C?(Nn=7,4096):(P=4186112&C)!=0?(Nn=6,P):(P=62914560&C)!=0?(Nn=5,P):67108864&C?(Nn=4,67108864):134217728&C?(Nn=3,134217728):(P=805306368&C)!=0?(Nn=2,P):1073741824&C?(Nn=1,1073741824):(Nn=8,C)}function ji(C,P){var q=C.pendingLanes;if(q===0)return Nn=0;var ie,oe=0,ae=0,ue=C.expiredLanes,_e=C.suspendedLanes,me=C.pingedLanes;if(ue!==0?(oe=ue,ae=Nn=15):(ue=134217727&q)!=0?(ie=ue&~_e)!=0?(oe=Zn(ie),ae=Nn):(me&=ue)!=0&&(oe=Zn(me),ae=Nn):(ue=q&~_e)!=0?(oe=Zn(ue),ae=Nn):me!==0&&(oe=Zn(me),ae=Nn),oe===0)return 0;if(oe=q&(((oe=31-hi(oe))<0?0:1<<oe)<<1)-1,P!==0&&P!==oe&&!(P&_e)){if(Zn(P),ae<=Nn)return P;Nn=ae}if((P=C.entangledLanes)!==0)for(C=C.entanglements,P&=oe;0<P;)oe|=C[q=31-hi(P)],P&=~(ae=1<<q);return oe}function ho(C){return(C=-1073741825&C.pendingLanes)!=0?C:1073741824&C?1073741824:0}function Go(C,P){switch(C){case 15:return 1;case 14:return 2;case 12:return(C=Eo(24&~P))===0?Go(10,P):C;case 10:return(C=Eo(192&~P))===0?Go(8,P):C;case 8:return(C=Eo(3584&~P))===0&&(C=Eo(4186112&~P))===0&&(C=512),C;case 2:return(P=Eo(805306368&~P))===0?268435456:P}throw Error(a(358,C))}function Eo(C){return C&-C}function eo(C){for(var P=[],q=0;q<31;q++)P.push(C);return P}function fl(C,P,q){C.pendingLanes|=P;var ie=P-1;C.suspendedLanes&=ie,C.pingedLanes&=ie,(C=C.eventTimes)[P=31-hi(P)]=q}var hi=Math.clz32||function(C){return C===0?32:31-(Lo(C)/Rn|0)|0},Lo=Math.log,Rn=Math.LN2,_g=u.unstable_UserBlockingPriority,Xd=u.unstable_runWithPriority,Bo=!0;function xg(C,P,q,ie){pt||lt();var oe=pl,ae=pt;pt=!0;try{Ne(oe,C,P,q,ie)}finally{(pt=ae)||Nt()}}function Zd(C,P,q,ie){Xd(_g,pl.bind(null,C,P,q,ie))}function pl(C,P,q,ie){var oe;if(Bo)if((oe=!(4&P))&&0<ot.length&&-1<Ye.indexOf(C))C=yt(null,C,P,q,ie),ot.push(C);else{var ae=Di(C,P,q,ie);if(ae===null)oe&&Ot(C,ie);else{if(oe){if(-1<Ye.indexOf(C))return C=yt(ae,C,P,q,ie),void ot.push(C);if(function(ue,_e,me,He,it){switch(_e){case"focusin":return Q=Kt(Q,ue,_e,me,He,it),1;case"dragenter":return le=Kt(le,ue,_e,me,He,it),1;case"mouseover":return ve=Kt(ve,ue,_e,me,He,it),1;case"pointerover":var ft=it.pointerId;return Je.set(ft,Kt(Je.get(ft)||null,ue,_e,me,He,it)),1;case"gotpointercapture":return ft=it.pointerId,et.set(ft,Kt(et.get(ft)||null,ue,_e,me,He,it)),1}}(ae,C,P,q,ie))return;Ot(C,ie)}W2(C,P,ie,null,q)}}}function Di(C,P,q,ie){var oe=gt(ie);if((oe=Ol(oe))!==null){var ae=kt(oe);if(ae===null)oe=null;else{var ue=ae.tag;if(ue===13){if((oe=It(ae))!==null)return oe;oe=null}else if(ue===3){if(ae.stateNode.hydrate)return ae.tag===3?ae.stateNode.containerInfo:null;oe=null}else ae!==oe&&(oe=null)}}return W2(C,P,ie,oe,q),null}var Li=null,Bi=null,gs=null;function Zc(){if(gs)return gs;for(var C=Bi,P=C.length,q=("value"in Li)?Li.value:Li.textContent,ie=q.length,oe=0;oe<P&&C[oe]===q[oe];oe++);for(var ae=P-oe,ue=1;ue<=ae&&C[P-ue]===q[ie-ue];ue++);return gs=q.slice(oe,1<ue?1-ue:void 0)}function Qc(C){var P=C.keyCode;return"charCode"in C?(C=C.charCode)===0&&P===13&&(C=13):C=P,32<=(C=C===10?13:C)||C===13?C:0}function hl(){return!0}function gl(){return!1}function Hr(C){function P(q,ie,oe,ae,ue){for(var _e in this._reactName=q,this._targetInst=oe,this.type=ie,this.nativeEvent=ae,this.target=ue,this.currentTarget=null,C)C.hasOwnProperty(_e)&&(q=C[_e],this[_e]=q?q(ae):ae[_e]);return this.isDefaultPrevented=(ae.defaultPrevented!=null?ae.defaultPrevented:ae.returnValue===!1)?hl:gl,this.isPropagationStopped=gl,this}return i(P.prototype,{preventDefault:function(){this.defaultPrevented=!0;var q=this.nativeEvent;q&&(q.preventDefault?q.preventDefault():typeof q.returnValue!="unknown"&&(q.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var q=this.nativeEvent;q&&(q.stopPropagation?q.stopPropagation():typeof q.cancelBubble!="unknown"&&(q.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),P}ct={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(C){return C.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0};var ml,yl,ms,ys=Hr(ct),eu=Hr(Br=i({},ct,{view:0,detail:0})),lr=i({},Br,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ya,button:0,buttons:0,relatedTarget:function(C){return C.relatedTarget===void 0?C.fromElement===C.srcElement?C.toElement:C.fromElement:C.relatedTarget},movementX:function(C){return"movementX"in C?C.movementX:(C!==ms&&(yl=ms&&C.type==="mousemove"?(ml=C.screenX-ms.screenX,C.screenY-ms.screenY):ml=0,ms=C),ml)},movementY:function(C){return"movementY"in C?C.movementY:yl}}),bs=Hr(lr),bl=Hr(i({},lr,{dataTransfer:0})),go=Hr(i({},Br,{relatedTarget:0})),vl=Hr(i({},ct,{animationName:0,elapsedTime:0,pseudoElement:0})),Fi=Hr(i({},ct,{clipboardData:function(C){return("clipboardData"in C?C:window).clipboardData}})),gi=Hr(i({},ct,{data:0})),$i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_l={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zi(C){var P=this.nativeEvent;return P.getModifierState?P.getModifierState(C):!!(C=mi[C])&&!!P[C]}function ya(){return zi}var ba=Hr(i({},Br,{key:function(C){if(C.key){var P=$i[C.key]||C.key;if(P!=="Unidentified")return P}return C.type==="keypress"?(C=Qc(C))===13?"Enter":String.fromCharCode(C):C.type==="keydown"||C.type==="keyup"?_l[C.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ya,charCode:function(C){return C.type==="keypress"?Qc(C):0},keyCode:function(C){return C.type==="keydown"||C.type==="keyup"?C.keyCode:0},which:function(C){return C.type==="keypress"?Qc(C):C.type==="keydown"||C.type==="keyup"?C.keyCode:0}})),xl=Hr(i({},lr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tu=Hr(i({},Br,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ya})),vs=Hr(i({},ct,{propertyName:0,elapsedTime:0,pseudoElement:0})),nu=Hr(i({},lr,{deltaX:function(C){return"deltaX"in C?C.deltaX:"wheelDeltaX"in C?-C.wheelDeltaX:0},deltaY:function(C){return"deltaY"in C?C.deltaY:"wheelDeltaY"in C?-C.wheelDeltaY:"wheelDelta"in C?-C.wheelDelta:0},deltaZ:0,deltaMode:0})),wg=[9,13,27,32],wl=e&&"CompositionEvent"in window,Br=null,Sl=(e&&"documentMode"in document&&(Br=document.documentMode),e&&"TextEvent"in window&&!Br),va=e&&(!wl||Br&&8<Br&&Br<=11),Cl=String.fromCharCode(32),Qd=!1;function ef(C,P){switch(C){case"keyup":return wg.indexOf(P.keyCode)!==-1;case"keydown":return P.keyCode!==229;case"keypress":case"mousedown":case"focusout":return 1;default:return}}function Ui(C){return typeof(C=C.detail)=="object"&&"data"in C?C.data:null}var _s=!1,_a={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ru(C){var P=C&&C.nodeName&&C.nodeName.toLowerCase();return P==="input"?_a[C.type]:P==="textarea"}function El(C,P,q,ie){jt(ie),0<(P=Cg(P,"onChange")).length&&(q=new ys("onChange","change",null,q,ie),C.push({event:q,listeners:P}))}var $e=null,nt=null;function ht(C){$2(C,0)}function Tt(C){if(ee(lu(C)))return C}function hn(C,P){if(C==="change")return P}var an=!1;function ln(){$e&&($e.detachEvent("onpropertychange",Gt),nt=$e=null)}function Gt(C){if(C.propertyName==="value"&&Tt(nt)){var P=[];if(El(P,nt,C,gt(C)),C=ht,pt)C(P);else{pt=!0;try{Tn(C,P)}finally{pt=!1,Nt()}}}}function cr(C,P,q){C==="focusin"?(ln(),nt=q,($e=P).attachEvent("onpropertychange",Gt)):C==="focusout"&&ln()}function Ar(C){if(C==="selectionchange"||C==="keyup"||C==="keydown")return Tt(nt)}function tf(C,P){if(C==="click")return Tt(P)}function Sg(C,P){if(C==="input"||C==="change")return Tt(P)}e&&(Br=e&&((ct="oninput"in document)||((lr=document.createElement("div")).setAttribute("oninput","return;"),ct=typeof lr.oninput=="function"),ct),an=Br&&(!document.documentMode||9<document.documentMode));var Or=typeof Object.is=="function"?Object.is:function(C,P){return C===P&&(C!==0||1/C==1/P)||C!=C&&P!=P},TF=Object.prototype.hasOwnProperty;function nf(C,P){if(Or(C,P))return!0;if(typeof C!="object"||C===null||typeof P!="object"||P===null)return!1;var q=Object.keys(C),ie=Object.keys(P);if(q.length!==ie.length)return!1;for(ie=0;ie<q.length;ie++)if(!TF.call(P,q[ie])||!Or(C[q[ie]],P[q[ie]]))return!1;return!0}function I2(C){for(;C&&C.firstChild;)C=C.firstChild;return C}function R2(C,P){var q,ie=I2(C);for(C=0;ie;){if(ie.nodeType===3){if(q=C+ie.textContent.length,C<=P&&P<=q)return{node:ie,offset:P-C};C=q}e:{for(;ie;){if(ie.nextSibling){ie=ie.nextSibling;break e}ie=ie.parentNode}ie=void 0}ie=I2(ie)}}function j2(){for(var C=window,P=ne();P instanceof C.HTMLIFrameElement;){try{var q=typeof P.contentWindow.location.href=="string"}catch{q=!1}if(!q)break;P=ne((C=P.contentWindow).document)}return P}function gv(C){var P=C&&C.nodeName&&C.nodeName.toLowerCase();return P&&(P==="input"&&(C.type==="text"||C.type==="search"||C.type==="tel"||C.type==="url"||C.type==="password")||P==="textarea"||C.contentEditable==="true")}var NF=e&&"documentMode"in document&&document.documentMode<=11,ou=null,mv=null,rf=null,yv=!1;function D2(C,P,q){var ie=q.window===q?q.document:q.nodeType===9?q:q.ownerDocument;yv||ou==null||ou!==ne(ie)||(ie="selectionStart"in(ie=ou)&&gv(ie)?{start:ie.selectionStart,end:ie.selectionEnd}:{anchorNode:(ie=(ie.ownerDocument&&ie.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:ie.anchorOffset,focusNode:ie.focusNode,focusOffset:ie.focusOffset},rf&&nf(rf,ie)||(rf=ie,0<(ie=Cg(mv,"onSelect")).length&&(P=new ys("onSelect","select",null,P,q),C.push({event:P,listeners:ie}),P.target=ou)))}ma("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),ma("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),ma(Dn,2);for(var L2="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),bv=0;bv<L2.length;bv++)Do.set(L2[bv],0);p("onMouseEnter",["mouseout","mouseover"]),p("onMouseLeave",["mouseout","mouseover"]),p("onPointerEnter",["pointerout","pointerover"]),p("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var of="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),B2=new Set("cancel close invalid load scroll toggle".split(" ").concat(of));function F2(C,P,q){var ie=C.type||"unknown-event";C.currentTarget=q,function(){var oe;Et.apply(this,arguments),be&&(oe=fe,be=!1,fe=null,xe||(xe=!0,Be=oe))}(ie,P,void 0,C),C.currentTarget=null}function $2(C,P){P=!!(4&P);for(var q=0;q<C.length;q++){var ie=(oe=C[q]).event,oe=oe.listeners;e:{var ae=void 0;if(P)for(var ue=oe.length-1;0<=ue;ue--){var _e=(He=oe[ue]).instance,me=He.currentTarget,He=He.listener;if(_e!==ae&&ie.isPropagationStopped())break e;F2(ie,He,me),ae=_e}else for(ue=0;ue<oe.length;ue++){if(_e=(He=oe[ue]).instance,me=He.currentTarget,He=He.listener,_e!==ae&&ie.isPropagationStopped())break e;F2(ie,He,me),ae=_e}}}if(xe)throw C=Be,xe=!1,Be=null,C}function Qn(C,P){var q=X2(P),ie=C+"__bubble";q.has(ie)||(K2(P,C,2,!1),q.add(ie))}var z2="_reactListening"+Math.random().toString(36).slice(2);function U2(C){C[z2]||(C[z2]=!0,f.forEach(function(P){B2.has(P)||H2(P,!1,C,null),H2(P,!0,C,null)}))}function H2(C,P,q,ie,oe){oe=4<arguments.length&&oe!==void 0?oe:0;var ae=q;if(C==="selectionchange"&&q.nodeType!==9&&(ae=q.ownerDocument),ie!==null&&!P&&B2.has(C)){if(C!=="scroll")return;oe|=2,ae=ie}ie=C+"__"+(P?"capture":"bubble"),(q=X2(ae)).has(ie)||(P&&(oe|=4),K2(ae,C,oe,P),q.add(ie))}function K2(C,P,q,ie){var oe=Do.get(P);switch(oe===void 0?2:oe){case 0:oe=xg;break;case 1:oe=Zd;break;default:oe=pl}q=oe.bind(null,P,q,C),oe=!(!ze||P!=="touchstart"&&P!=="touchmove"&&P!=="wheel")||void 0,ie?oe!==void 0?C.addEventListener(P,q,{capture:!0,passive:oe}):C.addEventListener(P,q,!0):oe!==void 0?C.addEventListener(P,q,{passive:oe}):C.addEventListener(P,q,!1)}function W2(C,P,q,ie,oe){var ae=ie;if(!(1&P||2&P||ie===null))e:for(;;){if(ie===null)return;var ue=ie.tag;if(ue===3||ue===4){var _e=ie.stateNode.containerInfo;if(_e===oe||_e.nodeType===8&&_e.parentNode===oe)break;if(ue===4)for(ue=ie.return;ue!==null;){var me=ue.tag;if((me===3||me===4)&&((me=ue.stateNode.containerInfo)===oe||me.nodeType===8&&me.parentNode===oe))return;ue=ue.return}for(;_e!==null;){if((ue=Ol(_e))===null)return;if((me=ue.tag)===5||me===6){ie=ae=ue;continue e}_e=_e.parentNode}}ie=ie.return}var He=function(){var ft,Lt,kn,Ve=ae,rt=gt(q),mt=[];e:{var Bt=Co.get(C);if(Bt!==void 0){var Dt=ys,tn=C;switch(C){case"keypress":if(Qc(q)===0)break e;case"keydown":case"keyup":Dt=ba;break;case"focusin":tn="focus",Dt=go;break;case"focusout":tn="blur",Dt=go;break;case"beforeblur":case"afterblur":Dt=go;break;case"click":if(q.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Dt=bs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Dt=bl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Dt=tu;break;case Er:case dl:case ga:Dt=vl;break;case Vo:Dt=vs;break;case"scroll":Dt=eu;break;case"wheel":Dt=nu;break;case"copy":case"cut":case"paste":Dt=Fi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Dt=xl}for(var yn=!(nn=!!(4&P))&&C==="scroll",sn=nn?Bt!==null?Bt+"Capture":null:Bt,nn=[],jn=Ve;jn!==null;){var zn,qn=(zn=jn).stateNode;if(zn.tag===5&&qn!==null&&(zn=qn,sn!==null&&(qn=Re(jn,sn))!=null&&nn.push(sf(jn,qn,zn))),yn)break;jn=jn.return}0<nn.length&&(Bt=new Dt(Bt,tn,null,q,rt),mt.push({event:Bt,listeners:nn}))}}if(!(7&P)){if(Dt=C==="mouseout"||C==="pointerout",(!(Bt=C==="mouseover"||C==="pointerover")||16&P||!(tn=q.relatedTarget||q.fromElement)||!Ol(tn)&&!tn[au])&&(Dt||Bt)&&(Bt=rt.window===rt?rt:(Bt=rt.ownerDocument)?Bt.defaultView||Bt.parentWindow:window,Dt?(Dt=Ve,(tn=(tn=q.relatedTarget||q.toElement)?Ol(tn):null)!==null&&(tn!==(yn=kt(tn))||tn.tag!==5&&tn.tag!==6)&&(tn=null)):(Dt=null,tn=Ve),Dt!==tn)){if(nn=bs,qn="onMouseLeave",sn="onMouseEnter",jn="mouse",C!=="pointerout"&&C!=="pointerover"||(nn=xl,qn="onPointerLeave",sn="onPointerEnter",jn="pointer"),yn=Dt==null?Bt:lu(Dt),zn=tn==null?Bt:lu(tn),(Bt=new nn(qn,jn+"leave",Dt,q,rt)).target=yn,Bt.relatedTarget=zn,qn=null,Ol(rt)===Ve&&((nn=new nn(sn,jn+"enter",tn,q,rt)).target=zn,nn.relatedTarget=yn,qn=nn),yn=qn,Dt&&tn)e:{for(sn=tn,jn=0,zn=nn=Dt;zn;zn=iu(zn))jn++;for(zn=0,qn=sn;qn;qn=iu(qn))zn++;for(;0<jn-zn;)nn=iu(nn),jn--;for(;0<zn-jn;)sn=iu(sn),zn--;for(;jn--;){if(nn===sn||sn!==null&&nn===sn.alternate)break e;nn=iu(nn),sn=iu(sn)}nn=null}else nn=null;Dt!==null&&q2(mt,Bt,Dt,nn,!1),tn!==null&&yn!==null&&q2(mt,yn,tn,nn,!0)}switch((Dt=(Bt=Ve?lu(Ve):window).nodeName&&Bt.nodeName.toLowerCase())==="select"||Dt==="input"&&Bt.type==="file"?ft=hn:ru(Bt)?an?ft=Sg:(ft=Ar,Lt=cr):!(Dt=Bt.nodeName)||Dt.toLowerCase()!=="input"||Bt.type!=="checkbox"&&Bt.type!=="radio"||(ft=tf),(ft=ft&&ft(C,Ve))?El(mt,ft,q,rt):(Lt&&Lt(C,Bt,Ve),C==="focusout"&&(Lt=Bt._wrapperState)&&Lt.controlled&&Bt.type==="number"&&Se(Bt,"number",Bt.value)),Lt=Ve?lu(Ve):window,C){case"focusin":!ru(Lt)&&Lt.contentEditable!=="true"||(ou=Lt,mv=Ve,rf=null);break;case"focusout":rf=mv=ou=null;break;case"mousedown":yv=!0;break;case"contextmenu":case"mouseup":case"dragend":yv=!1,D2(mt,q,rt);break;case"selectionchange":if(NF)break;case"keydown":case"keyup":D2(mt,q,rt)}if(wl)e:{switch(C){case"compositionstart":var En="onCompositionStart";break e;case"compositionend":En="onCompositionEnd";break e;case"compositionupdate":En="onCompositionUpdate";break e}En=void 0}else _s?ef(C,q)&&(En="onCompositionEnd"):C==="keydown"&&q.keyCode===229&&(En="onCompositionStart");En&&(va&&q.locale!=="ko"&&(_s||En!=="onCompositionStart"?En==="onCompositionEnd"&&_s&&(kn=Zc()):(Bi="value"in(Li=rt)?Li.value:Li.textContent,_s=!0)),0<(Lt=Cg(Ve,En)).length&&(En=new gi(En,C,null,q,rt),mt.push({event:En,listeners:Lt}),(kn||(kn=Ui(q))!==null)&&(En.data=kn))),(kn=(Sl?function(Mn,Sn){switch(Mn){case"compositionend":return Ui(Sn);case"keypress":return Sn.which!==32?null:(Qd=!0,Cl);case"textInput":return(Mn=Sn.data)===Cl&&Qd?null:Mn;default:return null}}:function(Mn,Sn){if(_s)return Mn==="compositionend"||!wl&&ef(Mn,Sn)?(Mn=Zc(),gs=Bi=Li=null,_s=!1,Mn):null;switch(Mn){case"paste":default:return null;case"keypress":if(!(Sn.ctrlKey||Sn.altKey||Sn.metaKey)||Sn.ctrlKey&&Sn.altKey){if(Sn.char&&1<Sn.char.length)return Sn.char;if(Sn.which)return String.fromCharCode(Sn.which)}return null;case"compositionend":return va&&Sn.locale!=="ko"?null:Sn.data}})(C,q))&&0<(Ve=Cg(Ve,"onBeforeInput")).length&&(rt=new gi("onBeforeInput","beforeinput",null,q,rt),mt.push({event:rt,listeners:Ve}),rt.data=kn)}$2(mt,P)},it=void 0;if(wt)He();else{wt=!0;try{YF(He,it)}finally{wt=!1,Nt()}}}function sf(C,P,q){return{instance:C,listener:P,currentTarget:q}}function Cg(C,P){for(var q=P+"Capture",ie=[];C!==null;){var oe=C,ae=oe.stateNode;oe.tag===5&&ae!==null&&(oe=ae,(ae=Re(C,q))!=null&&ie.unshift(sf(C,ae,oe)),(ae=Re(C,P))!=null&&ie.push(sf(C,ae,oe))),C=C.return}return ie}function iu(C){if(C===null)return null;for(;(C=C.return)&&C.tag!==5;);return C||null}function q2(C,P,q,ie,oe){for(var ae=P._reactName,ue=[];q!==null&&q!==ie;){var _e=q,me=_e.alternate,He=_e.stateNode;if(me!==null&&me===ie)break;_e.tag===5&&He!==null&&(_e=He,oe?(me=Re(q,ae))!=null&&ue.unshift(sf(q,me,_e)):(me=Re(q,ae))!=null&&ue.push(sf(q,me,_e))),q=q.return}ue.length!==0&&C.push({event:P,listeners:ue})}function Eg(){}var vv=null,_v=null;function J2(C,P){switch(C){case"button":case"input":case"select":case"textarea":return P.autoFocus}}function xv(C,P){return C==="textarea"||C==="option"||C==="noscript"||typeof P.children=="string"||typeof P.children=="number"||typeof P.dangerouslySetInnerHTML=="object"&&P.dangerouslySetInnerHTML!==null&&P.dangerouslySetInnerHTML.__html!=null}var V2=typeof setTimeout=="function"?setTimeout:void 0,kF=typeof clearTimeout=="function"?clearTimeout:void 0;function wv(C){(C.nodeType===1||C.nodeType===9&&(C=C.body)!=null)&&(C.textContent="")}function su(C){for(;C!=null;C=C.nextSibling){var P=C.nodeType;if(P===1||P===3)break}return C}function G2(C){C=C.previousSibling;for(var P=0;C;){if(C.nodeType===8){var q=C.data;if(q==="$"||q==="$!"||q==="$?"){if(P===0)return C;P--}else q==="/$"&&P++}C=C.previousSibling}return null}var Sv=0,xa="__reactFiber$"+(lr=Math.random().toString(36).slice(2)),Og="__reactProps$"+lr,au="__reactContainer$"+lr,Y2="__reactEvents$"+lr;function Ol(C){var P=C[xa];if(P)return P;for(var q=C.parentNode;q;){if(P=q[au]||q[xa]){if(q=P.alternate,P.child!==null||q!==null&&q.child!==null)for(C=G2(C);C!==null;){if(q=C[xa])return q;C=G2(C)}return P}q=(C=q).parentNode}return null}function af(C){return!(C=C[xa]||C[au])||C.tag!==5&&C.tag!==6&&C.tag!==13&&C.tag!==3?null:C}function lu(C){if(C.tag===5||C.tag===6)return C.stateNode;throw Error(a(33))}function Tg(C){return C[Og]||null}function X2(C){var P=C[Y2];return P===void 0?C[Y2]=new Set:P}var Cv=[],lf=-1;function wa(C){return{current:C}}function sr(C){lf<0||(C.current=Cv[lf],Cv[lf]=null,lf--)}function hr(C,P){Cv[++lf]=C.current,C.current=P}var Sa={},to=wa(Sa),Oo=wa(!1),Tl=Sa;function cu(C,P){var q=C.type.contextTypes;if(!q)return Sa;var ie=C.stateNode;if(ie&&ie.__reactInternalMemoizedUnmaskedChildContext===P)return ie.__reactInternalMemoizedMaskedChildContext;var oe,ae={};for(oe in q)ae[oe]=P[oe];return ie&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=P,C.__reactInternalMemoizedMaskedChildContext=ae),ae}function Fo(C){return C.childContextTypes!=null}function Ev(){sr(Oo),sr(to)}function Z2(C,P,q){if(to.current!==Sa)throw Error(a(168));hr(to,P),hr(Oo,q)}function Q2(C,P,q){var ie,oe=C.stateNode;if(C=P.childContextTypes,typeof oe.getChildContext!="function")return q;for(ie in oe=oe.getChildContext())if(!(ie in C))throw Error(a(108,Y(P)||"Unknown",ie));return i({},q,oe)}function Ng(C){C=(C=C.stateNode)&&C.__reactInternalMemoizedMergedChildContext||Sa,Tl=to.current,hr(to,C),hr(Oo,Oo.current)}function eT(C,P,q){var ie=C.stateNode;if(!ie)throw Error(a(169));q?(C=Q2(C,P,Tl),ie.__reactInternalMemoizedMergedChildContext=C,sr(Oo),sr(to),hr(to,C)):sr(Oo),hr(Oo,q)}var Ov=null,Nl=null,AF=u.unstable_runWithPriority,Tv=u.unstable_scheduleCallback,Nv=u.unstable_cancelCallback,PF=u.unstable_shouldYield,kv=(ct=u.unstable_requestPaint,u.unstable_now),MF=u.unstable_getCurrentPriorityLevel,kg=u.unstable_ImmediatePriority,tT=u.unstable_UserBlockingPriority,nT=u.unstable_NormalPriority,rT=u.unstable_LowPriority,oT=u.unstable_IdlePriority,Av={},IF=ct!==void 0?ct:function(){},xs=null,Ag=null,Pv=!1,iT=kv(),no=iT<1e4?kv:function(){return kv()-iT};function uu(){switch(MF()){case kg:return 99;case tT:return 98;case nT:return 97;case rT:return 96;case oT:return 95;default:throw Error(a(332))}}function sT(C){switch(C){case 99:return kg;case 98:return tT;case 97:return nT;case 96:return rT;case 95:return oT;default:throw Error(a(332))}}function kl(C,P){return C=sT(C),AF(C,P)}function cf(C,P,q){return C=sT(C),Tv(C,P,q)}function Hi(){var C;Ag!==null&&(C=Ag,Ag=null,Nv(C)),aT()}function aT(){if(!Pv&&xs!==null){Pv=!0;var C=0;try{var P=xs;kl(99,function(){for(;C<P.length;C++)for(var q=P[C];(q=q(!0))!==null;);}),xs=null}catch(q){throw xs!==null&&(xs=xs.slice(C+1)),Tv(kg,Hi),q}finally{Pv=!1}}}var RF=E.ReactCurrentBatchConfig;function yi(C,P){if(C&&C.defaultProps){for(var q in P=i({},P),C=C.defaultProps)P[q]===void 0&&(P[q]=C[q]);return P}return P}var Pg=wa(null),Mg=null,du=null,Ig=null;function Mv(){Ig=du=Mg=null}function Iv(C){var P=Pg.current;sr(Pg),C.type._context._currentValue=P}function lT(C,P){for(;C!==null;){var q=C.alternate;if((C.childLanes&P)===P){if(q===null||(q.childLanes&P)===P)break;q.childLanes|=P}else C.childLanes|=P,q!==null&&(q.childLanes|=P);C=C.return}}function fu(C,P){(Ig=du=null)!==(C=(Mg=C).dependencies)&&C.firstContext!==null&&(C.lanes&P&&(bi=!0),C.firstContext=null)}function Yo(C,P){if(Ig!==C&&P!==!1&&P!==0)if(typeof P=="number"&&P!==1073741823||(Ig=C,P=1073741823),P={context:C,observedBits:P,next:null},du===null){if(Mg===null)throw Error(a(308));du=P,Mg.dependencies={lanes:0,firstContext:P,responders:null}}else du=du.next=P;return C._currentValue}var Ca=!1;function Rv(C){C.updateQueue={baseState:C.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function cT(C,P){C=C.updateQueue,P.updateQueue===C&&(P.updateQueue={baseState:C.baseState,firstBaseUpdate:C.firstBaseUpdate,lastBaseUpdate:C.lastBaseUpdate,shared:C.shared,effects:C.effects})}function Ea(C,P){return{eventTime:C,lane:P,tag:0,payload:null,callback:null,next:null}}function Oa(C,P){var q;(C=C.updateQueue)!==null&&((q=(C=C.shared).pending)===null?P.next=P:(P.next=q.next,q.next=P),C.pending=P)}function uT(C,P){var q=C.updateQueue,ie=C.alternate;if(ie!==null&&q===(ie=ie.updateQueue)){var oe=null,ae=null;if((q=q.firstBaseUpdate)!==null){do var ue={eventTime:q.eventTime,lane:q.lane,tag:q.tag,payload:q.payload,callback:q.callback,next:null};while(ae===null?oe=ae=ue:ae=ae.next=ue,(q=q.next)!==null);ae===null?oe=ae=P:ae=ae.next=P}else oe=ae=P;return q={baseState:ie.baseState,firstBaseUpdate:oe,lastBaseUpdate:ae,shared:ie.shared,effects:ie.effects},void(C.updateQueue=q)}(C=q.lastBaseUpdate)===null?q.firstBaseUpdate=P:C.next=P,q.lastBaseUpdate=P}function uf(C,P,q,ie){var oe,ae,ue,_e,me=C.updateQueue,He=(Ca=!1,me.firstBaseUpdate),it=me.lastBaseUpdate;if((Ve=me.shared.pending)!==null&&(me.shared.pending=null,ae=(oe=Ve).next,(oe.next=null)===it?He=ae:it.next=ae,it=oe,(ue=C.alternate)!==null&&(_e=(ue=ue.updateQueue).lastBaseUpdate)!==it&&(_e===null?ue.firstBaseUpdate=ae:_e.next=ae,ue.lastBaseUpdate=oe)),He!==null){for(_e=me.baseState,it=0,ue=ae=oe=null;;){Ve=He.lane;var ft=He.eventTime;if((ie&Ve)===Ve){ue!==null&&(ue=ue.next={eventTime:ft,lane:0,tag:He.tag,payload:He.payload,callback:He.callback,next:null});e:{var Lt=C,kn=He,Ve=P;switch(ft=q,kn.tag){case 1:if(typeof(Lt=kn.payload)=="function"){_e=Lt.call(ft,_e,Ve);break e}_e=Lt;break e;case 3:Lt.flags=-4097&Lt.flags|64;case 0:if((Ve=typeof(Lt=kn.payload)=="function"?Lt.call(ft,_e,Ve):Lt)==null)break e;_e=i({},_e,Ve);break e;case 2:Ca=!0}}He.callback!==null&&(C.flags|=32,(Ve=me.effects)===null?me.effects=[He]:Ve.push(He))}else ft={eventTime:ft,lane:Ve,tag:He.tag,payload:He.payload,callback:He.callback,next:null},ue===null?(ae=ue=ft,oe=_e):ue=ue.next=ft,it|=Ve;if((He=He.next)===null){if((Ve=me.shared.pending)===null)break;He=Ve.next,Ve.next=null,me.lastBaseUpdate=Ve,me.shared.pending=null}}ue===null&&(oe=_e),me.baseState=oe,me.firstBaseUpdate=ae,me.lastBaseUpdate=ue,wf|=it,C.lanes=it,C.memoizedState=_e}}function dT(C,P,q){if(C=P.effects,(P.effects=null)!==C)for(P=0;P<C.length;P++){var ie=C[P],oe=ie.callback;if(oe!==null){if(ie.callback=null,ie=q,typeof oe!="function")throw Error(a(191,oe));oe.call(ie)}}}var fT=new o.Component().refs;function Rg(C,P,q,ie){q=(q=q(ie,P=C.memoizedState))==null?P:i({},P,q),C.memoizedState=q,C.lanes===0&&(C.updateQueue.baseState=q)}var jg={isMounted:function(C){return!!(C=C._reactInternals)&&kt(C)===C},enqueueSetState:function(C,P,q){C=C._reactInternals;var ie=zo(),oe=Aa(C),ae=Ea(ie,oe);ae.payload=P,q!=null&&(ae.callback=q),Oa(C,ae),Pa(C,oe,ie)},enqueueReplaceState:function(C,P,q){C=C._reactInternals;var ie=zo(),oe=Aa(C),ae=Ea(ie,oe);ae.tag=1,ae.payload=P,q!=null&&(ae.callback=q),Oa(C,ae),Pa(C,oe,ie)},enqueueForceUpdate:function(C,P){C=C._reactInternals;var q=zo(),ie=Aa(C),oe=Ea(q,ie);oe.tag=2,P!=null&&(oe.callback=P),Oa(C,oe),Pa(C,ie,q)}};function pT(C,P,q,ie,oe,ae,ue){return typeof(C=C.stateNode).shouldComponentUpdate=="function"?C.shouldComponentUpdate(ie,ae,ue):!(P.prototype&&P.prototype.isPureReactComponent&&nf(q,ie)&&nf(oe,ae))}function hT(C,P,q){var ie=!1,oe=Sa,ae=P.contextType;P=new P(q,ae=typeof ae=="object"&&ae!==null?Yo(ae):(oe=Fo(P)?Tl:to.current,(ie=(ie=P.contextTypes)!=null)?cu(C,oe):Sa)),C.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,P.updater=jg,(C.stateNode=P)._reactInternals=C,ie&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=oe,C.__reactInternalMemoizedMaskedChildContext=ae)}function gT(C,P,q,ie){C=P.state,typeof P.componentWillReceiveProps=="function"&&P.componentWillReceiveProps(q,ie),typeof P.UNSAFE_componentWillReceiveProps=="function"&&P.UNSAFE_componentWillReceiveProps(q,ie),P.state!==C&&jg.enqueueReplaceState(P,P.state,null)}function jv(C,P,q,ie){var oe=C.stateNode,ae=(oe.props=q,oe.state=C.memoizedState,oe.refs=fT,Rv(C),P.contextType);typeof ae=="object"&&ae!==null?oe.context=Yo(ae):(ae=Fo(P)?Tl:to.current,oe.context=cu(C,ae)),uf(C,q,oe,ie),oe.state=C.memoizedState,typeof(ae=P.getDerivedStateFromProps)=="function"&&(Rg(C,0,ae,q),oe.state=C.memoizedState),typeof P.getDerivedStateFromProps=="function"||typeof oe.getSnapshotBeforeUpdate=="function"||typeof oe.UNSAFE_componentWillMount!="function"&&typeof oe.componentWillMount!="function"||(P=oe.state,typeof oe.componentWillMount=="function"&&oe.componentWillMount(),typeof oe.UNSAFE_componentWillMount=="function"&&oe.UNSAFE_componentWillMount(),P!==oe.state&&jg.enqueueReplaceState(oe,oe.state,null),uf(C,q,oe,ie),oe.state=C.memoizedState),typeof oe.componentDidMount=="function"&&(C.flags|=4)}var Dg=Array.isArray;function df(C,P,q){if((C=q.ref)!==null&&typeof C!="function"&&typeof C!="object"){if(q._owner){if(q=q._owner){if(q.tag!==1)throw Error(a(309));var ie=q.stateNode}if(!ie)throw Error(a(147,C));var oe=""+C;return P!==null&&P.ref!==null&&typeof P.ref=="function"&&P.ref._stringRef===oe?P.ref:((P=function(ae){var ue=ie.refs;ue===fT&&(ue=ie.refs={}),ae===null?delete ue[oe]:ue[oe]=ae})._stringRef=oe,P)}if(typeof C!="string")throw Error(a(284));if(!q._owner)throw Error(a(290,C))}return C}function Lg(C,P){if(C.type!=="textarea")throw Error(a(31,Object.prototype.toString.call(P)==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":P))}function mT(C){function P(Ve,rt){var mt;C&&((mt=Ve.lastEffect)!==null?(mt.nextEffect=rt,Ve.lastEffect=rt):Ve.firstEffect=Ve.lastEffect=rt,rt.nextEffect=null,rt.flags=8)}function q(Ve,rt){if(!C)return null;for(;rt!==null;)P(Ve,rt),rt=rt.sibling;return null}function ie(Ve,rt){for(Ve=new Map;rt!==null;)rt.key!==null?Ve.set(rt.key,rt):Ve.set(rt.index,rt),rt=rt.sibling;return Ve}function oe(Ve,rt){return(Ve=Ra(Ve,rt)).index=0,Ve.sibling=null,Ve}function ae(Ve,rt,mt){return Ve.index=mt,C?(mt=Ve.alternate)===null||(mt=mt.index)<rt?(Ve.flags=2,rt):mt:rt}function ue(Ve){return C&&Ve.alternate===null&&(Ve.flags=2),Ve}function _e(Ve,rt,mt,Bt){return rt===null||rt.tag!==6?(rt=h_(mt,Ve.mode,Bt)).return=Ve:(rt=oe(rt,mt)).return=Ve,rt}function me(Ve,rt,mt,Bt){return rt!==null&&rt.elementType===mt.type?(Bt=oe(rt,mt.props)).ref=df(0,rt,mt):(Bt=em(mt.type,mt.key,mt.props,null,Ve.mode,Bt)).ref=df(0,rt,mt),Bt.return=Ve,Bt}function He(Ve,rt,mt,Bt){return rt===null||rt.tag!==4||rt.stateNode.containerInfo!==mt.containerInfo||rt.stateNode.implementation!==mt.implementation?(rt=g_(mt,Ve.mode,Bt)).return=Ve:(rt=oe(rt,mt.children||[])).return=Ve,rt}function it(Ve,rt,mt,Bt,Dt){return rt===null||rt.tag!==7?(rt=xu(mt,Ve.mode,Bt,Dt)).return=Ve:(rt=oe(rt,mt)).return=Ve,rt}function ft(Ve,rt,mt){if(typeof rt=="string"||typeof rt=="number")return(rt=h_(""+rt,Ve.mode,mt)).return=Ve,rt;if(typeof rt=="object"&&rt!==null){switch(rt.$$typeof){case O:return(mt=em(rt.type,rt.key,rt.props,null,Ve.mode,mt)).ref=df(0,null,rt),mt.return=Ve,mt;case j:return(rt=g_(rt,Ve.mode,mt)).return=Ve,rt}if(Dg(rt)||N(rt))return(rt=xu(rt,Ve.mode,mt,null)).return=Ve,rt;Lg(Ve,rt)}return null}function Lt(Ve,rt,mt,Bt){var Dt=rt!==null?rt.key:null;if(typeof mt=="string"||typeof mt=="number")return Dt!==null?null:_e(Ve,rt,""+mt,Bt);if(typeof mt=="object"&&mt!==null){switch(mt.$$typeof){case O:return mt.key===Dt?mt.type===A?it(Ve,rt,mt.props.children,Bt,Dt):me(Ve,rt,mt,Bt):null;case j:return mt.key===Dt?He(Ve,rt,mt,Bt):null}if(Dg(mt)||N(mt))return Dt!==null?null:it(Ve,rt,mt,Bt,null);Lg(Ve,mt)}return null}function kn(Ve,rt,mt,Bt,Dt){if(typeof Bt=="string"||typeof Bt=="number")return _e(rt,Ve=Ve.get(mt)||null,""+Bt,Dt);if(typeof Bt=="object"&&Bt!==null){switch(Bt.$$typeof){case O:return Ve=Ve.get(Bt.key===null?mt:Bt.key)||null,Bt.type===A?it(rt,Ve,Bt.props.children,Dt,Bt.key):me(rt,Ve,Bt,Dt);case j:return He(rt,Ve=Ve.get(Bt.key===null?mt:Bt.key)||null,Bt,Dt)}if(Dg(Bt)||N(Bt))return it(rt,Ve=Ve.get(mt)||null,Bt,Dt,null);Lg(rt,Bt)}return null}return function(Ve,rt,mt,Bt){var Dt=typeof mt=="object"&&mt!==null&&mt.type===A&&mt.key===null,tn=typeof(mt=Dt?mt.props.children:mt)=="object"&&mt!==null;if(tn)switch(mt.$$typeof){case O:e:{for(tn=mt.key,Dt=rt;Dt!==null;){if(Dt.key===tn){switch(Dt.tag){case 7:if(mt.type!==A)break;q(Ve,Dt.sibling),(rt=oe(Dt,mt.props.children)).return=Ve,Ve=rt;break e;default:if(Dt.elementType===mt.type){q(Ve,Dt.sibling),(rt=oe(Dt,mt.props)).ref=df(0,Dt,mt),rt.return=Ve,Ve=rt;break e}}q(Ve,Dt);break}P(Ve,Dt),Dt=Dt.sibling}Ve=mt.type===A?((rt=xu(mt.props.children,Ve.mode,Bt,mt.key)).return=Ve,rt):((Bt=em(mt.type,mt.key,mt.props,null,Ve.mode,Bt)).ref=df(0,rt,mt),Bt.return=Ve,Bt)}return ue(Ve);case j:e:{for(Dt=mt.key;rt!==null;){if(rt.key===Dt){if(rt.tag===4&&rt.stateNode.containerInfo===mt.containerInfo&&rt.stateNode.implementation===mt.implementation){q(Ve,rt.sibling),(rt=oe(rt,mt.children||[])).return=Ve,Ve=rt;break e}q(Ve,rt);break}P(Ve,rt),rt=rt.sibling}(rt=g_(mt,Ve.mode,Bt)).return=Ve,Ve=rt}return ue(Ve)}if(typeof mt=="string"||typeof mt=="number")return mt=""+mt,(rt=rt!==null&&rt.tag===6?(q(Ve,rt.sibling),oe(rt,mt)):(q(Ve,rt),h_(mt,Ve.mode,Bt))).return=Ve,ue(Ve=rt);if(Dg(mt)){for(var yn=Ve,sn=rt,nn=mt,jn=Bt,zn=null,qn=null,En=sn,Mn=sn=0,Sn=null;En!==null&&Mn<nn.length;Mn++){En.index>Mn?(Sn=En,En=null):Sn=En.sibling;var er=Lt(yn,En,nn[Mn],jn);if(er===null){En===null&&(En=Sn);break}C&&En&&er.alternate===null&&P(yn,En),sn=ae(er,sn,Mn),qn===null?zn=er:qn.sibling=er,qn=er,En=Sn}if(Mn===nn.length)return q(yn,En),zn;if(En===null){for(;Mn<nn.length;Mn++)(En=ft(yn,nn[Mn],jn))!==null&&(sn=ae(En,sn,Mn),qn===null?zn=En:qn.sibling=En,qn=En);return zn}for(En=ie(yn,En);Mn<nn.length;Mn++)(Sn=kn(En,yn,Mn,nn[Mn],jn))!==null&&(C&&Sn.alternate!==null&&En.delete(Sn.key===null?Mn:Sn.key),sn=ae(Sn,sn,Mn),qn===null?zn=Sn:qn.sibling=Sn,qn=Sn);return C&&En.forEach(function(__){return P(yn,__)}),zn}if(N(mt)){var gr=Ve,ei=rt,Vi=mt,v_=Bt,Es=N(Vi);if(typeof Es!="function")throw Error(a(150));if((Vi=Es.call(Vi))==null)throw Error(a(151));for(var Os=Es=null,Fr=ei,Ts=ei=0,rm=null,ur=Vi.next();Fr!==null&&!ur.done;Ts++,ur=Vi.next()){Fr.index>Ts?(rm=Fr,Fr=null):rm=Fr.sibling;var wu=Lt(gr,Fr,ur.value,v_);if(wu===null){Fr===null&&(Fr=rm);break}C&&Fr&&wu.alternate===null&&P(gr,Fr),ei=ae(wu,ei,Ts),Os===null?Es=wu:Os.sibling=wu,Os=wu,Fr=rm}if(ur.done)return q(gr,Fr),Es;if(Fr===null){for(;!ur.done;Ts++,ur=Vi.next())(ur=ft(gr,ur.value,v_))!==null&&(ei=ae(ur,ei,Ts),Os===null?Es=ur:Os.sibling=ur,Os=ur);return Es}for(Fr=ie(gr,Fr);!ur.done;Ts++,ur=Vi.next())(ur=kn(Fr,gr,Ts,ur.value,v_))!==null&&(C&&ur.alternate!==null&&Fr.delete(ur.key===null?Ts:ur.key),ei=ae(ur,ei,Ts),Os===null?Es=ur:Os.sibling=ur,Os=ur);return C&&Fr.forEach(function(__){return P(gr,__)}),Es}if(tn&&Lg(Ve,mt),mt===void 0&&!Dt)switch(Ve.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,Y(Ve.type)||"Component"))}return q(Ve,rt)}}var Bg=mT(!0),yT=mT(!1),ff={},Ki=wa(ff),pf=wa(ff),hf=wa(ff);function Al(C){if(C===ff)throw Error(a(174));return C}function Dv(C,P){switch(hr(hf,P),hr(pf,C),hr(Ki,ff),C=P.nodeType){case 9:case 11:P=(P=P.documentElement)?P.namespaceURI:Ee(null,"");break;default:P=Ee(P=(C=C===8?P.parentNode:P).namespaceURI||null,C=C.tagName)}sr(Ki),hr(Ki,P)}function pu(){sr(Ki),sr(pf),sr(hf)}function bT(C){Al(hf.current);var P=Al(Ki.current),q=Ee(P,C.type);P!==q&&(hr(pf,C),hr(Ki,q))}function Lv(C){pf.current===C&&(sr(Ki),sr(pf))}var vr=wa(0);function Fg(C){for(var P=C;P!==null;){if(P.tag===13){var q=P.memoizedState;if(q!==null&&((q=q.dehydrated)===null||q.data==="$?"||q.data==="$!"))return P}else if(P.tag===19&&P.memoizedProps.revealOrder!==void 0){if(64&P.flags)return P}else if(P.child!==null){P=(P.child.return=P).child;continue}if(P===C)break;for(;P.sibling===null;){if(P.return===null||P.return===C)return null;P=P.return}P.sibling.return=P.return,P=P.sibling}return null}var ws=null,Ta=null,Wi=!1;function vT(C,P){var q=Qo(5,null,null,0);q.elementType="DELETED",q.type="DELETED",q.stateNode=P,q.return=C,q.flags=8,C.lastEffect!==null?(C.lastEffect.nextEffect=q,C.lastEffect=q):C.firstEffect=C.lastEffect=q}function _T(C,P){switch(C.tag){case 5:var q=C.type;return(P=P.nodeType!==1||q.toLowerCase()!==P.nodeName.toLowerCase()?null:P)!==null&&(C.stateNode=P,1);case 6:return(P=C.pendingProps===""||P.nodeType!==3?null:P)!==null&&(C.stateNode=P,1);default:return}}function Bv(C){if(Wi){var P=Ta;if(P){var q=P;if(!_T(C,P)){if(!(P=su(q.nextSibling))||!_T(C,P))return C.flags=-1025&C.flags|2,Wi=!1,void(ws=C);vT(ws,q)}ws=C,Ta=su(P.firstChild)}else C.flags=-1025&C.flags|2,Wi=!1,ws=C}}function xT(C){for(C=C.return;C!==null&&C.tag!==5&&C.tag!==3&&C.tag!==13;)C=C.return;ws=C}function $g(C){if(C===ws){if(!Wi)return xT(C),Wi=!0,0;var P=C.type;if(C.tag!==5||P!=="head"&&P!=="body"&&!xv(P,C.memoizedProps))for(P=Ta;P;)vT(C,P),P=su(P.nextSibling);if(xT(C),C.tag===13){if(!(C=(C=C.memoizedState)!==null?C.dehydrated:null))throw Error(a(317));e:{for(C=C.nextSibling,P=0;C;){if(C.nodeType===8){var q=C.data;if(q==="/$"){if(P===0){Ta=su(C.nextSibling);break e}P--}else q!=="$"&&q!=="$!"&&q!=="$?"||P++}C=C.nextSibling}Ta=null}}else Ta=ws?su(C.stateNode.nextSibling):null;return 1}}function Fv(){Ta=ws=null,Wi=!1}var hu=[];function $v(){for(var C=0;C<hu.length;C++)hu[C]._workInProgressVersionPrimary=null;hu.length=0}var gf=E.ReactCurrentDispatcher,Xo=E.ReactCurrentBatchConfig,mf=0,_r=null,mo=null,Kr=null,zg=!1,yf=!1;function To(){throw Error(a(321))}function zv(C,P){if(P!==null){for(var q=0;q<P.length&&q<C.length;q++)if(!Or(C[q],P[q]))return;return 1}}function Uv(C,P,q,ie,oe,ae){if(mf=ae,(_r=P).memoizedState=null,P.updateQueue=null,P.lanes=0,gf.current=C===null||C.memoizedState===null?jF:DF,C=q(ie,oe),yf){ae=0;do if(yf=!1,!(ae<25))throw Error(a(301));while(ae+=1,Kr=mo=null,P.updateQueue=null,gf.current=LF,C=q(ie,oe),yf)}if(gf.current=Wg,P=mo!==null&&mo.next!==null,mf=0,Kr=mo=_r=null,zg=!1,P)throw Error(a(300));return C}function Pl(){var C={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kr===null?_r.memoizedState=Kr=C:Kr=Kr.next=C,Kr}function Ml(){C=mo===null?(C=_r.alternate)!==null?C.memoizedState:null:mo.next;var C,P=Kr===null?_r.memoizedState:Kr.next;if(P!==null)Kr=P,mo=C;else{if(C===null)throw Error(a(310));C={memoizedState:(mo=C).memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},Kr===null?_r.memoizedState=Kr=C:Kr=Kr.next=C}return Kr}function qi(C,P){return typeof P=="function"?P(C):P}function bf(C){var P=Ml(),q=P.queue;if(q===null)throw Error(a(311));q.lastRenderedReducer=C;var ie,oe=(ue=mo).baseQueue,ae=q.pending;if(ae!==null&&(oe!==null&&(ie=oe.next,oe.next=ae.next,ae.next=ie),ue.baseQueue=oe=ae,q.pending=null),oe!==null){oe=oe.next;var ue=ue.baseState,_e=ie=ae=null,me=oe;do var He,it=me.lane;while((mf&it)===it?(_e!==null&&(_e=_e.next={lane:0,action:me.action,eagerReducer:me.eagerReducer,eagerState:me.eagerState,next:null}),ue=me.eagerReducer===C?me.eagerState:C(ue,me.action)):(He={lane:it,action:me.action,eagerReducer:me.eagerReducer,eagerState:me.eagerState,next:null},_e===null?(ie=_e=He,ae=ue):_e=_e.next=He,_r.lanes|=it,wf|=it),(me=me.next)!==null&&me!==oe);_e===null?ae=ue:_e.next=ie,Or(ue,P.memoizedState)||(bi=!0),P.memoizedState=ue,P.baseState=ae,P.baseQueue=_e,q.lastRenderedState=ue}return[P.memoizedState,q.dispatch]}function vf(C){var P=Ml(),q=P.queue;if(q===null)throw Error(a(311));q.lastRenderedReducer=C;var ie=q.dispatch,oe=q.pending,ae=P.memoizedState;if(oe!==null){q.pending=null;for(var ue=oe=oe.next;ae=C(ae,ue.action),(ue=ue.next)!==oe;);Or(ae,P.memoizedState)||(bi=!0),P.memoizedState=ae,P.baseQueue===null&&(P.baseState=ae),q.lastRenderedState=ae}return[ae,ie]}function wT(C,P,q){var ie=(ie=P._getVersion)(P._source),oe=P._workInProgressVersionPrimary;if(oe!==null?C=oe===ie:(C=C.mutableReadLanes,(C=(mf&C)===C)&&(P._workInProgressVersionPrimary=ie,hu.push(P))),C)return q(P._source);throw hu.push(P),Error(a(350))}function ST(C,P,q,ie){var oe=yo;if(oe===null)throw Error(a(349));var ae=P._getVersion,ue=ae(P._source),_e=gf.current,me=(it=_e.useState(function(){return wT(oe,P,q)}))[1],He=it[0],it=Kr,ft=(Ve=C.memoizedState).refs,Lt=ft.getSnapshot,kn=Ve.source,Ve=Ve.subscribe,rt=_r;return C.memoizedState={refs:ft,source:P,subscribe:ie},_e.useEffect(function(){ft.getSnapshot=q,ft.setSnapshot=me;var mt=ae(P._source);if(!Or(ue,mt)){mt=q(P._source),Or(He,mt)||(me(mt),mt=Aa(rt),oe.mutableReadLanes|=mt&oe.pendingLanes),mt=oe.mutableReadLanes,oe.entangledLanes|=mt;for(var Bt=oe.entanglements,Dt=mt;0<Dt;){var tn=31-hi(Dt),yn=1<<tn;Bt[tn]|=mt,Dt&=~yn}}},[q,P,ie]),_e.useEffect(function(){return ie(P._source,function(){var mt=ft.getSnapshot,Bt=ft.setSnapshot;try{Bt(mt(P._source));var Dt=Aa(rt);oe.mutableReadLanes|=Dt&oe.pendingLanes}catch(tn){Bt(function(){throw tn})}})},[P,ie]),Or(Lt,q)&&Or(kn,P)&&Or(Ve,ie)||((C={pending:null,dispatch:null,lastRenderedReducer:qi,lastRenderedState:He}).dispatch=me=qv.bind(null,_r,C),it.queue=C,it.baseQueue=null,He=wT(oe,P,q),it.memoizedState=it.baseState=He),He}function CT(C,P,q){return ST(Ml(),C,P,q)}function _f(C){var P=Pl();return typeof C=="function"&&(C=C()),P.memoizedState=P.baseState=C,C=(C=P.queue={pending:null,dispatch:null,lastRenderedReducer:qi,lastRenderedState:C}).dispatch=qv.bind(null,_r,C),[P.memoizedState,C]}function Ug(C,P,q,ie){return C={tag:C,create:P,destroy:q,deps:ie,next:null},(P=_r.updateQueue)===null?(_r.updateQueue=P={lastEffect:null}).lastEffect=C.next=C:(q=P.lastEffect)===null?P.lastEffect=C.next=C:(ie=q.next,(q.next=C).next=ie,P.lastEffect=C),C}function ET(C){return Pl().memoizedState={current:C}}function Hg(){return Ml().memoizedState}function Hv(C,P,q,ie){var oe=Pl();_r.flags|=C,oe.memoizedState=Ug(1|P,q,void 0,ie===void 0?null:ie)}function Kv(C,P,q,ie){var oe=Ml(),ae=void(ie=ie===void 0?null:ie);if(mo!==null){var ue=mo.memoizedState;if(ae=ue.destroy,ie!==null&&zv(ie,ue.deps))return void Ug(P,q,ae,ie)}_r.flags|=C,oe.memoizedState=Ug(1|P,q,ae,ie)}function OT(C,P){return Hv(516,4,C,P)}function Kg(C,P){return Kv(516,4,C,P)}function TT(C,P){return Kv(4,2,C,P)}function NT(C,P){return typeof P=="function"?(C=C(),P(C),function(){P(null)}):P!=null?(C=C(),P.current=C,function(){P.current=null}):void 0}function kT(C,P,q){return q=q!=null?q.concat([C]):null,Kv(4,2,NT.bind(null,P,C),q)}function Wv(){}function AT(C,P){var q=Ml(),ie=(P=P===void 0?null:P,q.memoizedState);return ie!==null&&P!==null&&zv(P,ie[1])?ie[0]:(q.memoizedState=[C,P],C)}function PT(C,P){var q=Ml(),ie=(P=P===void 0?null:P,q.memoizedState);return ie!==null&&P!==null&&zv(P,ie[1])?ie[0]:(C=C(),q.memoizedState=[C,P],C)}function qv(C,P,q){var ie=zo(),oe=Aa(C),ae={lane:oe,action:q,eagerReducer:null,eagerState:null,next:null},ue=P.pending;if(ue===null?ae.next=ae:(ae.next=ue.next,ue.next=ae),P.pending=ae,ue=C.alternate,C===_r||ue!==null&&ue===_r)yf=zg=!0;else{if(C.lanes===0&&(ue===null||ue.lanes===0)&&(ue=P.lastRenderedReducer)!==null)try{var _e=P.lastRenderedState,me=ue(_e,q);if(ae.eagerReducer=ue,ae.eagerState=me,Or(me,_e))return}catch{}Pa(C,oe,ie)}}var Wg={readContext:Yo,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useMutableSource:To,useOpaqueIdentifier:To,unstable_isNewReconciler:!1},jF={readContext:Yo,useCallback:function(C,P){return Pl().memoizedState=[C,P===void 0?null:P],C},useContext:Yo,useEffect:OT,useImperativeHandle:function(C,P,q){return q=q!=null?q.concat([C]):null,Hv(4,2,NT.bind(null,P,C),q)},useLayoutEffect:function(C,P){return Hv(4,2,C,P)},useMemo:function(C,P){var q=Pl();return P=P===void 0?null:P,C=C(),q.memoizedState=[C,P],C},useReducer:function(C,P,q){var ie=Pl();return P=q!==void 0?q(P):P,ie.memoizedState=ie.baseState=P,C=(C=ie.queue={pending:null,dispatch:null,lastRenderedReducer:C,lastRenderedState:P}).dispatch=qv.bind(null,_r,C),[ie.memoizedState,C]},useRef:ET,useState:_f,useDebugValue:Wv,useDeferredValue:function(C){var P=_f(C),q=P[0],ie=P[1];return OT(function(){var oe=Xo.transition;Xo.transition=1;try{ie(C)}finally{Xo.transition=oe}},[C]),q},useTransition:function(){var C=_f(!1),P=C[0];return ET(C=(function(q,ie){var oe=uu();kl(oe<98?98:oe,function(){q(!0)}),kl(97<oe?97:oe,function(){var ae=Xo.transition;Xo.transition=1;try{q(!1),ie()}finally{Xo.transition=ae}})}).bind(null,C[1])),[C,P]},useMutableSource:function(C,P,q){var ie=Pl();return ie.memoizedState={refs:{getSnapshot:P,setSnapshot:null},source:C,subscribe:q},ST(ie,C,P,q)},useOpaqueIdentifier:function(){var C,P,q;return Wi?(C=!1,q={$$typeof:z,toString:q=function(){throw C||(C=!0,P("r:"+(Sv++).toString(36))),Error(a(355))},valueOf:q},P=_f(q)[1],!(2&_r.mode)&&(_r.flags|=516,Ug(5,function(){P("r:"+(Sv++).toString(36))},void 0,null))):_f(q="r:"+(Sv++).toString(36)),q},unstable_isNewReconciler:!1},DF={readContext:Yo,useCallback:AT,useContext:Yo,useEffect:Kg,useImperativeHandle:kT,useLayoutEffect:TT,useMemo:PT,useReducer:bf,useRef:Hg,useState:function(){return bf(qi)},useDebugValue:Wv,useDeferredValue:function(C){var P=bf(qi),q=P[0],ie=P[1];return Kg(function(){var oe=Xo.transition;Xo.transition=1;try{ie(C)}finally{Xo.transition=oe}},[C]),q},useTransition:function(){var C=bf(qi)[0];return[Hg().current,C]},useMutableSource:CT,useOpaqueIdentifier:function(){return bf(qi)[0]},unstable_isNewReconciler:!1},LF={readContext:Yo,useCallback:AT,useContext:Yo,useEffect:Kg,useImperativeHandle:kT,useLayoutEffect:TT,useMemo:PT,useReducer:vf,useRef:Hg,useState:function(){return vf(qi)},useDebugValue:Wv,useDeferredValue:function(C){var P=vf(qi),q=P[0],ie=P[1];return Kg(function(){var oe=Xo.transition;Xo.transition=1;try{ie(C)}finally{Xo.transition=oe}},[C]),q},useTransition:function(){var C=vf(qi)[0];return[Hg().current,C]},useMutableSource:CT,useOpaqueIdentifier:function(){return vf(qi)[0]},unstable_isNewReconciler:!1},BF=E.ReactCurrentOwner,bi=!1;function $o(C,P,q,ie){P.child=C===null?yT(P,null,q,ie):Bg(P,C.child,q,ie)}function MT(C,P,q,ie,oe){q=q.render;var ae=P.ref;return fu(P,oe),ie=Uv(C,P,q,ie,ae,oe),C===null||bi?(P.flags|=1,$o(C,P,ie,oe),P.child):(P.updateQueue=C.updateQueue,P.flags&=-517,C.lanes&=~oe,Ss(C,P,oe))}function IT(C,P,q,ie,oe,ae){var ue;return C===null?typeof(ue=q.type)!="function"||f_(ue)||ue.defaultProps!==void 0||q.compare!==null||q.defaultProps!==void 0?((C=em(q.type,null,ie,P,P.mode,ae)).ref=P.ref,(C.return=P).child=C):(P.tag=15,P.type=ue,RT(C,P,ue,ie,oe,ae)):(ue=C.child,oe&ae||(oe=ue.memoizedProps,!(q=(q=q.compare)!==null?q:nf)(oe,ie)||C.ref!==P.ref)?(P.flags|=1,(C=Ra(ue,ie)).ref=P.ref,(C.return=P).child=C):Ss(C,P,ae))}function RT(C,P,q,ie,oe,ae){if(C!==null&&nf(C.memoizedProps,ie)&&C.ref===P.ref){if(bi=!1,!(ae&oe))return P.lanes=C.lanes,Ss(C,P,ae);16384&C.flags&&(bi=!0)}return Jv(C,P,q,ie,ae)}function jT(C,P,q){var ie=P.pendingProps,oe=ie.children,ae=C!==null?C.memoizedState:null;if(ie.mode==="hidden"||ie.mode==="unstable-defer-without-hiding")if(4&P.mode){if(!(1073741824&q))return C=ae!==null?ae.baseLanes|q:q,P.lanes=P.childLanes=1073741824,P.memoizedState={baseLanes:C},Qg(0,C),null;P.memoizedState={baseLanes:0},Qg(0,ae!==null?ae.baseLanes:q)}else P.memoizedState={baseLanes:0},Qg(0,q);else ae!==null?(ie=ae.baseLanes|q,P.memoizedState=null):ie=q,Qg(0,ie);return $o(C,P,oe,q),P.child}function DT(C,P){var q=P.ref;(C===null&&q!==null||C!==null&&C.ref!==q)&&(P.flags|=128)}function Jv(C,P,q,ie,oe){var ae=cu(P,Fo(q)?Tl:to.current);return fu(P,oe),q=Uv(C,P,q,ie,ae,oe),C===null||bi?(P.flags|=1,$o(C,P,q,oe),P.child):(P.updateQueue=C.updateQueue,P.flags&=-517,C.lanes&=~oe,Ss(C,P,oe))}function LT(C,P,q,ie,oe){var ae,ue,_e,me,He,it,ft,Lt,kn,Ve;return Fo(q)?(ae=!0,Ng(P)):ae=!1,fu(P,oe),ie=P.stateNode===null?(C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),hT(P,q,ie),jv(P,q,ie,oe),!0):C===null?(ue=P.stateNode,_e=P.memoizedProps,ue.props=_e,Lt=ue.context,me=typeof(me=q.contextType)=="object"&&me!==null?Yo(me):cu(P,me=Fo(q)?Tl:to.current),(it=typeof(He=q.getDerivedStateFromProps)=="function"||typeof ue.getSnapshotBeforeUpdate=="function")||typeof ue.UNSAFE_componentWillReceiveProps!="function"&&typeof ue.componentWillReceiveProps!="function"||_e===ie&&Lt===me||gT(0,ue,ie,me),Ca=!1,ft=P.memoizedState,ue.state=ft,uf(P,ie,ue,oe),Lt=P.memoizedState,_e!==ie||ft!==Lt||Oo.current||Ca?(typeof He=="function"&&(Rg(P,0,He,ie),Lt=P.memoizedState),(_e=Ca||pT(P,q,_e,ie,ft,Lt,me))?(it||typeof ue.UNSAFE_componentWillMount!="function"&&typeof ue.componentWillMount!="function"||(typeof ue.componentWillMount=="function"&&ue.componentWillMount(),typeof ue.UNSAFE_componentWillMount=="function"&&ue.UNSAFE_componentWillMount()),typeof ue.componentDidMount=="function"&&(P.flags|=4)):(typeof ue.componentDidMount=="function"&&(P.flags|=4),P.memoizedProps=ie,P.memoizedState=Lt),ue.props=ie,ue.state=Lt,ue.context=me,_e):(typeof ue.componentDidMount=="function"&&(P.flags|=4),!1)):(ue=P.stateNode,cT(C,P),_e=P.memoizedProps,me=P.type===P.elementType?_e:yi(P.type,_e),ue.props=me,it=P.pendingProps,ft=ue.context,Lt=typeof(Lt=q.contextType)=="object"&&Lt!==null?Yo(Lt):cu(P,Lt=Fo(q)?Tl:to.current),(He=typeof(kn=q.getDerivedStateFromProps)=="function"||typeof ue.getSnapshotBeforeUpdate=="function")||typeof ue.UNSAFE_componentWillReceiveProps!="function"&&typeof ue.componentWillReceiveProps!="function"||_e===it&&ft===Lt||gT(0,ue,ie,Lt),Ca=!1,ft=P.memoizedState,ue.state=ft,uf(P,ie,ue,oe),Ve=P.memoizedState,_e!==it||ft!==Ve||Oo.current||Ca?(typeof kn=="function"&&(Rg(P,0,kn,ie),Ve=P.memoizedState),(me=Ca||pT(P,q,me,ie,ft,Ve,Lt))?(He||typeof ue.UNSAFE_componentWillUpdate!="function"&&typeof ue.componentWillUpdate!="function"||(typeof ue.componentWillUpdate=="function"&&ue.componentWillUpdate(ie,Ve,Lt),typeof ue.UNSAFE_componentWillUpdate=="function"&&ue.UNSAFE_componentWillUpdate(ie,Ve,Lt)),typeof ue.componentDidUpdate=="function"&&(P.flags|=4),typeof ue.getSnapshotBeforeUpdate=="function"&&(P.flags|=256)):(typeof ue.componentDidUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=4),typeof ue.getSnapshotBeforeUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=256),P.memoizedProps=ie,P.memoizedState=Ve),ue.props=ie,ue.state=Ve,ue.context=Lt,me):(typeof ue.componentDidUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=4),typeof ue.getSnapshotBeforeUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=256),!1)),Vv(C,P,q,ie,ae,oe)}function Vv(C,P,q,ie,oe,ae){DT(C,P);var ue=!!(64&P.flags);if(!ie&&!ue)return oe&&eT(P,q,!1),Ss(C,P,ae);ie=P.stateNode,BF.current=P;var _e=ue&&typeof q.getDerivedStateFromError!="function"?null:ie.render();return P.flags|=1,C!==null&&ue?(P.child=Bg(P,C.child,null,ae),P.child=Bg(P,null,_e,ae)):$o(C,P,_e,ae),P.memoizedState=ie.state,oe&&eT(P,q,!0),P.child}function BT(C){var P=C.stateNode;P.pendingContext?Z2(0,P.pendingContext,P.pendingContext!==P.context):P.context&&Z2(0,P.context,!1),Dv(C,P.containerInfo)}var Gv={dehydrated:null,retryLane:0};function FT(C,P,q){var ie,oe=P.pendingProps,ae=vr.current,ue=!1;return(ie=(ie=!!(64&P.flags))?ie:(C===null||C.memoizedState!==null)&&!!(2&ae))?(ue=!0,P.flags&=-65):C!==null&&C.memoizedState===null||oe.fallback===void 0||oe.unstable_avoidThisFallback===!0||(ae|=1),hr(vr,1&ae),C===null?(oe.fallback!==void 0&&Bv(P),C=oe.children,ae=oe.fallback,ue?(C=$T(P,C,ae,q),P.child.memoizedState={baseLanes:q},P.memoizedState=Gv,C):typeof oe.unstable_expectedLoadTime=="number"?(C=$T(P,C,ae,q),P.child.memoizedState={baseLanes:q},P.memoizedState=Gv,P.lanes=33554432,C):((q=p_({mode:"visible",children:C},P.mode,q,null)).return=P).child=q):(C.memoizedState,ue?(oe=function(_e,me,He,it,ft){var Lt=me.mode,kn=_e.child,Ve=(_e=kn.sibling,{mode:"hidden",children:He});return 2&Lt||me.child===kn?He=Ra(kn,Ve):((He=me.child).childLanes=0,He.pendingProps=Ve,(kn=He.lastEffect)!==null?(me.firstEffect=He.firstEffect,(me.lastEffect=kn).nextEffect=null):me.firstEffect=me.lastEffect=null),_e!==null?it=Ra(_e,it):(it=xu(it,Lt,ft,null)).flags|=2,it.return=me,He.return=me,He.sibling=it,me.child=He,it}(C,P,oe.children,oe.fallback,q),ue=P.child,ae=C.child.memoizedState,ue.memoizedState=ae===null?{baseLanes:q}:{baseLanes:ae.baseLanes|q},ue.childLanes=C.childLanes&~q,P.memoizedState=Gv,oe):(q=function(_e,me,He,it){var ft=_e.child;return _e=ft.sibling,He=Ra(ft,{mode:"visible",children:He}),!(2&me.mode)&&(He.lanes=it),He.return=me,(He.sibling=null)!==_e&&(_e.nextEffect=null,_e.flags=8,me.firstEffect=me.lastEffect=_e),me.child=He}(C,P,oe.children,q),P.memoizedState=null,q))}function $T(C,P,q,ie){var oe=C.mode,ae=C.child;return P={mode:"hidden",children:P},2&oe||ae===null?ae=p_(P,oe,0,null):(ae.childLanes=0,ae.pendingProps=P),q=xu(q,oe,ie,null),ae.return=C,q.return=C,ae.sibling=q,C.child=ae,q}function zT(C,P){C.lanes|=P;var q=C.alternate;q!==null&&(q.lanes|=P),lT(C.return,P)}function Yv(C,P,q,ie,oe,ae){var ue=C.memoizedState;ue===null?C.memoizedState={isBackwards:P,rendering:null,renderingStartTime:0,last:ie,tail:q,tailMode:oe,lastEffect:ae}:(ue.isBackwards=P,ue.rendering=null,ue.renderingStartTime=0,ue.last=ie,ue.tail=q,ue.tailMode=oe,ue.lastEffect=ae)}function UT(C,P,q){var ie=P.pendingProps,oe=ie.revealOrder,ae=ie.tail;if($o(C,P,ie.children,q),2&(ie=vr.current))ie=1&ie|2,P.flags|=64;else{if(C!==null&&64&C.flags)e:for(C=P.child;C!==null;){if(C.tag===13)C.memoizedState!==null&&zT(C,q);else if(C.tag===19)zT(C,q);else if(C.child!==null){C=(C.child.return=C).child;continue}if(C===P)break;for(;C.sibling===null;){if(C.return===null||C.return===P)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}ie&=1}if(hr(vr,ie),2&P.mode)switch(oe){case"forwards":for(q=P.child,oe=null;q!==null;)(C=q.alternate)!==null&&Fg(C)===null&&(oe=q),q=q.sibling;(q=oe)===null?(oe=P.child,P.child=null):(oe=q.sibling,q.sibling=null),Yv(P,!1,oe,q,ae,P.lastEffect);break;case"backwards":for(oe=P.child,P.child=q=null;oe!==null;){if((C=oe.alternate)!==null&&Fg(C)===null){P.child=oe;break}C=oe.sibling,oe.sibling=q,q=oe,oe=C}Yv(P,!0,q,null,ae,P.lastEffect);break;case"together":Yv(P,!1,null,null,void 0,P.lastEffect);break;default:P.memoizedState=null}else P.memoizedState=null;return P.child}function Ss(C,P,q){if(C!==null&&(P.dependencies=C.dependencies),wf|=P.lanes,!(q&P.childLanes))return null;if(C!==null&&P.child!==C.child)throw Error(a(153));if(P.child!==null){for(q=Ra(C=P.child,C.pendingProps),(P.child=q).return=P;C.sibling!==null;)C=C.sibling,(q=q.sibling=Ra(C,C.pendingProps)).return=P;q.sibling=null}return P.child}function xf(C,P){if(!Wi)switch(C.tailMode){case"hidden":P=C.tail;for(var q=null;P!==null;)P.alternate!==null&&(q=P),P=P.sibling;q===null?C.tail=null:q.sibling=null;break;case"collapsed":q=C.tail;for(var ie=null;q!==null;)q.alternate!==null&&(ie=q),q=q.sibling;ie===null?P||C.tail===null?C.tail=null:C.tail.sibling=null:ie.sibling=null}}function Xv(C,P){try{for(var q="",ie=P;q+=function(ae){switch(ae.tag){case 5:return R(ae.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return B(ae.type,!1);case 11:return B(ae.type.render,!1);case 22:return B(ae.type._render,!1);case 1:return B(ae.type,!0);default:return""}}(ie),ie=ie.return;);var oe=q}catch(ae){oe=`
|
|
124
|
+
`+oe[ue].replace(" at new "," at ");while(1<=ue&&0<=_e);break}}}finally{L=!1,Error.prepareStackTrace=q}return(C=C?C.displayName||C.name:"")?R(C):""}function Y(C){if(C==null)return null;if(typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case A:return"Fragment";case j:return"Portal";case I:return"Profiler";case T:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case $:return(C.displayName||"Context")+".Consumer";case k:return(C._context.displayName||"Context")+".Provider";case H:var P=(P=C.render).displayName||P.name||"";return C.displayName||(P!==""?"ForwardRef("+P+")":"ForwardRef");case W:return Y(C.type);case M:return Y(C._render);case J:P=C._payload,C=C._init;try{return Y(C(P))}catch{}}return null}function X(C){switch(typeof C){case"boolean":case"number":case"object":case"string":case"undefined":return C;default:return""}}function re(C){var P=C.type;return(C=C.nodeName)&&C.toLowerCase()==="input"&&(P==="checkbox"||P==="radio")}function Z(C){C._valueTracker||(C._valueTracker=function(P){var q,ie,oe=re(P)?"checked":"value",ae=Object.getOwnPropertyDescriptor(P.constructor.prototype,oe),ue=""+P[oe];if(!P.hasOwnProperty(oe)&&ae!==void 0&&typeof ae.get=="function"&&typeof ae.set=="function")return q=ae.get,ie=ae.set,Object.defineProperty(P,oe,{configurable:!0,get:function(){return q.call(this)},set:function(_e){ue=""+_e,ie.call(this,_e)}}),Object.defineProperty(P,oe,{enumerable:ae.enumerable}),{getValue:function(){return ue},setValue:function(_e){ue=""+_e},stopTracking:function(){P._valueTracker=null,delete P[oe]}}}(C))}function ee(C){if(C){var P=C._valueTracker;if(!P)return 1;var q=P.getValue(),ie="";return(C=ie=C?re(C)?C.checked?"true":"false":C.value:ie)!==q&&(P.setValue(C),1)}}function ne(C){if((C=C||(typeof document<"u"?document:void 0))===void 0)return null;try{return C.activeElement||C.body}catch{return C.body}}function te(C,P){var q=P.checked;return i({},P,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:q??C._wrapperState.initialChecked})}function se(C,P){var q=P.defaultValue==null?"":P.defaultValue,ie=P.checked!=null?P.checked:P.defaultChecked;q=X(P.value!=null?P.value:q),C._wrapperState={initialChecked:ie,initialValue:q,controlled:P.type==="checkbox"||P.type==="radio"?P.checked!=null:P.value!=null}}function ce(C,P){(P=P.checked)!=null&&x(C,"checked",P,!1)}function ge(C,P){ce(C,P);var q=X(P.value),ie=P.type;if(q!=null)ie==="number"?(q===0&&C.value===""||C.value!=q)&&(C.value=""+q):C.value!==""+q&&(C.value=""+q);else if(ie==="submit"||ie==="reset")return void C.removeAttribute("value");P.hasOwnProperty("value")?Se(C,P.type,q):P.hasOwnProperty("defaultValue")&&Se(C,P.type,X(P.defaultValue)),P.checked==null&&P.defaultChecked!=null&&(C.defaultChecked=!!P.defaultChecked)}function we(C,P,q){if(P.hasOwnProperty("value")||P.hasOwnProperty("defaultValue")){var ie=P.type;if(!(ie!=="submit"&&ie!=="reset"||P.value!==void 0&&P.value!==null))return;P=""+C._wrapperState.initialValue,q||P===C.value||(C.value=P),C.defaultValue=P}(q=C.name)!==""&&(C.name=""),C.defaultChecked=!!C._wrapperState.initialChecked,q!==""&&(C.name=q)}function Se(C,P,q){P==="number"&&ne(C.ownerDocument)===C||(q==null?C.defaultValue=""+C._wrapperState.initialValue:C.defaultValue!==""+q&&(C.defaultValue=""+q))}function je(C,P){var q,ie;return C=i({children:void 0},P),q=P.children,ie="",o.Children.forEach(q,function(oe){oe!=null&&(ie+=oe)}),(P=ie)&&(C.children=P),C}function Le(C,P,q,ie){if(C=C.options,P){P={};for(var oe=0;oe<q.length;oe++)P["$"+q[oe]]=!0;for(q=0;q<C.length;q++)oe=P.hasOwnProperty("$"+C[q].value),C[q].selected!==oe&&(C[q].selected=oe),oe&&ie&&(C[q].defaultSelected=!0)}else{for(q=""+X(q),P=null,oe=0;oe<C.length;oe++){if(C[oe].value===q)return C[oe].selected=!0,void(ie&&(C[oe].defaultSelected=!0));P!==null||C[oe].disabled||(P=C[oe])}P!==null&&(P.selected=!0)}}function Me(C,P){if(P.dangerouslySetInnerHTML!=null)throw Error(a(91));return i({},P,{value:void 0,defaultValue:void 0,children:""+C._wrapperState.initialValue})}function ye(C,P){var q=P.value;if(q==null){if(q=P.children,P=P.defaultValue,q!=null){if(P!=null)throw Error(a(92));if(Array.isArray(q)){if(!(q.length<=1))throw Error(a(93));q=q[0]}P=q}q=P=P??""}C._wrapperState={initialValue:X(q)}}function ke(C,P){var q=X(P.value),ie=X(P.defaultValue);q!=null&&((q=""+q)!==C.value&&(C.value=q),P.defaultValue==null&&C.defaultValue!==q&&(C.defaultValue=q)),ie!=null&&(C.defaultValue=""+ie)}function Ae(C){var P=C.textContent;P===C._wrapperState.initialValue&&P!==""&&P!==null&&(C.value=P)}var Ie="http://www.w3.org/1999/xhtml";function Te(C){switch(C){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ee(C,P){return C==null||C==="http://www.w3.org/1999/xhtml"?Te(P):C==="http://www.w3.org/2000/svg"&&P==="foreignObject"?"http://www.w3.org/1999/xhtml":C}Pe=function(C,P){if(C.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in C)C.innerHTML=P;else{for((Ce=Ce||document.createElement("div")).innerHTML="<svg>"+P.valueOf().toString()+"</svg>",P=Ce.firstChild;C.firstChild;)C.removeChild(C.firstChild);for(;P.firstChild;)C.appendChild(P.firstChild)}};var Ce,Pe,he=typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(C,P,q,ie){MSApp.execUnsafeLocalFunction(function(){return Pe(C,P)})}:Pe;function de(C,P){if(P){var q=C.firstChild;if(q&&q===C.lastChild&&q.nodeType===3)return void(q.nodeValue=P)}C.textContent=P}var Fe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},We=["Webkit","ms","Moz","O"];function Qe(C,P,q){return P==null||typeof P=="boolean"||P===""?"":q||typeof P!="number"||P===0||Fe.hasOwnProperty(C)&&Fe[C]?(""+P).trim():P+"px"}function Ze(C,P){for(var q in C=C.style,P){var ie,oe;P.hasOwnProperty(q)&&(ie=q.indexOf("--")===0,oe=Qe(q,P[q],ie),q==="float"&&(q="cssFloat"),ie?C.setProperty(q,oe):C[q]=oe)}}Object.keys(Fe).forEach(function(C){We.forEach(function(P){P=P+C.charAt(0).toUpperCase()+C.substring(1),Fe[P]=Fe[C]})});var _t=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oe(C,P){if(P){if(_t[C]&&(P.children!=null||P.dangerouslySetInnerHTML!=null))throw Error(a(137,C));if(P.dangerouslySetInnerHTML!=null){if(P.children!=null)throw Error(a(60));if(typeof P.dangerouslySetInnerHTML!="object"||!("__html"in P.dangerouslySetInnerHTML))throw Error(a(61))}if(P.style!=null&&typeof P.style!="object")throw Error(a(62))}}function tt(C,P){if(C.indexOf("-")===-1)return typeof P.is=="string";switch(C){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function gt(C){return(C=(C=C.target||C.srcElement||window).correspondingUseElement?C.correspondingUseElement:C).nodeType===3?C.parentNode:C}var $t=null,Ut=null,Jt=null;function Ht(C){if(C=af(C)){if(typeof $t!="function")throw Error(a(280));var P=C.stateNode;P&&(P=Tg(P),$t(C.stateNode,C.type,P))}}function jt(C){Ut?Jt?Jt.push(C):Jt=[C]:Ut=C}function qt(){if(Ut){var C=Ut,P=Jt;if(Jt=Ut=null,Ht(C),P)for(C=0;C<P.length;C++)Ht(P[C])}}function Tn(C,P){return C(P)}function Ne(C,P,q,ie,oe){return C(P,q,ie,oe)}function lt(){}var pt=!1,wt=!1;function Nt(){Ut===null&&Jt===null||(lt(),qt())}function Re(C,P){var q=C.stateNode;if(q===null)return null;var ie=Tg(q);if(ie===null)return null;switch(q=ie[P],P){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":C=!(ie=(ie=!ie.disabled)?ie:!((C=C.type)==="button"||C==="input"||C==="select"||C==="textarea"));break;default:C=!1}if(C)return null;if(q&&typeof q!="function")throw Error(a(231,P,typeof q));return q}var ze=!1;if(e)try{var ct={};Object.defineProperty(ct,"passive",{get:function(){ze=!0}}),window.addEventListener("test",ct,ct),window.removeEventListener("test",ct,ct)}catch{ze=!1}var be=!1,fe=null,xe=!1,Be=null,dt={onError:function(C){be=!0,fe=C}};function Et(C,P,q,ie,oe,ae,ue,_e,me){be=!1,fe=null,(function(He,it,ft,Lt,kn,Ve,rt,mt,Bt){var Dt=Array.prototype.slice.call(arguments,3);try{it.apply(ft,Dt)}catch(tn){this.onError(tn)}}).apply(dt,arguments)}function kt(C){var P=C,q=C;if(C.alternate)for(;P.return;)P=P.return;else for(C=P;1026&(P=C).flags&&(q=P.return),C=P.return;);return P.tag===3?q:null}function It(C){if(C.tag===13){var P=C.memoizedState;if(P===null&&(C=C.alternate)!==null&&(P=C.memoizedState),P!==null)return P.dehydrated}return null}function Qt(C){if(kt(C)!==C)throw Error(a(188))}function vt(C){if(!(C=function(q){var ie=q.alternate;if(!ie){if((ie=kt(q))===null)throw Error(a(188));return ie!==q?null:q}for(var oe=q,ae=ie;;){var ue=oe.return;if(ue===null)break;var _e=ue.alternate;if(_e===null){if((ae=ue.return)===null)break;oe=ae}else{if(ue.child===_e.child){for(_e=ue.child;_e;){if(_e===oe)return Qt(ue),q;if(_e===ae)return Qt(ue),ie;_e=_e.sibling}throw Error(a(188))}if(oe.return!==ae.return)oe=ue,ae=_e;else{for(var me=!1,He=ue.child;He;){if(He===oe){me=!0,oe=ue,ae=_e;break}if(He===ae){me=!0,ae=ue,oe=_e;break}He=He.sibling}if(!me){for(He=_e.child;He;){if(He===oe){me=!0,oe=_e,ae=ue;break}if(He===ae){me=!0,ae=_e,oe=ue;break}He=He.sibling}if(!me)throw Error(a(189))}}if(oe.alternate!==ae)throw Error(a(190))}}if(oe.tag!==3)throw Error(a(188));return oe.stateNode.current===oe?q:ie}(C)))return null;for(var P=C;;){if(P.tag===5||P.tag===6)return P;if(P.child)P=(P.child.return=P).child;else{if(P===C)break;for(;!P.sibling;){if(!P.return||P.return===C)return null;P=P.return}P.sibling.return=P.return,P=P.sibling}}return null}function pe(C,P){for(var q=C.alternate;P!==null;){if(P===C||P===q)return 1;P=P.return}}var De,Ue,Ke,qe=!1,ot=[],Q=null,le=null,ve=null,Je=new Map,et=new Map,Xe=[],Ye="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function yt(C,P,q,ie,oe){return{blockedOn:C,domEventName:P,eventSystemFlags:16|q,nativeEvent:oe,targetContainers:[ie]}}function Ot(C,P){switch(C){case"focusin":case"focusout":Q=null;break;case"dragenter":case"dragleave":le=null;break;case"mouseover":case"mouseout":ve=null;break;case"pointerover":case"pointerout":Je.delete(P.pointerId);break;case"gotpointercapture":case"lostpointercapture":et.delete(P.pointerId)}}function Kt(C,P,q,ie,oe,ae){return C===null||C.nativeEvent!==ae?(C=yt(P,q,ie,oe,ae),P===null||(P=af(P))!==null&&Ue(P)):(C.eventSystemFlags|=ie,P=C.targetContainers,oe!==null&&P.indexOf(oe)===-1&&P.push(oe)),C}function Mt(C){if(C.blockedOn===null){for(var P=C.targetContainers;0<P.length;){var q=Di(C.domEventName,C.eventSystemFlags,P[0],C.nativeEvent);if(q!==null)return(P=af(q))!==null&&Ue(P),C.blockedOn=q,0;P.shift()}return 1}}function Vt(C,P,q){Mt(C)&&q.delete(P)}function cn(){for(qe=!1;0<ot.length;){var C=ot[0];if(C.blockedOn!==null){(C=af(C.blockedOn))!==null&&De(C);break}for(var P=C.targetContainers;0<P.length;){var q=Di(C.domEventName,C.eventSystemFlags,P[0],C.nativeEvent);if(q!==null){C.blockedOn=q;break}P.shift()}C.blockedOn===null&&ot.shift()}Q!==null&&Mt(Q)&&(Q=null),le!==null&&Mt(le)&&(le=null),ve!==null&&Mt(ve)&&(ve=null),Je.forEach(Vt),et.forEach(Vt)}function _n(C,P){C.blockedOn===P&&(C.blockedOn=null,qe||(qe=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,cn)))}function Gn(C){function P(oe){return _n(oe,C)}if(0<ot.length){_n(ot[0],C);for(var q=1;q<ot.length;q++){var ie=ot[q];ie.blockedOn===C&&(ie.blockedOn=null)}}for(Q!==null&&_n(Q,C),le!==null&&_n(le,C),ve!==null&&_n(ve,C),Je.forEach(P),et.forEach(P),q=0;q<Xe.length;q++)(ie=Xe[q]).blockedOn===C&&(ie.blockedOn=null);for(;0<Xe.length&&(q=Xe[0]).blockedOn===null;)(function(oe){var ae=Ol(oe.target);if(ae!==null){var ue=kt(ae);if(ue!==null){if((ae=ue.tag)===13){if((ae=It(ue))!==null)return oe.blockedOn=ae,oe.lanePriority,u.unstable_runWithPriority(oe.priority,function(){Ke(ue)})}else if(ae===3&&ue.stateNode.hydrate)return oe.blockedOn=ue.tag===3?ue.stateNode.containerInfo:null}}oe.blockedOn=null})(q),q.blockedOn===null&&Xe.shift()}function wn(C,P){var q={};return q[C.toLowerCase()]=P.toLowerCase(),q["Webkit"+C]="webkit"+P,q["Moz"+C]="moz"+P,q}var In={animationend:wn("Animation","AnimationEnd"),animationiteration:wn("Animation","AnimationIteration"),animationstart:wn("Animation","AnimationStart"),transitionend:wn("Transition","TransitionEnd")},Yn={},ir={};function Cr(C){if(Yn[C])return Yn[C];if(!In[C])return C;var P,q=In[C];for(P in q)if(q.hasOwnProperty(P)&&P in ir)return Yn[C]=q[P];return C}e&&(ir=document.createElement("div").style,"AnimationEvent"in window||(delete In.animationend.animation,delete In.animationiteration.animation,delete In.animationstart.animation),"TransitionEvent"in window||delete In.transitionend.transition);var Er=Cr("animationend"),dl=Cr("animationiteration"),ga=Cr("animationstart"),Vo=Cr("transitionend"),Co=new Map,Do=new Map,Dn=["abort","abort",Er,"animationEnd",dl,"animationIteration",ga,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Vo,"transitionEnd","waiting","waiting"];function ma(C,P){for(var q=0;q<C.length;q+=2){var ie=C[q],oe="on"+((oe=C[q+1])[0].toUpperCase()+oe.slice(1));Do.set(ie,P),Co.set(ie,oe),d(oe,[ie])}}(0,u.unstable_now)();var Nn=8;function Zn(C){if(1&C)return Nn=15,1;if(2&C)return Nn=14,2;if(4&C)return Nn=13,4;var P=24&C;return P!==0?(Nn=12,P):32&C?(Nn=11,32):(P=192&C)!=0?(Nn=10,P):256&C?(Nn=9,256):(P=3584&C)!=0?(Nn=8,P):4096&C?(Nn=7,4096):(P=4186112&C)!=0?(Nn=6,P):(P=62914560&C)!=0?(Nn=5,P):67108864&C?(Nn=4,67108864):134217728&C?(Nn=3,134217728):(P=805306368&C)!=0?(Nn=2,P):1073741824&C?(Nn=1,1073741824):(Nn=8,C)}function ji(C,P){var q=C.pendingLanes;if(q===0)return Nn=0;var ie,oe=0,ae=0,ue=C.expiredLanes,_e=C.suspendedLanes,me=C.pingedLanes;if(ue!==0?(oe=ue,ae=Nn=15):(ue=134217727&q)!=0?(ie=ue&~_e)!=0?(oe=Zn(ie),ae=Nn):(me&=ue)!=0&&(oe=Zn(me),ae=Nn):(ue=q&~_e)!=0?(oe=Zn(ue),ae=Nn):me!==0&&(oe=Zn(me),ae=Nn),oe===0)return 0;if(oe=q&(((oe=31-hi(oe))<0?0:1<<oe)<<1)-1,P!==0&&P!==oe&&!(P&_e)){if(Zn(P),ae<=Nn)return P;Nn=ae}if((P=C.entangledLanes)!==0)for(C=C.entanglements,P&=oe;0<P;)oe|=C[q=31-hi(P)],P&=~(ae=1<<q);return oe}function ho(C){return(C=-1073741825&C.pendingLanes)!=0?C:1073741824&C?1073741824:0}function Go(C,P){switch(C){case 15:return 1;case 14:return 2;case 12:return(C=Eo(24&~P))===0?Go(10,P):C;case 10:return(C=Eo(192&~P))===0?Go(8,P):C;case 8:return(C=Eo(3584&~P))===0&&(C=Eo(4186112&~P))===0&&(C=512),C;case 2:return(P=Eo(805306368&~P))===0?268435456:P}throw Error(a(358,C))}function Eo(C){return C&-C}function eo(C){for(var P=[],q=0;q<31;q++)P.push(C);return P}function fl(C,P,q){C.pendingLanes|=P;var ie=P-1;C.suspendedLanes&=ie,C.pingedLanes&=ie,(C=C.eventTimes)[P=31-hi(P)]=q}var hi=Math.clz32||function(C){return C===0?32:31-(Lo(C)/Rn|0)|0},Lo=Math.log,Rn=Math.LN2,_g=u.unstable_UserBlockingPriority,Xd=u.unstable_runWithPriority,Bo=!0;function xg(C,P,q,ie){pt||lt();var oe=pl,ae=pt;pt=!0;try{Ne(oe,C,P,q,ie)}finally{(pt=ae)||Nt()}}function Zd(C,P,q,ie){Xd(_g,pl.bind(null,C,P,q,ie))}function pl(C,P,q,ie){var oe;if(Bo)if((oe=!(4&P))&&0<ot.length&&-1<Ye.indexOf(C))C=yt(null,C,P,q,ie),ot.push(C);else{var ae=Di(C,P,q,ie);if(ae===null)oe&&Ot(C,ie);else{if(oe){if(-1<Ye.indexOf(C))return C=yt(ae,C,P,q,ie),void ot.push(C);if(function(ue,_e,me,He,it){switch(_e){case"focusin":return Q=Kt(Q,ue,_e,me,He,it),1;case"dragenter":return le=Kt(le,ue,_e,me,He,it),1;case"mouseover":return ve=Kt(ve,ue,_e,me,He,it),1;case"pointerover":var ft=it.pointerId;return Je.set(ft,Kt(Je.get(ft)||null,ue,_e,me,He,it)),1;case"gotpointercapture":return ft=it.pointerId,et.set(ft,Kt(et.get(ft)||null,ue,_e,me,He,it)),1}}(ae,C,P,q,ie))return;Ot(C,ie)}K2(C,P,ie,null,q)}}}function Di(C,P,q,ie){var oe=gt(ie);if((oe=Ol(oe))!==null){var ae=kt(oe);if(ae===null)oe=null;else{var ue=ae.tag;if(ue===13){if((oe=It(ae))!==null)return oe;oe=null}else if(ue===3){if(ae.stateNode.hydrate)return ae.tag===3?ae.stateNode.containerInfo:null;oe=null}else ae!==oe&&(oe=null)}}return K2(C,P,ie,oe,q),null}var Li=null,Bi=null,gs=null;function Zc(){if(gs)return gs;for(var C=Bi,P=C.length,q=("value"in Li)?Li.value:Li.textContent,ie=q.length,oe=0;oe<P&&C[oe]===q[oe];oe++);for(var ae=P-oe,ue=1;ue<=ae&&C[P-ue]===q[ie-ue];ue++);return gs=q.slice(oe,1<ue?1-ue:void 0)}function Qc(C){var P=C.keyCode;return"charCode"in C?(C=C.charCode)===0&&P===13&&(C=13):C=P,32<=(C=C===10?13:C)||C===13?C:0}function hl(){return!0}function gl(){return!1}function Hr(C){function P(q,ie,oe,ae,ue){for(var _e in this._reactName=q,this._targetInst=oe,this.type=ie,this.nativeEvent=ae,this.target=ue,this.currentTarget=null,C)C.hasOwnProperty(_e)&&(q=C[_e],this[_e]=q?q(ae):ae[_e]);return this.isDefaultPrevented=(ae.defaultPrevented!=null?ae.defaultPrevented:ae.returnValue===!1)?hl:gl,this.isPropagationStopped=gl,this}return i(P.prototype,{preventDefault:function(){this.defaultPrevented=!0;var q=this.nativeEvent;q&&(q.preventDefault?q.preventDefault():typeof q.returnValue!="unknown"&&(q.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var q=this.nativeEvent;q&&(q.stopPropagation?q.stopPropagation():typeof q.cancelBubble!="unknown"&&(q.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),P}ct={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(C){return C.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0};var ml,yl,ms,ys=Hr(ct),eu=Hr(Br=i({},ct,{view:0,detail:0})),lr=i({},Br,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ya,button:0,buttons:0,relatedTarget:function(C){return C.relatedTarget===void 0?C.fromElement===C.srcElement?C.toElement:C.fromElement:C.relatedTarget},movementX:function(C){return"movementX"in C?C.movementX:(C!==ms&&(yl=ms&&C.type==="mousemove"?(ml=C.screenX-ms.screenX,C.screenY-ms.screenY):ml=0,ms=C),ml)},movementY:function(C){return"movementY"in C?C.movementY:yl}}),bs=Hr(lr),bl=Hr(i({},lr,{dataTransfer:0})),go=Hr(i({},Br,{relatedTarget:0})),vl=Hr(i({},ct,{animationName:0,elapsedTime:0,pseudoElement:0})),Fi=Hr(i({},ct,{clipboardData:function(C){return("clipboardData"in C?C:window).clipboardData}})),gi=Hr(i({},ct,{data:0})),$i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_l={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zi(C){var P=this.nativeEvent;return P.getModifierState?P.getModifierState(C):!!(C=mi[C])&&!!P[C]}function ya(){return zi}var ba=Hr(i({},Br,{key:function(C){if(C.key){var P=$i[C.key]||C.key;if(P!=="Unidentified")return P}return C.type==="keypress"?(C=Qc(C))===13?"Enter":String.fromCharCode(C):C.type==="keydown"||C.type==="keyup"?_l[C.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ya,charCode:function(C){return C.type==="keypress"?Qc(C):0},keyCode:function(C){return C.type==="keydown"||C.type==="keyup"?C.keyCode:0},which:function(C){return C.type==="keypress"?Qc(C):C.type==="keydown"||C.type==="keyup"?C.keyCode:0}})),xl=Hr(i({},lr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tu=Hr(i({},Br,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ya})),vs=Hr(i({},ct,{propertyName:0,elapsedTime:0,pseudoElement:0})),nu=Hr(i({},lr,{deltaX:function(C){return"deltaX"in C?C.deltaX:"wheelDeltaX"in C?-C.wheelDeltaX:0},deltaY:function(C){return"deltaY"in C?C.deltaY:"wheelDeltaY"in C?-C.wheelDeltaY:"wheelDelta"in C?-C.wheelDelta:0},deltaZ:0,deltaMode:0})),wg=[9,13,27,32],wl=e&&"CompositionEvent"in window,Br=null,Sl=(e&&"documentMode"in document&&(Br=document.documentMode),e&&"TextEvent"in window&&!Br),va=e&&(!wl||Br&&8<Br&&Br<=11),Cl=String.fromCharCode(32),Qd=!1;function ef(C,P){switch(C){case"keyup":return wg.indexOf(P.keyCode)!==-1;case"keydown":return P.keyCode!==229;case"keypress":case"mousedown":case"focusout":return 1;default:return}}function Ui(C){return typeof(C=C.detail)=="object"&&"data"in C?C.data:null}var _s=!1,_a={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ru(C){var P=C&&C.nodeName&&C.nodeName.toLowerCase();return P==="input"?_a[C.type]:P==="textarea"}function El(C,P,q,ie){jt(ie),0<(P=Cg(P,"onChange")).length&&(q=new ys("onChange","change",null,q,ie),C.push({event:q,listeners:P}))}var $e=null,nt=null;function ht(C){F2(C,0)}function Tt(C){if(ee(lu(C)))return C}function hn(C,P){if(C==="change")return P}var an=!1;function ln(){$e&&($e.detachEvent("onpropertychange",Gt),nt=$e=null)}function Gt(C){if(C.propertyName==="value"&&Tt(nt)){var P=[];if(El(P,nt,C,gt(C)),C=ht,pt)C(P);else{pt=!0;try{Tn(C,P)}finally{pt=!1,Nt()}}}}function cr(C,P,q){C==="focusin"?(ln(),nt=q,($e=P).attachEvent("onpropertychange",Gt)):C==="focusout"&&ln()}function Ar(C){if(C==="selectionchange"||C==="keyup"||C==="keydown")return Tt(nt)}function tf(C,P){if(C==="click")return Tt(P)}function Sg(C,P){if(C==="input"||C==="change")return Tt(P)}e&&(Br=e&&((ct="oninput"in document)||((lr=document.createElement("div")).setAttribute("oninput","return;"),ct=typeof lr.oninput=="function"),ct),an=Br&&(!document.documentMode||9<document.documentMode));var Or=typeof Object.is=="function"?Object.is:function(C,P){return C===P&&(C!==0||1/C==1/P)||C!=C&&P!=P},OF=Object.prototype.hasOwnProperty;function nf(C,P){if(Or(C,P))return!0;if(typeof C!="object"||C===null||typeof P!="object"||P===null)return!1;var q=Object.keys(C),ie=Object.keys(P);if(q.length!==ie.length)return!1;for(ie=0;ie<q.length;ie++)if(!OF.call(P,q[ie])||!Or(C[q[ie]],P[q[ie]]))return!1;return!0}function M2(C){for(;C&&C.firstChild;)C=C.firstChild;return C}function I2(C,P){var q,ie=M2(C);for(C=0;ie;){if(ie.nodeType===3){if(q=C+ie.textContent.length,C<=P&&P<=q)return{node:ie,offset:P-C};C=q}e:{for(;ie;){if(ie.nextSibling){ie=ie.nextSibling;break e}ie=ie.parentNode}ie=void 0}ie=M2(ie)}}function R2(){for(var C=window,P=ne();P instanceof C.HTMLIFrameElement;){try{var q=typeof P.contentWindow.location.href=="string"}catch{q=!1}if(!q)break;P=ne((C=P.contentWindow).document)}return P}function hv(C){var P=C&&C.nodeName&&C.nodeName.toLowerCase();return P&&(P==="input"&&(C.type==="text"||C.type==="search"||C.type==="tel"||C.type==="url"||C.type==="password")||P==="textarea"||C.contentEditable==="true")}var TF=e&&"documentMode"in document&&document.documentMode<=11,ou=null,gv=null,rf=null,mv=!1;function j2(C,P,q){var ie=q.window===q?q.document:q.nodeType===9?q:q.ownerDocument;mv||ou==null||ou!==ne(ie)||(ie="selectionStart"in(ie=ou)&&hv(ie)?{start:ie.selectionStart,end:ie.selectionEnd}:{anchorNode:(ie=(ie.ownerDocument&&ie.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:ie.anchorOffset,focusNode:ie.focusNode,focusOffset:ie.focusOffset},rf&&nf(rf,ie)||(rf=ie,0<(ie=Cg(gv,"onSelect")).length&&(P=new ys("onSelect","select",null,P,q),C.push({event:P,listeners:ie}),P.target=ou)))}ma("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),ma("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),ma(Dn,2);for(var D2="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),yv=0;yv<D2.length;yv++)Do.set(D2[yv],0);p("onMouseEnter",["mouseout","mouseover"]),p("onMouseLeave",["mouseout","mouseover"]),p("onPointerEnter",["pointerout","pointerover"]),p("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var of="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),L2=new Set("cancel close invalid load scroll toggle".split(" ").concat(of));function B2(C,P,q){var ie=C.type||"unknown-event";C.currentTarget=q,function(){var oe;Et.apply(this,arguments),be&&(oe=fe,be=!1,fe=null,xe||(xe=!0,Be=oe))}(ie,P,void 0,C),C.currentTarget=null}function F2(C,P){P=!!(4&P);for(var q=0;q<C.length;q++){var ie=(oe=C[q]).event,oe=oe.listeners;e:{var ae=void 0;if(P)for(var ue=oe.length-1;0<=ue;ue--){var _e=(He=oe[ue]).instance,me=He.currentTarget,He=He.listener;if(_e!==ae&&ie.isPropagationStopped())break e;B2(ie,He,me),ae=_e}else for(ue=0;ue<oe.length;ue++){if(_e=(He=oe[ue]).instance,me=He.currentTarget,He=He.listener,_e!==ae&&ie.isPropagationStopped())break e;B2(ie,He,me),ae=_e}}}if(xe)throw C=Be,xe=!1,Be=null,C}function Qn(C,P){var q=Y2(P),ie=C+"__bubble";q.has(ie)||(H2(P,C,2,!1),q.add(ie))}var $2="_reactListening"+Math.random().toString(36).slice(2);function z2(C){C[$2]||(C[$2]=!0,f.forEach(function(P){L2.has(P)||U2(P,!1,C,null),U2(P,!0,C,null)}))}function U2(C,P,q,ie,oe){oe=4<arguments.length&&oe!==void 0?oe:0;var ae=q;if(C==="selectionchange"&&q.nodeType!==9&&(ae=q.ownerDocument),ie!==null&&!P&&L2.has(C)){if(C!=="scroll")return;oe|=2,ae=ie}ie=C+"__"+(P?"capture":"bubble"),(q=Y2(ae)).has(ie)||(P&&(oe|=4),H2(ae,C,oe,P),q.add(ie))}function H2(C,P,q,ie){var oe=Do.get(P);switch(oe===void 0?2:oe){case 0:oe=xg;break;case 1:oe=Zd;break;default:oe=pl}q=oe.bind(null,P,q,C),oe=!(!ze||P!=="touchstart"&&P!=="touchmove"&&P!=="wheel")||void 0,ie?oe!==void 0?C.addEventListener(P,q,{capture:!0,passive:oe}):C.addEventListener(P,q,!0):oe!==void 0?C.addEventListener(P,q,{passive:oe}):C.addEventListener(P,q,!1)}function K2(C,P,q,ie,oe){var ae=ie;if(!(1&P||2&P||ie===null))e:for(;;){if(ie===null)return;var ue=ie.tag;if(ue===3||ue===4){var _e=ie.stateNode.containerInfo;if(_e===oe||_e.nodeType===8&&_e.parentNode===oe)break;if(ue===4)for(ue=ie.return;ue!==null;){var me=ue.tag;if((me===3||me===4)&&((me=ue.stateNode.containerInfo)===oe||me.nodeType===8&&me.parentNode===oe))return;ue=ue.return}for(;_e!==null;){if((ue=Ol(_e))===null)return;if((me=ue.tag)===5||me===6){ie=ae=ue;continue e}_e=_e.parentNode}}ie=ie.return}var He=function(){var ft,Lt,kn,Ve=ae,rt=gt(q),mt=[];e:{var Bt=Co.get(C);if(Bt!==void 0){var Dt=ys,tn=C;switch(C){case"keypress":if(Qc(q)===0)break e;case"keydown":case"keyup":Dt=ba;break;case"focusin":tn="focus",Dt=go;break;case"focusout":tn="blur",Dt=go;break;case"beforeblur":case"afterblur":Dt=go;break;case"click":if(q.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Dt=bs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Dt=bl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Dt=tu;break;case Er:case dl:case ga:Dt=vl;break;case Vo:Dt=vs;break;case"scroll":Dt=eu;break;case"wheel":Dt=nu;break;case"copy":case"cut":case"paste":Dt=Fi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Dt=xl}for(var yn=!(nn=!!(4&P))&&C==="scroll",sn=nn?Bt!==null?Bt+"Capture":null:Bt,nn=[],jn=Ve;jn!==null;){var zn,qn=(zn=jn).stateNode;if(zn.tag===5&&qn!==null&&(zn=qn,sn!==null&&(qn=Re(jn,sn))!=null&&nn.push(sf(jn,qn,zn))),yn)break;jn=jn.return}0<nn.length&&(Bt=new Dt(Bt,tn,null,q,rt),mt.push({event:Bt,listeners:nn}))}}if(!(7&P)){if(Dt=C==="mouseout"||C==="pointerout",(!(Bt=C==="mouseover"||C==="pointerover")||16&P||!(tn=q.relatedTarget||q.fromElement)||!Ol(tn)&&!tn[au])&&(Dt||Bt)&&(Bt=rt.window===rt?rt:(Bt=rt.ownerDocument)?Bt.defaultView||Bt.parentWindow:window,Dt?(Dt=Ve,(tn=(tn=q.relatedTarget||q.toElement)?Ol(tn):null)!==null&&(tn!==(yn=kt(tn))||tn.tag!==5&&tn.tag!==6)&&(tn=null)):(Dt=null,tn=Ve),Dt!==tn)){if(nn=bs,qn="onMouseLeave",sn="onMouseEnter",jn="mouse",C!=="pointerout"&&C!=="pointerover"||(nn=xl,qn="onPointerLeave",sn="onPointerEnter",jn="pointer"),yn=Dt==null?Bt:lu(Dt),zn=tn==null?Bt:lu(tn),(Bt=new nn(qn,jn+"leave",Dt,q,rt)).target=yn,Bt.relatedTarget=zn,qn=null,Ol(rt)===Ve&&((nn=new nn(sn,jn+"enter",tn,q,rt)).target=zn,nn.relatedTarget=yn,qn=nn),yn=qn,Dt&&tn)e:{for(sn=tn,jn=0,zn=nn=Dt;zn;zn=iu(zn))jn++;for(zn=0,qn=sn;qn;qn=iu(qn))zn++;for(;0<jn-zn;)nn=iu(nn),jn--;for(;0<zn-jn;)sn=iu(sn),zn--;for(;jn--;){if(nn===sn||sn!==null&&nn===sn.alternate)break e;nn=iu(nn),sn=iu(sn)}nn=null}else nn=null;Dt!==null&&W2(mt,Bt,Dt,nn,!1),tn!==null&&yn!==null&&W2(mt,yn,tn,nn,!0)}switch((Dt=(Bt=Ve?lu(Ve):window).nodeName&&Bt.nodeName.toLowerCase())==="select"||Dt==="input"&&Bt.type==="file"?ft=hn:ru(Bt)?an?ft=Sg:(ft=Ar,Lt=cr):!(Dt=Bt.nodeName)||Dt.toLowerCase()!=="input"||Bt.type!=="checkbox"&&Bt.type!=="radio"||(ft=tf),(ft=ft&&ft(C,Ve))?El(mt,ft,q,rt):(Lt&&Lt(C,Bt,Ve),C==="focusout"&&(Lt=Bt._wrapperState)&&Lt.controlled&&Bt.type==="number"&&Se(Bt,"number",Bt.value)),Lt=Ve?lu(Ve):window,C){case"focusin":!ru(Lt)&&Lt.contentEditable!=="true"||(ou=Lt,gv=Ve,rf=null);break;case"focusout":rf=gv=ou=null;break;case"mousedown":mv=!0;break;case"contextmenu":case"mouseup":case"dragend":mv=!1,j2(mt,q,rt);break;case"selectionchange":if(TF)break;case"keydown":case"keyup":j2(mt,q,rt)}if(wl)e:{switch(C){case"compositionstart":var En="onCompositionStart";break e;case"compositionend":En="onCompositionEnd";break e;case"compositionupdate":En="onCompositionUpdate";break e}En=void 0}else _s?ef(C,q)&&(En="onCompositionEnd"):C==="keydown"&&q.keyCode===229&&(En="onCompositionStart");En&&(va&&q.locale!=="ko"&&(_s||En!=="onCompositionStart"?En==="onCompositionEnd"&&_s&&(kn=Zc()):(Bi="value"in(Li=rt)?Li.value:Li.textContent,_s=!0)),0<(Lt=Cg(Ve,En)).length&&(En=new gi(En,C,null,q,rt),mt.push({event:En,listeners:Lt}),(kn||(kn=Ui(q))!==null)&&(En.data=kn))),(kn=(Sl?function(Mn,Sn){switch(Mn){case"compositionend":return Ui(Sn);case"keypress":return Sn.which!==32?null:(Qd=!0,Cl);case"textInput":return(Mn=Sn.data)===Cl&&Qd?null:Mn;default:return null}}:function(Mn,Sn){if(_s)return Mn==="compositionend"||!wl&&ef(Mn,Sn)?(Mn=Zc(),gs=Bi=Li=null,_s=!1,Mn):null;switch(Mn){case"paste":default:return null;case"keypress":if(!(Sn.ctrlKey||Sn.altKey||Sn.metaKey)||Sn.ctrlKey&&Sn.altKey){if(Sn.char&&1<Sn.char.length)return Sn.char;if(Sn.which)return String.fromCharCode(Sn.which)}return null;case"compositionend":return va&&Sn.locale!=="ko"?null:Sn.data}})(C,q))&&0<(Ve=Cg(Ve,"onBeforeInput")).length&&(rt=new gi("onBeforeInput","beforeinput",null,q,rt),mt.push({event:rt,listeners:Ve}),rt.data=kn)}F2(mt,P)},it=void 0;if(wt)He();else{wt=!0;try{GF(He,it)}finally{wt=!1,Nt()}}}function sf(C,P,q){return{instance:C,listener:P,currentTarget:q}}function Cg(C,P){for(var q=P+"Capture",ie=[];C!==null;){var oe=C,ae=oe.stateNode;oe.tag===5&&ae!==null&&(oe=ae,(ae=Re(C,q))!=null&&ie.unshift(sf(C,ae,oe)),(ae=Re(C,P))!=null&&ie.push(sf(C,ae,oe))),C=C.return}return ie}function iu(C){if(C===null)return null;for(;(C=C.return)&&C.tag!==5;);return C||null}function W2(C,P,q,ie,oe){for(var ae=P._reactName,ue=[];q!==null&&q!==ie;){var _e=q,me=_e.alternate,He=_e.stateNode;if(me!==null&&me===ie)break;_e.tag===5&&He!==null&&(_e=He,oe?(me=Re(q,ae))!=null&&ue.unshift(sf(q,me,_e)):(me=Re(q,ae))!=null&&ue.push(sf(q,me,_e))),q=q.return}ue.length!==0&&C.push({event:P,listeners:ue})}function Eg(){}var bv=null,vv=null;function q2(C,P){switch(C){case"button":case"input":case"select":case"textarea":return P.autoFocus}}function _v(C,P){return C==="textarea"||C==="option"||C==="noscript"||typeof P.children=="string"||typeof P.children=="number"||typeof P.dangerouslySetInnerHTML=="object"&&P.dangerouslySetInnerHTML!==null&&P.dangerouslySetInnerHTML.__html!=null}var J2=typeof setTimeout=="function"?setTimeout:void 0,NF=typeof clearTimeout=="function"?clearTimeout:void 0;function xv(C){(C.nodeType===1||C.nodeType===9&&(C=C.body)!=null)&&(C.textContent="")}function su(C){for(;C!=null;C=C.nextSibling){var P=C.nodeType;if(P===1||P===3)break}return C}function V2(C){C=C.previousSibling;for(var P=0;C;){if(C.nodeType===8){var q=C.data;if(q==="$"||q==="$!"||q==="$?"){if(P===0)return C;P--}else q==="/$"&&P++}C=C.previousSibling}return null}var wv=0,xa="__reactFiber$"+(lr=Math.random().toString(36).slice(2)),Og="__reactProps$"+lr,au="__reactContainer$"+lr,G2="__reactEvents$"+lr;function Ol(C){var P=C[xa];if(P)return P;for(var q=C.parentNode;q;){if(P=q[au]||q[xa]){if(q=P.alternate,P.child!==null||q!==null&&q.child!==null)for(C=V2(C);C!==null;){if(q=C[xa])return q;C=V2(C)}return P}q=(C=q).parentNode}return null}function af(C){return!(C=C[xa]||C[au])||C.tag!==5&&C.tag!==6&&C.tag!==13&&C.tag!==3?null:C}function lu(C){if(C.tag===5||C.tag===6)return C.stateNode;throw Error(a(33))}function Tg(C){return C[Og]||null}function Y2(C){var P=C[G2];return P===void 0?C[G2]=new Set:P}var Sv=[],lf=-1;function wa(C){return{current:C}}function sr(C){lf<0||(C.current=Sv[lf],Sv[lf]=null,lf--)}function hr(C,P){Sv[++lf]=C.current,C.current=P}var Sa={},to=wa(Sa),Oo=wa(!1),Tl=Sa;function cu(C,P){var q=C.type.contextTypes;if(!q)return Sa;var ie=C.stateNode;if(ie&&ie.__reactInternalMemoizedUnmaskedChildContext===P)return ie.__reactInternalMemoizedMaskedChildContext;var oe,ae={};for(oe in q)ae[oe]=P[oe];return ie&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=P,C.__reactInternalMemoizedMaskedChildContext=ae),ae}function Fo(C){return C.childContextTypes!=null}function Cv(){sr(Oo),sr(to)}function X2(C,P,q){if(to.current!==Sa)throw Error(a(168));hr(to,P),hr(Oo,q)}function Z2(C,P,q){var ie,oe=C.stateNode;if(C=P.childContextTypes,typeof oe.getChildContext!="function")return q;for(ie in oe=oe.getChildContext())if(!(ie in C))throw Error(a(108,Y(P)||"Unknown",ie));return i({},q,oe)}function Ng(C){C=(C=C.stateNode)&&C.__reactInternalMemoizedMergedChildContext||Sa,Tl=to.current,hr(to,C),hr(Oo,Oo.current)}function Q2(C,P,q){var ie=C.stateNode;if(!ie)throw Error(a(169));q?(C=Z2(C,P,Tl),ie.__reactInternalMemoizedMergedChildContext=C,sr(Oo),sr(to),hr(to,C)):sr(Oo),hr(Oo,q)}var Ev=null,Nl=null,kF=u.unstable_runWithPriority,Ov=u.unstable_scheduleCallback,Tv=u.unstable_cancelCallback,AF=u.unstable_shouldYield,Nv=(ct=u.unstable_requestPaint,u.unstable_now),PF=u.unstable_getCurrentPriorityLevel,kg=u.unstable_ImmediatePriority,eT=u.unstable_UserBlockingPriority,tT=u.unstable_NormalPriority,nT=u.unstable_LowPriority,rT=u.unstable_IdlePriority,kv={},MF=ct!==void 0?ct:function(){},xs=null,Ag=null,Av=!1,oT=Nv(),no=oT<1e4?Nv:function(){return Nv()-oT};function uu(){switch(PF()){case kg:return 99;case eT:return 98;case tT:return 97;case nT:return 96;case rT:return 95;default:throw Error(a(332))}}function iT(C){switch(C){case 99:return kg;case 98:return eT;case 97:return tT;case 96:return nT;case 95:return rT;default:throw Error(a(332))}}function kl(C,P){return C=iT(C),kF(C,P)}function cf(C,P,q){return C=iT(C),Ov(C,P,q)}function Hi(){var C;Ag!==null&&(C=Ag,Ag=null,Tv(C)),sT()}function sT(){if(!Av&&xs!==null){Av=!0;var C=0;try{var P=xs;kl(99,function(){for(;C<P.length;C++)for(var q=P[C];(q=q(!0))!==null;);}),xs=null}catch(q){throw xs!==null&&(xs=xs.slice(C+1)),Ov(kg,Hi),q}finally{Av=!1}}}var IF=E.ReactCurrentBatchConfig;function yi(C,P){if(C&&C.defaultProps){for(var q in P=i({},P),C=C.defaultProps)P[q]===void 0&&(P[q]=C[q]);return P}return P}var Pg=wa(null),Mg=null,du=null,Ig=null;function Pv(){Ig=du=Mg=null}function Mv(C){var P=Pg.current;sr(Pg),C.type._context._currentValue=P}function aT(C,P){for(;C!==null;){var q=C.alternate;if((C.childLanes&P)===P){if(q===null||(q.childLanes&P)===P)break;q.childLanes|=P}else C.childLanes|=P,q!==null&&(q.childLanes|=P);C=C.return}}function fu(C,P){(Ig=du=null)!==(C=(Mg=C).dependencies)&&C.firstContext!==null&&(C.lanes&P&&(bi=!0),C.firstContext=null)}function Yo(C,P){if(Ig!==C&&P!==!1&&P!==0)if(typeof P=="number"&&P!==1073741823||(Ig=C,P=1073741823),P={context:C,observedBits:P,next:null},du===null){if(Mg===null)throw Error(a(308));du=P,Mg.dependencies={lanes:0,firstContext:P,responders:null}}else du=du.next=P;return C._currentValue}var Ca=!1;function Iv(C){C.updateQueue={baseState:C.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function lT(C,P){C=C.updateQueue,P.updateQueue===C&&(P.updateQueue={baseState:C.baseState,firstBaseUpdate:C.firstBaseUpdate,lastBaseUpdate:C.lastBaseUpdate,shared:C.shared,effects:C.effects})}function Ea(C,P){return{eventTime:C,lane:P,tag:0,payload:null,callback:null,next:null}}function Oa(C,P){var q;(C=C.updateQueue)!==null&&((q=(C=C.shared).pending)===null?P.next=P:(P.next=q.next,q.next=P),C.pending=P)}function cT(C,P){var q=C.updateQueue,ie=C.alternate;if(ie!==null&&q===(ie=ie.updateQueue)){var oe=null,ae=null;if((q=q.firstBaseUpdate)!==null){do var ue={eventTime:q.eventTime,lane:q.lane,tag:q.tag,payload:q.payload,callback:q.callback,next:null};while(ae===null?oe=ae=ue:ae=ae.next=ue,(q=q.next)!==null);ae===null?oe=ae=P:ae=ae.next=P}else oe=ae=P;return q={baseState:ie.baseState,firstBaseUpdate:oe,lastBaseUpdate:ae,shared:ie.shared,effects:ie.effects},void(C.updateQueue=q)}(C=q.lastBaseUpdate)===null?q.firstBaseUpdate=P:C.next=P,q.lastBaseUpdate=P}function uf(C,P,q,ie){var oe,ae,ue,_e,me=C.updateQueue,He=(Ca=!1,me.firstBaseUpdate),it=me.lastBaseUpdate;if((Ve=me.shared.pending)!==null&&(me.shared.pending=null,ae=(oe=Ve).next,(oe.next=null)===it?He=ae:it.next=ae,it=oe,(ue=C.alternate)!==null&&(_e=(ue=ue.updateQueue).lastBaseUpdate)!==it&&(_e===null?ue.firstBaseUpdate=ae:_e.next=ae,ue.lastBaseUpdate=oe)),He!==null){for(_e=me.baseState,it=0,ue=ae=oe=null;;){Ve=He.lane;var ft=He.eventTime;if((ie&Ve)===Ve){ue!==null&&(ue=ue.next={eventTime:ft,lane:0,tag:He.tag,payload:He.payload,callback:He.callback,next:null});e:{var Lt=C,kn=He,Ve=P;switch(ft=q,kn.tag){case 1:if(typeof(Lt=kn.payload)=="function"){_e=Lt.call(ft,_e,Ve);break e}_e=Lt;break e;case 3:Lt.flags=-4097&Lt.flags|64;case 0:if((Ve=typeof(Lt=kn.payload)=="function"?Lt.call(ft,_e,Ve):Lt)==null)break e;_e=i({},_e,Ve);break e;case 2:Ca=!0}}He.callback!==null&&(C.flags|=32,(Ve=me.effects)===null?me.effects=[He]:Ve.push(He))}else ft={eventTime:ft,lane:Ve,tag:He.tag,payload:He.payload,callback:He.callback,next:null},ue===null?(ae=ue=ft,oe=_e):ue=ue.next=ft,it|=Ve;if((He=He.next)===null){if((Ve=me.shared.pending)===null)break;He=Ve.next,Ve.next=null,me.lastBaseUpdate=Ve,me.shared.pending=null}}ue===null&&(oe=_e),me.baseState=oe,me.firstBaseUpdate=ae,me.lastBaseUpdate=ue,wf|=it,C.lanes=it,C.memoizedState=_e}}function uT(C,P,q){if(C=P.effects,(P.effects=null)!==C)for(P=0;P<C.length;P++){var ie=C[P],oe=ie.callback;if(oe!==null){if(ie.callback=null,ie=q,typeof oe!="function")throw Error(a(191,oe));oe.call(ie)}}}var dT=new o.Component().refs;function Rg(C,P,q,ie){q=(q=q(ie,P=C.memoizedState))==null?P:i({},P,q),C.memoizedState=q,C.lanes===0&&(C.updateQueue.baseState=q)}var jg={isMounted:function(C){return!!(C=C._reactInternals)&&kt(C)===C},enqueueSetState:function(C,P,q){C=C._reactInternals;var ie=zo(),oe=Aa(C),ae=Ea(ie,oe);ae.payload=P,q!=null&&(ae.callback=q),Oa(C,ae),Pa(C,oe,ie)},enqueueReplaceState:function(C,P,q){C=C._reactInternals;var ie=zo(),oe=Aa(C),ae=Ea(ie,oe);ae.tag=1,ae.payload=P,q!=null&&(ae.callback=q),Oa(C,ae),Pa(C,oe,ie)},enqueueForceUpdate:function(C,P){C=C._reactInternals;var q=zo(),ie=Aa(C),oe=Ea(q,ie);oe.tag=2,P!=null&&(oe.callback=P),Oa(C,oe),Pa(C,ie,q)}};function fT(C,P,q,ie,oe,ae,ue){return typeof(C=C.stateNode).shouldComponentUpdate=="function"?C.shouldComponentUpdate(ie,ae,ue):!(P.prototype&&P.prototype.isPureReactComponent&&nf(q,ie)&&nf(oe,ae))}function pT(C,P,q){var ie=!1,oe=Sa,ae=P.contextType;P=new P(q,ae=typeof ae=="object"&&ae!==null?Yo(ae):(oe=Fo(P)?Tl:to.current,(ie=(ie=P.contextTypes)!=null)?cu(C,oe):Sa)),C.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,P.updater=jg,(C.stateNode=P)._reactInternals=C,ie&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=oe,C.__reactInternalMemoizedMaskedChildContext=ae)}function hT(C,P,q,ie){C=P.state,typeof P.componentWillReceiveProps=="function"&&P.componentWillReceiveProps(q,ie),typeof P.UNSAFE_componentWillReceiveProps=="function"&&P.UNSAFE_componentWillReceiveProps(q,ie),P.state!==C&&jg.enqueueReplaceState(P,P.state,null)}function Rv(C,P,q,ie){var oe=C.stateNode,ae=(oe.props=q,oe.state=C.memoizedState,oe.refs=dT,Iv(C),P.contextType);typeof ae=="object"&&ae!==null?oe.context=Yo(ae):(ae=Fo(P)?Tl:to.current,oe.context=cu(C,ae)),uf(C,q,oe,ie),oe.state=C.memoizedState,typeof(ae=P.getDerivedStateFromProps)=="function"&&(Rg(C,0,ae,q),oe.state=C.memoizedState),typeof P.getDerivedStateFromProps=="function"||typeof oe.getSnapshotBeforeUpdate=="function"||typeof oe.UNSAFE_componentWillMount!="function"&&typeof oe.componentWillMount!="function"||(P=oe.state,typeof oe.componentWillMount=="function"&&oe.componentWillMount(),typeof oe.UNSAFE_componentWillMount=="function"&&oe.UNSAFE_componentWillMount(),P!==oe.state&&jg.enqueueReplaceState(oe,oe.state,null),uf(C,q,oe,ie),oe.state=C.memoizedState),typeof oe.componentDidMount=="function"&&(C.flags|=4)}var Dg=Array.isArray;function df(C,P,q){if((C=q.ref)!==null&&typeof C!="function"&&typeof C!="object"){if(q._owner){if(q=q._owner){if(q.tag!==1)throw Error(a(309));var ie=q.stateNode}if(!ie)throw Error(a(147,C));var oe=""+C;return P!==null&&P.ref!==null&&typeof P.ref=="function"&&P.ref._stringRef===oe?P.ref:((P=function(ae){var ue=ie.refs;ue===dT&&(ue=ie.refs={}),ae===null?delete ue[oe]:ue[oe]=ae})._stringRef=oe,P)}if(typeof C!="string")throw Error(a(284));if(!q._owner)throw Error(a(290,C))}return C}function Lg(C,P){if(C.type!=="textarea")throw Error(a(31,Object.prototype.toString.call(P)==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":P))}function gT(C){function P(Ve,rt){var mt;C&&((mt=Ve.lastEffect)!==null?(mt.nextEffect=rt,Ve.lastEffect=rt):Ve.firstEffect=Ve.lastEffect=rt,rt.nextEffect=null,rt.flags=8)}function q(Ve,rt){if(!C)return null;for(;rt!==null;)P(Ve,rt),rt=rt.sibling;return null}function ie(Ve,rt){for(Ve=new Map;rt!==null;)rt.key!==null?Ve.set(rt.key,rt):Ve.set(rt.index,rt),rt=rt.sibling;return Ve}function oe(Ve,rt){return(Ve=Ra(Ve,rt)).index=0,Ve.sibling=null,Ve}function ae(Ve,rt,mt){return Ve.index=mt,C?(mt=Ve.alternate)===null||(mt=mt.index)<rt?(Ve.flags=2,rt):mt:rt}function ue(Ve){return C&&Ve.alternate===null&&(Ve.flags=2),Ve}function _e(Ve,rt,mt,Bt){return rt===null||rt.tag!==6?(rt=p_(mt,Ve.mode,Bt)).return=Ve:(rt=oe(rt,mt)).return=Ve,rt}function me(Ve,rt,mt,Bt){return rt!==null&&rt.elementType===mt.type?(Bt=oe(rt,mt.props)).ref=df(0,rt,mt):(Bt=em(mt.type,mt.key,mt.props,null,Ve.mode,Bt)).ref=df(0,rt,mt),Bt.return=Ve,Bt}function He(Ve,rt,mt,Bt){return rt===null||rt.tag!==4||rt.stateNode.containerInfo!==mt.containerInfo||rt.stateNode.implementation!==mt.implementation?(rt=h_(mt,Ve.mode,Bt)).return=Ve:(rt=oe(rt,mt.children||[])).return=Ve,rt}function it(Ve,rt,mt,Bt,Dt){return rt===null||rt.tag!==7?(rt=xu(mt,Ve.mode,Bt,Dt)).return=Ve:(rt=oe(rt,mt)).return=Ve,rt}function ft(Ve,rt,mt){if(typeof rt=="string"||typeof rt=="number")return(rt=p_(""+rt,Ve.mode,mt)).return=Ve,rt;if(typeof rt=="object"&&rt!==null){switch(rt.$$typeof){case O:return(mt=em(rt.type,rt.key,rt.props,null,Ve.mode,mt)).ref=df(0,null,rt),mt.return=Ve,mt;case j:return(rt=h_(rt,Ve.mode,mt)).return=Ve,rt}if(Dg(rt)||N(rt))return(rt=xu(rt,Ve.mode,mt,null)).return=Ve,rt;Lg(Ve,rt)}return null}function Lt(Ve,rt,mt,Bt){var Dt=rt!==null?rt.key:null;if(typeof mt=="string"||typeof mt=="number")return Dt!==null?null:_e(Ve,rt,""+mt,Bt);if(typeof mt=="object"&&mt!==null){switch(mt.$$typeof){case O:return mt.key===Dt?mt.type===A?it(Ve,rt,mt.props.children,Bt,Dt):me(Ve,rt,mt,Bt):null;case j:return mt.key===Dt?He(Ve,rt,mt,Bt):null}if(Dg(mt)||N(mt))return Dt!==null?null:it(Ve,rt,mt,Bt,null);Lg(Ve,mt)}return null}function kn(Ve,rt,mt,Bt,Dt){if(typeof Bt=="string"||typeof Bt=="number")return _e(rt,Ve=Ve.get(mt)||null,""+Bt,Dt);if(typeof Bt=="object"&&Bt!==null){switch(Bt.$$typeof){case O:return Ve=Ve.get(Bt.key===null?mt:Bt.key)||null,Bt.type===A?it(rt,Ve,Bt.props.children,Dt,Bt.key):me(rt,Ve,Bt,Dt);case j:return He(rt,Ve=Ve.get(Bt.key===null?mt:Bt.key)||null,Bt,Dt)}if(Dg(Bt)||N(Bt))return it(rt,Ve=Ve.get(mt)||null,Bt,Dt,null);Lg(rt,Bt)}return null}return function(Ve,rt,mt,Bt){var Dt=typeof mt=="object"&&mt!==null&&mt.type===A&&mt.key===null,tn=typeof(mt=Dt?mt.props.children:mt)=="object"&&mt!==null;if(tn)switch(mt.$$typeof){case O:e:{for(tn=mt.key,Dt=rt;Dt!==null;){if(Dt.key===tn){switch(Dt.tag){case 7:if(mt.type!==A)break;q(Ve,Dt.sibling),(rt=oe(Dt,mt.props.children)).return=Ve,Ve=rt;break e;default:if(Dt.elementType===mt.type){q(Ve,Dt.sibling),(rt=oe(Dt,mt.props)).ref=df(0,Dt,mt),rt.return=Ve,Ve=rt;break e}}q(Ve,Dt);break}P(Ve,Dt),Dt=Dt.sibling}Ve=mt.type===A?((rt=xu(mt.props.children,Ve.mode,Bt,mt.key)).return=Ve,rt):((Bt=em(mt.type,mt.key,mt.props,null,Ve.mode,Bt)).ref=df(0,rt,mt),Bt.return=Ve,Bt)}return ue(Ve);case j:e:{for(Dt=mt.key;rt!==null;){if(rt.key===Dt){if(rt.tag===4&&rt.stateNode.containerInfo===mt.containerInfo&&rt.stateNode.implementation===mt.implementation){q(Ve,rt.sibling),(rt=oe(rt,mt.children||[])).return=Ve,Ve=rt;break e}q(Ve,rt);break}P(Ve,rt),rt=rt.sibling}(rt=h_(mt,Ve.mode,Bt)).return=Ve,Ve=rt}return ue(Ve)}if(typeof mt=="string"||typeof mt=="number")return mt=""+mt,(rt=rt!==null&&rt.tag===6?(q(Ve,rt.sibling),oe(rt,mt)):(q(Ve,rt),p_(mt,Ve.mode,Bt))).return=Ve,ue(Ve=rt);if(Dg(mt)){for(var yn=Ve,sn=rt,nn=mt,jn=Bt,zn=null,qn=null,En=sn,Mn=sn=0,Sn=null;En!==null&&Mn<nn.length;Mn++){En.index>Mn?(Sn=En,En=null):Sn=En.sibling;var er=Lt(yn,En,nn[Mn],jn);if(er===null){En===null&&(En=Sn);break}C&&En&&er.alternate===null&&P(yn,En),sn=ae(er,sn,Mn),qn===null?zn=er:qn.sibling=er,qn=er,En=Sn}if(Mn===nn.length)return q(yn,En),zn;if(En===null){for(;Mn<nn.length;Mn++)(En=ft(yn,nn[Mn],jn))!==null&&(sn=ae(En,sn,Mn),qn===null?zn=En:qn.sibling=En,qn=En);return zn}for(En=ie(yn,En);Mn<nn.length;Mn++)(Sn=kn(En,yn,Mn,nn[Mn],jn))!==null&&(C&&Sn.alternate!==null&&En.delete(Sn.key===null?Mn:Sn.key),sn=ae(Sn,sn,Mn),qn===null?zn=Sn:qn.sibling=Sn,qn=Sn);return C&&En.forEach(function(v_){return P(yn,v_)}),zn}if(N(mt)){var gr=Ve,ei=rt,Vi=mt,b_=Bt,Es=N(Vi);if(typeof Es!="function")throw Error(a(150));if((Vi=Es.call(Vi))==null)throw Error(a(151));for(var Os=Es=null,Fr=ei,Ts=ei=0,rm=null,ur=Vi.next();Fr!==null&&!ur.done;Ts++,ur=Vi.next()){Fr.index>Ts?(rm=Fr,Fr=null):rm=Fr.sibling;var wu=Lt(gr,Fr,ur.value,b_);if(wu===null){Fr===null&&(Fr=rm);break}C&&Fr&&wu.alternate===null&&P(gr,Fr),ei=ae(wu,ei,Ts),Os===null?Es=wu:Os.sibling=wu,Os=wu,Fr=rm}if(ur.done)return q(gr,Fr),Es;if(Fr===null){for(;!ur.done;Ts++,ur=Vi.next())(ur=ft(gr,ur.value,b_))!==null&&(ei=ae(ur,ei,Ts),Os===null?Es=ur:Os.sibling=ur,Os=ur);return Es}for(Fr=ie(gr,Fr);!ur.done;Ts++,ur=Vi.next())(ur=kn(Fr,gr,Ts,ur.value,b_))!==null&&(C&&ur.alternate!==null&&Fr.delete(ur.key===null?Ts:ur.key),ei=ae(ur,ei,Ts),Os===null?Es=ur:Os.sibling=ur,Os=ur);return C&&Fr.forEach(function(v_){return P(gr,v_)}),Es}if(tn&&Lg(Ve,mt),mt===void 0&&!Dt)switch(Ve.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,Y(Ve.type)||"Component"))}return q(Ve,rt)}}var Bg=gT(!0),mT=gT(!1),ff={},Ki=wa(ff),pf=wa(ff),hf=wa(ff);function Al(C){if(C===ff)throw Error(a(174));return C}function jv(C,P){switch(hr(hf,P),hr(pf,C),hr(Ki,ff),C=P.nodeType){case 9:case 11:P=(P=P.documentElement)?P.namespaceURI:Ee(null,"");break;default:P=Ee(P=(C=C===8?P.parentNode:P).namespaceURI||null,C=C.tagName)}sr(Ki),hr(Ki,P)}function pu(){sr(Ki),sr(pf),sr(hf)}function yT(C){Al(hf.current);var P=Al(Ki.current),q=Ee(P,C.type);P!==q&&(hr(pf,C),hr(Ki,q))}function Dv(C){pf.current===C&&(sr(Ki),sr(pf))}var vr=wa(0);function Fg(C){for(var P=C;P!==null;){if(P.tag===13){var q=P.memoizedState;if(q!==null&&((q=q.dehydrated)===null||q.data==="$?"||q.data==="$!"))return P}else if(P.tag===19&&P.memoizedProps.revealOrder!==void 0){if(64&P.flags)return P}else if(P.child!==null){P=(P.child.return=P).child;continue}if(P===C)break;for(;P.sibling===null;){if(P.return===null||P.return===C)return null;P=P.return}P.sibling.return=P.return,P=P.sibling}return null}var ws=null,Ta=null,Wi=!1;function bT(C,P){var q=Qo(5,null,null,0);q.elementType="DELETED",q.type="DELETED",q.stateNode=P,q.return=C,q.flags=8,C.lastEffect!==null?(C.lastEffect.nextEffect=q,C.lastEffect=q):C.firstEffect=C.lastEffect=q}function vT(C,P){switch(C.tag){case 5:var q=C.type;return(P=P.nodeType!==1||q.toLowerCase()!==P.nodeName.toLowerCase()?null:P)!==null&&(C.stateNode=P,1);case 6:return(P=C.pendingProps===""||P.nodeType!==3?null:P)!==null&&(C.stateNode=P,1);default:return}}function Lv(C){if(Wi){var P=Ta;if(P){var q=P;if(!vT(C,P)){if(!(P=su(q.nextSibling))||!vT(C,P))return C.flags=-1025&C.flags|2,Wi=!1,void(ws=C);bT(ws,q)}ws=C,Ta=su(P.firstChild)}else C.flags=-1025&C.flags|2,Wi=!1,ws=C}}function _T(C){for(C=C.return;C!==null&&C.tag!==5&&C.tag!==3&&C.tag!==13;)C=C.return;ws=C}function $g(C){if(C===ws){if(!Wi)return _T(C),Wi=!0,0;var P=C.type;if(C.tag!==5||P!=="head"&&P!=="body"&&!_v(P,C.memoizedProps))for(P=Ta;P;)bT(C,P),P=su(P.nextSibling);if(_T(C),C.tag===13){if(!(C=(C=C.memoizedState)!==null?C.dehydrated:null))throw Error(a(317));e:{for(C=C.nextSibling,P=0;C;){if(C.nodeType===8){var q=C.data;if(q==="/$"){if(P===0){Ta=su(C.nextSibling);break e}P--}else q!=="$"&&q!=="$!"&&q!=="$?"||P++}C=C.nextSibling}Ta=null}}else Ta=ws?su(C.stateNode.nextSibling):null;return 1}}function Bv(){Ta=ws=null,Wi=!1}var hu=[];function Fv(){for(var C=0;C<hu.length;C++)hu[C]._workInProgressVersionPrimary=null;hu.length=0}var gf=E.ReactCurrentDispatcher,Xo=E.ReactCurrentBatchConfig,mf=0,_r=null,mo=null,Kr=null,zg=!1,yf=!1;function To(){throw Error(a(321))}function $v(C,P){if(P!==null){for(var q=0;q<P.length&&q<C.length;q++)if(!Or(C[q],P[q]))return;return 1}}function zv(C,P,q,ie,oe,ae){if(mf=ae,(_r=P).memoizedState=null,P.updateQueue=null,P.lanes=0,gf.current=C===null||C.memoizedState===null?RF:jF,C=q(ie,oe),yf){ae=0;do if(yf=!1,!(ae<25))throw Error(a(301));while(ae+=1,Kr=mo=null,P.updateQueue=null,gf.current=DF,C=q(ie,oe),yf)}if(gf.current=Wg,P=mo!==null&&mo.next!==null,mf=0,Kr=mo=_r=null,zg=!1,P)throw Error(a(300));return C}function Pl(){var C={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kr===null?_r.memoizedState=Kr=C:Kr=Kr.next=C,Kr}function Ml(){C=mo===null?(C=_r.alternate)!==null?C.memoizedState:null:mo.next;var C,P=Kr===null?_r.memoizedState:Kr.next;if(P!==null)Kr=P,mo=C;else{if(C===null)throw Error(a(310));C={memoizedState:(mo=C).memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},Kr===null?_r.memoizedState=Kr=C:Kr=Kr.next=C}return Kr}function qi(C,P){return typeof P=="function"?P(C):P}function bf(C){var P=Ml(),q=P.queue;if(q===null)throw Error(a(311));q.lastRenderedReducer=C;var ie,oe=(ue=mo).baseQueue,ae=q.pending;if(ae!==null&&(oe!==null&&(ie=oe.next,oe.next=ae.next,ae.next=ie),ue.baseQueue=oe=ae,q.pending=null),oe!==null){oe=oe.next;var ue=ue.baseState,_e=ie=ae=null,me=oe;do var He,it=me.lane;while((mf&it)===it?(_e!==null&&(_e=_e.next={lane:0,action:me.action,eagerReducer:me.eagerReducer,eagerState:me.eagerState,next:null}),ue=me.eagerReducer===C?me.eagerState:C(ue,me.action)):(He={lane:it,action:me.action,eagerReducer:me.eagerReducer,eagerState:me.eagerState,next:null},_e===null?(ie=_e=He,ae=ue):_e=_e.next=He,_r.lanes|=it,wf|=it),(me=me.next)!==null&&me!==oe);_e===null?ae=ue:_e.next=ie,Or(ue,P.memoizedState)||(bi=!0),P.memoizedState=ue,P.baseState=ae,P.baseQueue=_e,q.lastRenderedState=ue}return[P.memoizedState,q.dispatch]}function vf(C){var P=Ml(),q=P.queue;if(q===null)throw Error(a(311));q.lastRenderedReducer=C;var ie=q.dispatch,oe=q.pending,ae=P.memoizedState;if(oe!==null){q.pending=null;for(var ue=oe=oe.next;ae=C(ae,ue.action),(ue=ue.next)!==oe;);Or(ae,P.memoizedState)||(bi=!0),P.memoizedState=ae,P.baseQueue===null&&(P.baseState=ae),q.lastRenderedState=ae}return[ae,ie]}function xT(C,P,q){var ie=(ie=P._getVersion)(P._source),oe=P._workInProgressVersionPrimary;if(oe!==null?C=oe===ie:(C=C.mutableReadLanes,(C=(mf&C)===C)&&(P._workInProgressVersionPrimary=ie,hu.push(P))),C)return q(P._source);throw hu.push(P),Error(a(350))}function wT(C,P,q,ie){var oe=yo;if(oe===null)throw Error(a(349));var ae=P._getVersion,ue=ae(P._source),_e=gf.current,me=(it=_e.useState(function(){return xT(oe,P,q)}))[1],He=it[0],it=Kr,ft=(Ve=C.memoizedState).refs,Lt=ft.getSnapshot,kn=Ve.source,Ve=Ve.subscribe,rt=_r;return C.memoizedState={refs:ft,source:P,subscribe:ie},_e.useEffect(function(){ft.getSnapshot=q,ft.setSnapshot=me;var mt=ae(P._source);if(!Or(ue,mt)){mt=q(P._source),Or(He,mt)||(me(mt),mt=Aa(rt),oe.mutableReadLanes|=mt&oe.pendingLanes),mt=oe.mutableReadLanes,oe.entangledLanes|=mt;for(var Bt=oe.entanglements,Dt=mt;0<Dt;){var tn=31-hi(Dt),yn=1<<tn;Bt[tn]|=mt,Dt&=~yn}}},[q,P,ie]),_e.useEffect(function(){return ie(P._source,function(){var mt=ft.getSnapshot,Bt=ft.setSnapshot;try{Bt(mt(P._source));var Dt=Aa(rt);oe.mutableReadLanes|=Dt&oe.pendingLanes}catch(tn){Bt(function(){throw tn})}})},[P,ie]),Or(Lt,q)&&Or(kn,P)&&Or(Ve,ie)||((C={pending:null,dispatch:null,lastRenderedReducer:qi,lastRenderedState:He}).dispatch=me=Wv.bind(null,_r,C),it.queue=C,it.baseQueue=null,He=xT(oe,P,q),it.memoizedState=it.baseState=He),He}function ST(C,P,q){return wT(Ml(),C,P,q)}function _f(C){var P=Pl();return typeof C=="function"&&(C=C()),P.memoizedState=P.baseState=C,C=(C=P.queue={pending:null,dispatch:null,lastRenderedReducer:qi,lastRenderedState:C}).dispatch=Wv.bind(null,_r,C),[P.memoizedState,C]}function Ug(C,P,q,ie){return C={tag:C,create:P,destroy:q,deps:ie,next:null},(P=_r.updateQueue)===null?(_r.updateQueue=P={lastEffect:null}).lastEffect=C.next=C:(q=P.lastEffect)===null?P.lastEffect=C.next=C:(ie=q.next,(q.next=C).next=ie,P.lastEffect=C),C}function CT(C){return Pl().memoizedState={current:C}}function Hg(){return Ml().memoizedState}function Uv(C,P,q,ie){var oe=Pl();_r.flags|=C,oe.memoizedState=Ug(1|P,q,void 0,ie===void 0?null:ie)}function Hv(C,P,q,ie){var oe=Ml(),ae=void(ie=ie===void 0?null:ie);if(mo!==null){var ue=mo.memoizedState;if(ae=ue.destroy,ie!==null&&$v(ie,ue.deps))return void Ug(P,q,ae,ie)}_r.flags|=C,oe.memoizedState=Ug(1|P,q,ae,ie)}function ET(C,P){return Uv(516,4,C,P)}function Kg(C,P){return Hv(516,4,C,P)}function OT(C,P){return Hv(4,2,C,P)}function TT(C,P){return typeof P=="function"?(C=C(),P(C),function(){P(null)}):P!=null?(C=C(),P.current=C,function(){P.current=null}):void 0}function NT(C,P,q){return q=q!=null?q.concat([C]):null,Hv(4,2,TT.bind(null,P,C),q)}function Kv(){}function kT(C,P){var q=Ml(),ie=(P=P===void 0?null:P,q.memoizedState);return ie!==null&&P!==null&&$v(P,ie[1])?ie[0]:(q.memoizedState=[C,P],C)}function AT(C,P){var q=Ml(),ie=(P=P===void 0?null:P,q.memoizedState);return ie!==null&&P!==null&&$v(P,ie[1])?ie[0]:(C=C(),q.memoizedState=[C,P],C)}function Wv(C,P,q){var ie=zo(),oe=Aa(C),ae={lane:oe,action:q,eagerReducer:null,eagerState:null,next:null},ue=P.pending;if(ue===null?ae.next=ae:(ae.next=ue.next,ue.next=ae),P.pending=ae,ue=C.alternate,C===_r||ue!==null&&ue===_r)yf=zg=!0;else{if(C.lanes===0&&(ue===null||ue.lanes===0)&&(ue=P.lastRenderedReducer)!==null)try{var _e=P.lastRenderedState,me=ue(_e,q);if(ae.eagerReducer=ue,ae.eagerState=me,Or(me,_e))return}catch{}Pa(C,oe,ie)}}var Wg={readContext:Yo,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useMutableSource:To,useOpaqueIdentifier:To,unstable_isNewReconciler:!1},RF={readContext:Yo,useCallback:function(C,P){return Pl().memoizedState=[C,P===void 0?null:P],C},useContext:Yo,useEffect:ET,useImperativeHandle:function(C,P,q){return q=q!=null?q.concat([C]):null,Uv(4,2,TT.bind(null,P,C),q)},useLayoutEffect:function(C,P){return Uv(4,2,C,P)},useMemo:function(C,P){var q=Pl();return P=P===void 0?null:P,C=C(),q.memoizedState=[C,P],C},useReducer:function(C,P,q){var ie=Pl();return P=q!==void 0?q(P):P,ie.memoizedState=ie.baseState=P,C=(C=ie.queue={pending:null,dispatch:null,lastRenderedReducer:C,lastRenderedState:P}).dispatch=Wv.bind(null,_r,C),[ie.memoizedState,C]},useRef:CT,useState:_f,useDebugValue:Kv,useDeferredValue:function(C){var P=_f(C),q=P[0],ie=P[1];return ET(function(){var oe=Xo.transition;Xo.transition=1;try{ie(C)}finally{Xo.transition=oe}},[C]),q},useTransition:function(){var C=_f(!1),P=C[0];return CT(C=(function(q,ie){var oe=uu();kl(oe<98?98:oe,function(){q(!0)}),kl(97<oe?97:oe,function(){var ae=Xo.transition;Xo.transition=1;try{q(!1),ie()}finally{Xo.transition=ae}})}).bind(null,C[1])),[C,P]},useMutableSource:function(C,P,q){var ie=Pl();return ie.memoizedState={refs:{getSnapshot:P,setSnapshot:null},source:C,subscribe:q},wT(ie,C,P,q)},useOpaqueIdentifier:function(){var C,P,q;return Wi?(C=!1,q={$$typeof:z,toString:q=function(){throw C||(C=!0,P("r:"+(wv++).toString(36))),Error(a(355))},valueOf:q},P=_f(q)[1],!(2&_r.mode)&&(_r.flags|=516,Ug(5,function(){P("r:"+(wv++).toString(36))},void 0,null))):_f(q="r:"+(wv++).toString(36)),q},unstable_isNewReconciler:!1},jF={readContext:Yo,useCallback:kT,useContext:Yo,useEffect:Kg,useImperativeHandle:NT,useLayoutEffect:OT,useMemo:AT,useReducer:bf,useRef:Hg,useState:function(){return bf(qi)},useDebugValue:Kv,useDeferredValue:function(C){var P=bf(qi),q=P[0],ie=P[1];return Kg(function(){var oe=Xo.transition;Xo.transition=1;try{ie(C)}finally{Xo.transition=oe}},[C]),q},useTransition:function(){var C=bf(qi)[0];return[Hg().current,C]},useMutableSource:ST,useOpaqueIdentifier:function(){return bf(qi)[0]},unstable_isNewReconciler:!1},DF={readContext:Yo,useCallback:kT,useContext:Yo,useEffect:Kg,useImperativeHandle:NT,useLayoutEffect:OT,useMemo:AT,useReducer:vf,useRef:Hg,useState:function(){return vf(qi)},useDebugValue:Kv,useDeferredValue:function(C){var P=vf(qi),q=P[0],ie=P[1];return Kg(function(){var oe=Xo.transition;Xo.transition=1;try{ie(C)}finally{Xo.transition=oe}},[C]),q},useTransition:function(){var C=vf(qi)[0];return[Hg().current,C]},useMutableSource:ST,useOpaqueIdentifier:function(){return vf(qi)[0]},unstable_isNewReconciler:!1},LF=E.ReactCurrentOwner,bi=!1;function $o(C,P,q,ie){P.child=C===null?mT(P,null,q,ie):Bg(P,C.child,q,ie)}function PT(C,P,q,ie,oe){q=q.render;var ae=P.ref;return fu(P,oe),ie=zv(C,P,q,ie,ae,oe),C===null||bi?(P.flags|=1,$o(C,P,ie,oe),P.child):(P.updateQueue=C.updateQueue,P.flags&=-517,C.lanes&=~oe,Ss(C,P,oe))}function MT(C,P,q,ie,oe,ae){var ue;return C===null?typeof(ue=q.type)!="function"||d_(ue)||ue.defaultProps!==void 0||q.compare!==null||q.defaultProps!==void 0?((C=em(q.type,null,ie,P,P.mode,ae)).ref=P.ref,(C.return=P).child=C):(P.tag=15,P.type=ue,IT(C,P,ue,ie,oe,ae)):(ue=C.child,oe&ae||(oe=ue.memoizedProps,!(q=(q=q.compare)!==null?q:nf)(oe,ie)||C.ref!==P.ref)?(P.flags|=1,(C=Ra(ue,ie)).ref=P.ref,(C.return=P).child=C):Ss(C,P,ae))}function IT(C,P,q,ie,oe,ae){if(C!==null&&nf(C.memoizedProps,ie)&&C.ref===P.ref){if(bi=!1,!(ae&oe))return P.lanes=C.lanes,Ss(C,P,ae);16384&C.flags&&(bi=!0)}return qv(C,P,q,ie,ae)}function RT(C,P,q){var ie=P.pendingProps,oe=ie.children,ae=C!==null?C.memoizedState:null;if(ie.mode==="hidden"||ie.mode==="unstable-defer-without-hiding")if(4&P.mode){if(!(1073741824&q))return C=ae!==null?ae.baseLanes|q:q,P.lanes=P.childLanes=1073741824,P.memoizedState={baseLanes:C},Qg(0,C),null;P.memoizedState={baseLanes:0},Qg(0,ae!==null?ae.baseLanes:q)}else P.memoizedState={baseLanes:0},Qg(0,q);else ae!==null?(ie=ae.baseLanes|q,P.memoizedState=null):ie=q,Qg(0,ie);return $o(C,P,oe,q),P.child}function jT(C,P){var q=P.ref;(C===null&&q!==null||C!==null&&C.ref!==q)&&(P.flags|=128)}function qv(C,P,q,ie,oe){var ae=cu(P,Fo(q)?Tl:to.current);return fu(P,oe),q=zv(C,P,q,ie,ae,oe),C===null||bi?(P.flags|=1,$o(C,P,q,oe),P.child):(P.updateQueue=C.updateQueue,P.flags&=-517,C.lanes&=~oe,Ss(C,P,oe))}function DT(C,P,q,ie,oe){var ae,ue,_e,me,He,it,ft,Lt,kn,Ve;return Fo(q)?(ae=!0,Ng(P)):ae=!1,fu(P,oe),ie=P.stateNode===null?(C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),pT(P,q,ie),Rv(P,q,ie,oe),!0):C===null?(ue=P.stateNode,_e=P.memoizedProps,ue.props=_e,Lt=ue.context,me=typeof(me=q.contextType)=="object"&&me!==null?Yo(me):cu(P,me=Fo(q)?Tl:to.current),(it=typeof(He=q.getDerivedStateFromProps)=="function"||typeof ue.getSnapshotBeforeUpdate=="function")||typeof ue.UNSAFE_componentWillReceiveProps!="function"&&typeof ue.componentWillReceiveProps!="function"||_e===ie&&Lt===me||hT(0,ue,ie,me),Ca=!1,ft=P.memoizedState,ue.state=ft,uf(P,ie,ue,oe),Lt=P.memoizedState,_e!==ie||ft!==Lt||Oo.current||Ca?(typeof He=="function"&&(Rg(P,0,He,ie),Lt=P.memoizedState),(_e=Ca||fT(P,q,_e,ie,ft,Lt,me))?(it||typeof ue.UNSAFE_componentWillMount!="function"&&typeof ue.componentWillMount!="function"||(typeof ue.componentWillMount=="function"&&ue.componentWillMount(),typeof ue.UNSAFE_componentWillMount=="function"&&ue.UNSAFE_componentWillMount()),typeof ue.componentDidMount=="function"&&(P.flags|=4)):(typeof ue.componentDidMount=="function"&&(P.flags|=4),P.memoizedProps=ie,P.memoizedState=Lt),ue.props=ie,ue.state=Lt,ue.context=me,_e):(typeof ue.componentDidMount=="function"&&(P.flags|=4),!1)):(ue=P.stateNode,lT(C,P),_e=P.memoizedProps,me=P.type===P.elementType?_e:yi(P.type,_e),ue.props=me,it=P.pendingProps,ft=ue.context,Lt=typeof(Lt=q.contextType)=="object"&&Lt!==null?Yo(Lt):cu(P,Lt=Fo(q)?Tl:to.current),(He=typeof(kn=q.getDerivedStateFromProps)=="function"||typeof ue.getSnapshotBeforeUpdate=="function")||typeof ue.UNSAFE_componentWillReceiveProps!="function"&&typeof ue.componentWillReceiveProps!="function"||_e===it&&ft===Lt||hT(0,ue,ie,Lt),Ca=!1,ft=P.memoizedState,ue.state=ft,uf(P,ie,ue,oe),Ve=P.memoizedState,_e!==it||ft!==Ve||Oo.current||Ca?(typeof kn=="function"&&(Rg(P,0,kn,ie),Ve=P.memoizedState),(me=Ca||fT(P,q,me,ie,ft,Ve,Lt))?(He||typeof ue.UNSAFE_componentWillUpdate!="function"&&typeof ue.componentWillUpdate!="function"||(typeof ue.componentWillUpdate=="function"&&ue.componentWillUpdate(ie,Ve,Lt),typeof ue.UNSAFE_componentWillUpdate=="function"&&ue.UNSAFE_componentWillUpdate(ie,Ve,Lt)),typeof ue.componentDidUpdate=="function"&&(P.flags|=4),typeof ue.getSnapshotBeforeUpdate=="function"&&(P.flags|=256)):(typeof ue.componentDidUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=4),typeof ue.getSnapshotBeforeUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=256),P.memoizedProps=ie,P.memoizedState=Ve),ue.props=ie,ue.state=Ve,ue.context=Lt,me):(typeof ue.componentDidUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=4),typeof ue.getSnapshotBeforeUpdate!="function"||_e===C.memoizedProps&&ft===C.memoizedState||(P.flags|=256),!1)),Jv(C,P,q,ie,ae,oe)}function Jv(C,P,q,ie,oe,ae){jT(C,P);var ue=!!(64&P.flags);if(!ie&&!ue)return oe&&Q2(P,q,!1),Ss(C,P,ae);ie=P.stateNode,LF.current=P;var _e=ue&&typeof q.getDerivedStateFromError!="function"?null:ie.render();return P.flags|=1,C!==null&&ue?(P.child=Bg(P,C.child,null,ae),P.child=Bg(P,null,_e,ae)):$o(C,P,_e,ae),P.memoizedState=ie.state,oe&&Q2(P,q,!0),P.child}function LT(C){var P=C.stateNode;P.pendingContext?X2(0,P.pendingContext,P.pendingContext!==P.context):P.context&&X2(0,P.context,!1),jv(C,P.containerInfo)}var Vv={dehydrated:null,retryLane:0};function BT(C,P,q){var ie,oe=P.pendingProps,ae=vr.current,ue=!1;return(ie=(ie=!!(64&P.flags))?ie:(C===null||C.memoizedState!==null)&&!!(2&ae))?(ue=!0,P.flags&=-65):C!==null&&C.memoizedState===null||oe.fallback===void 0||oe.unstable_avoidThisFallback===!0||(ae|=1),hr(vr,1&ae),C===null?(oe.fallback!==void 0&&Lv(P),C=oe.children,ae=oe.fallback,ue?(C=FT(P,C,ae,q),P.child.memoizedState={baseLanes:q},P.memoizedState=Vv,C):typeof oe.unstable_expectedLoadTime=="number"?(C=FT(P,C,ae,q),P.child.memoizedState={baseLanes:q},P.memoizedState=Vv,P.lanes=33554432,C):((q=f_({mode:"visible",children:C},P.mode,q,null)).return=P).child=q):(C.memoizedState,ue?(oe=function(_e,me,He,it,ft){var Lt=me.mode,kn=_e.child,Ve=(_e=kn.sibling,{mode:"hidden",children:He});return 2&Lt||me.child===kn?He=Ra(kn,Ve):((He=me.child).childLanes=0,He.pendingProps=Ve,(kn=He.lastEffect)!==null?(me.firstEffect=He.firstEffect,(me.lastEffect=kn).nextEffect=null):me.firstEffect=me.lastEffect=null),_e!==null?it=Ra(_e,it):(it=xu(it,Lt,ft,null)).flags|=2,it.return=me,He.return=me,He.sibling=it,me.child=He,it}(C,P,oe.children,oe.fallback,q),ue=P.child,ae=C.child.memoizedState,ue.memoizedState=ae===null?{baseLanes:q}:{baseLanes:ae.baseLanes|q},ue.childLanes=C.childLanes&~q,P.memoizedState=Vv,oe):(q=function(_e,me,He,it){var ft=_e.child;return _e=ft.sibling,He=Ra(ft,{mode:"visible",children:He}),!(2&me.mode)&&(He.lanes=it),He.return=me,(He.sibling=null)!==_e&&(_e.nextEffect=null,_e.flags=8,me.firstEffect=me.lastEffect=_e),me.child=He}(C,P,oe.children,q),P.memoizedState=null,q))}function FT(C,P,q,ie){var oe=C.mode,ae=C.child;return P={mode:"hidden",children:P},2&oe||ae===null?ae=f_(P,oe,0,null):(ae.childLanes=0,ae.pendingProps=P),q=xu(q,oe,ie,null),ae.return=C,q.return=C,ae.sibling=q,C.child=ae,q}function $T(C,P){C.lanes|=P;var q=C.alternate;q!==null&&(q.lanes|=P),aT(C.return,P)}function Gv(C,P,q,ie,oe,ae){var ue=C.memoizedState;ue===null?C.memoizedState={isBackwards:P,rendering:null,renderingStartTime:0,last:ie,tail:q,tailMode:oe,lastEffect:ae}:(ue.isBackwards=P,ue.rendering=null,ue.renderingStartTime=0,ue.last=ie,ue.tail=q,ue.tailMode=oe,ue.lastEffect=ae)}function zT(C,P,q){var ie=P.pendingProps,oe=ie.revealOrder,ae=ie.tail;if($o(C,P,ie.children,q),2&(ie=vr.current))ie=1&ie|2,P.flags|=64;else{if(C!==null&&64&C.flags)e:for(C=P.child;C!==null;){if(C.tag===13)C.memoizedState!==null&&$T(C,q);else if(C.tag===19)$T(C,q);else if(C.child!==null){C=(C.child.return=C).child;continue}if(C===P)break;for(;C.sibling===null;){if(C.return===null||C.return===P)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}ie&=1}if(hr(vr,ie),2&P.mode)switch(oe){case"forwards":for(q=P.child,oe=null;q!==null;)(C=q.alternate)!==null&&Fg(C)===null&&(oe=q),q=q.sibling;(q=oe)===null?(oe=P.child,P.child=null):(oe=q.sibling,q.sibling=null),Gv(P,!1,oe,q,ae,P.lastEffect);break;case"backwards":for(oe=P.child,P.child=q=null;oe!==null;){if((C=oe.alternate)!==null&&Fg(C)===null){P.child=oe;break}C=oe.sibling,oe.sibling=q,q=oe,oe=C}Gv(P,!0,q,null,ae,P.lastEffect);break;case"together":Gv(P,!1,null,null,void 0,P.lastEffect);break;default:P.memoizedState=null}else P.memoizedState=null;return P.child}function Ss(C,P,q){if(C!==null&&(P.dependencies=C.dependencies),wf|=P.lanes,!(q&P.childLanes))return null;if(C!==null&&P.child!==C.child)throw Error(a(153));if(P.child!==null){for(q=Ra(C=P.child,C.pendingProps),(P.child=q).return=P;C.sibling!==null;)C=C.sibling,(q=q.sibling=Ra(C,C.pendingProps)).return=P;q.sibling=null}return P.child}function xf(C,P){if(!Wi)switch(C.tailMode){case"hidden":P=C.tail;for(var q=null;P!==null;)P.alternate!==null&&(q=P),P=P.sibling;q===null?C.tail=null:q.sibling=null;break;case"collapsed":q=C.tail;for(var ie=null;q!==null;)q.alternate!==null&&(ie=q),q=q.sibling;ie===null?P||C.tail===null?C.tail=null:C.tail.sibling=null:ie.sibling=null}}function Yv(C,P){try{for(var q="",ie=P;q+=function(ae){switch(ae.tag){case 5:return R(ae.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return B(ae.type,!1);case 11:return B(ae.type.render,!1);case 22:return B(ae.type._render,!1);case 1:return B(ae.type,!0);default:return""}}(ie),ie=ie.return;);var oe=q}catch(ae){oe=`
|
|
125
125
|
Error generating stack: `+ae.message+`
|
|
126
|
-
`+ae.stack}return{value:C,source:P,stack:oe}}function Zv(C,P){try{console.error(P.value)}catch(q){setTimeout(function(){throw q})}}var FF=function(C,P){for(var q=P.child;q!==null;){if(q.tag===5||q.tag===6)C.appendChild(q.stateNode);else if(q.tag!==4&&q.child!==null){q=(q.child.return=q).child;continue}if(q===P)break;for(;q.sibling===null;){if(q.return===null||q.return===P)return;q=q.return}q.sibling.return=q.return,q=q.sibling}},$F=function(C,P,q,ie){var oe=C.memoizedProps;if(oe!==ie){C=P.stateNode,Al(Ki.current);var ae,ue=null;switch(q){case"input":oe=te(C,oe),ie=te(C,ie),ue=[];break;case"option":oe=je(C,oe),ie=je(C,ie),ue=[];break;case"select":oe=i({},oe,{value:void 0}),ie=i({},ie,{value:void 0}),ue=[];break;case"textarea":oe=Me(C,oe),ie=Me(C,ie),ue=[];break;default:typeof oe.onClick!="function"&&typeof ie.onClick=="function"&&(C.onclick=Eg)}for(He in Oe(q,ie),q=null,oe)if(!ie.hasOwnProperty(He)&&oe.hasOwnProperty(He)&&oe[He]!=null)if(He==="style"){var _e=oe[He];for(ae in _e)_e.hasOwnProperty(ae)&&((q=q||{})[ae]="")}else He!=="dangerouslySetInnerHTML"&&He!=="children"&&He!=="suppressContentEditableWarning"&&He!=="suppressHydrationWarning"&&He!=="autoFocus"&&(l.hasOwnProperty(He)?ue=ue||[]:(ue=ue||[]).push(He,null));for(He in ie){var me=ie[He];if(_e=oe!=null?oe[He]:void 0,ie.hasOwnProperty(He)&&me!==_e&&(me!=null||_e!=null))if(He==="style")if(_e){for(ae in _e)!_e.hasOwnProperty(ae)||me&&me.hasOwnProperty(ae)||((q=q||{})[ae]="");for(ae in me)me.hasOwnProperty(ae)&&_e[ae]!==me[ae]&&((q=q||{})[ae]=me[ae])}else q||(ue=ue||[]).push(He,q),q=me;else He==="dangerouslySetInnerHTML"?(me=me?me.__html:void 0,_e=_e?_e.__html:void 0,me!=null&&_e!==me&&(ue=ue||[]).push(He,me)):He==="children"?typeof me!="string"&&typeof me!="number"||(ue=ue||[]).push(He,""+me):He!=="suppressContentEditableWarning"&&He!=="suppressHydrationWarning"&&(l.hasOwnProperty(He)?(me!=null&&He==="onScroll"&&Qn("scroll",C),ue||_e===me||(ue=[])):typeof me=="object"&&me!==null&&me.$$typeof===z?me.toString():(ue=ue||[]).push(He,me))}q&&(ue=ue||[]).push("style",q);var He=ue;(P.updateQueue=He)&&(P.flags|=4)}},zF=function(C,P,q,ie){q!==ie&&(P.flags|=4)},UF=typeof WeakMap=="function"?WeakMap:Map;function HT(C,P,q){(q=Ea(-1,q)).tag=3,q.payload={element:null};var ie=P.value;return q.callback=function(){Vg||(Vg=!0,s_=ie),Zv(0,P)},q}function KT(C,P,q){(q=Ea(-1,q)).tag=3;var ie,oe=C.type.getDerivedStateFromError;return typeof oe=="function"&&(ie=P.value,q.payload=function(){return Zv(0,P),oe(ie)}),(C=C.stateNode)!==null&&typeof C.componentDidCatch=="function"&&(q.callback=function(){typeof oe!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this),Zv(0,P));var ae=P.stack;this.componentDidCatch(P.value,{componentStack:ae!==null?ae:""})}),q}var HF=typeof WeakSet=="function"?WeakSet:Set;function WT(C){var P=C.ref;if(P!==null)if(typeof P=="function")try{P(null)}catch(q){Ia(C,q)}else P.current=null}function KF(C,P,q){switch(q.tag){case 0:case 11:case 15:case 22:if((P=(P=q.updateQueue)!==null?P.lastEffect:null)!==null){C=P=P.next;do;while(!(3&~C.tag)&&(oe=C.create,C.destroy=oe()),(C=C.next)!==P)}if((P=(P=q.updateQueue)!==null?P.lastEffect:null)!==null){C=P=P.next;do{var ie=C,oe=ie.next;4&(ie=ie.tag)&&1&ie&&(aN(q,C),ie=q,ae=C,a_.push(ae,ie),Na||(Na=!0,cf(97,function(){return Ma(),null}))),C=oe}while(C!==P)}return;case 1:return C=q.stateNode,4&q.flags&&(P===null?C.componentDidMount():(oe=q.elementType===q.type?P.memoizedProps:yi(q.type,P.memoizedProps),C.componentDidUpdate(oe,P.memoizedState,C.__reactInternalSnapshotBeforeUpdate))),void((P=q.updateQueue)!==null&&dT(0,P,C));case 3:if((P=q.updateQueue)!==null){if((C=null)!==q.child)switch(q.child.tag){case 5:case 1:C=q.child.stateNode}dT(0,P,C)}return;case 5:return C=q.stateNode,void(P===null&&4&q.flags&&J2(q.type,q.memoizedProps)&&C.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(q.memoizedState===null&&(q=q.alternate)!==null&&(q=q.memoizedState)!==null&&(q=q.dehydrated)!==null&&Gn(q))}var ae;throw Error(a(163))}function qT(C,P){for(var q=C;;){if(q.tag===5){var ie,oe=q.stateNode;P?typeof(oe=oe.style).setProperty=="function"?oe.setProperty("display","none","important"):oe.display="none":(oe=q.stateNode,ie=(ie=q.memoizedProps.style)!=null&&ie.hasOwnProperty("display")?ie.display:null,oe.style.display=Qe("display",ie))}else if(q.tag===6)q.stateNode.nodeValue=P?"":q.memoizedProps;else if((q.tag!==23&&q.tag!==24||q.memoizedState===null||q===C)&&q.child!==null){q=(q.child.return=q).child;continue}if(q===C)break;for(;q.sibling===null;){if(q.return===null||q.return===C)return;q=q.return}q.sibling.return=q.return,q=q.sibling}}function JT(C,P){if(Nl&&typeof Nl.onCommitFiberUnmount=="function")try{Nl.onCommitFiberUnmount(Ov,P)}catch{}switch(P.tag){case 0:case 11:case 14:case 15:case 22:if((C=P.updateQueue)!==null&&(C=C.lastEffect)!==null){var q=C=C.next;do{var ie=(oe=q).destroy,oe=oe.tag;if(ie!==void 0)if(4&oe)aN(P,q);else{oe=P;try{ie()}catch(ae){Ia(oe,ae)}}}while((q=q.next)!==C)}break;case 1:if(WT(P),typeof(C=P.stateNode).componentWillUnmount=="function")try{C.props=P.memoizedProps,C.state=P.memoizedState,C.componentWillUnmount()}catch(ae){Ia(P,ae)}break;case 5:WT(P);break;case 4:XT(C,P)}}function VT(C){C.alternate=null,C.child=null,C.dependencies=null,C.firstEffect=null,C.lastEffect=null,C.memoizedProps=null,C.memoizedState=null,C.pendingProps=null,C.return=null,C.updateQueue=null}function GT(C){return C.tag===5||C.tag===3||C.tag===4}function YT(C){e:{for(var P=C.return;P!==null;){if(GT(P))break e;P=P.return}throw Error(a(160))}var q=P;switch(P=q.stateNode,q.tag){case 5:var ie=!1;break;case 3:case 4:P=P.containerInfo,ie=!0;break;default:throw Error(a(161))}16&q.flags&&(de(P,""),q.flags&=-17);e:t:for(q=C;;){for(;q.sibling===null;){if(q.return===null||GT(q.return)){q=null;break e}q=q.return}for(q.sibling.return=q.return,q=q.sibling;q.tag!==5&&q.tag!==6&&q.tag!==18;){if(2&q.flags||q.child===null||q.tag===4)continue t;q=(q.child.return=q).child}if(!(2&q.flags)){q=q.stateNode;break e}}(ie?function oe(ae,ue,_e){var me=ae.tag,He=me===5||me===6;if(He)ae=He?ae.stateNode:ae.stateNode.instance,ue?(_e.nodeType===8?_e.parentNode:_e).insertBefore(ae,ue):(_e.nodeType===8?(ue=_e.parentNode).insertBefore(ae,_e):(ue=_e).appendChild(ae),(_e=_e._reactRootContainer)==null&&ue.onclick===null&&(ue.onclick=Eg));else if(me!==4&&(ae=ae.child)!==null)for(oe(ae,ue,_e),ae=ae.sibling;ae!==null;)oe(ae,ue,_e),ae=ae.sibling}:function oe(ae,ue,_e){var me=ae.tag,He=me===5||me===6;if(He)ae=He?ae.stateNode:ae.stateNode.instance,ue?_e.insertBefore(ae,ue):_e.appendChild(ae);else if(me!==4&&(ae=ae.child)!==null)for(oe(ae,ue,_e),ae=ae.sibling;ae!==null;)oe(ae,ue,_e),ae=ae.sibling})(C,q,P)}function XT(C,P){for(var q,ie,oe=P,ae=!1;;){if(!ae){ae=oe.return;e:for(;;){if(ae===null)throw Error(a(160));switch(q=ae.stateNode,ae.tag){case 5:ie=!1;break e;case 3:case 4:q=q.containerInfo,ie=!0;break e}ae=ae.return}ae=!0}if(oe.tag===5||oe.tag===6){e:for(var ue=C,_e=oe,me=_e;;)if(JT(ue,me),me.child!==null&&me.tag!==4)me.child.return=me,me=me.child;else{if(me===_e)break;for(;me.sibling===null;){if(me.return===null||me.return===_e)break e;me=me.return}me.sibling.return=me.return,me=me.sibling}ie?(ue=q,_e=oe.stateNode,(ue.nodeType===8?ue.parentNode:ue).removeChild(_e)):q.removeChild(oe.stateNode)}else if(oe.tag===4){if(oe.child!==null){q=oe.stateNode.containerInfo,ie=!0,oe=(oe.child.return=oe).child;continue}}else if(JT(C,oe),oe.child!==null){oe=(oe.child.return=oe).child;continue}if(oe===P)break;for(;oe.sibling===null;){if(oe.return===null||oe.return===P)return;(oe=oe.return).tag===4&&(ae=!1)}oe.sibling.return=oe.return,oe=oe.sibling}}function Qv(C,P){switch(P.tag){case 0:case 11:case 14:case 15:case 22:var q=P.updateQueue;if((q=q!==null?q.lastEffect:null)!==null)for(var ie=q=q.next;!(3&~ie.tag)&&(C=ie.destroy,(ie.destroy=void 0)!==C&&C()),(ie=ie.next)!==q;);return;case 1:case 12:case 17:return;case 5:if((q=P.stateNode)!=null){ie=P.memoizedProps;var oe=C!==null?C.memoizedProps:ie,ae=(C=P.type,P.updateQueue);if((P.updateQueue=null)!==ae){for(q[Og]=ie,C==="input"&&ie.type==="radio"&&ie.name!=null&&ce(q,ie),tt(C,oe),P=tt(C,ie),oe=0;oe<ae.length;oe+=2){var ue=ae[oe],_e=ae[oe+1];ue==="style"?Ze(q,_e):ue==="dangerouslySetInnerHTML"?he(q,_e):ue==="children"?de(q,_e):x(q,ue,_e,P)}switch(C){case"input":ge(q,ie);break;case"textarea":ke(q,ie);break;case"select":C=q._wrapperState.wasMultiple,q._wrapperState.wasMultiple=!!ie.multiple,(ae=ie.value)!=null?Le(q,!!ie.multiple,ae,!1):C!==!!ie.multiple&&(ie.defaultValue!=null?Le(q,!!ie.multiple,ie.defaultValue,!0):Le(q,!!ie.multiple,ie.multiple?[]:"",!1))}}}return;case 6:if(P.stateNode===null)throw Error(a(162));return void(P.stateNode.nodeValue=P.memoizedProps);case 3:return void((q=P.stateNode).hydrate&&(q.hydrate=!1,Gn(q.containerInfo)));case 13:return P.memoizedState!==null&&(o_=no(),qT(P.child,!0)),void ZT(P);case 19:return void ZT(P);case 23:case 24:return void qT(P,P.memoizedState!==null)}throw Error(a(163))}function ZT(C){var P,q=C.updateQueue;q!==null&&((C.updateQueue=null)===(P=C.stateNode)&&(P=C.stateNode=new HF),q.forEach(function(ie){var oe=(function(ae,ue){var _e=ae.stateNode;_e!==null&&_e.delete(ue),(ue=0)===ue&&(2&(ue=ae.mode)?4&ue?(ue=Eo(62914560&~(ka=ka===0?gu:ka)))===0&&(ue=4194304):ue=uu()===99?1:2:ue=1),_e=zo(),(ae=Zg(ae,ue))!==null&&(fl(ae,ue,_e),Zo(ae,_e))}).bind(null,C,ie);P.has(ie)||(P.add(ie),ie.then(oe,oe))}))}var WF=Math.ceil,qg=E.ReactCurrentDispatcher,e_=E.ReactCurrentOwner,Cn=0,yo=null,Pr=null,ro=0,Il=0,t_=wa(0),Wr=0,Jg=null,gu=0,wf=0,mu=0,n_=0,r_=null,o_=0,i_=1/0;function yu(){i_=no()+500}var QT,en=null,Vg=!1,s_=null,Ji=null,Na=!1,Sf=null,Cf=90,a_=[],l_=[],Cs=null,Ef=0,c_=null,Gg=-1,ka=0,Yg=0,Of=null,Xg=!1;function zo(){return 48&Cn?no():Gg!==-1?Gg:Gg=no()}function Aa(C){return 2&(C=C.mode)?4&C?(ka===0&&(ka=gu),RF.transition!==0?(Yg!==0&&(Yg=r_!==null?r_.pendingLanes:0),C=ka,P=4186112&~Yg,(P&=-P)!=0||(P=(C=4186112&~C)&-C)==0&&(P=8192),P):(C=uu(),Go(4&Cn&&C===98?12:C=function(q){switch(q){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(C),ka))):uu()===99?1:2:1;var P}function Pa(C,P,q){if(50<Ef)throw Ef=0,c_=null,Error(a(185));var ie;(C=Zg(C,P))!==null&&(fl(C,P,q),C===yo&&(mu|=P,Wr===4&&bu(C,ro)),ie=uu(),P===1?8&Cn&&!(48&Cn)?u_(C):(Zo(C,q),Cn===0&&(yu(),Hi())):(!(4&Cn)||ie!==98&&ie!==99||(Cs===null?Cs=new Set([C]):Cs.add(C)),Zo(C,q)),r_=C)}function Zg(C,P){C.lanes|=P;var q=C.alternate;for(q!==null&&(q.lanes|=P),C=(q=C).return;C!==null;)C.childLanes|=P,(q=C.alternate)!==null&&(q.childLanes|=P),C=(q=C).return;return q.tag===3?q.stateNode:null}function Zo(C,P){for(var q=C.callbackNode,ie=C.suspendedLanes,oe=C.pingedLanes,ae=C.expirationTimes,ue=C.pendingLanes;0<ue;){var _e,me=31-hi(ue),He=1<<me,it=ae[me];it===-1?He&ie&&!(He&oe)||(it=P,Zn(He),_e=Nn,ae[me]=10<=_e?it+250:6<=_e?it+5e3:-1):it<=P&&(C.expiredLanes|=He),ue&=~He}if(ie=ji(C,C===yo?ro:0),P=Nn,ie===0)q!==null&&(q!==Av&&Nv(q),C.callbackNode=null,C.callbackPriority=0);else{if(q!==null){if(C.callbackPriority===P)return;q!==Av&&Nv(q)}q=P===15?(q=u_.bind(null,C),xs===null?(xs=[q],Ag=Tv(kg,aT)):xs.push(q),Av):P===14?cf(99,u_.bind(null,C)):cf(q=function(ft){switch(ft){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,ft))}}(P),eN.bind(null,C)),C.callbackPriority=P,C.callbackNode=q}}function eN(C){if(Gg=-1,(Yg=ka=0)!=(48&Cn))throw Error(a(327));var P=C.callbackNode;if(Ma()&&C.callbackNode!==P)return null;var q=ji(C,C===yo?ro:0);if(q===0)return null;var ie=q,oe=Cn,ae=(Cn|=16,oN());for(yo===C&&ro===ie||(yu(),vu(C,ie));;)try{for(;Pr!==null&&!PF();)iN(Pr);break}catch(_e){rN(C,_e)}if(Mv(),qg.current=ae,Cn=oe,ie=Pr!==null?0:(yo=null,ro=0,Wr),gu&mu)vu(C,0);else if(ie!==0){if(ie===2&&(Cn|=64,C.hydrate&&(C.hydrate=!1,wv(C.containerInfo)),(q=ho(C))!==0&&(ie=Tf(C,q))),ie===1)throw P=Jg,vu(C,0),bu(C,q),Zo(C,no()),P;switch(C.finishedWork=C.current.alternate,C.finishedLanes=q,ie){case 0:case 1:throw Error(a(345));case 2:case 5:_u(C);break;case 3:if(bu(C,q),(62914560&q)===q&&10<(ie=o_+500-no())){if(ji(C,0)!==0)break;if(((oe=C.suspendedLanes)&q)!==q){zo(),C.pingedLanes|=C.suspendedLanes&oe;break}C.timeoutHandle=V2(_u.bind(null,C),ie);break}_u(C);break;case 4:if(bu(C,q),(4186112&q)===q)break;for(ie=C.eventTimes,oe=-1;0<q;){var ue=31-hi(q);ae=1<<ue,oe<(ue=ie[ue])&&(oe=ue),q&=~ae}if(q=oe,10<(q=((q=no()-q)<120?120:q<480?480:q<1080?1080:q<1920?1920:q<3e3?3e3:q<4320?4320:1960*WF(q/1960))-q)){C.timeoutHandle=V2(_u.bind(null,C),q);break}_u(C);break;default:throw Error(a(329))}}return Zo(C,no()),C.callbackNode===P?eN.bind(null,C):null}function bu(C,P){for(P=P&~n_&~mu,C.suspendedLanes|=P,C.pingedLanes&=~P,C=C.expirationTimes;0<P;){var q=31-hi(P),ie=1<<q;C[q]=-1,P&=~ie}}function u_(C){if(48&Cn)throw Error(a(327));var P,q;if(Ma(),C===yo&&C.expiredLanes&ro?(q=Tf(C,P=ro),gu&mu&&(q=Tf(C,P=ji(C,P)))):q=Tf(C,P=ji(C,0)),C.tag!==0&&q===2&&(Cn|=64,C.hydrate&&(C.hydrate=!1,wv(C.containerInfo)),(P=ho(C))!==0&&(q=Tf(C,P))),q===1)throw q=Jg,vu(C,0),bu(C,P),Zo(C,no()),q;return C.finishedWork=C.current.alternate,C.finishedLanes=P,_u(C),Zo(C,no()),null}function tN(C,P){var q=Cn;Cn|=1;try{return C(P)}finally{(Cn=q)===0&&(yu(),Hi())}}function nN(C,P){var q=Cn;Cn=-2&Cn|8;try{C(P)}finally{(Cn=q)===0&&(yu(),Hi())}}function Qg(C,P){hr(t_,Il),Il|=P,gu|=P}function d_(){Il=t_.current,sr(t_)}function vu(C,P){C.finishedWork=null,C.finishedLanes=0;var q=C.timeoutHandle;if(q!==-1&&(C.timeoutHandle=-1,kF(q)),Pr!==null)for(q=Pr.return;q!==null;){var ie=q;switch(ie.tag){case 1:(ie=ie.type.childContextTypes)!=null&&Ev();break;case 3:pu(),sr(Oo),sr(to),$v();break;case 5:Lv(ie);break;case 4:pu();break;case 13:case 19:sr(vr);break;case 10:Iv(ie);break;case 23:case 24:d_()}q=q.return}Pr=Ra((yo=C).current,null),ro=Il=gu=P,Jg=null,n_=mu=wf=Wr=0}function rN(C,P){for(;;){var q=Pr;try{if(Mv(),gf.current=Wg,zg){for(var ie=_r.memoizedState;ie!==null;){var oe=ie.queue;oe!==null&&(oe.pending=null),ie=ie.next}zg=!1}if(mf=0,Kr=mo=_r=null,yf=!1,(e_.current=null)===q||q.return===null){Wr=1,Jg=P,Pr=null;break}e:{var ae=C,ue=q.return,_e=P;if(P=ro,(tn=q).flags|=2048,(tn.firstEffect=tn.lastEffect=null)!==_e&&typeof _e=="object"&&typeof _e.then=="function"){var me,He,it,ft,Lt=_e,kn=(!(2&tn.mode)&&((me=tn.alternate)?(tn.updateQueue=me.updateQueue,tn.memoizedState=me.memoizedState,tn.lanes=me.lanes):(tn.updateQueue=null,tn.memoizedState=null)),!!(1&vr.current)),Ve=ue;do if(ft=(ft=Ve.tag===13)?(He=Ve.memoizedState)!==null?He.dehydrated!==null:(it=Ve.memoizedProps).fallback!==void 0&&(it.unstable_avoidThisFallback!==!0||!kn):ft){var rt,mt,Bt=Ve.updateQueue;if(Bt===null?((rt=new Set).add(Lt),Ve.updateQueue=rt):Bt.add(Lt),!(2&Ve.mode)){Ve.flags|=64,tn.flags|=16384,tn.flags&=-2981,tn.tag===1&&(tn.alternate===null?tn.tag=17:((mt=Ea(-1,1)).tag=2,Oa(tn,mt))),tn.lanes|=1;break e}_e=void 0;var Dt,tn=P,yn=ae.pingCache;yn===null?(yn=ae.pingCache=new UF,_e=new Set,yn.set(Lt,_e)):(_e=yn.get(Lt))===void 0&&(_e=new Set,yn.set(Lt,_e)),_e.has(tn)||(_e.add(tn),Dt=JF.bind(null,ae,Lt,tn),Lt.then(Dt,Dt)),Ve.flags|=4096,Ve.lanes=P;break e}while((Ve=Ve.return)!==null);_e=Error((Y(tn.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
126
|
+
`+ae.stack}return{value:C,source:P,stack:oe}}function Xv(C,P){try{console.error(P.value)}catch(q){setTimeout(function(){throw q})}}var BF=function(C,P){for(var q=P.child;q!==null;){if(q.tag===5||q.tag===6)C.appendChild(q.stateNode);else if(q.tag!==4&&q.child!==null){q=(q.child.return=q).child;continue}if(q===P)break;for(;q.sibling===null;){if(q.return===null||q.return===P)return;q=q.return}q.sibling.return=q.return,q=q.sibling}},FF=function(C,P,q,ie){var oe=C.memoizedProps;if(oe!==ie){C=P.stateNode,Al(Ki.current);var ae,ue=null;switch(q){case"input":oe=te(C,oe),ie=te(C,ie),ue=[];break;case"option":oe=je(C,oe),ie=je(C,ie),ue=[];break;case"select":oe=i({},oe,{value:void 0}),ie=i({},ie,{value:void 0}),ue=[];break;case"textarea":oe=Me(C,oe),ie=Me(C,ie),ue=[];break;default:typeof oe.onClick!="function"&&typeof ie.onClick=="function"&&(C.onclick=Eg)}for(He in Oe(q,ie),q=null,oe)if(!ie.hasOwnProperty(He)&&oe.hasOwnProperty(He)&&oe[He]!=null)if(He==="style"){var _e=oe[He];for(ae in _e)_e.hasOwnProperty(ae)&&((q=q||{})[ae]="")}else He!=="dangerouslySetInnerHTML"&&He!=="children"&&He!=="suppressContentEditableWarning"&&He!=="suppressHydrationWarning"&&He!=="autoFocus"&&(l.hasOwnProperty(He)?ue=ue||[]:(ue=ue||[]).push(He,null));for(He in ie){var me=ie[He];if(_e=oe!=null?oe[He]:void 0,ie.hasOwnProperty(He)&&me!==_e&&(me!=null||_e!=null))if(He==="style")if(_e){for(ae in _e)!_e.hasOwnProperty(ae)||me&&me.hasOwnProperty(ae)||((q=q||{})[ae]="");for(ae in me)me.hasOwnProperty(ae)&&_e[ae]!==me[ae]&&((q=q||{})[ae]=me[ae])}else q||(ue=ue||[]).push(He,q),q=me;else He==="dangerouslySetInnerHTML"?(me=me?me.__html:void 0,_e=_e?_e.__html:void 0,me!=null&&_e!==me&&(ue=ue||[]).push(He,me)):He==="children"?typeof me!="string"&&typeof me!="number"||(ue=ue||[]).push(He,""+me):He!=="suppressContentEditableWarning"&&He!=="suppressHydrationWarning"&&(l.hasOwnProperty(He)?(me!=null&&He==="onScroll"&&Qn("scroll",C),ue||_e===me||(ue=[])):typeof me=="object"&&me!==null&&me.$$typeof===z?me.toString():(ue=ue||[]).push(He,me))}q&&(ue=ue||[]).push("style",q);var He=ue;(P.updateQueue=He)&&(P.flags|=4)}},$F=function(C,P,q,ie){q!==ie&&(P.flags|=4)},zF=typeof WeakMap=="function"?WeakMap:Map;function UT(C,P,q){(q=Ea(-1,q)).tag=3,q.payload={element:null};var ie=P.value;return q.callback=function(){Vg||(Vg=!0,i_=ie),Xv(0,P)},q}function HT(C,P,q){(q=Ea(-1,q)).tag=3;var ie,oe=C.type.getDerivedStateFromError;return typeof oe=="function"&&(ie=P.value,q.payload=function(){return Xv(0,P),oe(ie)}),(C=C.stateNode)!==null&&typeof C.componentDidCatch=="function"&&(q.callback=function(){typeof oe!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this),Xv(0,P));var ae=P.stack;this.componentDidCatch(P.value,{componentStack:ae!==null?ae:""})}),q}var UF=typeof WeakSet=="function"?WeakSet:Set;function KT(C){var P=C.ref;if(P!==null)if(typeof P=="function")try{P(null)}catch(q){Ia(C,q)}else P.current=null}function HF(C,P,q){switch(q.tag){case 0:case 11:case 15:case 22:if((P=(P=q.updateQueue)!==null?P.lastEffect:null)!==null){C=P=P.next;do;while(!(3&~C.tag)&&(oe=C.create,C.destroy=oe()),(C=C.next)!==P)}if((P=(P=q.updateQueue)!==null?P.lastEffect:null)!==null){C=P=P.next;do{var ie=C,oe=ie.next;4&(ie=ie.tag)&&1&ie&&(sN(q,C),ie=q,ae=C,s_.push(ae,ie),Na||(Na=!0,cf(97,function(){return Ma(),null}))),C=oe}while(C!==P)}return;case 1:return C=q.stateNode,4&q.flags&&(P===null?C.componentDidMount():(oe=q.elementType===q.type?P.memoizedProps:yi(q.type,P.memoizedProps),C.componentDidUpdate(oe,P.memoizedState,C.__reactInternalSnapshotBeforeUpdate))),void((P=q.updateQueue)!==null&&uT(0,P,C));case 3:if((P=q.updateQueue)!==null){if((C=null)!==q.child)switch(q.child.tag){case 5:case 1:C=q.child.stateNode}uT(0,P,C)}return;case 5:return C=q.stateNode,void(P===null&&4&q.flags&&q2(q.type,q.memoizedProps)&&C.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(q.memoizedState===null&&(q=q.alternate)!==null&&(q=q.memoizedState)!==null&&(q=q.dehydrated)!==null&&Gn(q))}var ae;throw Error(a(163))}function WT(C,P){for(var q=C;;){if(q.tag===5){var ie,oe=q.stateNode;P?typeof(oe=oe.style).setProperty=="function"?oe.setProperty("display","none","important"):oe.display="none":(oe=q.stateNode,ie=(ie=q.memoizedProps.style)!=null&&ie.hasOwnProperty("display")?ie.display:null,oe.style.display=Qe("display",ie))}else if(q.tag===6)q.stateNode.nodeValue=P?"":q.memoizedProps;else if((q.tag!==23&&q.tag!==24||q.memoizedState===null||q===C)&&q.child!==null){q=(q.child.return=q).child;continue}if(q===C)break;for(;q.sibling===null;){if(q.return===null||q.return===C)return;q=q.return}q.sibling.return=q.return,q=q.sibling}}function qT(C,P){if(Nl&&typeof Nl.onCommitFiberUnmount=="function")try{Nl.onCommitFiberUnmount(Ev,P)}catch{}switch(P.tag){case 0:case 11:case 14:case 15:case 22:if((C=P.updateQueue)!==null&&(C=C.lastEffect)!==null){var q=C=C.next;do{var ie=(oe=q).destroy,oe=oe.tag;if(ie!==void 0)if(4&oe)sN(P,q);else{oe=P;try{ie()}catch(ae){Ia(oe,ae)}}}while((q=q.next)!==C)}break;case 1:if(KT(P),typeof(C=P.stateNode).componentWillUnmount=="function")try{C.props=P.memoizedProps,C.state=P.memoizedState,C.componentWillUnmount()}catch(ae){Ia(P,ae)}break;case 5:KT(P);break;case 4:YT(C,P)}}function JT(C){C.alternate=null,C.child=null,C.dependencies=null,C.firstEffect=null,C.lastEffect=null,C.memoizedProps=null,C.memoizedState=null,C.pendingProps=null,C.return=null,C.updateQueue=null}function VT(C){return C.tag===5||C.tag===3||C.tag===4}function GT(C){e:{for(var P=C.return;P!==null;){if(VT(P))break e;P=P.return}throw Error(a(160))}var q=P;switch(P=q.stateNode,q.tag){case 5:var ie=!1;break;case 3:case 4:P=P.containerInfo,ie=!0;break;default:throw Error(a(161))}16&q.flags&&(de(P,""),q.flags&=-17);e:t:for(q=C;;){for(;q.sibling===null;){if(q.return===null||VT(q.return)){q=null;break e}q=q.return}for(q.sibling.return=q.return,q=q.sibling;q.tag!==5&&q.tag!==6&&q.tag!==18;){if(2&q.flags||q.child===null||q.tag===4)continue t;q=(q.child.return=q).child}if(!(2&q.flags)){q=q.stateNode;break e}}(ie?function oe(ae,ue,_e){var me=ae.tag,He=me===5||me===6;if(He)ae=He?ae.stateNode:ae.stateNode.instance,ue?(_e.nodeType===8?_e.parentNode:_e).insertBefore(ae,ue):(_e.nodeType===8?(ue=_e.parentNode).insertBefore(ae,_e):(ue=_e).appendChild(ae),(_e=_e._reactRootContainer)==null&&ue.onclick===null&&(ue.onclick=Eg));else if(me!==4&&(ae=ae.child)!==null)for(oe(ae,ue,_e),ae=ae.sibling;ae!==null;)oe(ae,ue,_e),ae=ae.sibling}:function oe(ae,ue,_e){var me=ae.tag,He=me===5||me===6;if(He)ae=He?ae.stateNode:ae.stateNode.instance,ue?_e.insertBefore(ae,ue):_e.appendChild(ae);else if(me!==4&&(ae=ae.child)!==null)for(oe(ae,ue,_e),ae=ae.sibling;ae!==null;)oe(ae,ue,_e),ae=ae.sibling})(C,q,P)}function YT(C,P){for(var q,ie,oe=P,ae=!1;;){if(!ae){ae=oe.return;e:for(;;){if(ae===null)throw Error(a(160));switch(q=ae.stateNode,ae.tag){case 5:ie=!1;break e;case 3:case 4:q=q.containerInfo,ie=!0;break e}ae=ae.return}ae=!0}if(oe.tag===5||oe.tag===6){e:for(var ue=C,_e=oe,me=_e;;)if(qT(ue,me),me.child!==null&&me.tag!==4)me.child.return=me,me=me.child;else{if(me===_e)break;for(;me.sibling===null;){if(me.return===null||me.return===_e)break e;me=me.return}me.sibling.return=me.return,me=me.sibling}ie?(ue=q,_e=oe.stateNode,(ue.nodeType===8?ue.parentNode:ue).removeChild(_e)):q.removeChild(oe.stateNode)}else if(oe.tag===4){if(oe.child!==null){q=oe.stateNode.containerInfo,ie=!0,oe=(oe.child.return=oe).child;continue}}else if(qT(C,oe),oe.child!==null){oe=(oe.child.return=oe).child;continue}if(oe===P)break;for(;oe.sibling===null;){if(oe.return===null||oe.return===P)return;(oe=oe.return).tag===4&&(ae=!1)}oe.sibling.return=oe.return,oe=oe.sibling}}function Zv(C,P){switch(P.tag){case 0:case 11:case 14:case 15:case 22:var q=P.updateQueue;if((q=q!==null?q.lastEffect:null)!==null)for(var ie=q=q.next;!(3&~ie.tag)&&(C=ie.destroy,(ie.destroy=void 0)!==C&&C()),(ie=ie.next)!==q;);return;case 1:case 12:case 17:return;case 5:if((q=P.stateNode)!=null){ie=P.memoizedProps;var oe=C!==null?C.memoizedProps:ie,ae=(C=P.type,P.updateQueue);if((P.updateQueue=null)!==ae){for(q[Og]=ie,C==="input"&&ie.type==="radio"&&ie.name!=null&&ce(q,ie),tt(C,oe),P=tt(C,ie),oe=0;oe<ae.length;oe+=2){var ue=ae[oe],_e=ae[oe+1];ue==="style"?Ze(q,_e):ue==="dangerouslySetInnerHTML"?he(q,_e):ue==="children"?de(q,_e):x(q,ue,_e,P)}switch(C){case"input":ge(q,ie);break;case"textarea":ke(q,ie);break;case"select":C=q._wrapperState.wasMultiple,q._wrapperState.wasMultiple=!!ie.multiple,(ae=ie.value)!=null?Le(q,!!ie.multiple,ae,!1):C!==!!ie.multiple&&(ie.defaultValue!=null?Le(q,!!ie.multiple,ie.defaultValue,!0):Le(q,!!ie.multiple,ie.multiple?[]:"",!1))}}}return;case 6:if(P.stateNode===null)throw Error(a(162));return void(P.stateNode.nodeValue=P.memoizedProps);case 3:return void((q=P.stateNode).hydrate&&(q.hydrate=!1,Gn(q.containerInfo)));case 13:return P.memoizedState!==null&&(r_=no(),WT(P.child,!0)),void XT(P);case 19:return void XT(P);case 23:case 24:return void WT(P,P.memoizedState!==null)}throw Error(a(163))}function XT(C){var P,q=C.updateQueue;q!==null&&((C.updateQueue=null)===(P=C.stateNode)&&(P=C.stateNode=new UF),q.forEach(function(ie){var oe=(function(ae,ue){var _e=ae.stateNode;_e!==null&&_e.delete(ue),(ue=0)===ue&&(2&(ue=ae.mode)?4&ue?(ue=Eo(62914560&~(ka=ka===0?gu:ka)))===0&&(ue=4194304):ue=uu()===99?1:2:ue=1),_e=zo(),(ae=Zg(ae,ue))!==null&&(fl(ae,ue,_e),Zo(ae,_e))}).bind(null,C,ie);P.has(ie)||(P.add(ie),ie.then(oe,oe))}))}var KF=Math.ceil,qg=E.ReactCurrentDispatcher,Qv=E.ReactCurrentOwner,Cn=0,yo=null,Pr=null,ro=0,Il=0,e_=wa(0),Wr=0,Jg=null,gu=0,wf=0,mu=0,t_=0,n_=null,r_=0,o_=1/0;function yu(){o_=no()+500}var ZT,en=null,Vg=!1,i_=null,Ji=null,Na=!1,Sf=null,Cf=90,s_=[],a_=[],Cs=null,Ef=0,l_=null,Gg=-1,ka=0,Yg=0,Of=null,Xg=!1;function zo(){return 48&Cn?no():Gg!==-1?Gg:Gg=no()}function Aa(C){return 2&(C=C.mode)?4&C?(ka===0&&(ka=gu),IF.transition!==0?(Yg!==0&&(Yg=n_!==null?n_.pendingLanes:0),C=ka,P=4186112&~Yg,(P&=-P)!=0||(P=(C=4186112&~C)&-C)==0&&(P=8192),P):(C=uu(),Go(4&Cn&&C===98?12:C=function(q){switch(q){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(C),ka))):uu()===99?1:2:1;var P}function Pa(C,P,q){if(50<Ef)throw Ef=0,l_=null,Error(a(185));var ie;(C=Zg(C,P))!==null&&(fl(C,P,q),C===yo&&(mu|=P,Wr===4&&bu(C,ro)),ie=uu(),P===1?8&Cn&&!(48&Cn)?c_(C):(Zo(C,q),Cn===0&&(yu(),Hi())):(!(4&Cn)||ie!==98&&ie!==99||(Cs===null?Cs=new Set([C]):Cs.add(C)),Zo(C,q)),n_=C)}function Zg(C,P){C.lanes|=P;var q=C.alternate;for(q!==null&&(q.lanes|=P),C=(q=C).return;C!==null;)C.childLanes|=P,(q=C.alternate)!==null&&(q.childLanes|=P),C=(q=C).return;return q.tag===3?q.stateNode:null}function Zo(C,P){for(var q=C.callbackNode,ie=C.suspendedLanes,oe=C.pingedLanes,ae=C.expirationTimes,ue=C.pendingLanes;0<ue;){var _e,me=31-hi(ue),He=1<<me,it=ae[me];it===-1?He&ie&&!(He&oe)||(it=P,Zn(He),_e=Nn,ae[me]=10<=_e?it+250:6<=_e?it+5e3:-1):it<=P&&(C.expiredLanes|=He),ue&=~He}if(ie=ji(C,C===yo?ro:0),P=Nn,ie===0)q!==null&&(q!==kv&&Tv(q),C.callbackNode=null,C.callbackPriority=0);else{if(q!==null){if(C.callbackPriority===P)return;q!==kv&&Tv(q)}q=P===15?(q=c_.bind(null,C),xs===null?(xs=[q],Ag=Ov(kg,sT)):xs.push(q),kv):P===14?cf(99,c_.bind(null,C)):cf(q=function(ft){switch(ft){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,ft))}}(P),QT.bind(null,C)),C.callbackPriority=P,C.callbackNode=q}}function QT(C){if(Gg=-1,(Yg=ka=0)!=(48&Cn))throw Error(a(327));var P=C.callbackNode;if(Ma()&&C.callbackNode!==P)return null;var q=ji(C,C===yo?ro:0);if(q===0)return null;var ie=q,oe=Cn,ae=(Cn|=16,rN());for(yo===C&&ro===ie||(yu(),vu(C,ie));;)try{for(;Pr!==null&&!AF();)oN(Pr);break}catch(_e){nN(C,_e)}if(Pv(),qg.current=ae,Cn=oe,ie=Pr!==null?0:(yo=null,ro=0,Wr),gu&mu)vu(C,0);else if(ie!==0){if(ie===2&&(Cn|=64,C.hydrate&&(C.hydrate=!1,xv(C.containerInfo)),(q=ho(C))!==0&&(ie=Tf(C,q))),ie===1)throw P=Jg,vu(C,0),bu(C,q),Zo(C,no()),P;switch(C.finishedWork=C.current.alternate,C.finishedLanes=q,ie){case 0:case 1:throw Error(a(345));case 2:case 5:_u(C);break;case 3:if(bu(C,q),(62914560&q)===q&&10<(ie=r_+500-no())){if(ji(C,0)!==0)break;if(((oe=C.suspendedLanes)&q)!==q){zo(),C.pingedLanes|=C.suspendedLanes&oe;break}C.timeoutHandle=J2(_u.bind(null,C),ie);break}_u(C);break;case 4:if(bu(C,q),(4186112&q)===q)break;for(ie=C.eventTimes,oe=-1;0<q;){var ue=31-hi(q);ae=1<<ue,oe<(ue=ie[ue])&&(oe=ue),q&=~ae}if(q=oe,10<(q=((q=no()-q)<120?120:q<480?480:q<1080?1080:q<1920?1920:q<3e3?3e3:q<4320?4320:1960*KF(q/1960))-q)){C.timeoutHandle=J2(_u.bind(null,C),q);break}_u(C);break;default:throw Error(a(329))}}return Zo(C,no()),C.callbackNode===P?QT.bind(null,C):null}function bu(C,P){for(P=P&~t_&~mu,C.suspendedLanes|=P,C.pingedLanes&=~P,C=C.expirationTimes;0<P;){var q=31-hi(P),ie=1<<q;C[q]=-1,P&=~ie}}function c_(C){if(48&Cn)throw Error(a(327));var P,q;if(Ma(),C===yo&&C.expiredLanes&ro?(q=Tf(C,P=ro),gu&mu&&(q=Tf(C,P=ji(C,P)))):q=Tf(C,P=ji(C,0)),C.tag!==0&&q===2&&(Cn|=64,C.hydrate&&(C.hydrate=!1,xv(C.containerInfo)),(P=ho(C))!==0&&(q=Tf(C,P))),q===1)throw q=Jg,vu(C,0),bu(C,P),Zo(C,no()),q;return C.finishedWork=C.current.alternate,C.finishedLanes=P,_u(C),Zo(C,no()),null}function eN(C,P){var q=Cn;Cn|=1;try{return C(P)}finally{(Cn=q)===0&&(yu(),Hi())}}function tN(C,P){var q=Cn;Cn=-2&Cn|8;try{C(P)}finally{(Cn=q)===0&&(yu(),Hi())}}function Qg(C,P){hr(e_,Il),Il|=P,gu|=P}function u_(){Il=e_.current,sr(e_)}function vu(C,P){C.finishedWork=null,C.finishedLanes=0;var q=C.timeoutHandle;if(q!==-1&&(C.timeoutHandle=-1,NF(q)),Pr!==null)for(q=Pr.return;q!==null;){var ie=q;switch(ie.tag){case 1:(ie=ie.type.childContextTypes)!=null&&Cv();break;case 3:pu(),sr(Oo),sr(to),Fv();break;case 5:Dv(ie);break;case 4:pu();break;case 13:case 19:sr(vr);break;case 10:Mv(ie);break;case 23:case 24:u_()}q=q.return}Pr=Ra((yo=C).current,null),ro=Il=gu=P,Jg=null,t_=mu=wf=Wr=0}function nN(C,P){for(;;){var q=Pr;try{if(Pv(),gf.current=Wg,zg){for(var ie=_r.memoizedState;ie!==null;){var oe=ie.queue;oe!==null&&(oe.pending=null),ie=ie.next}zg=!1}if(mf=0,Kr=mo=_r=null,yf=!1,(Qv.current=null)===q||q.return===null){Wr=1,Jg=P,Pr=null;break}e:{var ae=C,ue=q.return,_e=P;if(P=ro,(tn=q).flags|=2048,(tn.firstEffect=tn.lastEffect=null)!==_e&&typeof _e=="object"&&typeof _e.then=="function"){var me,He,it,ft,Lt=_e,kn=(!(2&tn.mode)&&((me=tn.alternate)?(tn.updateQueue=me.updateQueue,tn.memoizedState=me.memoizedState,tn.lanes=me.lanes):(tn.updateQueue=null,tn.memoizedState=null)),!!(1&vr.current)),Ve=ue;do if(ft=(ft=Ve.tag===13)?(He=Ve.memoizedState)!==null?He.dehydrated!==null:(it=Ve.memoizedProps).fallback!==void 0&&(it.unstable_avoidThisFallback!==!0||!kn):ft){var rt,mt,Bt=Ve.updateQueue;if(Bt===null?((rt=new Set).add(Lt),Ve.updateQueue=rt):Bt.add(Lt),!(2&Ve.mode)){Ve.flags|=64,tn.flags|=16384,tn.flags&=-2981,tn.tag===1&&(tn.alternate===null?tn.tag=17:((mt=Ea(-1,1)).tag=2,Oa(tn,mt))),tn.lanes|=1;break e}_e=void 0;var Dt,tn=P,yn=ae.pingCache;yn===null?(yn=ae.pingCache=new zF,_e=new Set,yn.set(Lt,_e)):(_e=yn.get(Lt))===void 0&&(_e=new Set,yn.set(Lt,_e)),_e.has(tn)||(_e.add(tn),Dt=qF.bind(null,ae,Lt,tn),Lt.then(Dt,Dt)),Ve.flags|=4096,Ve.lanes=P;break e}while((Ve=Ve.return)!==null);_e=Error((Y(tn.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
127
127
|
|
|
128
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Wr!==5&&(Wr=2),_e=Xv(_e,tn),Ve=ue;do switch(Ve.tag){case 3:ae=_e,Ve.flags|=4096,P&=-P,Ve.lanes|=P,uT(Ve,HT(0,ae,P));break e;case 1:ae=_e;var sn=Ve.type,nn=Ve.stateNode;if(!(64&Ve.flags||typeof sn.getDerivedStateFromError!="function"&&(nn===null||typeof nn.componentDidCatch!="function"||Ji!==null&&Ji.has(nn)))){Ve.flags|=4096,P&=-P,Ve.lanes|=P,uT(Ve,KT(Ve,ae,P));break e}}while((Ve=Ve.return)!==null)}sN(q)}catch(jn){P=jn,Pr===q&&q!==null&&(Pr=q=q.return);continue}break}}function oN(){var C=qg.current;return qg.current=Wg,C===null?Wg:C}function Tf(C,P){var q=Cn,ie=(Cn|=16,oN());for(yo===C&&ro===P||vu(C,P);;)try{for(;Pr!==null;)iN(Pr);break}catch(oe){rN(C,oe)}if(Mv(),Cn=q,qg.current=ie,Pr!==null)throw Error(a(261));return yo=null,ro=0,Wr}function iN(C){var P=QT(C.alternate,C,Il);C.memoizedProps=C.pendingProps,P===null?sN(C):Pr=P,e_.current=null}function sN(C){var P=C;do{var q=P.alternate;if(C=P.return,2048&P.flags){if((q=function(ae){switch(ae.tag){case 1:Fo(ae.type)&&Ev();var ue=ae.flags;return 4096&ue?(ae.flags=-4097&ue|64,ae):null;case 3:if(pu(),sr(Oo),sr(to),$v(),64&(ue=ae.flags))throw Error(a(285));return ae.flags=-4097&ue|64,ae;case 5:return Lv(ae),null;case 13:return sr(vr),4096&(ue=ae.flags)?(ae.flags=-4097&ue|64,ae):null;case 19:return sr(vr),null;case 4:return pu(),null;case 10:return Iv(ae),null;case 23:case 24:return d_(),null;default:return null}}(P))!==null)return q.flags&=2047,void(Pr=q);C!==null&&(C.firstEffect=C.lastEffect=null,C.flags|=2048)}else{if((q=function(ae,ue,_e){var me=ue.pendingProps;switch(ue.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return Fo(ue.type)&&Ev(),null;case 3:return pu(),sr(Oo),sr(to),$v(),(me=ue.stateNode).pendingContext&&(me.context=me.pendingContext,me.pendingContext=null),ae!==null&&ae.child!==null||($g(ue)?ue.flags|=4:me.hydrate||(ue.flags|=256)),null;case 5:Lv(ue);var He=Al(hf.current);if(_e=ue.type,ae!==null&&ue.stateNode!=null)$F(ae,ue,_e,me),ae.ref!==ue.ref&&(ue.flags|=128);else{if(!me){if(ue.stateNode===null)throw Error(a(166));return null}if(ae=Al(Ki.current),$g(ue)){me=ue.stateNode,_e=ue.type;var it,ft=ue.memoizedProps;switch(me[xa]=ue,me[Og]=ft,_e){case"dialog":Qn("cancel",me),Qn("close",me);break;case"iframe":case"object":case"embed":Qn("load",me);break;case"video":case"audio":for(ae=0;ae<of.length;ae++)Qn(of[ae],me);break;case"source":Qn("error",me);break;case"img":case"image":case"link":Qn("error",me),Qn("load",me);break;case"details":Qn("toggle",me);break;case"input":se(me,ft),Qn("invalid",me);break;case"select":me._wrapperState={wasMultiple:!!ft.multiple},Qn("invalid",me);break;case"textarea":ye(me,ft),Qn("invalid",me)}for(it in Oe(_e,ft),ae=null,ft)ft.hasOwnProperty(it)&&(He=ft[it],it==="children"?typeof He=="string"?me.textContent!==He&&(ae=["children",He]):typeof He=="number"&&me.textContent!==""+He&&(ae=["children",""+He]):l.hasOwnProperty(it)&&He!=null&&it==="onScroll"&&Qn("scroll",me));switch(_e){case"input":Z(me),we(me,ft,!0);break;case"textarea":Z(me),Ae(me);break;case"select":case"option":break;default:typeof ft.onClick=="function"&&(me.onclick=Eg)}me=ae,(ue.updateQueue=me)!==null&&(ue.flags|=4)}else{switch(it=He.nodeType===9?He:He.ownerDocument,(ae=ae===Ie?Te(_e):ae)===Ie?_e==="script"?((ae=it.createElement("div")).innerHTML="<script><\/script>",ae=ae.removeChild(ae.firstChild)):typeof me.is=="string"?ae=it.createElement(_e,{is:me.is}):(ae=it.createElement(_e),_e==="select"&&(it=ae,me.multiple?it.multiple=!0:me.size&&(it.size=me.size))):ae=it.createElementNS(ae,_e),ae[xa]=ue,ae[Og]=me,FF(ae,ue),ue.stateNode=ae,it=tt(_e,me),_e){case"dialog":Qn("cancel",ae),Qn("close",ae),He=me;break;case"iframe":case"object":case"embed":Qn("load",ae),He=me;break;case"video":case"audio":for(He=0;He<of.length;He++)Qn(of[He],ae);He=me;break;case"source":Qn("error",ae),He=me;break;case"img":case"image":case"link":Qn("error",ae),Qn("load",ae),He=me;break;case"details":Qn("toggle",ae),He=me;break;case"input":se(ae,me),He=te(ae,me),Qn("invalid",ae);break;case"option":He=je(ae,me);break;case"select":ae._wrapperState={wasMultiple:!!me.multiple},He=i({},me,{value:void 0}),Qn("invalid",ae);break;case"textarea":ye(ae,me),He=Me(ae,me),Qn("invalid",ae);break;default:He=me}Oe(_e,He);var Lt,kn=He;for(ft in kn)kn.hasOwnProperty(ft)&&(Lt=kn[ft],ft==="style"?Ze(ae,Lt):ft==="dangerouslySetInnerHTML"?(Lt=Lt?Lt.__html:void 0)!=null&&he(ae,Lt):ft==="children"?typeof Lt=="string"?_e==="textarea"&&Lt===""||de(ae,Lt):typeof Lt=="number"&&de(ae,""+Lt):ft!=="suppressContentEditableWarning"&&ft!=="suppressHydrationWarning"&&ft!=="autoFocus"&&(l.hasOwnProperty(ft)?Lt!=null&&ft==="onScroll"&&Qn("scroll",ae):Lt!=null&&x(ae,ft,Lt,it)));switch(_e){case"input":Z(ae),we(ae,me,!1);break;case"textarea":Z(ae),Ae(ae);break;case"option":me.value!=null&&ae.setAttribute("value",""+X(me.value));break;case"select":ae.multiple=!!me.multiple,(ft=me.value)!=null?Le(ae,!!me.multiple,ft,!1):me.defaultValue!=null&&Le(ae,!!me.multiple,me.defaultValue,!0);break;default:typeof He.onClick=="function"&&(ae.onclick=Eg)}J2(_e,me)&&(ue.flags|=4)}ue.ref!==null&&(ue.flags|=128)}return null;case 6:if(ae&&ue.stateNode!=null)zF(0,ue,ae.memoizedProps,me);else{if(typeof me!="string"&&ue.stateNode===null)throw Error(a(166));_e=Al(hf.current),Al(Ki.current),$g(ue)?(me=ue.stateNode,_e=ue.memoizedProps,me[xa]=ue,me.nodeValue!==_e&&(ue.flags|=4)):((me=(_e.nodeType===9?_e:_e.ownerDocument).createTextNode(me))[xa]=ue).stateNode=me}return null;case 13:return sr(vr),me=ue.memoizedState,64&ue.flags?(ue.lanes=_e,ue):(me=me!==null,_e=!1,ae===null?ue.memoizedProps.fallback!==void 0&&$g(ue):_e=ae.memoizedState!==null,me&&!_e&&2&ue.mode&&(ae===null&&ue.memoizedProps.unstable_avoidThisFallback!==!0||1&vr.current?Wr===0&&(Wr=3):(Wr!==0&&Wr!==3||(Wr=4),yo===null||!(134217727&wf)&&!(134217727&mu)||bu(yo,ro))),(me||_e)&&(ue.flags|=4),null);case 4:return pu(),ae===null&&U2(ue.stateNode.containerInfo),null;case 10:return Iv(ue),null;case 19:if(sr(vr),(me=ue.memoizedState)===null)return null;if(ft=!!(64&ue.flags),(it=me.rendering)===null)if(ft)xf(me,!1);else{if(Wr!==0||ae!==null&&64&ae.flags)for(ae=ue.child;ae!==null;){if((it=Fg(ae))!==null){for(ue.flags|=64,xf(me,!1),(ft=it.updateQueue)!==null&&(ue.updateQueue=ft,ue.flags|=4),me.lastEffect===null&&(ue.firstEffect=null),ue.lastEffect=me.lastEffect,me=_e,_e=ue.child;_e!==null;)ae=me,(ft=_e).flags&=2,ft.nextEffect=null,ft.firstEffect=null,(ft.lastEffect=null)===(it=ft.alternate)?(ft.childLanes=0,ft.lanes=ae,ft.child=null,ft.memoizedProps=null,ft.memoizedState=null,ft.updateQueue=null,ft.dependencies=null,ft.stateNode=null):(ft.childLanes=it.childLanes,ft.lanes=it.lanes,ft.child=it.child,ft.memoizedProps=it.memoizedProps,ft.memoizedState=it.memoizedState,ft.updateQueue=it.updateQueue,ft.type=it.type,ae=it.dependencies,ft.dependencies=ae===null?null:{lanes:ae.lanes,firstContext:ae.firstContext}),_e=_e.sibling;return hr(vr,1&vr.current|2),ue.child}ae=ae.sibling}me.tail!==null&&no()>i_&&(ue.flags|=64,xf(me,!(ft=!0)),ue.lanes=33554432)}else{if(!ft)if((ae=Fg(it))!==null){if(ue.flags|=64,ft=!0,(_e=ae.updateQueue)!==null&&(ue.updateQueue=_e,ue.flags|=4),xf(me,!0),me.tail===null&&me.tailMode==="hidden"&&!it.alternate&&!Wi)return(ue=ue.lastEffect=me.lastEffect)!==null&&(ue.nextEffect=null),null}else 2*no()-me.renderingStartTime>i_&&_e!==1073741824&&(ue.flags|=64,xf(me,!(ft=!0)),ue.lanes=33554432);me.isBackwards?(it.sibling=ue.child,ue.child=it):((_e=me.last)!==null?_e.sibling=it:ue.child=it,me.last=it)}return me.tail!==null?(_e=me.tail,me.rendering=_e,me.tail=_e.sibling,me.lastEffect=ue.lastEffect,me.renderingStartTime=no(),_e.sibling=null,ue=vr.current,hr(vr,ft?1&ue|2:1&ue),_e):null;case 23:case 24:return d_(),ae!==null&&ae.memoizedState!==null!=(ue.memoizedState!==null)&&me.mode!=="unstable-defer-without-hiding"&&(ue.flags|=4),null}throw Error(a(156,ue.tag))}(q,P,Il))!==null)return void(Pr=q);if((q=P).tag!==24&&q.tag!==23||q.memoizedState===null||1073741824&Il||!(4&q.mode)){for(var ie=0,oe=q.child;oe!==null;)ie|=oe.lanes|oe.childLanes,oe=oe.sibling;q.childLanes=ie}C!==null&&!(2048&C.flags)&&(C.firstEffect===null&&(C.firstEffect=P.firstEffect),P.lastEffect!==null&&(C.lastEffect!==null&&(C.lastEffect.nextEffect=P.firstEffect),C.lastEffect=P.lastEffect),1<P.flags&&(C.lastEffect!==null?C.lastEffect.nextEffect=P:C.firstEffect=P,C.lastEffect=P))}if((P=P.sibling)!==null)return void(Pr=P)}while(Pr=P=C,P!==null);Wr===0&&(Wr=5)}function _u(C){var P=uu();return kl(99,(function(q,ie){for(;Ma(),Sf!==null;);if(48&Cn)throw Error(a(327));var oe=q.finishedWork;if(oe===null)return null;if(q.finishedWork=null,q.finishedLanes=0,oe===q.current)throw Error(a(177));q.callbackNode=null;var ae=oe.lanes|oe.childLanes,ue=ae,_e=q.pendingLanes&~ue;q.pendingLanes=ue,q.suspendedLanes=0,q.pingedLanes=0,q.expiredLanes&=ue,q.mutableReadLanes&=ue,q.entangledLanes&=ue,ue=q.entanglements;for(var me,He=q.eventTimes,it=q.expirationTimes;0<_e;){var ft=31-hi(_e),Lt=1<<ft;ue[ft]=0,He[ft]=-1,it[ft]=-1,_e&=~Lt}if(Cs!==null&&!(24&ae)&&Cs.has(q)&&Cs.delete(q),q===yo&&(Pr=yo=null,ro=0),(ae=1<oe.flags?oe.lastEffect!==null?(oe.lastEffect.nextEffect=oe,oe.firstEffect):oe:oe.firstEffect)!==null){if(ue=Cn,Cn|=32,e_.current=null,vv=Bo,gv(He=j2())){if("selectionStart"in He)it={start:He.selectionStart,end:He.selectionEnd};else e:if(it=(it=He.ownerDocument)&&it.defaultView||window,(Lt=it.getSelection&&it.getSelection())&&Lt.rangeCount!==0){it=Lt.anchorNode,_e=Lt.anchorOffset,ft=Lt.focusNode,Lt=Lt.focusOffset;try{it.nodeType,ft.nodeType}catch{it=null;break e}var kn=0,Ve=-1,rt=-1,mt=0,Bt=0,Dt=He,tn=null;t:for(;;){for(;Dt!==it||_e!==0&&Dt.nodeType!==3||(Ve=kn+_e),Dt!==ft||Lt!==0&&Dt.nodeType!==3||(rt=kn+Lt),Dt.nodeType===3&&(kn+=Dt.nodeValue.length),(me=Dt.firstChild)!==null;)tn=Dt,Dt=me;for(;;){if(Dt===He)break t;if(tn===it&&++mt===_e&&(Ve=kn),tn===ft&&++Bt===Lt&&(rt=kn),(me=Dt.nextSibling)!==null)break;tn=(Dt=tn).parentNode}Dt=me}it=Ve===-1||rt===-1?null:{start:Ve,end:rt}}else it=null;it=it||{start:0,end:0}}else it=null;Of=null,Xg=Bo=!(_v={focusedElem:He,selectionRange:it}),en=ae;do try{(function(){for(;en!==null;){var Mn=en.alternate,Sn=(Xg||Of===null||(8&en.flags?pe(en,Of)&&(Xg=!0):en.tag===13&&function(er,gr){return er!==null&&((er=er.memoizedState)===null||er.dehydrated!==null)&&(gr=gr.memoizedState)!==null&&gr.dehydrated===null}(Mn,en)&&pe(en,Of)&&(Xg=!0)),en.flags);256&Sn&&function(er,gr){switch(gr.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:var ei,Vi;return 256&gr.flags&&er!==null&&(ei=er.memoizedProps,Vi=er.memoizedState,gr=(er=gr.stateNode).getSnapshotBeforeUpdate(gr.elementType===gr.type?ei:yi(gr.type,ei),Vi),er.__reactInternalSnapshotBeforeUpdate=gr);case 3:return 256&gr.flags&&wv(gr.stateNode.containerInfo)}throw Error(a(163))}(Mn,en),!(512&Sn)||Na||(Na=!0,cf(97,function(){return Ma(),null})),en=en.nextEffect}})()}catch(Mn){if(en===null)throw Error(a(330));Ia(en,Mn),en=en.nextEffect}while(en!==null);Of=null,en=ae;do try{for(He=q;en!==null;){var yn,sn,nn=en.flags;switch(16&nn&&de(en.stateNode,""),128&nn&&(yn=en.alternate)!==null&&(sn=yn.ref)!==null&&(typeof sn=="function"?sn(null):sn.current=null),1038&nn){case 2:YT(en),en.flags&=-3;break;case 6:YT(en),en.flags&=-3,Qv(en.alternate,en);break;case 1024:en.flags&=-1025;break;case 1028:en.flags&=-1025,Qv(en.alternate,en);break;case 4:Qv(en.alternate,en);break;case 8:XT(He,it=en);var jn=it.alternate;VT(it),jn!==null&&VT(jn)}en=en.nextEffect}}catch(Mn){if(en===null)throw Error(a(330));Ia(en,Mn),en=en.nextEffect}while(en!==null);if(sn=_v,yn=j2(),nn=sn.focusedElem,He=sn.selectionRange,yn!==nn&&nn&&nn.ownerDocument&&function Mn(Sn,er){return!(!Sn||!er)&&(Sn===er||(!Sn||Sn.nodeType!==3)&&(er&&er.nodeType===3?Mn(Sn,er.parentNode):"contains"in Sn?Sn.contains(er):!!Sn.compareDocumentPosition&&!!(16&Sn.compareDocumentPosition(er))))}(nn.ownerDocument.documentElement,nn)){for(He!==null&&gv(nn)&&(yn=He.start,(sn=He.end)===void 0&&(sn=yn),"selectionStart"in nn?(nn.selectionStart=yn,nn.selectionEnd=Math.min(sn,nn.value.length)):(sn=(yn=nn.ownerDocument||document)&&yn.defaultView||window).getSelection&&(sn=sn.getSelection(),it=nn.textContent.length,jn=Math.min(He.start,it),He=He.end===void 0?jn:Math.min(He.end,it),!sn.extend&&He<jn&&(it=He,He=jn,jn=it),it=R2(nn,jn),_e=R2(nn,He),it&&_e&&(sn.rangeCount!==1||sn.anchorNode!==it.node||sn.anchorOffset!==it.offset||sn.focusNode!==_e.node||sn.focusOffset!==_e.offset)&&((yn=yn.createRange()).setStart(it.node,it.offset),sn.removeAllRanges(),He<jn?(sn.addRange(yn),sn.extend(_e.node,_e.offset)):(yn.setEnd(_e.node,_e.offset),sn.addRange(yn))))),yn=[],sn=nn;sn=sn.parentNode;)sn.nodeType===1&&yn.push({element:sn,left:sn.scrollLeft,top:sn.scrollTop});for(typeof nn.focus=="function"&&nn.focus(),nn=0;nn<yn.length;nn++)(sn=yn[nn]).element.scrollLeft=sn.left,sn.element.scrollTop=sn.top}Bo=!!vv,_v=vv=null,q.current=oe,en=ae;do try{for(nn=q;en!==null;){var zn,qn,En=en.flags;36&En&&KF(nn,en.alternate,en),128&En&&(yn=void 0,(zn=en.ref)!==null&&(qn=en.stateNode,en.tag,yn=qn,typeof zn=="function"?zn(yn):zn.current=yn)),en=en.nextEffect}}catch(Mn){if(en===null)throw Error(a(330));Ia(en,Mn),en=en.nextEffect}while(en!==null);en=null,IF(),Cn=ue}else q.current=oe;if(Na)Na=!1,Sf=q,Cf=ie;else for(en=ae;en!==null;)ie=en.nextEffect,en.nextEffect=null,8&en.flags&&((En=en).sibling=null,En.stateNode=null),en=ie;if((ae=q.pendingLanes)===0&&(Ji=null),ae===1?q===c_?Ef++:(Ef=0,c_=q):Ef=0,oe=oe.stateNode,Nl&&typeof Nl.onCommitFiberRoot=="function")try{Nl.onCommitFiberRoot(Ov,oe,void 0,!(64&~oe.current.flags))}catch{}if(Zo(q,no()),Vg)throw Vg=!1,q=s_,s_=null,q;return 8&Cn||Hi(),null}).bind(null,C,P)),null}function Ma(){var C;return Cf!==90&&(C=97<Cf?97:Cf,Cf=90,kl(C,qF))}function aN(C,P){l_.push(P,C),Na||(Na=!0,cf(97,function(){return Ma(),null}))}function qF(){if(Sf===null)return!1;var C=Sf;if(Sf=null,48&Cn)throw Error(a(331));var P=Cn,q=(Cn|=32,l_);l_=[];for(var ie=0;ie<q.length;ie+=2){var oe=q[ie],ae=q[ie+1],ue=oe.destroy;if(oe.destroy=void 0,typeof ue=="function")try{ue()}catch(me){if(ae===null)throw Error(a(330));Ia(ae,me)}}for(q=a_,a_=[],ie=0;ie<q.length;ie+=2){oe=q[ie],ae=q[ie+1];try{var _e=oe.create;oe.destroy=_e()}catch(me){if(ae===null)throw Error(a(330));Ia(ae,me)}}for(_e=C.current.firstEffect;_e!==null;)C=_e.nextEffect,_e.nextEffect=null,8&_e.flags&&(_e.sibling=null,_e.stateNode=null),_e=C;return Cn=P,Hi(),!0}function lN(C,P,q){Oa(C,P=HT(0,P=Xv(q,P),1)),P=zo(),(C=Zg(C,1))!==null&&(fl(C,1,P),Zo(C,P))}function Ia(C,P){if(C.tag===3)lN(C,C,P);else for(var q=C.return;q!==null;){if(q.tag===3){lN(q,C,P);break}if(q.tag===1){var ie,oe=q.stateNode;if(typeof q.type.getDerivedStateFromError=="function"||typeof oe.componentDidCatch=="function"&&(Ji===null||!Ji.has(oe))){if(Oa(q,KT(q,C=Xv(P,C),1)),ie=zo(),(q=Zg(q,1))!==null)fl(q,1,ie),Zo(q,ie);else if(typeof oe.componentDidCatch=="function"&&(Ji===null||!Ji.has(oe)))try{oe.componentDidCatch(P,C)}catch{}break}}q=q.return}}function JF(C,P,q){var ie=C.pingCache;ie!==null&&ie.delete(P),P=zo(),C.pingedLanes|=C.suspendedLanes&q,yo===C&&(ro&q)===q&&(Wr===4||Wr===3&&(62914560&ro)===ro&&no()-o_<500?vu(C,0):n_|=q),Zo(C,P)}function VF(C,P,q,ie){this.tag=C,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=P,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ie,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Qo(C,P,q,ie){return new VF(C,P,q,ie)}function f_(C){return(C=C.prototype)&&C.isReactComponent}function Ra(C,P){var q=C.alternate;return q===null?((q=Qo(C.tag,P,C.key,C.mode)).elementType=C.elementType,q.type=C.type,q.stateNode=C.stateNode,(q.alternate=C).alternate=q):(q.pendingProps=P,q.type=C.type,q.flags=0,q.nextEffect=null,q.firstEffect=null,q.lastEffect=null),q.childLanes=C.childLanes,q.lanes=C.lanes,q.child=C.child,q.memoizedProps=C.memoizedProps,q.memoizedState=C.memoizedState,q.updateQueue=C.updateQueue,P=C.dependencies,q.dependencies=P===null?null:{lanes:P.lanes,firstContext:P.firstContext},q.sibling=C.sibling,q.index=C.index,q.ref=C.ref,q}function em(C,P,q,ie,oe,ae){var ue=2;if(typeof(ie=C)=="function")f_(C)&&(ue=1);else if(typeof C=="string")ue=5;else e:switch(C){case A:return xu(q.children,oe,ae,P);case V:ue=8,oe|=16;break;case T:ue=8,oe|=1;break;case I:return(C=Qo(12,q,P,8|oe)).elementType=I,C.type=I,C.lanes=ae,C;case U:return(C=Qo(13,q,P,oe)).type=U,C.elementType=U,C.lanes=ae,C;case D:return(C=Qo(19,q,P,oe)).elementType=D,C.lanes=ae,C;case G:return p_(q,oe,ae,P);case F:return(C=Qo(24,q,P,oe)).elementType=F,C.lanes=ae,C;default:if(typeof C=="object"&&C!==null)switch(C.$$typeof){case k:ue=10;break e;case $:ue=9;break e;case H:ue=11;break e;case W:ue=14;break e;case J:ue=16,ie=null;break e;case M:ue=22;break e}throw Error(a(130,C==null?C:typeof C,""))}return(P=Qo(ue,q,P,oe)).elementType=C,P.type=ie,P.lanes=ae,P}function xu(C,P,q,ie){return(C=Qo(7,C,ie,P)).lanes=q,C}function p_(C,P,q,ie){return(C=Qo(23,C,ie,P)).elementType=G,C.lanes=q,C}function h_(C,P,q){return(C=Qo(6,C,null,P)).lanes=q,C}function g_(C,P,q){return(P=Qo(4,C.children!==null?C.children:[],C.key,P)).lanes=q,P.stateNode={containerInfo:C.containerInfo,pendingChildren:null,implementation:C.implementation},P}function GF(C,P,q){this.tag=P,this.containerInfo=C,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=q,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=eo(0),this.expirationTimes=eo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eo(0),this.mutableSourceEagerHydrationData=null}function tm(C,P,q,ie){var oe=P.current,ae=zo(),ue=Aa(oe);e:if(q){t:{if(kt(q=q._reactInternals)!==q||q.tag!==1)throw Error(a(170));var _e=q;do switch(_e.tag){case 3:_e=_e.stateNode.context;break t;case 1:if(Fo(_e.type)){_e=_e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}while((_e=_e.return)!==null);throw Error(a(171))}if(q.tag===1){var me=q.type;if(Fo(me)){q=Q2(q,me,_e);break e}}q=_e}else q=Sa;P.context===null?P.context=q:P.pendingContext=q,(P=Ea(ae,ue)).payload={element:C},(ie=ie===void 0?null:ie)!==null&&(P.callback=ie),Oa(oe,P),Pa(oe,ue,ae)}function m_(C){return(C=C.current).child?(C.child.tag,C.child.stateNode):null}function cN(C,P){var q;(C=C.memoizedState)!==null&&C.dehydrated!==null&&(q=C.retryLane,C.retryLane=q!==0&&q<P?q:P)}function y_(C,P){cN(C,P),(C=C.alternate)&&cN(C,P)}function b_(C,P,q){var ie=q!=null&&q.hydrationOptions!=null&&q.hydrationOptions.mutableSources||null;if(q=new GF(C,P,q!=null&&q.hydrate===!0),P=Qo(3,null,null,P===2?7:P===1?3:0),(q.current=P).stateNode=q,Rv(P),C[au]=q.current,U2(C.nodeType===8?C.parentNode:C),ie)for(C=0;C<ie.length;C++){var oe=(oe=(P=ie[C])._getVersion)(P._source);q.mutableSourceEagerHydrationData==null?q.mutableSourceEagerHydrationData=[P,oe]:q.mutableSourceEagerHydrationData.push(P,oe)}this._internalRoot=q}function Nf(C){return C&&(C.nodeType===1||C.nodeType===9||C.nodeType===11||C.nodeType===8&&C.nodeValue===" react-mount-point-unstable ")}function nm(C,P,q,ie,oe){var ae,ue,_e,me=q._reactRootContainer;return me?(_e=me._internalRoot,typeof oe=="function"&&(ae=oe,oe=function(){var He=m_(_e);ae.call(He)}),tm(P,_e,C,oe)):(_e=(me=q._reactRootContainer=function(He,it){if(!(it=it||!(!(it=He?He.nodeType===9?He.documentElement:He.firstChild:null)||it.nodeType!==1||!it.hasAttribute("data-reactroot"))))for(var ft;ft=He.lastChild;)He.removeChild(ft);return new b_(He,0,it?{hydrate:!0}:void 0)}(q,ie))._internalRoot,typeof oe=="function"&&(ue=oe,oe=function(){var He=m_(_e);ue.call(He)}),nN(function(){tm(P,_e,C,oe)})),m_(_e)}function uN(C,P){if(Nf(P))return function(q,ie,oe,ae){return{$$typeof:j,key:(ae=3<arguments.length&&ae!==void 0?ae:null)==null?null:""+ae,children:q,containerInfo:ie,implementation:oe}}(C,P,null,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null);throw Error(a(200))}QT=function(C,P,q){var ie=P.lanes;if(C!==null)if(C.memoizedProps!==P.pendingProps||Oo.current)bi=!0;else{if(!(q&ie)){switch(bi=!1,P.tag){case 3:BT(P),Fv();break;case 5:bT(P);break;case 1:Fo(P.type)&&Ng(P);break;case 4:Dv(P,P.stateNode.containerInfo);break;case 10:ie=P.memoizedProps.value;var oe=P.type._context;hr(Pg,oe._currentValue),oe._currentValue=ie;break;case 13:if(P.memoizedState!==null)return q&P.child.childLanes?FT(C,P,q):(hr(vr,1&vr.current),(P=Ss(C,P,q))!==null?P.sibling:null);hr(vr,1&vr.current);break;case 19:if(ie=!!(q&P.childLanes),64&C.flags){if(ie)return UT(C,P,q);P.flags|=64}if((oe=P.memoizedState)!==null&&(oe.rendering=null,oe.tail=null,oe.lastEffect=null),hr(vr,vr.current),ie)break;return null;case 23:case 24:return P.lanes=0,jT(C,P,q)}return Ss(C,P,q)}bi=!!(16384&C.flags)}else bi=!1;switch(P.lanes=0,P.tag){case 2:return ie=P.type,C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),C=P.pendingProps,oe=cu(P,to.current),fu(P,q),oe=Uv(null,P,ie,C,oe,q),P.flags|=1,typeof oe=="object"&&oe!==null&&typeof oe.render=="function"&&oe.$$typeof===void 0?(P.tag=1,P.memoizedState=null,P.updateQueue=null,Fo(ie)?(ae=!0,Ng(P)):ae=!1,P.memoizedState=oe.state!==null&&oe.state!==void 0?oe.state:null,Rv(P),typeof(me=ie.getDerivedStateFromProps)=="function"&&Rg(P,0,me,C),oe.updater=jg,jv((P.stateNode=oe)._reactInternals=P,ie,C,q),Vv(null,P,ie,!0,ae,q)):(P.tag=0,$o(null,P,oe,q),P.child);case 16:oe=P.elementType;e:{switch(C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),C=P.pendingProps,oe=(ae=oe._init)(oe._payload),P.type=oe,ae=P.tag=function(it){if(typeof it=="function")return f_(it)?1:0;if(it!=null){if((it=it.$$typeof)===H)return 11;if(it===W)return 14}return 2}(oe),C=yi(oe,C),ae){case 0:P=Jv(null,P,oe,C,q);break e;case 1:P=LT(null,P,oe,C,q);break e;case 11:P=MT(null,P,oe,C,q);break e;case 14:P=IT(null,P,oe,yi(oe.type,C),ie,q);break e}throw Error(a(306,oe,""))}return P;case 0:return ie=P.type,oe=P.pendingProps,Jv(C,P,ie,oe=P.elementType===ie?oe:yi(ie,oe),q);case 1:return ie=P.type,oe=P.pendingProps,LT(C,P,ie,oe=P.elementType===ie?oe:yi(ie,oe),q);case 3:if(BT(P),ie=P.updateQueue,C===null||ie===null)throw Error(a(282));if(ie=P.pendingProps,oe=(oe=P.memoizedState)!==null?oe.element:null,cT(C,P),uf(P,ie,null,q),(ie=P.memoizedState.element)===oe)Fv(),P=Ss(C,P,q);else{if((ae=(oe=P.stateNode).hydrate)&&(Ta=su(P.stateNode.containerInfo.firstChild),ws=P,ae=Wi=!0),ae){if((C=oe.mutableSourceEagerHydrationData)!=null)for(oe=0;oe<C.length;oe+=2)(ae=C[oe])._workInProgressVersionPrimary=C[oe+1],hu.push(ae);for(q=yT(P,null,ie,q),P.child=q;q;)q.flags=-3&q.flags|1024,q=q.sibling}else $o(C,P,ie,q),Fv();P=P.child}return P;case 5:return bT(P),C===null&&Bv(P),ie=P.type,oe=P.pendingProps,ae=C!==null?C.memoizedProps:null,me=oe.children,xv(ie,oe)?me=null:ae!==null&&xv(ie,ae)&&(P.flags|=16),DT(C,P),$o(C,P,me,q),P.child;case 6:return C===null&&Bv(P),null;case 13:return FT(C,P,q);case 4:return Dv(P,P.stateNode.containerInfo),ie=P.pendingProps,C===null?P.child=Bg(P,null,ie,q):$o(C,P,ie,q),P.child;case 11:return ie=P.type,oe=P.pendingProps,MT(C,P,ie,oe=P.elementType===ie?oe:yi(ie,oe),q);case 7:return $o(C,P,P.pendingProps,q),P.child;case 8:case 12:return $o(C,P,P.pendingProps.children,q),P.child;case 10:e:{ie=P.type._context,oe=P.pendingProps,me=P.memoizedProps;var ae=oe.value,ue=P.type._context;if(hr(Pg,ue._currentValue),ue._currentValue=ae,me!==null)if(ue=me.value,(ae=Or(ue,ae)?0:0|(typeof ie._calculateChangedBits=="function"?ie._calculateChangedBits(ue,ae):1073741823))==0){if(me.children===oe.children&&!Oo.current){P=Ss(C,P,q);break e}}else for((ue=P.child)!==null&&(ue.return=P);ue!==null;){var _e=ue.dependencies;if(_e!==null)for(var me=ue.child,He=_e.firstContext;He!==null;){if(He.context===ie&&He.observedBits&ae){ue.tag===1&&((He=Ea(-1,q&-q)).tag=2,Oa(ue,He)),ue.lanes|=q,(He=ue.alternate)!==null&&(He.lanes|=q),lT(ue.return,q),_e.lanes|=q;break}He=He.next}else me=ue.tag===10&&ue.type===P.type?null:ue.child;if(me!==null)me.return=ue;else for(me=ue;me!==null;){if(me===P){me=null;break}if((ue=me.sibling)!==null){ue.return=me.return,me=ue;break}me=me.return}ue=me}$o(C,P,oe.children,q),P=P.child}return P;case 9:return oe=P.type,ie=(ae=P.pendingProps).children,fu(P,q),ie=ie(oe=Yo(oe,ae.unstable_observedBits)),P.flags|=1,$o(C,P,ie,q),P.child;case 14:return ae=yi(oe=P.type,P.pendingProps),IT(C,P,oe,ae=yi(oe.type,ae),ie,q);case 15:return RT(C,P,P.type,P.pendingProps,ie,q);case 17:return ie=P.type,oe=P.pendingProps,oe=P.elementType===ie?oe:yi(ie,oe),C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),P.tag=1,Fo(ie)?(C=!0,Ng(P)):C=!1,fu(P,q),hT(P,ie,oe),jv(P,ie,oe,q),Vv(null,P,ie,!0,C,q);case 19:return UT(C,P,q);case 23:case 24:return jT(C,P,q)}throw Error(a(156,P.tag))},b_.prototype.render=function(C){tm(C,this._internalRoot,null,null)},b_.prototype.unmount=function(){var C=this._internalRoot,P=C.containerInfo;tm(null,C,null,function(){P[au]=null})},De=function(C){C.tag===13&&(Pa(C,4,zo()),y_(C,4))},Ue=function(C){C.tag===13&&(Pa(C,67108864,zo()),y_(C,67108864))},Ke=function(C){var P,q;C.tag===13&&(P=zo(),Pa(C,q=Aa(C),P),y_(C,q))},$t=function(C,P,q){switch(P){case"input":if(ge(C,q),P=q.name,q.type==="radio"&&P!=null){for(q=C;q.parentNode;)q=q.parentNode;for(q=q.querySelectorAll("input[name="+JSON.stringify(""+P)+'][type="radio"]'),P=0;P<q.length;P++){var ie=q[P];if(ie!==C&&ie.form===C.form){var oe=Tg(ie);if(!oe)throw Error(a(90));ee(ie),ge(ie,oe)}}}break;case"textarea":ke(C,q);break;case"select":(P=q.value)!=null&&Le(C,!!q.multiple,P,!1)}},Tn=tN,Ne=function(C,P,q,ie,oe){var ae=Cn;Cn|=4;try{return kl(98,C.bind(null,P,q,ie,oe))}finally{(Cn=ae)===0&&(yu(),Hi())}};var YF=function(C,P){var q=Cn;Cn|=2;try{return C(P)}finally{(Cn=q)===0&&(yu(),Hi())}};if(Br={Events:[af,lu,Tg,jt,qt,Ma,{current:!(lt=function(){var C;!(49&Cn)&&(Cs!==null&&(C=Cs,Cs=null,C.forEach(function(P){P.expiredLanes|=24&P.pendingLanes,Zo(P,no())})),Hi(),Ma())})}]},Dn={bundleType:(e={findFiberByHostInstance:Ol,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"}).bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(C){return(C=vt(C))===null?null:C.stateNode},findFiberByHostInstance:e.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&!(lr=__REACT_DEVTOOLS_GLOBAL_HOOK__).isDisabled&&lr.supportsFiber)try{Ov=lr.inject(Dn),Nl=lr}catch{}r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Br,r.createPortal=uN,r.findDOMNode=function(C){if(C==null)return null;if(C.nodeType===1)return C;var P=C._reactInternals;if(P!==void 0)return(C=vt(P))===null?null:C.stateNode;throw typeof C.render=="function"?Error(a(188)):Error(a(268,Object.keys(C)))},r.flushSync=function(C,P){var q=Cn;if(48&q)return C(P);Cn|=1;try{if(C)return kl(99,C.bind(null,P))}finally{Cn=q,Hi()}},r.hydrate=function(C,P,q){if(Nf(P))return nm(null,C,P,!0,q);throw Error(a(200))},r.render=function(C,P,q){if(Nf(P))return nm(null,C,P,!1,q);throw Error(a(200))},r.unmountComponentAtNode=function(C){if(Nf(C))return!!C._reactRootContainer&&(nN(function(){nm(null,null,C,!1,function(){C._reactRootContainer=null,C[au]=null})}),!0);throw Error(a(40))},r.unstable_batchedUpdates=tN,r.unstable_createPortal=function(C,P){return uN(C,P,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)},r.unstable_renderSubtreeIntoContainer=function(C,P,q,ie){if(!Nf(q))throw Error(a(200));if(C==null||C._reactInternals===void 0)throw Error(a(38));return nm(C,P,q,!1,ie)},r.version="17.0.2"},{"object-assign":385,react:408,scheduler:414}],401:[function(e,s,r){(function o(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE=="function")try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(i){console.error(i)}})(),s.exports=e("./cjs/react-dom.production.min.js")},{"./cjs/react-dom.development.js":399,"./cjs/react-dom.production.min.js":400}],402:[function(e,s,r){(function(o){(function(){function i(J){if(typeof J=="object"&&J!==null){var M=J.$$typeof;switch(M){case u:var z=J.type;switch(z){case f:case d:case l:case g:case y:return z;default:var V=z&&z.$$typeof;switch(V){case h:case m:case v:case b:case p:return V;default:return M}}case a:return M}}}var u,a,f,l,d,p,h,m,g,y,b,v,_,w,x,S,E,O,j,A,T,I,k,$,H,U,D,W;o.env.NODE_ENV!=="production"&&(u=60103,a=60106,f=60107,l=60108,d=60114,p=60109,h=60110,m=60112,g=60113,y=60120,b=60115,v=60116,_=60121,w=60122,x=60117,S=60129,E=60131,typeof Symbol=="function"&&Symbol.for&&(u=(O=Symbol.for)("react.element"),a=O("react.portal"),f=O("react.fragment"),l=O("react.strict_mode"),d=O("react.profiler"),p=O("react.provider"),h=O("react.context"),m=O("react.forward_ref"),g=O("react.suspense"),y=O("react.suspense_list"),b=O("react.memo"),v=O("react.lazy"),_=O("react.block"),w=O("react.server.block"),x=O("react.fundamental"),O("react.scope"),O("react.opaque.id"),S=O("react.debug_trace_mode"),O("react.offscreen"),E=O("react.legacy_hidden")),O=h,j=p,A=u,T=m,I=f,k=v,$=b,H=a,U=d,D=l,W=g,r.ContextConsumer=O,r.ContextProvider=j,r.Element=A,r.ForwardRef=T,r.Fragment=I,r.Lazy=k,r.Memo=$,r.Portal=H,r.Profiler=U,r.StrictMode=D,r.Suspense=W,r.isAsyncMode=function(J){return!1},r.isConcurrentMode=function(J){return!1},r.isContextConsumer=function(J){return i(J)===h},r.isContextProvider=function(J){return i(J)===p},r.isElement=function(J){return typeof J=="object"&&J!==null&&J.$$typeof===u},r.isForwardRef=function(J){return i(J)===m},r.isFragment=function(J){return i(J)===f},r.isLazy=function(J){return i(J)===v},r.isMemo=function(J){return i(J)===b},r.isPortal=function(J){return i(J)===a},r.isProfiler=function(J){return i(J)===d},r.isStrictMode=function(J){return i(J)===l},r.isSuspense=function(J){return i(J)===g},r.isValidElementType=function(J){return typeof J=="string"||typeof J=="function"||J===f||J===d||J===S||J===l||J===g||J===y||J===E||typeof J=="object"&&J!==null&&(J.$$typeof===v||J.$$typeof===b||J.$$typeof===p||J.$$typeof===h||J.$$typeof===m||J.$$typeof===x||J.$$typeof===_||J[0]===w)},r.typeOf=i)}).call(this)}).call(this,e("_process"))},{_process:386}],403:[function(e,s,r){var o=60103,i=60106,u=60107,a=60108,f=60114,l=60109,d=60110,p=60112,h=60113,m=60120,g=60115,y=60116,b=60121,v=60122,_=60117,w=60129,x=60131;function S(D){if(typeof D=="object"&&D!==null){var W=D.$$typeof;switch(W){case o:switch(D=D.type){case u:case f:case a:case h:case m:return D;default:switch(D=D&&D.$$typeof){case d:case p:case y:case g:case l:return D;default:return W}}case i:return W}}}typeof Symbol=="function"&&Symbol.for&&(o=(E=Symbol.for)("react.element"),i=E("react.portal"),u=E("react.fragment"),a=E("react.strict_mode"),f=E("react.profiler"),l=E("react.provider"),d=E("react.context"),p=E("react.forward_ref"),h=E("react.suspense"),m=E("react.suspense_list"),g=E("react.memo"),y=E("react.lazy"),b=E("react.block"),v=E("react.server.block"),_=E("react.fundamental"),w=E("react.debug_trace_mode"),x=E("react.legacy_hidden"));var E=l,O=o,j=p,A=u,T=y,I=g,k=i,$=f,H=a,U=h;r.ContextConsumer=d,r.ContextProvider=E,r.Element=O,r.ForwardRef=j,r.Fragment=A,r.Lazy=T,r.Memo=I,r.Portal=k,r.Profiler=$,r.StrictMode=H,r.Suspense=U,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(D){return S(D)===d},r.isContextProvider=function(D){return S(D)===l},r.isElement=function(D){return typeof D=="object"&&D!==null&&D.$$typeof===o},r.isForwardRef=function(D){return S(D)===p},r.isFragment=function(D){return S(D)===u},r.isLazy=function(D){return S(D)===y},r.isMemo=function(D){return S(D)===g},r.isPortal=function(D){return S(D)===i},r.isProfiler=function(D){return S(D)===f},r.isStrictMode=function(D){return S(D)===a},r.isSuspense=function(D){return S(D)===h},r.isValidElementType=function(D){return typeof D=="string"||typeof D=="function"||D===u||D===f||D===w||D===a||D===h||D===m||D===x||typeof D=="object"&&D!==null&&(D.$$typeof===y||D.$$typeof===g||D.$$typeof===l||D.$$typeof===d||D.$$typeof===p||D.$$typeof===_||D.$$typeof===b||D[0]===v)},r.typeOf=S},{}],404:[function(e,s,r){arguments[4][381][0].apply(r,arguments)},{"./cjs/react-is.development.js":402,"./cjs/react-is.production.min.js":403,_process:386,dup:381}],405:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0});var o=Object.assign||function(f){for(var l=1;l<arguments.length;l++){var d,p=arguments[l];for(d in p)Object.prototype.hasOwnProperty.call(p,d)&&(f[d]=p[d])}return f},i=u(e("react"));function u(f){return f&&f.__esModule?f:{default:f}}e=u(e("localized-strings"));var a=/(\{[\d|\w]+\})/;e.default.prototype.formatString=function(f){for(var l=arguments.length,d=Array(1<l?l-1:0),p=1;p<l;p++)d[p-1]=arguments[p];var h=!1;return f=(f||"").split(a).filter(function(m){return!!m}).map(function(m,g){if(m.match(a)){var y=m.slice(1,-1),b=d[y];if(b==null){if((y=d[0][y])===void 0)return b;b=y}return i.default.isValidElement(b)?(h=!0,i.default.Children.toArray(b).map(function(v){return o({},v,{key:g.toString()})})):b}return m}),h?f:f.join("")},r.default=e.default},{"localized-strings":383,react:408}],406:[function(e,s,r){},{"object-assign":385}],407:[function(e,s,r){var o=e("object-assign"),i=60103,u=60106,a=(r.Fragment=60107,r.StrictMode=60108,r.Profiler=60114,60109),f=60110,l=60112,d=(r.Suspense=60113,60115),p=60116,h=(typeof Symbol=="function"&&Symbol.for&&(i=(e=Symbol.for)("react.element"),u=e("react.portal"),r.Fragment=e("react.fragment"),r.StrictMode=e("react.strict_mode"),r.Profiler=e("react.profiler"),a=e("react.provider"),f=e("react.context"),l=e("react.forward_ref"),r.Suspense=e("react.suspense"),d=e("react.memo"),p=e("react.lazy")),typeof Symbol=="function"&&Symbol.iterator);function m(U){for(var D="https://reactjs.org/docs/error-decoder.html?invariant="+U,W=1;W<arguments.length;W++)D+="&args[]="+encodeURIComponent(arguments[W]);return"Minified React error #"+U+"; visit "+D+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function b(U,D,W){this.props=U,this.context=D,this.refs=y,this.updater=W||g}function v(){}function _(U,D,W){this.props=U,this.context=D,this.refs=y,this.updater=W||g}b.prototype.isReactComponent={},b.prototype.setState=function(U,D){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error(m(85));this.updater.enqueueSetState(this,U,D,"setState")},b.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")},v.prototype=b.prototype;var w=((e=_.prototype=new v).constructor=_,o(e,b.prototype),e.isPureReactComponent=!0,{current:null}),x=Object.prototype.hasOwnProperty,S={key:!0,ref:!0,__self:!0,__source:!0};function E(U,D,W){var J,M={},z=null,V=null;if(D!=null)for(J in D.ref!==void 0&&(V=D.ref),D.key!==void 0&&(z=""+D.key),D)x.call(D,J)&&!S.hasOwnProperty(J)&&(M[J]=D[J]);var G=arguments.length-2;if(G===1)M.children=W;else if(1<G){for(var F=Array(G),K=0;K<G;K++)F[K]=arguments[K+2];M.children=F}if(U&&U.defaultProps)for(J in G=U.defaultProps)M[J]===void 0&&(M[J]=G[J]);return{$$typeof:i,type:U,key:z,ref:V,props:M,_owner:w.current}}function O(U){return typeof U=="object"&&U!==null&&U.$$typeof===i}var j=/\/+/g;function A(U,D){return typeof U=="object"&&U!==null&&U.key!=null?(U=""+U.key,W={"=":"=0",":":"=2"},"$"+U.replace(/[=:]/g,function(J){return W[J]})):D.toString(36);var W}function T(U,D,W,J,M){var z,V,G=!1;if((U=(K=typeof U)!="undefined"&&K!=="boolean"?U:null)===null)G=!0;else switch(K){case"string":case"number":G=!0;break;case"object":switch(U.$$typeof){case i:case u:G=!0}}if(G)return M=M(G=U),U=J===""?"."+A(G,0):J,Array.isArray(M)?(W="",T(M,D,W=U!=null?U.replace(j,"$&/")+"/":W,"",function(R){return R})):M!=null&&(O(M)&&(V=W+(!(z=M).key||G&&G.key===M.key?"":(""+M.key).replace(j,"$&/")+"/")+U,M={$$typeof:i,type:z.type,key:V,ref:z.ref,props:z.props,_owner:z._owner}),D.push(M)),1;if(G=0,J=J===""?".":J+":",Array.isArray(U))for(var F=0;F<U.length;F++){var K,N=J+A(K=U[F],F);G+=T(K,D,W,N,M)}else if(typeof(N=(V=U)!==null&&typeof V=="object"&&typeof(V=h&&V[h]||V["@@iterator"])=="function"?V:null)=="function")for(U=N.call(U),F=0;!(K=U.next()).done;)G+=T(K=K.value,D,W,N=J+A(K,F++),M);else if(K==="object")throw D=""+U,Error(m(31,D==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":D));return G}function I(U,D,W){if(U==null)return U;var J=[],M=0;return T(U,J,"","",function(z){return D.call(W,z,M++)}),J}function k(U){var D;if(U._status===-1&&(D=(D=U._result)(),U._status=0,(U._result=D).then(function(W){U._status===0&&(W=W.default,U._status=1,U._result=W)},function(W){U._status===0&&(U._status=2,U._result=W)})),U._status===1)return U._result;throw U._result}var $={current:null};function H(){var U=$.current;if(U===null)throw Error(m(321));return U}e={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:o},r.Children={map:I,forEach:function(U,D,W){I(U,function(){D.apply(this,arguments)},W)},count:function(U){var D=0;return I(U,function(){D++}),D},toArray:function(U){return I(U,function(D){return D})||[]},only:function(U){if(O(U))return U;throw Error(m(143))}},r.Component=b,r.PureComponent=_,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e,r.cloneElement=function(U,D,W){if(U==null)throw Error(m(267,U));var J=o({},U.props),M=U.key,z=U.ref,V=U._owner;if(D!=null)for(G in D.ref!==void 0&&(z=D.ref,V=w.current),D.key!==void 0&&(M=""+D.key),U.type&&U.type.defaultProps&&(F=U.type.defaultProps),D)x.call(D,G)&&!S.hasOwnProperty(G)&&(J[G]=(D[G]===void 0&&F!==void 0?F:D)[G]);var G=arguments.length-2;if(G===1)J.children=W;else if(1<G){for(var F=Array(G),K=0;K<G;K++)F[K]=arguments[K+2];J.children=F}return{$$typeof:i,type:U.type,key:M,ref:z,props:J,_owner:V}},r.createContext=function(U,D){return(U={$$typeof:f,_calculateChangedBits:D=D===void 0?null:D,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:U},U.Consumer=U},r.createElement=E,r.createFactory=function(U){var D=E.bind(null,U);return D.type=U,D},r.createRef=function(){return{current:null}},r.forwardRef=function(U){return{$$typeof:l,render:U}},r.isValidElement=O,r.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:k}},r.memo=function(U,D){return{$$typeof:d,type:U,compare:D===void 0?null:D}},r.useCallback=function(U,D){return H().useCallback(U,D)},r.useContext=function(U,D){return H().useContext(U,D)},r.useDebugValue=function(){},r.useEffect=function(U,D){return H().useEffect(U,D)},r.useImperativeHandle=function(U,D,W){return H().useImperativeHandle(U,D,W)},r.useLayoutEffect=function(U,D){return H().useLayoutEffect(U,D)},r.useMemo=function(U,D){return H().useMemo(U,D)},r.useReducer=function(U,D,W){return H().useReducer(U,D,W)},r.useRef=function(U){return H().useRef(U)},r.useState=function(U){return H().useState(U)},r.version="17.0.2"},{"object-assign":385}],408:[function(e,s,r){s.exports=e("./cjs/react.production.min.js")},{"./cjs/react.development.js":406,"./cjs/react.production.min.js":407}],409:[function(e,s,r){s=function(o){var i,u=Object.prototype,a=u.hasOwnProperty,f=(E=typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator",l=E.asyncIterator||"@@asyncIterator",d=E.toStringTag||"@@toStringTag";function p(D,W,J){return Object.defineProperty(D,W,{value:J,enumerable:!0,configurable:!0,writable:!0}),D[W]}try{p({},"")}catch{p=function(W,J,M){return W[J]=M}}function h(D,W,J,M){var z,V,G,F;return W=W&&W.prototype instanceof w?W:w,W=Object.create(W.prototype),M=new $(M||[]),W._invoke=(z=D,V=J,G=M,F=g,function(K,N){if(F===b)throw new Error("Generator is already running");if(F===v){if(K==="throw")throw N;return U()}for(G.method=K,G.arg=N;;){var R=G.delegate;if(R&&(R=function L(B,Y){var X=B.iterator[Y.method];if(X===i){if(Y.delegate=null,Y.method==="throw"){if(B.iterator.return&&(Y.method="return",Y.arg=i,L(B,Y),Y.method==="throw"))return _;Y.method="throw",Y.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}return(X=m(X,B.iterator,Y.arg)).type==="throw"?(Y.method="throw",Y.arg=X.arg,Y.delegate=null,_):(X=X.arg)?X.done?(Y[B.resultName]=X.value,Y.next=B.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=i),Y.delegate=null,_):X:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,_)}(R,G),R)){if(R===_)continue;return R}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(F===g)throw F=v,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);if(F=b,(R=m(z,V,G)).type==="normal"){if(F=G.done?v:y,R.arg!==_)return{value:R.arg,done:G.done}}else R.type==="throw"&&(F=v,G.method="throw",G.arg=R.arg)}}),W}function m(D,W,J){try{return{type:"normal",arg:D.call(W,J)}}catch(M){return{type:"throw",arg:M}}}o.wrap=h;var g="suspendedStart",y="suspendedYield",b="executing",v="completed",_={};function w(){}function x(){}function S(){}var E,O,j=(p(E={},f,function(){return this}),(O=(O=Object.getPrototypeOf)&&O(O(H([]))))&&O!==u&&a.call(O,f)&&(E=O),S.prototype=w.prototype=Object.create(E));function A(D){["next","throw","return"].forEach(function(W){p(D,W,function(J){return this._invoke(W,J)})})}function T(D,W){var J;this._invoke=function(M,z){function V(){return new W(function(G,F){(function K(N,R,L,B){var Y;if((N=m(D[N],D,R)).type!=="throw")return(R=(Y=N.arg).value)&&typeof R=="object"&&a.call(R,"__await")?W.resolve(R.__await).then(function(X){K("next",X,L,B)},function(X){K("throw",X,L,B)}):W.resolve(R).then(function(X){Y.value=X,L(Y)},function(X){return K("throw",X,L,B)});B(N.arg)})(M,z,G,F)})}return J=J?J.then(V,V):V()}}function I(D){var W={tryLoc:D[0]};1 in D&&(W.catchLoc=D[1]),2 in D&&(W.finallyLoc=D[2],W.afterLoc=D[3]),this.tryEntries.push(W)}function k(D){var W=D.completion||{};W.type="normal",delete W.arg,D.completion=W}function $(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(I,this),this.reset(!0)}function H(D){if(D){var W,J=D[f];if(J)return J.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length))return W=-1,(J=function M(){for(;++W<D.length;)if(a.call(D,W))return M.value=D[W],M.done=!1,M;return M.value=i,M.done=!0,M}).next=J}return{next:U}}function U(){return{value:i,done:!0}}return p(j,"constructor",x.prototype=S),p(S,"constructor",x),x.displayName=p(S,d,"GeneratorFunction"),o.isGeneratorFunction=function(D){return!!(D=typeof D=="function"&&D.constructor)&&(D===x||(D.displayName||D.name)==="GeneratorFunction")},o.mark=function(D){return Object.setPrototypeOf?Object.setPrototypeOf(D,S):(D.__proto__=S,p(D,d,"GeneratorFunction")),D.prototype=Object.create(j),D},o.awrap=function(D){return{__await:D}},A(T.prototype),p(T.prototype,l,function(){return this}),o.AsyncIterator=T,o.async=function(D,W,J,M,z){z===void 0&&(z=Promise);var V=new T(h(D,W,J,M),z);return o.isGeneratorFunction(W)?V:V.next().then(function(G){return G.done?G.value:V.next()})},A(j),p(j,d,"Generator"),p(j,f,function(){return this}),p(j,"toString",function(){return"[object Generator]"}),o.keys=function(D){var W,J=[];for(W in D)J.push(W);return J.reverse(),function M(){for(;J.length;){var z=J.pop();if(z in D)return M.value=z,M.done=!1,M}return M.done=!0,M}},o.values=H,$.prototype={constructor:$,reset:function(D){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(k),!D)for(var W in this)W.charAt(0)==="t"&&a.call(this,W)&&!isNaN(+W.slice(1))&&(this[W]=i)},stop:function(){this.done=!0;var D=this.tryEntries[0].completion;if(D.type==="throw")throw D.arg;return this.rval},dispatchException:function(D){if(this.done)throw D;var W=this;function J(K,N){return V.type="throw",V.arg=D,W.next=K,N&&(W.method="next",W.arg=i),!!N}for(var M=this.tryEntries.length-1;0<=M;--M){var z=this.tryEntries[M],V=z.completion;if(z.tryLoc==="root")return J("end");if(z.tryLoc<=this.prev){var G=a.call(z,"catchLoc"),F=a.call(z,"finallyLoc");if(G&&F){if(this.prev<z.catchLoc)return J(z.catchLoc,!0);if(this.prev<z.finallyLoc)return J(z.finallyLoc)}else if(G){if(this.prev<z.catchLoc)return J(z.catchLoc,!0)}else{if(!F)throw new Error("try statement without catch or finally");if(this.prev<z.finallyLoc)return J(z.finallyLoc)}}}},abrupt:function(D,W){for(var J=this.tryEntries.length-1;0<=J;--J){var M=this.tryEntries[J];if(M.tryLoc<=this.prev&&a.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var z=M;break}}var V=(z=z&&(D==="break"||D==="continue")&&z.tryLoc<=W&&W<=z.finallyLoc?null:z)?z.completion:{};return V.type=D,V.arg=W,z?(this.method="next",this.next=z.finallyLoc,_):this.complete(V)},complete:function(D,W){if(D.type==="throw")throw D.arg;return D.type==="break"||D.type==="continue"?this.next=D.arg:D.type==="return"?(this.rval=this.arg=D.arg,this.method="return",this.next="end"):D.type==="normal"&&W&&(this.next=W),_},finish:function(D){for(var W=this.tryEntries.length-1;0<=W;--W){var J=this.tryEntries[W];if(J.finallyLoc===D)return this.complete(J.completion,J.afterLoc),k(J),_}},catch:function(D){for(var W=this.tryEntries.length-1;0<=W;--W){var J,M,z=this.tryEntries[W];if(z.tryLoc===D)return(J=z.completion).type==="throw"&&(M=J.arg,k(z)),M}throw new Error("illegal catch attempt")},delegateYield:function(D,W,J){return this.delegate={iterator:H(D),resultName:W,nextLoc:J},this.method==="next"&&(this.arg=i),_}},o}(typeof s=="object"?s.exports:{});try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},{}],410:[function(e,s,r){},{}],411:[function(e,s,r){var o=0;r.__interactionsRef=null,r.__subscriberRef=null,r.unstable_clear=function(i){return i()},r.unstable_getCurrent=function(){return null},r.unstable_getThreadID=function(){return++o},r.unstable_subscribe=function(){},r.unstable_trace=function(i,u,a){return a()},r.unstable_unsubscribe=function(){},r.unstable_wrap=function(i){return i}},{}],412:[function(e,s,r){},{}],413:[function(e,s,r){var o,i,u,a,f,l,d,p,h,m,g,y,b,v,_,w,x,S;function E(G,F){var K=G.length;for(G.push(F);;){var N=K-1>>>1,R=G[N];if(!(R!==void 0&&0<A(R,F)))break;G[N]=F,G[K]=R,K=N}}function O(G){return(G=G[0])===void 0?null:G}function j(G){var F=G[0];if(F!==void 0){var K=G.pop();if(K!==F){G[0]=K;for(var N=0,R=G.length;N<R;){var L=2*(N+1)-1,B=G[L],Y=1+L,X=G[Y];if(B!==void 0&&A(B,K)<0)N=X!==void 0&&A(X,B)<0?(G[N]=X,G[Y]=K,Y):(G[N]=B,G[L]=K,L);else{if(!(X!==void 0&&A(X,K)<0))break;G[N]=X,G[Y]=K,N=Y}}}}}function A(G,F){var K=G.sortIndex-F.sortIndex;return K!=0?K:G.id-F.id}typeof performance=="object"&&typeof performance.now=="function"?(i=performance,r.unstable_now=function(){return i.now()}):(u=Date,a=u.now(),r.unstable_now=function(){return u.now()-a}),typeof window>"u"||typeof MessageChannel!="function"?(l=f=null,d=function(){if(f!==null)try{var G=r.unstable_now();f(!0,G),f=null}catch(F){throw setTimeout(d,0),F}},p=function(G){f!==null?setTimeout(p,0,G):(f=G,setTimeout(d,0))},h=function(G,F){l=setTimeout(G,F)},m=function(){clearTimeout(l)},r.unstable_shouldYield=function(){return!1},o=r.unstable_forceFrameRate=function(){}):(g=window.setTimeout,y=window.clearTimeout,typeof console<"u"&&(V=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof V!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),b=!1,v=null,_=-1,w=5,x=0,r.unstable_shouldYield=function(){return r.unstable_now()>=x},o=function(){},r.unstable_forceFrameRate=function(G){G<0||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<G?Math.floor(1e3/G):5},V=new MessageChannel,S=V.port2,V.port1.onmessage=function(){if(v!==null){var G=r.unstable_now();x=G+w;try{v(!0,G)?S.postMessage(null):(b=!1,v=null)}catch(F){throw S.postMessage(null),F}}else b=!1},p=function(G){v=G,b||(b=!0,S.postMessage(null))},h=function(G,F){_=g(function(){G(r.unstable_now())},F)},m=function(){y(_),_=-1});var T=[],I=[],k=1,$=null,H=3,U=!1,D=!1,W=!1;function J(G){for(var F=O(I);F!==null;){if(F.callback===null)j(I);else{if(!(F.startTime<=G))break;j(I),F.sortIndex=F.expirationTime,E(T,F)}F=O(I)}}function M(G){var F;W=!1,J(G),D||(O(T)!==null?(D=!0,p(z)):(F=O(I))!==null&&h(M,F.startTime-G))}function z(G,F){D=!1,W&&(W=!1,m()),U=!0;var K=H;try{for(J(F),$=O(T);$!==null&&(!($.expirationTime>F)||G&&!r.unstable_shouldYield());){var N,R=$.callback;typeof R=="function"?($.callback=null,H=$.priorityLevel,N=R($.expirationTime<=F),F=r.unstable_now(),typeof N=="function"?$.callback=N:$===O(T)&&j(T),J(F)):j(T),$=O(T)}var L;return $!==null||((L=O(I))!==null&&h(M,L.startTime-F),!1)}finally{$=null,H=K,U=!1}}var V=o;r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(G){G.callback=null},r.unstable_continueExecution=function(){D||U||(D=!0,p(z))},r.unstable_getCurrentPriorityLevel=function(){return H},r.unstable_getFirstCallbackNode=function(){return O(T)},r.unstable_next=function(G){switch(H){case 1:case 2:case 3:var F=3;break;default:F=H}var K=H;H=F;try{return G()}finally{H=K}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=V,r.unstable_runWithPriority=function(G,F){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var K=H;H=G;try{return F()}finally{H=K}},r.unstable_scheduleCallback=function(G,F,K){var N=r.unstable_now();switch(K=typeof K=="object"&&K!==null&&typeof(K=K.delay)=="number"&&0<K?N+K:N,G){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return G={id:k++,callback:F,priorityLevel:G,startTime:K,expirationTime:R=K+R,sortIndex:-1},N<K?(G.sortIndex=K,E(I,G),O(T)===null&&G===O(I)&&(W?m():W=!0,h(M,K-N))):(G.sortIndex=R,E(T,G),D||U||(D=!0,p(z))),G},r.unstable_wrapCallback=function(G){var F=H;return function(){var K=H;H=F;try{return G.apply(this,arguments)}finally{H=K}}}},{}],414:[function(e,s,r){s.exports=e("./cjs/scheduler.production.min.js")},{"./cjs/scheduler.development.js":412,"./cjs/scheduler.production.min.js":413}],415:[function(e,s,r){s.exports=e("./cjs/scheduler-tracing.production.min.js")},{"./cjs/scheduler-tracing.development.js":410,"./cjs/scheduler-tracing.production.min.js":411}],416:[function(e,s,r){s.exports=function(o,i,u,a){if((m=u?u.call(a,o,i):void 0)!==void 0)return!!m;if(o===i)return!0;if(typeof o!="object"||!o||typeof i!="object"||!i)return!1;var f=Object.keys(o),l=Object.keys(i);if(f.length!==l.length)return!1;for(var d=Object.prototype.hasOwnProperty.bind(i),p=0;p<f.length;p++){var h=f[p];if(!d(h))return!1;var m,g=o[h],y=i[h];if((m=u?u.call(a,g,y,h):void 0)===!1||m===void 0&&g!==y)return!1}return!0}},{}],417:[function(e,s,r){(function(o){(function(){function i(pe){return pe&&typeof pe=="object"&&"default"in pe?pe.default:pe}Object.defineProperty(r,"__esModule",{value:!0});var u=e("react-is"),a=e("react"),f=i(a),l=i(e("shallowequal")),d=i(e("@emotion/stylis")),p=i(e("@emotion/unitless")),h=i(e("@emotion/is-prop-valid")),m=i(e("hoist-non-react-statics"));function g(){return(g=Object.assign||function(pe){for(var De=1;De<arguments.length;De++){var Ue,Ke=arguments[De];for(Ue in Ke)Object.prototype.hasOwnProperty.call(Ke,Ue)&&(pe[Ue]=Ke[Ue])}return pe}).apply(this,arguments)}var y=function(pe,De){for(var Ue=[pe[0]],Ke=0,qe=De.length;Ke<qe;Ke+=1)Ue.push(De[Ke],pe[Ke+1]);return Ue},b=function(pe){return pe!==null&&typeof pe=="object"&&(pe.toString?pe.toString():Object.prototype.toString.call(pe))==="[object Object]"&&!u.typeOf(pe)},v=Object.freeze([]),_=Object.freeze({});function w(pe){return typeof pe=="function"}function x(pe){return o.env.NODE_ENV!=="production"&&typeof pe=="string"&&pe||pe.displayName||pe.name||"Component"}function S(pe){return pe&&typeof pe.styledComponentId=="string"}var E=o!==void 0&&(o.env.REACT_APP_SC_ATTR||o.env.SC_ATTR)||"data-styled",O=typeof window<"u"&&"HTMLElement"in window,j=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:o!==void 0&&o.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&o.env.REACT_APP_SC_DISABLE_SPEEDY!==""?o.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&o.env.REACT_APP_SC_DISABLE_SPEEDY:o!==void 0&&o.env.SC_DISABLE_SPEEDY!==void 0&&o.env.SC_DISABLE_SPEEDY!==""?o.env.SC_DISABLE_SPEEDY!=="false"&&o.env.SC_DISABLE_SPEEDY:o.env.NODE_ENV!=="production"),A={},T=o.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
128
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Wr!==5&&(Wr=2),_e=Yv(_e,tn),Ve=ue;do switch(Ve.tag){case 3:ae=_e,Ve.flags|=4096,P&=-P,Ve.lanes|=P,cT(Ve,UT(0,ae,P));break e;case 1:ae=_e;var sn=Ve.type,nn=Ve.stateNode;if(!(64&Ve.flags||typeof sn.getDerivedStateFromError!="function"&&(nn===null||typeof nn.componentDidCatch!="function"||Ji!==null&&Ji.has(nn)))){Ve.flags|=4096,P&=-P,Ve.lanes|=P,cT(Ve,HT(Ve,ae,P));break e}}while((Ve=Ve.return)!==null)}iN(q)}catch(jn){P=jn,Pr===q&&q!==null&&(Pr=q=q.return);continue}break}}function rN(){var C=qg.current;return qg.current=Wg,C===null?Wg:C}function Tf(C,P){var q=Cn,ie=(Cn|=16,rN());for(yo===C&&ro===P||vu(C,P);;)try{for(;Pr!==null;)oN(Pr);break}catch(oe){nN(C,oe)}if(Pv(),Cn=q,qg.current=ie,Pr!==null)throw Error(a(261));return yo=null,ro=0,Wr}function oN(C){var P=ZT(C.alternate,C,Il);C.memoizedProps=C.pendingProps,P===null?iN(C):Pr=P,Qv.current=null}function iN(C){var P=C;do{var q=P.alternate;if(C=P.return,2048&P.flags){if((q=function(ae){switch(ae.tag){case 1:Fo(ae.type)&&Cv();var ue=ae.flags;return 4096&ue?(ae.flags=-4097&ue|64,ae):null;case 3:if(pu(),sr(Oo),sr(to),Fv(),64&(ue=ae.flags))throw Error(a(285));return ae.flags=-4097&ue|64,ae;case 5:return Dv(ae),null;case 13:return sr(vr),4096&(ue=ae.flags)?(ae.flags=-4097&ue|64,ae):null;case 19:return sr(vr),null;case 4:return pu(),null;case 10:return Mv(ae),null;case 23:case 24:return u_(),null;default:return null}}(P))!==null)return q.flags&=2047,void(Pr=q);C!==null&&(C.firstEffect=C.lastEffect=null,C.flags|=2048)}else{if((q=function(ae,ue,_e){var me=ue.pendingProps;switch(ue.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return Fo(ue.type)&&Cv(),null;case 3:return pu(),sr(Oo),sr(to),Fv(),(me=ue.stateNode).pendingContext&&(me.context=me.pendingContext,me.pendingContext=null),ae!==null&&ae.child!==null||($g(ue)?ue.flags|=4:me.hydrate||(ue.flags|=256)),null;case 5:Dv(ue);var He=Al(hf.current);if(_e=ue.type,ae!==null&&ue.stateNode!=null)FF(ae,ue,_e,me),ae.ref!==ue.ref&&(ue.flags|=128);else{if(!me){if(ue.stateNode===null)throw Error(a(166));return null}if(ae=Al(Ki.current),$g(ue)){me=ue.stateNode,_e=ue.type;var it,ft=ue.memoizedProps;switch(me[xa]=ue,me[Og]=ft,_e){case"dialog":Qn("cancel",me),Qn("close",me);break;case"iframe":case"object":case"embed":Qn("load",me);break;case"video":case"audio":for(ae=0;ae<of.length;ae++)Qn(of[ae],me);break;case"source":Qn("error",me);break;case"img":case"image":case"link":Qn("error",me),Qn("load",me);break;case"details":Qn("toggle",me);break;case"input":se(me,ft),Qn("invalid",me);break;case"select":me._wrapperState={wasMultiple:!!ft.multiple},Qn("invalid",me);break;case"textarea":ye(me,ft),Qn("invalid",me)}for(it in Oe(_e,ft),ae=null,ft)ft.hasOwnProperty(it)&&(He=ft[it],it==="children"?typeof He=="string"?me.textContent!==He&&(ae=["children",He]):typeof He=="number"&&me.textContent!==""+He&&(ae=["children",""+He]):l.hasOwnProperty(it)&&He!=null&&it==="onScroll"&&Qn("scroll",me));switch(_e){case"input":Z(me),we(me,ft,!0);break;case"textarea":Z(me),Ae(me);break;case"select":case"option":break;default:typeof ft.onClick=="function"&&(me.onclick=Eg)}me=ae,(ue.updateQueue=me)!==null&&(ue.flags|=4)}else{switch(it=He.nodeType===9?He:He.ownerDocument,(ae=ae===Ie?Te(_e):ae)===Ie?_e==="script"?((ae=it.createElement("div")).innerHTML="<script><\/script>",ae=ae.removeChild(ae.firstChild)):typeof me.is=="string"?ae=it.createElement(_e,{is:me.is}):(ae=it.createElement(_e),_e==="select"&&(it=ae,me.multiple?it.multiple=!0:me.size&&(it.size=me.size))):ae=it.createElementNS(ae,_e),ae[xa]=ue,ae[Og]=me,BF(ae,ue),ue.stateNode=ae,it=tt(_e,me),_e){case"dialog":Qn("cancel",ae),Qn("close",ae),He=me;break;case"iframe":case"object":case"embed":Qn("load",ae),He=me;break;case"video":case"audio":for(He=0;He<of.length;He++)Qn(of[He],ae);He=me;break;case"source":Qn("error",ae),He=me;break;case"img":case"image":case"link":Qn("error",ae),Qn("load",ae),He=me;break;case"details":Qn("toggle",ae),He=me;break;case"input":se(ae,me),He=te(ae,me),Qn("invalid",ae);break;case"option":He=je(ae,me);break;case"select":ae._wrapperState={wasMultiple:!!me.multiple},He=i({},me,{value:void 0}),Qn("invalid",ae);break;case"textarea":ye(ae,me),He=Me(ae,me),Qn("invalid",ae);break;default:He=me}Oe(_e,He);var Lt,kn=He;for(ft in kn)kn.hasOwnProperty(ft)&&(Lt=kn[ft],ft==="style"?Ze(ae,Lt):ft==="dangerouslySetInnerHTML"?(Lt=Lt?Lt.__html:void 0)!=null&&he(ae,Lt):ft==="children"?typeof Lt=="string"?_e==="textarea"&&Lt===""||de(ae,Lt):typeof Lt=="number"&&de(ae,""+Lt):ft!=="suppressContentEditableWarning"&&ft!=="suppressHydrationWarning"&&ft!=="autoFocus"&&(l.hasOwnProperty(ft)?Lt!=null&&ft==="onScroll"&&Qn("scroll",ae):Lt!=null&&x(ae,ft,Lt,it)));switch(_e){case"input":Z(ae),we(ae,me,!1);break;case"textarea":Z(ae),Ae(ae);break;case"option":me.value!=null&&ae.setAttribute("value",""+X(me.value));break;case"select":ae.multiple=!!me.multiple,(ft=me.value)!=null?Le(ae,!!me.multiple,ft,!1):me.defaultValue!=null&&Le(ae,!!me.multiple,me.defaultValue,!0);break;default:typeof He.onClick=="function"&&(ae.onclick=Eg)}q2(_e,me)&&(ue.flags|=4)}ue.ref!==null&&(ue.flags|=128)}return null;case 6:if(ae&&ue.stateNode!=null)$F(0,ue,ae.memoizedProps,me);else{if(typeof me!="string"&&ue.stateNode===null)throw Error(a(166));_e=Al(hf.current),Al(Ki.current),$g(ue)?(me=ue.stateNode,_e=ue.memoizedProps,me[xa]=ue,me.nodeValue!==_e&&(ue.flags|=4)):((me=(_e.nodeType===9?_e:_e.ownerDocument).createTextNode(me))[xa]=ue).stateNode=me}return null;case 13:return sr(vr),me=ue.memoizedState,64&ue.flags?(ue.lanes=_e,ue):(me=me!==null,_e=!1,ae===null?ue.memoizedProps.fallback!==void 0&&$g(ue):_e=ae.memoizedState!==null,me&&!_e&&2&ue.mode&&(ae===null&&ue.memoizedProps.unstable_avoidThisFallback!==!0||1&vr.current?Wr===0&&(Wr=3):(Wr!==0&&Wr!==3||(Wr=4),yo===null||!(134217727&wf)&&!(134217727&mu)||bu(yo,ro))),(me||_e)&&(ue.flags|=4),null);case 4:return pu(),ae===null&&z2(ue.stateNode.containerInfo),null;case 10:return Mv(ue),null;case 19:if(sr(vr),(me=ue.memoizedState)===null)return null;if(ft=!!(64&ue.flags),(it=me.rendering)===null)if(ft)xf(me,!1);else{if(Wr!==0||ae!==null&&64&ae.flags)for(ae=ue.child;ae!==null;){if((it=Fg(ae))!==null){for(ue.flags|=64,xf(me,!1),(ft=it.updateQueue)!==null&&(ue.updateQueue=ft,ue.flags|=4),me.lastEffect===null&&(ue.firstEffect=null),ue.lastEffect=me.lastEffect,me=_e,_e=ue.child;_e!==null;)ae=me,(ft=_e).flags&=2,ft.nextEffect=null,ft.firstEffect=null,(ft.lastEffect=null)===(it=ft.alternate)?(ft.childLanes=0,ft.lanes=ae,ft.child=null,ft.memoizedProps=null,ft.memoizedState=null,ft.updateQueue=null,ft.dependencies=null,ft.stateNode=null):(ft.childLanes=it.childLanes,ft.lanes=it.lanes,ft.child=it.child,ft.memoizedProps=it.memoizedProps,ft.memoizedState=it.memoizedState,ft.updateQueue=it.updateQueue,ft.type=it.type,ae=it.dependencies,ft.dependencies=ae===null?null:{lanes:ae.lanes,firstContext:ae.firstContext}),_e=_e.sibling;return hr(vr,1&vr.current|2),ue.child}ae=ae.sibling}me.tail!==null&&no()>o_&&(ue.flags|=64,xf(me,!(ft=!0)),ue.lanes=33554432)}else{if(!ft)if((ae=Fg(it))!==null){if(ue.flags|=64,ft=!0,(_e=ae.updateQueue)!==null&&(ue.updateQueue=_e,ue.flags|=4),xf(me,!0),me.tail===null&&me.tailMode==="hidden"&&!it.alternate&&!Wi)return(ue=ue.lastEffect=me.lastEffect)!==null&&(ue.nextEffect=null),null}else 2*no()-me.renderingStartTime>o_&&_e!==1073741824&&(ue.flags|=64,xf(me,!(ft=!0)),ue.lanes=33554432);me.isBackwards?(it.sibling=ue.child,ue.child=it):((_e=me.last)!==null?_e.sibling=it:ue.child=it,me.last=it)}return me.tail!==null?(_e=me.tail,me.rendering=_e,me.tail=_e.sibling,me.lastEffect=ue.lastEffect,me.renderingStartTime=no(),_e.sibling=null,ue=vr.current,hr(vr,ft?1&ue|2:1&ue),_e):null;case 23:case 24:return u_(),ae!==null&&ae.memoizedState!==null!=(ue.memoizedState!==null)&&me.mode!=="unstable-defer-without-hiding"&&(ue.flags|=4),null}throw Error(a(156,ue.tag))}(q,P,Il))!==null)return void(Pr=q);if((q=P).tag!==24&&q.tag!==23||q.memoizedState===null||1073741824&Il||!(4&q.mode)){for(var ie=0,oe=q.child;oe!==null;)ie|=oe.lanes|oe.childLanes,oe=oe.sibling;q.childLanes=ie}C!==null&&!(2048&C.flags)&&(C.firstEffect===null&&(C.firstEffect=P.firstEffect),P.lastEffect!==null&&(C.lastEffect!==null&&(C.lastEffect.nextEffect=P.firstEffect),C.lastEffect=P.lastEffect),1<P.flags&&(C.lastEffect!==null?C.lastEffect.nextEffect=P:C.firstEffect=P,C.lastEffect=P))}if((P=P.sibling)!==null)return void(Pr=P)}while(Pr=P=C,P!==null);Wr===0&&(Wr=5)}function _u(C){var P=uu();return kl(99,(function(q,ie){for(;Ma(),Sf!==null;);if(48&Cn)throw Error(a(327));var oe=q.finishedWork;if(oe===null)return null;if(q.finishedWork=null,q.finishedLanes=0,oe===q.current)throw Error(a(177));q.callbackNode=null;var ae=oe.lanes|oe.childLanes,ue=ae,_e=q.pendingLanes&~ue;q.pendingLanes=ue,q.suspendedLanes=0,q.pingedLanes=0,q.expiredLanes&=ue,q.mutableReadLanes&=ue,q.entangledLanes&=ue,ue=q.entanglements;for(var me,He=q.eventTimes,it=q.expirationTimes;0<_e;){var ft=31-hi(_e),Lt=1<<ft;ue[ft]=0,He[ft]=-1,it[ft]=-1,_e&=~Lt}if(Cs!==null&&!(24&ae)&&Cs.has(q)&&Cs.delete(q),q===yo&&(Pr=yo=null,ro=0),(ae=1<oe.flags?oe.lastEffect!==null?(oe.lastEffect.nextEffect=oe,oe.firstEffect):oe:oe.firstEffect)!==null){if(ue=Cn,Cn|=32,Qv.current=null,bv=Bo,hv(He=R2())){if("selectionStart"in He)it={start:He.selectionStart,end:He.selectionEnd};else e:if(it=(it=He.ownerDocument)&&it.defaultView||window,(Lt=it.getSelection&&it.getSelection())&&Lt.rangeCount!==0){it=Lt.anchorNode,_e=Lt.anchorOffset,ft=Lt.focusNode,Lt=Lt.focusOffset;try{it.nodeType,ft.nodeType}catch{it=null;break e}var kn=0,Ve=-1,rt=-1,mt=0,Bt=0,Dt=He,tn=null;t:for(;;){for(;Dt!==it||_e!==0&&Dt.nodeType!==3||(Ve=kn+_e),Dt!==ft||Lt!==0&&Dt.nodeType!==3||(rt=kn+Lt),Dt.nodeType===3&&(kn+=Dt.nodeValue.length),(me=Dt.firstChild)!==null;)tn=Dt,Dt=me;for(;;){if(Dt===He)break t;if(tn===it&&++mt===_e&&(Ve=kn),tn===ft&&++Bt===Lt&&(rt=kn),(me=Dt.nextSibling)!==null)break;tn=(Dt=tn).parentNode}Dt=me}it=Ve===-1||rt===-1?null:{start:Ve,end:rt}}else it=null;it=it||{start:0,end:0}}else it=null;Of=null,Xg=Bo=!(vv={focusedElem:He,selectionRange:it}),en=ae;do try{(function(){for(;en!==null;){var Mn=en.alternate,Sn=(Xg||Of===null||(8&en.flags?pe(en,Of)&&(Xg=!0):en.tag===13&&function(er,gr){return er!==null&&((er=er.memoizedState)===null||er.dehydrated!==null)&&(gr=gr.memoizedState)!==null&&gr.dehydrated===null}(Mn,en)&&pe(en,Of)&&(Xg=!0)),en.flags);256&Sn&&function(er,gr){switch(gr.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:var ei,Vi;return 256&gr.flags&&er!==null&&(ei=er.memoizedProps,Vi=er.memoizedState,gr=(er=gr.stateNode).getSnapshotBeforeUpdate(gr.elementType===gr.type?ei:yi(gr.type,ei),Vi),er.__reactInternalSnapshotBeforeUpdate=gr);case 3:return 256&gr.flags&&xv(gr.stateNode.containerInfo)}throw Error(a(163))}(Mn,en),!(512&Sn)||Na||(Na=!0,cf(97,function(){return Ma(),null})),en=en.nextEffect}})()}catch(Mn){if(en===null)throw Error(a(330));Ia(en,Mn),en=en.nextEffect}while(en!==null);Of=null,en=ae;do try{for(He=q;en!==null;){var yn,sn,nn=en.flags;switch(16&nn&&de(en.stateNode,""),128&nn&&(yn=en.alternate)!==null&&(sn=yn.ref)!==null&&(typeof sn=="function"?sn(null):sn.current=null),1038&nn){case 2:GT(en),en.flags&=-3;break;case 6:GT(en),en.flags&=-3,Zv(en.alternate,en);break;case 1024:en.flags&=-1025;break;case 1028:en.flags&=-1025,Zv(en.alternate,en);break;case 4:Zv(en.alternate,en);break;case 8:YT(He,it=en);var jn=it.alternate;JT(it),jn!==null&&JT(jn)}en=en.nextEffect}}catch(Mn){if(en===null)throw Error(a(330));Ia(en,Mn),en=en.nextEffect}while(en!==null);if(sn=vv,yn=R2(),nn=sn.focusedElem,He=sn.selectionRange,yn!==nn&&nn&&nn.ownerDocument&&function Mn(Sn,er){return!(!Sn||!er)&&(Sn===er||(!Sn||Sn.nodeType!==3)&&(er&&er.nodeType===3?Mn(Sn,er.parentNode):"contains"in Sn?Sn.contains(er):!!Sn.compareDocumentPosition&&!!(16&Sn.compareDocumentPosition(er))))}(nn.ownerDocument.documentElement,nn)){for(He!==null&&hv(nn)&&(yn=He.start,(sn=He.end)===void 0&&(sn=yn),"selectionStart"in nn?(nn.selectionStart=yn,nn.selectionEnd=Math.min(sn,nn.value.length)):(sn=(yn=nn.ownerDocument||document)&&yn.defaultView||window).getSelection&&(sn=sn.getSelection(),it=nn.textContent.length,jn=Math.min(He.start,it),He=He.end===void 0?jn:Math.min(He.end,it),!sn.extend&&He<jn&&(it=He,He=jn,jn=it),it=I2(nn,jn),_e=I2(nn,He),it&&_e&&(sn.rangeCount!==1||sn.anchorNode!==it.node||sn.anchorOffset!==it.offset||sn.focusNode!==_e.node||sn.focusOffset!==_e.offset)&&((yn=yn.createRange()).setStart(it.node,it.offset),sn.removeAllRanges(),He<jn?(sn.addRange(yn),sn.extend(_e.node,_e.offset)):(yn.setEnd(_e.node,_e.offset),sn.addRange(yn))))),yn=[],sn=nn;sn=sn.parentNode;)sn.nodeType===1&&yn.push({element:sn,left:sn.scrollLeft,top:sn.scrollTop});for(typeof nn.focus=="function"&&nn.focus(),nn=0;nn<yn.length;nn++)(sn=yn[nn]).element.scrollLeft=sn.left,sn.element.scrollTop=sn.top}Bo=!!bv,vv=bv=null,q.current=oe,en=ae;do try{for(nn=q;en!==null;){var zn,qn,En=en.flags;36&En&&HF(nn,en.alternate,en),128&En&&(yn=void 0,(zn=en.ref)!==null&&(qn=en.stateNode,en.tag,yn=qn,typeof zn=="function"?zn(yn):zn.current=yn)),en=en.nextEffect}}catch(Mn){if(en===null)throw Error(a(330));Ia(en,Mn),en=en.nextEffect}while(en!==null);en=null,MF(),Cn=ue}else q.current=oe;if(Na)Na=!1,Sf=q,Cf=ie;else for(en=ae;en!==null;)ie=en.nextEffect,en.nextEffect=null,8&en.flags&&((En=en).sibling=null,En.stateNode=null),en=ie;if((ae=q.pendingLanes)===0&&(Ji=null),ae===1?q===l_?Ef++:(Ef=0,l_=q):Ef=0,oe=oe.stateNode,Nl&&typeof Nl.onCommitFiberRoot=="function")try{Nl.onCommitFiberRoot(Ev,oe,void 0,!(64&~oe.current.flags))}catch{}if(Zo(q,no()),Vg)throw Vg=!1,q=i_,i_=null,q;return 8&Cn||Hi(),null}).bind(null,C,P)),null}function Ma(){var C;return Cf!==90&&(C=97<Cf?97:Cf,Cf=90,kl(C,WF))}function sN(C,P){a_.push(P,C),Na||(Na=!0,cf(97,function(){return Ma(),null}))}function WF(){if(Sf===null)return!1;var C=Sf;if(Sf=null,48&Cn)throw Error(a(331));var P=Cn,q=(Cn|=32,a_);a_=[];for(var ie=0;ie<q.length;ie+=2){var oe=q[ie],ae=q[ie+1],ue=oe.destroy;if(oe.destroy=void 0,typeof ue=="function")try{ue()}catch(me){if(ae===null)throw Error(a(330));Ia(ae,me)}}for(q=s_,s_=[],ie=0;ie<q.length;ie+=2){oe=q[ie],ae=q[ie+1];try{var _e=oe.create;oe.destroy=_e()}catch(me){if(ae===null)throw Error(a(330));Ia(ae,me)}}for(_e=C.current.firstEffect;_e!==null;)C=_e.nextEffect,_e.nextEffect=null,8&_e.flags&&(_e.sibling=null,_e.stateNode=null),_e=C;return Cn=P,Hi(),!0}function aN(C,P,q){Oa(C,P=UT(0,P=Yv(q,P),1)),P=zo(),(C=Zg(C,1))!==null&&(fl(C,1,P),Zo(C,P))}function Ia(C,P){if(C.tag===3)aN(C,C,P);else for(var q=C.return;q!==null;){if(q.tag===3){aN(q,C,P);break}if(q.tag===1){var ie,oe=q.stateNode;if(typeof q.type.getDerivedStateFromError=="function"||typeof oe.componentDidCatch=="function"&&(Ji===null||!Ji.has(oe))){if(Oa(q,HT(q,C=Yv(P,C),1)),ie=zo(),(q=Zg(q,1))!==null)fl(q,1,ie),Zo(q,ie);else if(typeof oe.componentDidCatch=="function"&&(Ji===null||!Ji.has(oe)))try{oe.componentDidCatch(P,C)}catch{}break}}q=q.return}}function qF(C,P,q){var ie=C.pingCache;ie!==null&&ie.delete(P),P=zo(),C.pingedLanes|=C.suspendedLanes&q,yo===C&&(ro&q)===q&&(Wr===4||Wr===3&&(62914560&ro)===ro&&no()-r_<500?vu(C,0):t_|=q),Zo(C,P)}function JF(C,P,q,ie){this.tag=C,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=P,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ie,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Qo(C,P,q,ie){return new JF(C,P,q,ie)}function d_(C){return(C=C.prototype)&&C.isReactComponent}function Ra(C,P){var q=C.alternate;return q===null?((q=Qo(C.tag,P,C.key,C.mode)).elementType=C.elementType,q.type=C.type,q.stateNode=C.stateNode,(q.alternate=C).alternate=q):(q.pendingProps=P,q.type=C.type,q.flags=0,q.nextEffect=null,q.firstEffect=null,q.lastEffect=null),q.childLanes=C.childLanes,q.lanes=C.lanes,q.child=C.child,q.memoizedProps=C.memoizedProps,q.memoizedState=C.memoizedState,q.updateQueue=C.updateQueue,P=C.dependencies,q.dependencies=P===null?null:{lanes:P.lanes,firstContext:P.firstContext},q.sibling=C.sibling,q.index=C.index,q.ref=C.ref,q}function em(C,P,q,ie,oe,ae){var ue=2;if(typeof(ie=C)=="function")d_(C)&&(ue=1);else if(typeof C=="string")ue=5;else e:switch(C){case A:return xu(q.children,oe,ae,P);case V:ue=8,oe|=16;break;case T:ue=8,oe|=1;break;case I:return(C=Qo(12,q,P,8|oe)).elementType=I,C.type=I,C.lanes=ae,C;case U:return(C=Qo(13,q,P,oe)).type=U,C.elementType=U,C.lanes=ae,C;case D:return(C=Qo(19,q,P,oe)).elementType=D,C.lanes=ae,C;case G:return f_(q,oe,ae,P);case F:return(C=Qo(24,q,P,oe)).elementType=F,C.lanes=ae,C;default:if(typeof C=="object"&&C!==null)switch(C.$$typeof){case k:ue=10;break e;case $:ue=9;break e;case H:ue=11;break e;case W:ue=14;break e;case J:ue=16,ie=null;break e;case M:ue=22;break e}throw Error(a(130,C==null?C:typeof C,""))}return(P=Qo(ue,q,P,oe)).elementType=C,P.type=ie,P.lanes=ae,P}function xu(C,P,q,ie){return(C=Qo(7,C,ie,P)).lanes=q,C}function f_(C,P,q,ie){return(C=Qo(23,C,ie,P)).elementType=G,C.lanes=q,C}function p_(C,P,q){return(C=Qo(6,C,null,P)).lanes=q,C}function h_(C,P,q){return(P=Qo(4,C.children!==null?C.children:[],C.key,P)).lanes=q,P.stateNode={containerInfo:C.containerInfo,pendingChildren:null,implementation:C.implementation},P}function VF(C,P,q){this.tag=P,this.containerInfo=C,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=q,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=eo(0),this.expirationTimes=eo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eo(0),this.mutableSourceEagerHydrationData=null}function tm(C,P,q,ie){var oe=P.current,ae=zo(),ue=Aa(oe);e:if(q){t:{if(kt(q=q._reactInternals)!==q||q.tag!==1)throw Error(a(170));var _e=q;do switch(_e.tag){case 3:_e=_e.stateNode.context;break t;case 1:if(Fo(_e.type)){_e=_e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}while((_e=_e.return)!==null);throw Error(a(171))}if(q.tag===1){var me=q.type;if(Fo(me)){q=Z2(q,me,_e);break e}}q=_e}else q=Sa;P.context===null?P.context=q:P.pendingContext=q,(P=Ea(ae,ue)).payload={element:C},(ie=ie===void 0?null:ie)!==null&&(P.callback=ie),Oa(oe,P),Pa(oe,ue,ae)}function g_(C){return(C=C.current).child?(C.child.tag,C.child.stateNode):null}function lN(C,P){var q;(C=C.memoizedState)!==null&&C.dehydrated!==null&&(q=C.retryLane,C.retryLane=q!==0&&q<P?q:P)}function m_(C,P){lN(C,P),(C=C.alternate)&&lN(C,P)}function y_(C,P,q){var ie=q!=null&&q.hydrationOptions!=null&&q.hydrationOptions.mutableSources||null;if(q=new VF(C,P,q!=null&&q.hydrate===!0),P=Qo(3,null,null,P===2?7:P===1?3:0),(q.current=P).stateNode=q,Iv(P),C[au]=q.current,z2(C.nodeType===8?C.parentNode:C),ie)for(C=0;C<ie.length;C++){var oe=(oe=(P=ie[C])._getVersion)(P._source);q.mutableSourceEagerHydrationData==null?q.mutableSourceEagerHydrationData=[P,oe]:q.mutableSourceEagerHydrationData.push(P,oe)}this._internalRoot=q}function Nf(C){return C&&(C.nodeType===1||C.nodeType===9||C.nodeType===11||C.nodeType===8&&C.nodeValue===" react-mount-point-unstable ")}function nm(C,P,q,ie,oe){var ae,ue,_e,me=q._reactRootContainer;return me?(_e=me._internalRoot,typeof oe=="function"&&(ae=oe,oe=function(){var He=g_(_e);ae.call(He)}),tm(P,_e,C,oe)):(_e=(me=q._reactRootContainer=function(He,it){if(!(it=it||!(!(it=He?He.nodeType===9?He.documentElement:He.firstChild:null)||it.nodeType!==1||!it.hasAttribute("data-reactroot"))))for(var ft;ft=He.lastChild;)He.removeChild(ft);return new y_(He,0,it?{hydrate:!0}:void 0)}(q,ie))._internalRoot,typeof oe=="function"&&(ue=oe,oe=function(){var He=g_(_e);ue.call(He)}),tN(function(){tm(P,_e,C,oe)})),g_(_e)}function cN(C,P){if(Nf(P))return function(q,ie,oe,ae){return{$$typeof:j,key:(ae=3<arguments.length&&ae!==void 0?ae:null)==null?null:""+ae,children:q,containerInfo:ie,implementation:oe}}(C,P,null,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null);throw Error(a(200))}ZT=function(C,P,q){var ie=P.lanes;if(C!==null)if(C.memoizedProps!==P.pendingProps||Oo.current)bi=!0;else{if(!(q&ie)){switch(bi=!1,P.tag){case 3:LT(P),Bv();break;case 5:yT(P);break;case 1:Fo(P.type)&&Ng(P);break;case 4:jv(P,P.stateNode.containerInfo);break;case 10:ie=P.memoizedProps.value;var oe=P.type._context;hr(Pg,oe._currentValue),oe._currentValue=ie;break;case 13:if(P.memoizedState!==null)return q&P.child.childLanes?BT(C,P,q):(hr(vr,1&vr.current),(P=Ss(C,P,q))!==null?P.sibling:null);hr(vr,1&vr.current);break;case 19:if(ie=!!(q&P.childLanes),64&C.flags){if(ie)return zT(C,P,q);P.flags|=64}if((oe=P.memoizedState)!==null&&(oe.rendering=null,oe.tail=null,oe.lastEffect=null),hr(vr,vr.current),ie)break;return null;case 23:case 24:return P.lanes=0,RT(C,P,q)}return Ss(C,P,q)}bi=!!(16384&C.flags)}else bi=!1;switch(P.lanes=0,P.tag){case 2:return ie=P.type,C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),C=P.pendingProps,oe=cu(P,to.current),fu(P,q),oe=zv(null,P,ie,C,oe,q),P.flags|=1,typeof oe=="object"&&oe!==null&&typeof oe.render=="function"&&oe.$$typeof===void 0?(P.tag=1,P.memoizedState=null,P.updateQueue=null,Fo(ie)?(ae=!0,Ng(P)):ae=!1,P.memoizedState=oe.state!==null&&oe.state!==void 0?oe.state:null,Iv(P),typeof(me=ie.getDerivedStateFromProps)=="function"&&Rg(P,0,me,C),oe.updater=jg,Rv((P.stateNode=oe)._reactInternals=P,ie,C,q),Jv(null,P,ie,!0,ae,q)):(P.tag=0,$o(null,P,oe,q),P.child);case 16:oe=P.elementType;e:{switch(C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),C=P.pendingProps,oe=(ae=oe._init)(oe._payload),P.type=oe,ae=P.tag=function(it){if(typeof it=="function")return d_(it)?1:0;if(it!=null){if((it=it.$$typeof)===H)return 11;if(it===W)return 14}return 2}(oe),C=yi(oe,C),ae){case 0:P=qv(null,P,oe,C,q);break e;case 1:P=DT(null,P,oe,C,q);break e;case 11:P=PT(null,P,oe,C,q);break e;case 14:P=MT(null,P,oe,yi(oe.type,C),ie,q);break e}throw Error(a(306,oe,""))}return P;case 0:return ie=P.type,oe=P.pendingProps,qv(C,P,ie,oe=P.elementType===ie?oe:yi(ie,oe),q);case 1:return ie=P.type,oe=P.pendingProps,DT(C,P,ie,oe=P.elementType===ie?oe:yi(ie,oe),q);case 3:if(LT(P),ie=P.updateQueue,C===null||ie===null)throw Error(a(282));if(ie=P.pendingProps,oe=(oe=P.memoizedState)!==null?oe.element:null,lT(C,P),uf(P,ie,null,q),(ie=P.memoizedState.element)===oe)Bv(),P=Ss(C,P,q);else{if((ae=(oe=P.stateNode).hydrate)&&(Ta=su(P.stateNode.containerInfo.firstChild),ws=P,ae=Wi=!0),ae){if((C=oe.mutableSourceEagerHydrationData)!=null)for(oe=0;oe<C.length;oe+=2)(ae=C[oe])._workInProgressVersionPrimary=C[oe+1],hu.push(ae);for(q=mT(P,null,ie,q),P.child=q;q;)q.flags=-3&q.flags|1024,q=q.sibling}else $o(C,P,ie,q),Bv();P=P.child}return P;case 5:return yT(P),C===null&&Lv(P),ie=P.type,oe=P.pendingProps,ae=C!==null?C.memoizedProps:null,me=oe.children,_v(ie,oe)?me=null:ae!==null&&_v(ie,ae)&&(P.flags|=16),jT(C,P),$o(C,P,me,q),P.child;case 6:return C===null&&Lv(P),null;case 13:return BT(C,P,q);case 4:return jv(P,P.stateNode.containerInfo),ie=P.pendingProps,C===null?P.child=Bg(P,null,ie,q):$o(C,P,ie,q),P.child;case 11:return ie=P.type,oe=P.pendingProps,PT(C,P,ie,oe=P.elementType===ie?oe:yi(ie,oe),q);case 7:return $o(C,P,P.pendingProps,q),P.child;case 8:case 12:return $o(C,P,P.pendingProps.children,q),P.child;case 10:e:{ie=P.type._context,oe=P.pendingProps,me=P.memoizedProps;var ae=oe.value,ue=P.type._context;if(hr(Pg,ue._currentValue),ue._currentValue=ae,me!==null)if(ue=me.value,(ae=Or(ue,ae)?0:0|(typeof ie._calculateChangedBits=="function"?ie._calculateChangedBits(ue,ae):1073741823))==0){if(me.children===oe.children&&!Oo.current){P=Ss(C,P,q);break e}}else for((ue=P.child)!==null&&(ue.return=P);ue!==null;){var _e=ue.dependencies;if(_e!==null)for(var me=ue.child,He=_e.firstContext;He!==null;){if(He.context===ie&&He.observedBits&ae){ue.tag===1&&((He=Ea(-1,q&-q)).tag=2,Oa(ue,He)),ue.lanes|=q,(He=ue.alternate)!==null&&(He.lanes|=q),aT(ue.return,q),_e.lanes|=q;break}He=He.next}else me=ue.tag===10&&ue.type===P.type?null:ue.child;if(me!==null)me.return=ue;else for(me=ue;me!==null;){if(me===P){me=null;break}if((ue=me.sibling)!==null){ue.return=me.return,me=ue;break}me=me.return}ue=me}$o(C,P,oe.children,q),P=P.child}return P;case 9:return oe=P.type,ie=(ae=P.pendingProps).children,fu(P,q),ie=ie(oe=Yo(oe,ae.unstable_observedBits)),P.flags|=1,$o(C,P,ie,q),P.child;case 14:return ae=yi(oe=P.type,P.pendingProps),MT(C,P,oe,ae=yi(oe.type,ae),ie,q);case 15:return IT(C,P,P.type,P.pendingProps,ie,q);case 17:return ie=P.type,oe=P.pendingProps,oe=P.elementType===ie?oe:yi(ie,oe),C!==null&&(C.alternate=null,P.alternate=null,P.flags|=2),P.tag=1,Fo(ie)?(C=!0,Ng(P)):C=!1,fu(P,q),pT(P,ie,oe),Rv(P,ie,oe,q),Jv(null,P,ie,!0,C,q);case 19:return zT(C,P,q);case 23:case 24:return RT(C,P,q)}throw Error(a(156,P.tag))},y_.prototype.render=function(C){tm(C,this._internalRoot,null,null)},y_.prototype.unmount=function(){var C=this._internalRoot,P=C.containerInfo;tm(null,C,null,function(){P[au]=null})},De=function(C){C.tag===13&&(Pa(C,4,zo()),m_(C,4))},Ue=function(C){C.tag===13&&(Pa(C,67108864,zo()),m_(C,67108864))},Ke=function(C){var P,q;C.tag===13&&(P=zo(),Pa(C,q=Aa(C),P),m_(C,q))},$t=function(C,P,q){switch(P){case"input":if(ge(C,q),P=q.name,q.type==="radio"&&P!=null){for(q=C;q.parentNode;)q=q.parentNode;for(q=q.querySelectorAll("input[name="+JSON.stringify(""+P)+'][type="radio"]'),P=0;P<q.length;P++){var ie=q[P];if(ie!==C&&ie.form===C.form){var oe=Tg(ie);if(!oe)throw Error(a(90));ee(ie),ge(ie,oe)}}}break;case"textarea":ke(C,q);break;case"select":(P=q.value)!=null&&Le(C,!!q.multiple,P,!1)}},Tn=eN,Ne=function(C,P,q,ie,oe){var ae=Cn;Cn|=4;try{return kl(98,C.bind(null,P,q,ie,oe))}finally{(Cn=ae)===0&&(yu(),Hi())}};var GF=function(C,P){var q=Cn;Cn|=2;try{return C(P)}finally{(Cn=q)===0&&(yu(),Hi())}};if(Br={Events:[af,lu,Tg,jt,qt,Ma,{current:!(lt=function(){var C;!(49&Cn)&&(Cs!==null&&(C=Cs,Cs=null,C.forEach(function(P){P.expiredLanes|=24&P.pendingLanes,Zo(P,no())})),Hi(),Ma())})}]},Dn={bundleType:(e={findFiberByHostInstance:Ol,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"}).bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(C){return(C=vt(C))===null?null:C.stateNode},findFiberByHostInstance:e.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&!(lr=__REACT_DEVTOOLS_GLOBAL_HOOK__).isDisabled&&lr.supportsFiber)try{Ev=lr.inject(Dn),Nl=lr}catch{}r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Br,r.createPortal=cN,r.findDOMNode=function(C){if(C==null)return null;if(C.nodeType===1)return C;var P=C._reactInternals;if(P!==void 0)return(C=vt(P))===null?null:C.stateNode;throw typeof C.render=="function"?Error(a(188)):Error(a(268,Object.keys(C)))},r.flushSync=function(C,P){var q=Cn;if(48&q)return C(P);Cn|=1;try{if(C)return kl(99,C.bind(null,P))}finally{Cn=q,Hi()}},r.hydrate=function(C,P,q){if(Nf(P))return nm(null,C,P,!0,q);throw Error(a(200))},r.render=function(C,P,q){if(Nf(P))return nm(null,C,P,!1,q);throw Error(a(200))},r.unmountComponentAtNode=function(C){if(Nf(C))return!!C._reactRootContainer&&(tN(function(){nm(null,null,C,!1,function(){C._reactRootContainer=null,C[au]=null})}),!0);throw Error(a(40))},r.unstable_batchedUpdates=eN,r.unstable_createPortal=function(C,P){return cN(C,P,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)},r.unstable_renderSubtreeIntoContainer=function(C,P,q,ie){if(!Nf(q))throw Error(a(200));if(C==null||C._reactInternals===void 0)throw Error(a(38));return nm(C,P,q,!1,ie)},r.version="17.0.2"},{"object-assign":385,react:408,scheduler:414}],401:[function(e,s,r){(function o(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE=="function")try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(i){console.error(i)}})(),s.exports=e("./cjs/react-dom.production.min.js")},{"./cjs/react-dom.development.js":399,"./cjs/react-dom.production.min.js":400}],402:[function(e,s,r){(function(o){(function(){function i(J){if(typeof J=="object"&&J!==null){var M=J.$$typeof;switch(M){case u:var z=J.type;switch(z){case f:case d:case l:case g:case y:return z;default:var V=z&&z.$$typeof;switch(V){case h:case m:case v:case b:case p:return V;default:return M}}case a:return M}}}var u,a,f,l,d,p,h,m,g,y,b,v,_,w,x,S,E,O,j,A,T,I,k,$,H,U,D,W;o.env.NODE_ENV!=="production"&&(u=60103,a=60106,f=60107,l=60108,d=60114,p=60109,h=60110,m=60112,g=60113,y=60120,b=60115,v=60116,_=60121,w=60122,x=60117,S=60129,E=60131,typeof Symbol=="function"&&Symbol.for&&(u=(O=Symbol.for)("react.element"),a=O("react.portal"),f=O("react.fragment"),l=O("react.strict_mode"),d=O("react.profiler"),p=O("react.provider"),h=O("react.context"),m=O("react.forward_ref"),g=O("react.suspense"),y=O("react.suspense_list"),b=O("react.memo"),v=O("react.lazy"),_=O("react.block"),w=O("react.server.block"),x=O("react.fundamental"),O("react.scope"),O("react.opaque.id"),S=O("react.debug_trace_mode"),O("react.offscreen"),E=O("react.legacy_hidden")),O=h,j=p,A=u,T=m,I=f,k=v,$=b,H=a,U=d,D=l,W=g,r.ContextConsumer=O,r.ContextProvider=j,r.Element=A,r.ForwardRef=T,r.Fragment=I,r.Lazy=k,r.Memo=$,r.Portal=H,r.Profiler=U,r.StrictMode=D,r.Suspense=W,r.isAsyncMode=function(J){return!1},r.isConcurrentMode=function(J){return!1},r.isContextConsumer=function(J){return i(J)===h},r.isContextProvider=function(J){return i(J)===p},r.isElement=function(J){return typeof J=="object"&&J!==null&&J.$$typeof===u},r.isForwardRef=function(J){return i(J)===m},r.isFragment=function(J){return i(J)===f},r.isLazy=function(J){return i(J)===v},r.isMemo=function(J){return i(J)===b},r.isPortal=function(J){return i(J)===a},r.isProfiler=function(J){return i(J)===d},r.isStrictMode=function(J){return i(J)===l},r.isSuspense=function(J){return i(J)===g},r.isValidElementType=function(J){return typeof J=="string"||typeof J=="function"||J===f||J===d||J===S||J===l||J===g||J===y||J===E||typeof J=="object"&&J!==null&&(J.$$typeof===v||J.$$typeof===b||J.$$typeof===p||J.$$typeof===h||J.$$typeof===m||J.$$typeof===x||J.$$typeof===_||J[0]===w)},r.typeOf=i)}).call(this)}).call(this,e("_process"))},{_process:386}],403:[function(e,s,r){var o=60103,i=60106,u=60107,a=60108,f=60114,l=60109,d=60110,p=60112,h=60113,m=60120,g=60115,y=60116,b=60121,v=60122,_=60117,w=60129,x=60131;function S(D){if(typeof D=="object"&&D!==null){var W=D.$$typeof;switch(W){case o:switch(D=D.type){case u:case f:case a:case h:case m:return D;default:switch(D=D&&D.$$typeof){case d:case p:case y:case g:case l:return D;default:return W}}case i:return W}}}typeof Symbol=="function"&&Symbol.for&&(o=(E=Symbol.for)("react.element"),i=E("react.portal"),u=E("react.fragment"),a=E("react.strict_mode"),f=E("react.profiler"),l=E("react.provider"),d=E("react.context"),p=E("react.forward_ref"),h=E("react.suspense"),m=E("react.suspense_list"),g=E("react.memo"),y=E("react.lazy"),b=E("react.block"),v=E("react.server.block"),_=E("react.fundamental"),w=E("react.debug_trace_mode"),x=E("react.legacy_hidden"));var E=l,O=o,j=p,A=u,T=y,I=g,k=i,$=f,H=a,U=h;r.ContextConsumer=d,r.ContextProvider=E,r.Element=O,r.ForwardRef=j,r.Fragment=A,r.Lazy=T,r.Memo=I,r.Portal=k,r.Profiler=$,r.StrictMode=H,r.Suspense=U,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(D){return S(D)===d},r.isContextProvider=function(D){return S(D)===l},r.isElement=function(D){return typeof D=="object"&&D!==null&&D.$$typeof===o},r.isForwardRef=function(D){return S(D)===p},r.isFragment=function(D){return S(D)===u},r.isLazy=function(D){return S(D)===y},r.isMemo=function(D){return S(D)===g},r.isPortal=function(D){return S(D)===i},r.isProfiler=function(D){return S(D)===f},r.isStrictMode=function(D){return S(D)===a},r.isSuspense=function(D){return S(D)===h},r.isValidElementType=function(D){return typeof D=="string"||typeof D=="function"||D===u||D===f||D===w||D===a||D===h||D===m||D===x||typeof D=="object"&&D!==null&&(D.$$typeof===y||D.$$typeof===g||D.$$typeof===l||D.$$typeof===d||D.$$typeof===p||D.$$typeof===_||D.$$typeof===b||D[0]===v)},r.typeOf=S},{}],404:[function(e,s,r){arguments[4][381][0].apply(r,arguments)},{"./cjs/react-is.development.js":402,"./cjs/react-is.production.min.js":403,_process:386,dup:381}],405:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0});var o=Object.assign||function(f){for(var l=1;l<arguments.length;l++){var d,p=arguments[l];for(d in p)Object.prototype.hasOwnProperty.call(p,d)&&(f[d]=p[d])}return f},i=u(e("react"));function u(f){return f&&f.__esModule?f:{default:f}}e=u(e("localized-strings"));var a=/(\{[\d|\w]+\})/;e.default.prototype.formatString=function(f){for(var l=arguments.length,d=Array(1<l?l-1:0),p=1;p<l;p++)d[p-1]=arguments[p];var h=!1;return f=(f||"").split(a).filter(function(m){return!!m}).map(function(m,g){if(m.match(a)){var y=m.slice(1,-1),b=d[y];if(b==null){if((y=d[0][y])===void 0)return b;b=y}return i.default.isValidElement(b)?(h=!0,i.default.Children.toArray(b).map(function(v){return o({},v,{key:g.toString()})})):b}return m}),h?f:f.join("")},r.default=e.default},{"localized-strings":383,react:408}],406:[function(e,s,r){},{"object-assign":385}],407:[function(e,s,r){var o=e("object-assign"),i=60103,u=60106,a=(r.Fragment=60107,r.StrictMode=60108,r.Profiler=60114,60109),f=60110,l=60112,d=(r.Suspense=60113,60115),p=60116,h=(typeof Symbol=="function"&&Symbol.for&&(i=(e=Symbol.for)("react.element"),u=e("react.portal"),r.Fragment=e("react.fragment"),r.StrictMode=e("react.strict_mode"),r.Profiler=e("react.profiler"),a=e("react.provider"),f=e("react.context"),l=e("react.forward_ref"),r.Suspense=e("react.suspense"),d=e("react.memo"),p=e("react.lazy")),typeof Symbol=="function"&&Symbol.iterator);function m(U){for(var D="https://reactjs.org/docs/error-decoder.html?invariant="+U,W=1;W<arguments.length;W++)D+="&args[]="+encodeURIComponent(arguments[W]);return"Minified React error #"+U+"; visit "+D+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function b(U,D,W){this.props=U,this.context=D,this.refs=y,this.updater=W||g}function v(){}function _(U,D,W){this.props=U,this.context=D,this.refs=y,this.updater=W||g}b.prototype.isReactComponent={},b.prototype.setState=function(U,D){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error(m(85));this.updater.enqueueSetState(this,U,D,"setState")},b.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")},v.prototype=b.prototype;var w=((e=_.prototype=new v).constructor=_,o(e,b.prototype),e.isPureReactComponent=!0,{current:null}),x=Object.prototype.hasOwnProperty,S={key:!0,ref:!0,__self:!0,__source:!0};function E(U,D,W){var J,M={},z=null,V=null;if(D!=null)for(J in D.ref!==void 0&&(V=D.ref),D.key!==void 0&&(z=""+D.key),D)x.call(D,J)&&!S.hasOwnProperty(J)&&(M[J]=D[J]);var G=arguments.length-2;if(G===1)M.children=W;else if(1<G){for(var F=Array(G),K=0;K<G;K++)F[K]=arguments[K+2];M.children=F}if(U&&U.defaultProps)for(J in G=U.defaultProps)M[J]===void 0&&(M[J]=G[J]);return{$$typeof:i,type:U,key:z,ref:V,props:M,_owner:w.current}}function O(U){return typeof U=="object"&&U!==null&&U.$$typeof===i}var j=/\/+/g;function A(U,D){return typeof U=="object"&&U!==null&&U.key!=null?(U=""+U.key,W={"=":"=0",":":"=2"},"$"+U.replace(/[=:]/g,function(J){return W[J]})):D.toString(36);var W}function T(U,D,W,J,M){var z,V,G=!1;if((U=(K=typeof U)!="undefined"&&K!=="boolean"?U:null)===null)G=!0;else switch(K){case"string":case"number":G=!0;break;case"object":switch(U.$$typeof){case i:case u:G=!0}}if(G)return M=M(G=U),U=J===""?"."+A(G,0):J,Array.isArray(M)?(W="",T(M,D,W=U!=null?U.replace(j,"$&/")+"/":W,"",function(R){return R})):M!=null&&(O(M)&&(V=W+(!(z=M).key||G&&G.key===M.key?"":(""+M.key).replace(j,"$&/")+"/")+U,M={$$typeof:i,type:z.type,key:V,ref:z.ref,props:z.props,_owner:z._owner}),D.push(M)),1;if(G=0,J=J===""?".":J+":",Array.isArray(U))for(var F=0;F<U.length;F++){var K,N=J+A(K=U[F],F);G+=T(K,D,W,N,M)}else if(typeof(N=(V=U)!==null&&typeof V=="object"&&typeof(V=h&&V[h]||V["@@iterator"])=="function"?V:null)=="function")for(U=N.call(U),F=0;!(K=U.next()).done;)G+=T(K=K.value,D,W,N=J+A(K,F++),M);else if(K==="object")throw D=""+U,Error(m(31,D==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":D));return G}function I(U,D,W){if(U==null)return U;var J=[],M=0;return T(U,J,"","",function(z){return D.call(W,z,M++)}),J}function k(U){var D;if(U._status===-1&&(D=(D=U._result)(),U._status=0,(U._result=D).then(function(W){U._status===0&&(W=W.default,U._status=1,U._result=W)},function(W){U._status===0&&(U._status=2,U._result=W)})),U._status===1)return U._result;throw U._result}var $={current:null};function H(){var U=$.current;if(U===null)throw Error(m(321));return U}e={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:o},r.Children={map:I,forEach:function(U,D,W){I(U,function(){D.apply(this,arguments)},W)},count:function(U){var D=0;return I(U,function(){D++}),D},toArray:function(U){return I(U,function(D){return D})||[]},only:function(U){if(O(U))return U;throw Error(m(143))}},r.Component=b,r.PureComponent=_,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e,r.cloneElement=function(U,D,W){if(U==null)throw Error(m(267,U));var J=o({},U.props),M=U.key,z=U.ref,V=U._owner;if(D!=null)for(G in D.ref!==void 0&&(z=D.ref,V=w.current),D.key!==void 0&&(M=""+D.key),U.type&&U.type.defaultProps&&(F=U.type.defaultProps),D)x.call(D,G)&&!S.hasOwnProperty(G)&&(J[G]=(D[G]===void 0&&F!==void 0?F:D)[G]);var G=arguments.length-2;if(G===1)J.children=W;else if(1<G){for(var F=Array(G),K=0;K<G;K++)F[K]=arguments[K+2];J.children=F}return{$$typeof:i,type:U.type,key:M,ref:z,props:J,_owner:V}},r.createContext=function(U,D){return(U={$$typeof:f,_calculateChangedBits:D=D===void 0?null:D,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:U},U.Consumer=U},r.createElement=E,r.createFactory=function(U){var D=E.bind(null,U);return D.type=U,D},r.createRef=function(){return{current:null}},r.forwardRef=function(U){return{$$typeof:l,render:U}},r.isValidElement=O,r.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:k}},r.memo=function(U,D){return{$$typeof:d,type:U,compare:D===void 0?null:D}},r.useCallback=function(U,D){return H().useCallback(U,D)},r.useContext=function(U,D){return H().useContext(U,D)},r.useDebugValue=function(){},r.useEffect=function(U,D){return H().useEffect(U,D)},r.useImperativeHandle=function(U,D,W){return H().useImperativeHandle(U,D,W)},r.useLayoutEffect=function(U,D){return H().useLayoutEffect(U,D)},r.useMemo=function(U,D){return H().useMemo(U,D)},r.useReducer=function(U,D,W){return H().useReducer(U,D,W)},r.useRef=function(U){return H().useRef(U)},r.useState=function(U){return H().useState(U)},r.version="17.0.2"},{"object-assign":385}],408:[function(e,s,r){s.exports=e("./cjs/react.production.min.js")},{"./cjs/react.development.js":406,"./cjs/react.production.min.js":407}],409:[function(e,s,r){s=function(o){var i,u=Object.prototype,a=u.hasOwnProperty,f=(E=typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator",l=E.asyncIterator||"@@asyncIterator",d=E.toStringTag||"@@toStringTag";function p(D,W,J){return Object.defineProperty(D,W,{value:J,enumerable:!0,configurable:!0,writable:!0}),D[W]}try{p({},"")}catch{p=function(W,J,M){return W[J]=M}}function h(D,W,J,M){var z,V,G,F;return W=W&&W.prototype instanceof w?W:w,W=Object.create(W.prototype),M=new $(M||[]),W._invoke=(z=D,V=J,G=M,F=g,function(K,N){if(F===b)throw new Error("Generator is already running");if(F===v){if(K==="throw")throw N;return U()}for(G.method=K,G.arg=N;;){var R=G.delegate;if(R&&(R=function L(B,Y){var X=B.iterator[Y.method];if(X===i){if(Y.delegate=null,Y.method==="throw"){if(B.iterator.return&&(Y.method="return",Y.arg=i,L(B,Y),Y.method==="throw"))return _;Y.method="throw",Y.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}return(X=m(X,B.iterator,Y.arg)).type==="throw"?(Y.method="throw",Y.arg=X.arg,Y.delegate=null,_):(X=X.arg)?X.done?(Y[B.resultName]=X.value,Y.next=B.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=i),Y.delegate=null,_):X:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,_)}(R,G),R)){if(R===_)continue;return R}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(F===g)throw F=v,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);if(F=b,(R=m(z,V,G)).type==="normal"){if(F=G.done?v:y,R.arg!==_)return{value:R.arg,done:G.done}}else R.type==="throw"&&(F=v,G.method="throw",G.arg=R.arg)}}),W}function m(D,W,J){try{return{type:"normal",arg:D.call(W,J)}}catch(M){return{type:"throw",arg:M}}}o.wrap=h;var g="suspendedStart",y="suspendedYield",b="executing",v="completed",_={};function w(){}function x(){}function S(){}var E,O,j=(p(E={},f,function(){return this}),(O=(O=Object.getPrototypeOf)&&O(O(H([]))))&&O!==u&&a.call(O,f)&&(E=O),S.prototype=w.prototype=Object.create(E));function A(D){["next","throw","return"].forEach(function(W){p(D,W,function(J){return this._invoke(W,J)})})}function T(D,W){var J;this._invoke=function(M,z){function V(){return new W(function(G,F){(function K(N,R,L,B){var Y;if((N=m(D[N],D,R)).type!=="throw")return(R=(Y=N.arg).value)&&typeof R=="object"&&a.call(R,"__await")?W.resolve(R.__await).then(function(X){K("next",X,L,B)},function(X){K("throw",X,L,B)}):W.resolve(R).then(function(X){Y.value=X,L(Y)},function(X){return K("throw",X,L,B)});B(N.arg)})(M,z,G,F)})}return J=J?J.then(V,V):V()}}function I(D){var W={tryLoc:D[0]};1 in D&&(W.catchLoc=D[1]),2 in D&&(W.finallyLoc=D[2],W.afterLoc=D[3]),this.tryEntries.push(W)}function k(D){var W=D.completion||{};W.type="normal",delete W.arg,D.completion=W}function $(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(I,this),this.reset(!0)}function H(D){if(D){var W,J=D[f];if(J)return J.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length))return W=-1,(J=function M(){for(;++W<D.length;)if(a.call(D,W))return M.value=D[W],M.done=!1,M;return M.value=i,M.done=!0,M}).next=J}return{next:U}}function U(){return{value:i,done:!0}}return p(j,"constructor",x.prototype=S),p(S,"constructor",x),x.displayName=p(S,d,"GeneratorFunction"),o.isGeneratorFunction=function(D){return!!(D=typeof D=="function"&&D.constructor)&&(D===x||(D.displayName||D.name)==="GeneratorFunction")},o.mark=function(D){return Object.setPrototypeOf?Object.setPrototypeOf(D,S):(D.__proto__=S,p(D,d,"GeneratorFunction")),D.prototype=Object.create(j),D},o.awrap=function(D){return{__await:D}},A(T.prototype),p(T.prototype,l,function(){return this}),o.AsyncIterator=T,o.async=function(D,W,J,M,z){z===void 0&&(z=Promise);var V=new T(h(D,W,J,M),z);return o.isGeneratorFunction(W)?V:V.next().then(function(G){return G.done?G.value:V.next()})},A(j),p(j,d,"Generator"),p(j,f,function(){return this}),p(j,"toString",function(){return"[object Generator]"}),o.keys=function(D){var W,J=[];for(W in D)J.push(W);return J.reverse(),function M(){for(;J.length;){var z=J.pop();if(z in D)return M.value=z,M.done=!1,M}return M.done=!0,M}},o.values=H,$.prototype={constructor:$,reset:function(D){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(k),!D)for(var W in this)W.charAt(0)==="t"&&a.call(this,W)&&!isNaN(+W.slice(1))&&(this[W]=i)},stop:function(){this.done=!0;var D=this.tryEntries[0].completion;if(D.type==="throw")throw D.arg;return this.rval},dispatchException:function(D){if(this.done)throw D;var W=this;function J(K,N){return V.type="throw",V.arg=D,W.next=K,N&&(W.method="next",W.arg=i),!!N}for(var M=this.tryEntries.length-1;0<=M;--M){var z=this.tryEntries[M],V=z.completion;if(z.tryLoc==="root")return J("end");if(z.tryLoc<=this.prev){var G=a.call(z,"catchLoc"),F=a.call(z,"finallyLoc");if(G&&F){if(this.prev<z.catchLoc)return J(z.catchLoc,!0);if(this.prev<z.finallyLoc)return J(z.finallyLoc)}else if(G){if(this.prev<z.catchLoc)return J(z.catchLoc,!0)}else{if(!F)throw new Error("try statement without catch or finally");if(this.prev<z.finallyLoc)return J(z.finallyLoc)}}}},abrupt:function(D,W){for(var J=this.tryEntries.length-1;0<=J;--J){var M=this.tryEntries[J];if(M.tryLoc<=this.prev&&a.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var z=M;break}}var V=(z=z&&(D==="break"||D==="continue")&&z.tryLoc<=W&&W<=z.finallyLoc?null:z)?z.completion:{};return V.type=D,V.arg=W,z?(this.method="next",this.next=z.finallyLoc,_):this.complete(V)},complete:function(D,W){if(D.type==="throw")throw D.arg;return D.type==="break"||D.type==="continue"?this.next=D.arg:D.type==="return"?(this.rval=this.arg=D.arg,this.method="return",this.next="end"):D.type==="normal"&&W&&(this.next=W),_},finish:function(D){for(var W=this.tryEntries.length-1;0<=W;--W){var J=this.tryEntries[W];if(J.finallyLoc===D)return this.complete(J.completion,J.afterLoc),k(J),_}},catch:function(D){for(var W=this.tryEntries.length-1;0<=W;--W){var J,M,z=this.tryEntries[W];if(z.tryLoc===D)return(J=z.completion).type==="throw"&&(M=J.arg,k(z)),M}throw new Error("illegal catch attempt")},delegateYield:function(D,W,J){return this.delegate={iterator:H(D),resultName:W,nextLoc:J},this.method==="next"&&(this.arg=i),_}},o}(typeof s=="object"?s.exports:{});try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},{}],410:[function(e,s,r){},{}],411:[function(e,s,r){var o=0;r.__interactionsRef=null,r.__subscriberRef=null,r.unstable_clear=function(i){return i()},r.unstable_getCurrent=function(){return null},r.unstable_getThreadID=function(){return++o},r.unstable_subscribe=function(){},r.unstable_trace=function(i,u,a){return a()},r.unstable_unsubscribe=function(){},r.unstable_wrap=function(i){return i}},{}],412:[function(e,s,r){},{}],413:[function(e,s,r){var o,i,u,a,f,l,d,p,h,m,g,y,b,v,_,w,x,S;function E(G,F){var K=G.length;for(G.push(F);;){var N=K-1>>>1,R=G[N];if(!(R!==void 0&&0<A(R,F)))break;G[N]=F,G[K]=R,K=N}}function O(G){return(G=G[0])===void 0?null:G}function j(G){var F=G[0];if(F!==void 0){var K=G.pop();if(K!==F){G[0]=K;for(var N=0,R=G.length;N<R;){var L=2*(N+1)-1,B=G[L],Y=1+L,X=G[Y];if(B!==void 0&&A(B,K)<0)N=X!==void 0&&A(X,B)<0?(G[N]=X,G[Y]=K,Y):(G[N]=B,G[L]=K,L);else{if(!(X!==void 0&&A(X,K)<0))break;G[N]=X,G[Y]=K,N=Y}}}}}function A(G,F){var K=G.sortIndex-F.sortIndex;return K!=0?K:G.id-F.id}typeof performance=="object"&&typeof performance.now=="function"?(i=performance,r.unstable_now=function(){return i.now()}):(u=Date,a=u.now(),r.unstable_now=function(){return u.now()-a}),typeof window>"u"||typeof MessageChannel!="function"?(l=f=null,d=function(){if(f!==null)try{var G=r.unstable_now();f(!0,G),f=null}catch(F){throw setTimeout(d,0),F}},p=function(G){f!==null?setTimeout(p,0,G):(f=G,setTimeout(d,0))},h=function(G,F){l=setTimeout(G,F)},m=function(){clearTimeout(l)},r.unstable_shouldYield=function(){return!1},o=r.unstable_forceFrameRate=function(){}):(g=window.setTimeout,y=window.clearTimeout,typeof console<"u"&&(V=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof V!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),b=!1,v=null,_=-1,w=5,x=0,r.unstable_shouldYield=function(){return r.unstable_now()>=x},o=function(){},r.unstable_forceFrameRate=function(G){G<0||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<G?Math.floor(1e3/G):5},V=new MessageChannel,S=V.port2,V.port1.onmessage=function(){if(v!==null){var G=r.unstable_now();x=G+w;try{v(!0,G)?S.postMessage(null):(b=!1,v=null)}catch(F){throw S.postMessage(null),F}}else b=!1},p=function(G){v=G,b||(b=!0,S.postMessage(null))},h=function(G,F){_=g(function(){G(r.unstable_now())},F)},m=function(){y(_),_=-1});var T=[],I=[],k=1,$=null,H=3,U=!1,D=!1,W=!1;function J(G){for(var F=O(I);F!==null;){if(F.callback===null)j(I);else{if(!(F.startTime<=G))break;j(I),F.sortIndex=F.expirationTime,E(T,F)}F=O(I)}}function M(G){var F;W=!1,J(G),D||(O(T)!==null?(D=!0,p(z)):(F=O(I))!==null&&h(M,F.startTime-G))}function z(G,F){D=!1,W&&(W=!1,m()),U=!0;var K=H;try{for(J(F),$=O(T);$!==null&&(!($.expirationTime>F)||G&&!r.unstable_shouldYield());){var N,R=$.callback;typeof R=="function"?($.callback=null,H=$.priorityLevel,N=R($.expirationTime<=F),F=r.unstable_now(),typeof N=="function"?$.callback=N:$===O(T)&&j(T),J(F)):j(T),$=O(T)}var L;return $!==null||((L=O(I))!==null&&h(M,L.startTime-F),!1)}finally{$=null,H=K,U=!1}}var V=o;r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(G){G.callback=null},r.unstable_continueExecution=function(){D||U||(D=!0,p(z))},r.unstable_getCurrentPriorityLevel=function(){return H},r.unstable_getFirstCallbackNode=function(){return O(T)},r.unstable_next=function(G){switch(H){case 1:case 2:case 3:var F=3;break;default:F=H}var K=H;H=F;try{return G()}finally{H=K}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=V,r.unstable_runWithPriority=function(G,F){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var K=H;H=G;try{return F()}finally{H=K}},r.unstable_scheduleCallback=function(G,F,K){var N=r.unstable_now();switch(K=typeof K=="object"&&K!==null&&typeof(K=K.delay)=="number"&&0<K?N+K:N,G){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return G={id:k++,callback:F,priorityLevel:G,startTime:K,expirationTime:R=K+R,sortIndex:-1},N<K?(G.sortIndex=K,E(I,G),O(T)===null&&G===O(I)&&(W?m():W=!0,h(M,K-N))):(G.sortIndex=R,E(T,G),D||U||(D=!0,p(z))),G},r.unstable_wrapCallback=function(G){var F=H;return function(){var K=H;H=F;try{return G.apply(this,arguments)}finally{H=K}}}},{}],414:[function(e,s,r){s.exports=e("./cjs/scheduler.production.min.js")},{"./cjs/scheduler.development.js":412,"./cjs/scheduler.production.min.js":413}],415:[function(e,s,r){s.exports=e("./cjs/scheduler-tracing.production.min.js")},{"./cjs/scheduler-tracing.development.js":410,"./cjs/scheduler-tracing.production.min.js":411}],416:[function(e,s,r){s.exports=function(o,i,u,a){if((m=u?u.call(a,o,i):void 0)!==void 0)return!!m;if(o===i)return!0;if(typeof o!="object"||!o||typeof i!="object"||!i)return!1;var f=Object.keys(o),l=Object.keys(i);if(f.length!==l.length)return!1;for(var d=Object.prototype.hasOwnProperty.bind(i),p=0;p<f.length;p++){var h=f[p];if(!d(h))return!1;var m,g=o[h],y=i[h];if((m=u?u.call(a,g,y,h):void 0)===!1||m===void 0&&g!==y)return!1}return!0}},{}],417:[function(e,s,r){(function(o){(function(){function i(pe){return pe&&typeof pe=="object"&&"default"in pe?pe.default:pe}Object.defineProperty(r,"__esModule",{value:!0});var u=e("react-is"),a=e("react"),f=i(a),l=i(e("shallowequal")),d=i(e("@emotion/stylis")),p=i(e("@emotion/unitless")),h=i(e("@emotion/is-prop-valid")),m=i(e("hoist-non-react-statics"));function g(){return(g=Object.assign||function(pe){for(var De=1;De<arguments.length;De++){var Ue,Ke=arguments[De];for(Ue in Ke)Object.prototype.hasOwnProperty.call(Ke,Ue)&&(pe[Ue]=Ke[Ue])}return pe}).apply(this,arguments)}var y=function(pe,De){for(var Ue=[pe[0]],Ke=0,qe=De.length;Ke<qe;Ke+=1)Ue.push(De[Ke],pe[Ke+1]);return Ue},b=function(pe){return pe!==null&&typeof pe=="object"&&(pe.toString?pe.toString():Object.prototype.toString.call(pe))==="[object Object]"&&!u.typeOf(pe)},v=Object.freeze([]),_=Object.freeze({});function w(pe){return typeof pe=="function"}function x(pe){return o.env.NODE_ENV!=="production"&&typeof pe=="string"&&pe||pe.displayName||pe.name||"Component"}function S(pe){return pe&&typeof pe.styledComponentId=="string"}var E=o!==void 0&&(o.env.REACT_APP_SC_ATTR||o.env.SC_ATTR)||"data-styled",O=typeof window<"u"&&"HTMLElement"in window,j=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:o!==void 0&&o.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&o.env.REACT_APP_SC_DISABLE_SPEEDY!==""?o.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&o.env.REACT_APP_SC_DISABLE_SPEEDY:o!==void 0&&o.env.SC_DISABLE_SPEEDY!==void 0&&o.env.SC_DISABLE_SPEEDY!==""?o.env.SC_DISABLE_SPEEDY!=="false"&&o.env.SC_DISABLE_SPEEDY:o.env.NODE_ENV!=="production"),A={},T=o.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
129
129
|
|
|
130
130
|
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
|
|
131
131
|
|
|
@@ -1406,7 +1406,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1406
1406
|
display: none !important;
|
|
1407
1407
|
}
|
|
1408
1408
|
`,""]);const i=o},269:(c,t,n)=>{const e=n(962),s={};for(const i of Object.keys(e))s[e[i]]=i;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};c.exports=r;for(const i of Object.keys(r)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:u,labels:a}=r[i];delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:u}),Object.defineProperty(r[i],"labels",{value:a})}function o(i,u){return(i[0]-u[0])**2+(i[1]-u[1])**2+(i[2]-u[2])**2}r.rgb.hsl=function(i){const u=i[0]/255,a=i[1]/255,f=i[2]/255,l=Math.min(u,a,f),d=Math.max(u,a,f),p=d-l;let h,m;d===l?h=0:u===d?h=(a-f)/p:a===d?h=2+(f-u)/p:f===d&&(h=4+(u-a)/p),h=Math.min(60*h,360),h<0&&(h+=360);const g=(l+d)/2;return m=d===l?0:g<=.5?p/(d+l):p/(2-d-l),[h,100*m,100*g]},r.rgb.hsv=function(i){let u,a,f,l,d;const p=i[0]/255,h=i[1]/255,m=i[2]/255,g=Math.max(p,h,m),y=g-Math.min(p,h,m),b=function(v){return(g-v)/6/y+.5};return y===0?(l=0,d=0):(d=y/g,u=b(p),a=b(h),f=b(m),p===g?l=f-a:h===g?l=1/3+u-f:m===g&&(l=2/3+a-u),l<0?l+=1:l>1&&(l-=1)),[360*l,100*d,100*g]},r.rgb.hwb=function(i){const u=i[0],a=i[1];let f=i[2];const l=r.rgb.hsl(i)[0],d=1/255*Math.min(u,Math.min(a,f));return f=1-1/255*Math.max(u,Math.max(a,f)),[l,100*d,100*f]},r.rgb.cmyk=function(i){const u=i[0]/255,a=i[1]/255,f=i[2]/255,l=Math.min(1-u,1-a,1-f);return[100*((1-u-l)/(1-l)||0),100*((1-a-l)/(1-l)||0),100*((1-f-l)/(1-l)||0),100*l]},r.rgb.keyword=function(i){const u=s[i];if(u)return u;let a,f=1/0;for(const l of Object.keys(e)){const d=o(i,e[l]);d<f&&(f=d,a=l)}return a},r.keyword.rgb=function(i){return e[i]},r.rgb.xyz=function(i){let u=i[0]/255,a=i[1]/255,f=i[2]/255;return u=u>.04045?((u+.055)/1.055)**2.4:u/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92,f=f>.04045?((f+.055)/1.055)**2.4:f/12.92,[100*(.4124*u+.3576*a+.1805*f),100*(.2126*u+.7152*a+.0722*f),100*(.0193*u+.1192*a+.9505*f)]},r.rgb.lab=function(i){const u=r.rgb.xyz(i);let a=u[0],f=u[1],l=u[2];return a/=95.047,f/=100,l/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,f=f>.008856?f**(1/3):7.787*f+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,[116*f-16,500*(a-f),200*(f-l)]},r.hsl.rgb=function(i){const u=i[0]/360,a=i[1]/100,f=i[2]/100;let l,d,p;if(a===0)return p=255*f,[p,p,p];l=f<.5?f*(1+a):f+a-f*a;const h=2*f-l,m=[0,0,0];for(let g=0;g<3;g++)d=u+1/3*-(g-1),d<0&&d++,d>1&&d--,p=6*d<1?h+6*(l-h)*d:2*d<1?l:3*d<2?h+(l-h)*(2/3-d)*6:h,m[g]=255*p;return m},r.hsl.hsv=function(i){const u=i[0];let a=i[1]/100,f=i[2]/100,l=a;const d=Math.max(f,.01);return f*=2,a*=f<=1?f:2-f,l*=d<=1?d:2-d,[u,100*(f===0?2*l/(d+l):2*a/(f+a)),(f+a)/2*100]},r.hsv.rgb=function(i){const u=i[0]/60,a=i[1]/100;let f=i[2]/100;const l=Math.floor(u)%6,d=u-Math.floor(u),p=255*f*(1-a),h=255*f*(1-a*d),m=255*f*(1-a*(1-d));switch(f*=255,l){case 0:return[f,m,p];case 1:return[h,f,p];case 2:return[p,f,m];case 3:return[p,h,f];case 4:return[m,p,f];case 5:return[f,p,h]}},r.hsv.hsl=function(i){const u=i[0],a=i[1]/100,f=i[2]/100,l=Math.max(f,.01);let d,p;p=(2-a)*f;const h=(2-a)*l;return d=a*l,d/=h<=1?h:2-h,d=d||0,p/=2,[u,100*d,100*p]},r.hwb.rgb=function(i){const u=i[0]/360;let a=i[1]/100,f=i[2]/100;const l=a+f;let d;l>1&&(a/=l,f/=l);const p=Math.floor(6*u),h=1-f;d=6*u-p,1&p&&(d=1-d);const m=a+d*(h-a);let g,y,b;switch(p){default:case 6:case 0:g=h,y=m,b=a;break;case 1:g=m,y=h,b=a;break;case 2:g=a,y=h,b=m;break;case 3:g=a,y=m,b=h;break;case 4:g=m,y=a,b=h;break;case 5:g=h,y=a,b=m}return[255*g,255*y,255*b]},r.cmyk.rgb=function(i){const u=i[0]/100,a=i[1]/100,f=i[2]/100,l=i[3]/100;return[255*(1-Math.min(1,u*(1-l)+l)),255*(1-Math.min(1,a*(1-l)+l)),255*(1-Math.min(1,f*(1-l)+l))]},r.xyz.rgb=function(i){const u=i[0]/100,a=i[1]/100,f=i[2]/100;let l,d,p;return l=3.2406*u+-1.5372*a+-.4986*f,d=-.9689*u+1.8758*a+.0415*f,p=.0557*u+-.204*a+1.057*f,l=l>.0031308?1.055*l**(1/2.4)-.055:12.92*l,d=d>.0031308?1.055*d**(1/2.4)-.055:12.92*d,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,l=Math.min(Math.max(0,l),1),d=Math.min(Math.max(0,d),1),p=Math.min(Math.max(0,p),1),[255*l,255*d,255*p]},r.xyz.lab=function(i){let u=i[0],a=i[1],f=i[2];return u/=95.047,a/=100,f/=108.883,u=u>.008856?u**(1/3):7.787*u+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,f=f>.008856?f**(1/3):7.787*f+16/116,[116*a-16,500*(u-a),200*(a-f)]},r.lab.xyz=function(i){let u,a,f;a=(i[0]+16)/116,u=i[1]/500+a,f=a-i[2]/200;const l=a**3,d=u**3,p=f**3;return a=l>.008856?l:(a-16/116)/7.787,u=d>.008856?d:(u-16/116)/7.787,f=p>.008856?p:(f-16/116)/7.787,u*=95.047,a*=100,f*=108.883,[u,a,f]},r.lab.lch=function(i){const u=i[0],a=i[1],f=i[2];let l;return l=360*Math.atan2(f,a)/2/Math.PI,l<0&&(l+=360),[u,Math.sqrt(a*a+f*f),l]},r.lch.lab=function(i){const u=i[0],a=i[1],f=i[2]/360*2*Math.PI;return[u,a*Math.cos(f),a*Math.sin(f)]},r.rgb.ansi16=function(i,u=null){const[a,f,l]=i;let d=u===null?r.rgb.hsv(i)[2]:u;if(d=Math.round(d/50),d===0)return 30;let p=30+(Math.round(l/255)<<2|Math.round(f/255)<<1|Math.round(a/255));return d===2&&(p+=60),p},r.hsv.ansi16=function(i){return r.rgb.ansi16(r.hsv.rgb(i),i[2])},r.rgb.ansi256=function(i){const u=i[0],a=i[1],f=i[2];return u===a&&a===f?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(a/255*5)+Math.round(f/255*5)},r.ansi16.rgb=function(i){let u=i%10;if(u===0||u===7)return i>50&&(u+=3.5),u=u/10.5*255,[u,u,u];const a=.5*(1+~~(i>50));return[(1&u)*a*255,(u>>1&1)*a*255,(u>>2&1)*a*255]},r.ansi256.rgb=function(i){if(i>=232){const a=10*(i-232)+8;return[a,a,a]}let u;return i-=16,[Math.floor(i/36)/5*255,Math.floor((u=i%36)/6)/5*255,u%6/5*255]},r.rgb.hex=function(i){const u=(((255&Math.round(i[0]))<<16)+((255&Math.round(i[1]))<<8)+(255&Math.round(i[2]))).toString(16).toUpperCase();return"000000".substring(u.length)+u},r.hex.rgb=function(i){const u=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!u)return[0,0,0];let a=u[0];u[0].length===3&&(a=a.split("").map(l=>l+l).join(""));const f=parseInt(a,16);return[f>>16&255,f>>8&255,255&f]},r.rgb.hcg=function(i){const u=i[0]/255,a=i[1]/255,f=i[2]/255,l=Math.max(Math.max(u,a),f),d=Math.min(Math.min(u,a),f),p=l-d;let h,m;return h=p<1?d/(1-p):0,m=p<=0?0:l===u?(a-f)/p%6:l===a?2+(f-u)/p:4+(u-a)/p,m/=6,m%=1,[360*m,100*p,100*h]},r.hsl.hcg=function(i){const u=i[1]/100,a=i[2]/100,f=a<.5?2*u*a:2*u*(1-a);let l=0;return f<1&&(l=(a-.5*f)/(1-f)),[i[0],100*f,100*l]},r.hsv.hcg=function(i){const u=i[1]/100,a=i[2]/100,f=u*a;let l=0;return f<1&&(l=(a-f)/(1-f)),[i[0],100*f,100*l]},r.hcg.rgb=function(i){const u=i[0]/360,a=i[1]/100,f=i[2]/100;if(a===0)return[255*f,255*f,255*f];const l=[0,0,0],d=u%1*6,p=d%1,h=1-p;let m=0;switch(Math.floor(d)){case 0:l[0]=1,l[1]=p,l[2]=0;break;case 1:l[0]=h,l[1]=1,l[2]=0;break;case 2:l[0]=0,l[1]=1,l[2]=p;break;case 3:l[0]=0,l[1]=h,l[2]=1;break;case 4:l[0]=p,l[1]=0,l[2]=1;break;default:l[0]=1,l[1]=0,l[2]=h}return m=(1-a)*f,[255*(a*l[0]+m),255*(a*l[1]+m),255*(a*l[2]+m)]},r.hcg.hsv=function(i){const u=i[1]/100,a=u+i[2]/100*(1-u);let f=0;return a>0&&(f=u/a),[i[0],100*f,100*a]},r.hcg.hsl=function(i){const u=i[1]/100,a=i[2]/100*(1-u)+.5*u;let f=0;return a>0&&a<.5?f=u/(2*a):a>=.5&&a<1&&(f=u/(2*(1-a))),[i[0],100*f,100*a]},r.hcg.hwb=function(i){const u=i[1]/100,a=u+i[2]/100*(1-u);return[i[0],100*(a-u),100*(1-a)]},r.hwb.hcg=function(i){const u=i[1]/100,a=1-i[2]/100,f=a-u;let l=0;return f<1&&(l=(a-f)/(1-f)),[i[0],100*f,100*l]},r.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},r.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},r.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},r.gray.hsl=function(i){return[0,0,i[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(i){return[0,100,i[0]]},r.gray.cmyk=function(i){return[0,0,0,i[0]]},r.gray.lab=function(i){return[i[0],0,0]},r.gray.hex=function(i){const u=255&Math.round(i[0]/100*255),a=((u<<16)+(u<<8)+u).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]}},256:(c,t,n)=>{const e=n(269),s=n(273),r={};Object.keys(e).forEach(o=>{r[o]={},Object.defineProperty(r[o],"channels",{value:e[o].channels}),Object.defineProperty(r[o],"labels",{value:e[o].labels});const i=s(o);Object.keys(i).forEach(u=>{const a=i[u];r[o][u]=function(f){const l=function(...d){const p=d[0];if(p==null)return p;p.length>1&&(d=p);const h=f(d);if(typeof h=="object")for(let m=h.length,g=0;g<m;g++)h[g]=Math.round(h[g]);return h};return"conversion"in f&&(l.conversion=f.conversion),l}(a),r[o][u].raw=function(f){const l=function(...d){const p=d[0];return p==null?p:(p.length>1&&(d=p),f(d))};return"conversion"in f&&(l.conversion=f.conversion),l}(a)})}),c.exports=r},273:(c,t,n)=>{const e=n(269);function s(o,i){return function(u){return i(o(u))}}function r(o,i){const u=[i[o].parent,o];let a=e[i[o].parent][o],f=i[o].parent;for(;i[f].parent;)u.unshift(i[f].parent),a=s(e[i[f].parent][f],a),f=i[f].parent;return a.conversion=u,a}c.exports=function(o){const i=function(f){const l=function(){const p={},h=Object.keys(e);for(let m=h.length,g=0;g<m;g++)p[h[g]]={distance:-1,parent:null};return p}(),d=[f];for(l[f].distance=0;d.length;){const p=d.pop(),h=Object.keys(e[p]);for(let m=h.length,g=0;g<m;g++){const y=h[g],b=l[y];b.distance===-1&&(b.distance=l[p].distance+1,b.parent=p,d.unshift(y))}}return l}(o),u={},a=Object.keys(i);for(let f=a.length,l=0;l<f;l++){const d=a[l];i[d].parent!==null&&(u[d]=r(d,i))}return u}},962:c=>{c.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},364:c=>{c.exports=function(t){var n=[];return n.toString=function(){return this.map(function(e){var s="",r=e[5]!==void 0;return e[4]&&(s+="@supports (".concat(e[4],") {")),e[2]&&(s+="@media ".concat(e[2]," {")),r&&(s+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),s+=t(e),r&&(s+="}"),e[2]&&(s+="}"),e[4]&&(s+="}"),s}).join("")},n.i=function(e,s,r,o,i){typeof e=="string"&&(e=[[null,e,void 0]]);var u={};if(r)for(var a=0;a<this.length;a++){var f=this[a][0];f!=null&&(u[f]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);r&&u[d[0]]||(i!==void 0&&(d[5]===void 0||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),s&&(d[2]&&(d[1]="@media ".concat(d[2]," {").concat(d[1],"}")),d[2]=s),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),n.push(d))}},n}},379:c=>{c.exports=function(t){return t[1]}},186:c=>{var t=[];function n(r){for(var o=-1,i=0;i<t.length;i++)if(t[i].identifier===r){o=i;break}return o}function e(r,o){for(var i={},u=[],a=0;a<r.length;a++){var f=r[a],l=o.base?f[0]+o.base:f[0],d=i[l]||0,p="".concat(l," ").concat(d);i[l]=d+1;var h=n(p),m={css:f[1],media:f[2],sourceMap:f[3],supports:f[4],layer:f[5]};if(h!==-1)t[h].references++,t[h].updater(m);else{var g=s(m,o);o.byIndex=a,t.splice(a,0,{identifier:p,updater:g,references:1})}u.push(p)}return u}function s(r,o){var i=o.domAPI(o);return i.update(r),function(u){if(u){if(u.css===r.css&&u.media===r.media&&u.sourceMap===r.sourceMap&&u.supports===r.supports&&u.layer===r.layer)return;i.update(r=u)}else i.remove()}}c.exports=function(r,o){var i=e(r=r||[],o=o||{});return function(u){u=u||[];for(var a=0;a<i.length;a++){var f=n(i[a]);t[f].references--}for(var l=e(u,o),d=0;d<i.length;d++){var p=n(i[d]);t[p].references===0&&(t[p].updater(),t.splice(p,1))}i=l}}},433:c=>{var t={};c.exports=function(n,e){var s=function(r){if(t[r]===void 0){var o=document.querySelector(r);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch{o=null}t[r]=o}return t[r]}(n);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}},990:c=>{c.exports=function(t){var n=document.createElement("style");return t.setAttributes(n,t.attributes),t.insert(n,t.options),n}},626:(c,t,n)=>{c.exports=function(e){var s=n.nc;s&&e.setAttribute("nonce",s)}},155:c=>{c.exports=function(t){if(typeof document>"u")return{update:function(){},remove:function(){}};var n=t.insertStyleElement(t);return{update:function(e){(function(s,r,o){var i="";o.supports&&(i+="@supports (".concat(o.supports,") {")),o.media&&(i+="@media ".concat(o.media," {"));var u=o.layer!==void 0;u&&(i+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),i+=o.css,u&&(i+="}"),o.media&&(i+="}"),o.supports&&(i+="}");var a=o.sourceMap;a&&typeof btoa<"u"&&(i+=`
|
|
1409
|
-
/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),r.styleTagTransform(i,s,r.options)})(n,t,e)},remove:function(){(function(e){if(e.parentNode===null)return!1;e.parentNode.removeChild(e)})(n)}}}},827:c=>{c.exports=function(t,n){if(n.styleSheet)n.styleSheet.cssText=t;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(t))}}}},PE={};function un(c){var t=PE[c];if(t!==void 0)return t.exports;var n=PE[c]={id:c,exports:{}};return f4[c](n,n.exports,un),n.exports}un.n=c=>{var t=c&&c.__esModule?()=>c.default:()=>c;return un.d(t,{a:t}),t},un.d=(c,t)=>{for(var n in t)un.o(t,n)&&!un.o(c,n)&&Object.defineProperty(c,n,{enumerable:!0,get:t[n]})},un.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),un.o=(c,t)=>Object.prototype.hasOwnProperty.call(c,t),un.nc=void 0;var aa={};un.d(aa,{yy:()=>n6,_U:()=>d8,a8:()=>N8,Vs:()=>O8,Cn:()=>Cb,gK:()=>O6,vv:()=>qL});var p4=c=>{var t={};return un.d(t,c),t};const bt=p4({$addUpdateTag:()=>LM,$createNodeSelection:()=>BM,$createParagraphNode:()=>An,$createRangeSelection:()=>ud,$getNodeByKey:()=>Ro,$getRoot:()=>Un,$getSelection:()=>st,$isDecoratorNode:()=>uo,$isElementNode:()=>Rt,$isLineBreakNode:()=>dd,$isNodeSelection:()=>fo,$isParagraphNode:()=>xy,$isRangeSelection:()=>at,$isTextNode:()=>zt,$nodesOfType:()=>FM,$setSelection:()=>kr,CAN_REDO_COMMAND:()=>Oi,CAN_UNDO_COMMAND:()=>Ti,CLEAR_EDITOR_COMMAND:()=>fd,COMMAND_PRIORITY_CRITICAL:()=>mr,COMMAND_PRIORITY_EDITOR:()=>Ct,CUT_COMMAND:()=>pd,DecoratorNode:()=>$M,ElementNode:()=>po,KEY_BACKSPACE_COMMAND:()=>Va,KEY_DELETE_COMMAND:()=>Ga,KEY_ESCAPE_COMMAND:()=>hd,LineBreakNode:()=>zM,PASTE_COMMAND:()=>gd,ParagraphNode:()=>UM,REDO_COMMAND:()=>Qp,RootNode:()=>HM,TextNode:()=>Ya,UNDO_COMMAND:()=>rh,createCommand:()=>Xa,createEditor:()=>wy});var h4=c=>{var t={};return un.d(t,c),t};const g4=h4({$isLinkNode:()=>Hj});var m4=c=>{var t={};return un.d(t,c),t};const qo=m4({$createMarkNode:()=>Zj,$getMarkIDs:()=>Qj,$isMarkNode:()=>eD,$unwrapMarkNode:()=>tD,$wrapSelectionInMarkNode:()=>nD,MarkNode:()=>rD});var y4=c=>{var t={};return un.d(t,c),t};const $n=y4({$createTableCellNode:()=>QD,$createTableRowNode:()=>e3,$createTableSelection:()=>t3,$getTableColumnIndexFromTableCellNode:()=>n3,$isTableCellNode:()=>r3,$isTableNode:()=>o3,$isTableRowNode:()=>i3,$isTableSelection:()=>s3,TableCellNode:()=>a3,TableNode:()=>l3,TableRowNode:()=>c3}),b4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ME={randomUUID:b4};let Bh;const v4=new Uint8Array(16);function _4(){if(!Bh&&(Bh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bh(v4)}const Ur=[];for(let c=0;c<256;++c)Ur.push((c+256).toString(16).slice(1));function x4(c,t=0){return Ur[c[t+0]]+Ur[c[t+1]]+Ur[c[t+2]]+Ur[c[t+3]]+"-"+Ur[c[t+4]]+Ur[c[t+5]]+"-"+Ur[c[t+6]]+Ur[c[t+7]]+"-"+Ur[c[t+8]]+Ur[c[t+9]]+"-"+Ur[c[t+10]]+Ur[c[t+11]]+Ur[c[t+12]]+Ur[c[t+13]]+Ur[c[t+14]]+Ur[c[t+15]]}function w4(c,t,n){if(ME.randomUUID&&!t&&!c)return ME.randomUUID();const e=(c=c||{}).random||(c.rng||_4)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,t){n=n||0;for(let s=0;s<16;++s)t[n+s]=e[s];return t}return x4(e)}const S4=w4;let C4=()=>{},Rd=function(){return C4};const E4=Rd(),O4=Rd(),T4=Rd(),N4=Rd(),k4=Rd(),A4={log:E4,info:O4,warn:N4,debug:T4,error:k4},ut=A4,P4=[c=>c.hasFormat("bold")&&"bold",c=>c.hasFormat("code")&&"code",c=>c.hasFormat("italic")&&"italic",c=>c.hasFormat("strikethrough")&&"strikethrough",c=>c.hasFormat("subscript")&&"subscript",c=>c.hasFormat("superscript")&&"superscript",c=>c.hasFormat("underline")&&"underline"],IE={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},M4={center:2,end:6,justify:4,left:1,right:3,start:5};function I4(c){if(!c||!c.length)return 0;let t=c.split(",");if(t=t.map(e=>e.trim()),t.length===1&&!IE[t[0]])return c;let n=0;for(const e of t){const s=IE[e];s&&(n^=s)}return n}function R4(c){return c?P4.map(t=>t(c)).filter(Boolean).join(","):""}function j4(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return c&&M4[c]||0}function jd(c){return`__${c}`}function xb(c){return c.split("__")[1]||""}class D4{constructor(){this.subscribers={}}on(t,n){t&&n&&(this.subscribers[t]||(this.subscribers[t]=[]),this.subscribers[t].push(n))}emit(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.subscribers[t]&&this.subscribers[t].length)for(const e of this.subscribers[t])typeof e=="function"&&e(n)}clear(){this.subscribers={}}}const RE=D4,Jo={historic:"historic",historyMerge:"history-merge",historyPush:"history-push"},L4={paste:"application/x-lexical-editor",drag:"application/x-lexical-drag",dragBlock:"application/x-lexical-drag-block",plainText:"text/plain"},jo={created:"created",updated:"updated",destroyed:"destroyed"},la={text:"text",element:"element",whitelist:["text","element"]},Qr={mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keypress:"keypress",keyup:"keyup",resize:"resize",scroll:"scroll"},jE=[Qr.mousemove,Qr.mouseover,Qr.mouseout],Fh={text:"text",linebreak:"linebreak",horizontalrule:"horizontalrule"},wb={local:"local",remote:"remote"},ol={editorState:"editorState",root:"root"},ca={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},Dd="codox_comments_change",DE={horizontalrule:["table","image","inline-image","sticky"],"page-break":["image","inline-image","table","sticky"],"collapsible-container":["table","image","inline-image","collapsible-container","sticky"],"layout-container":["table","image","inline-image","layout-container","sticky"],image:["image","inline-image","sticky"],"inline-image":["image","inline-image","sticky"],table:["image","inline-image","table","sticky"],poll:["image","inline-image","sticky"],excalidraw:["image","inline-image","sticky"]},B4="Invalid state - forbidden content nesting found",LE={local:"local",remote:"remote"};function BE(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function FE(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BE(Object(n),!0).forEach(function(e){F4(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):BE(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function F4(c,t,n){return(t=$4(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function $4(c){var t=z4(c,"string");return typeof t=="symbol"?t:t+""}function z4(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}class Wt{static equalSelectionsJSON(t,n){return!((t||n)&&(t&&!n||n&&!t||t.anchor.codoxId.toString()!==n.anchor.codoxId.toString()||t.anchor.offset!==n.anchor.offset||t.focus.codoxId.toString()!==n.focus.codoxId.toString()||t.focus.offset!==n.focus.offset))}static getNodeAncestorsList(t){return t.getParents()}static getAllNodeLeaves(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(m6(t))return n.push(t),n;let e=t.getChildren();if(!e.length)return n;for(const s of e)n=Wt.getAllNodeLeaves(s,n);return n}static splitCodoxIdPathIntoMainAndNested(t){let n=t.findIndex(s=>s===ol.editorState),e=n+1;return{mainPath:t.slice(0,n),nestedPath:t.slice(e+1)}}static getCodoxIdAndOffsetFromRootNode(t,n){let e=t.getChildren()[n];return{codoxIdArray:e&&e.codoxId?[e.codoxId]:[],offset:0}}static isNestedSelectionJSON(t){return!!t&&!(!t.anchor.codoxId.includes(ol.editorState)||!t.focus.codoxId.includes(ol.editorState))}static lexicalToJSONNested(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=Wt.lexicalToJSON(t);if(!s)return null;let r=[...e,n,ol.editorState,ol.root];return s.anchor.codoxId=[...r,...s.anchor.codoxId],s.focus.codoxId=[...r,...s.focus.codoxId],s}static getNestedSelectionJSONFromMainSelectionJSON(t){let n={nestedSelectionJSON:null,nestedEditor:null},{mainPath:e,nestedPath:s}=Wt.splitCodoxIdPathIntoMainAndNested(t.anchor.codoxId),{mainPath:r,nestedPath:o}=Wt.splitCodoxIdPathIntoMainAndNested(t.focus.codoxId);e.toString()===r.toString()||ut.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Nested selection main path part must point to same node in main editor: ",{anchorCodoxIds:t.anchor.codoxId,mainAnchorPath:e,nestedAnchorPath:s,focusCodoxIds:t.focus.codoxId,mainFocusPath:r,nestedFocusPath:o});let i=e,u=i[i.length-1],a=i[i.length-2],f=Wn.get(a);if(!f){let p=i[i.length-3];if(p){let h=Wn.get(p);h&&(f=h.getChildren().find(m=>m.codoxDId===a))}}if(!f)return ut.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Lexical node with nested editor not found in codox nodes map - selection will be dropped",{jsonSelection:t,targetNodeCodoxId:a}),n;let l=jd(u),d=f[l];return xt.isLexicalEditorInstance(d)?(n.nestedSelectionJSON=FE(FE({},t),{},{anchor:{codoxId:s,offset:t.anchor.offset},focus:{codoxId:o,offset:t.focus.offset}}),n.nestedEditor=d,n):(ut.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Found nested editor is not LexicalEditor instance",{jsonSelection:t,targetLexicalNode:f,targetLexicalNodeAttrName:l,nestedEditorCandidate:d}),n)}static getNodeAncestorsCodoxIds(t){let n=[],e=Wt.getNodeAncestorsList(t);if(e.length===1&&e[0].__type==="root")return n.push(t.codoxId),n;for(let s=e.length-2;s>=0;s--){let r=e[s];r.codoxId&&n.push(r.codoxId)}return t.codoxId&&t.getChildren&&n.push(t.codoxId),n}static getParentOffsetOutOfNodeOffset(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(arguments.length>2&&arguments[2]!==void 0&&arguments[2]){if(t.getChildrenSize&&t.getChildrenSize()===0||n===0&&t.codoxId)return n;let o=n,i=[];if(t.codoxId)i=t.getChildren();else{const a=t.getParents().find(l=>!!l.codoxId);let f=!1;for(const l of a.getChildren()){if(l.__key===t.__key&&(f=!!n&&(Fd(l)||Bd(l)),!f))break;if(pa(l))i.push(l),o+=l.getTextContentSize();else if(Bn(l))i.push(l),o++;else{let d=Wt.getAllNodeLeaves(l),p=d.reduce((h,m)=>(pa(m)?h+=m.getTextContentSize():Bn(m)&&h++,h),0);i.push(...d),o+=p}if(f)break}}let u=0;for(const a of i){if(o<=0)break;let f=0;f=Bn(a)?1:a.getTextContentSize(),u+=f,Bn(a)?o--:o-=f}return u}let e=t.getParents().find(o=>!!o.codoxId);if(!e)return n;let s=[];for(const o of e.getChildren())if(pa(o)||Bn(o))s.push(o);else{let i=Wt.getAllNodeLeaves(o);s.push(...i)}if(s.length===1&&s[0].__key===t.__key)return n;let r=0;for(const o of s){if(o.__key===t.__key){r+=n;break}let i=0;i=Bn(o)?1:o.getTextContentSize(),r+=i}return r}static lexicalToJSON(t){if(!t)return null;let n=[],e=0,s=[],r=0,o="",i=0,u=!0;if((0,bt.$isRangeSelection)(t)){let a=(0,bt.$getNodeByKey)(t.anchor.key);if(al(a)){let{codoxIdArray:l,offset:d}=Wt.getCodoxIdAndOffsetFromRootNode(a,t.anchor.offset);n=l,e=d}else{if((0,$n.$isTableCellNode)(a)){let p=a.getFirstChild();p&&Dc(p)&&(a=p)}n=Wt.getNodeAncestorsCodoxIds(a);const l=t.anchor.offset,d=t.anchor.type===la.element;e=Wt.getParentOffsetOutOfNodeOffset(a,l,d,"anchor")}let f=(0,bt.$getNodeByKey)(t.focus.key);if(al(f)){let{codoxIdArray:l,offset:d}=Wt.getCodoxIdAndOffsetFromRootNode(f,t.focus.offset);s=l,r=d}else{if((0,$n.$isTableCellNode)(f)){let p=f.getFirstChild();p&&Dc(p)&&(f=p)}s=Wt.getNodeAncestorsCodoxIds(f);const l=t.focus.offset,d=t.focus.type===la.element;r=Wt.getParentOffsetOutOfNodeOffset(f,l,d,"focus")}o=t.style,i=t.format,u=t.dirty}else if((0,bt.$isNodeSelection)(t)){let a=t.getNodes();if(!a.length)return null;let f=a[0],l=a[a.length-1],d=(0,bt.$createRangeSelection)();d.anchor.set(f.getKey(),0,la.element),d.focus.set(l.getKey(),0,la.element);let p=d.isBackward();n=Wt.getNodeAncestorsCodoxIds(f),s=Wt.getNodeAncestorsCodoxIds(l);let h=p?1:0,m=p?0:1;e=Wt.getParentOffsetOutOfNodeOffset(f,h),r=Wt.getParentOffsetOutOfNodeOffset(l,m)}else if((0,$n.$isTableSelection)(t)){e=r=null;let a=(0,bt.$getNodeByKey)(t.anchor.key),f=(0,bt.$getNodeByKey)(t.focus.key);n=Wt.getNodeAncestorsCodoxIds(a),s=Wt.getNodeAncestorsCodoxIds(f)}return{anchor:{codoxId:n,offset:e},focus:{codoxId:s,offset:r},style:o,format:i,dirty:u}}static createTableSelection(t,n){if(!Lc(t)||!Lc(n))return ut.warn("[createTableSelection] invalid anchor/focus nodes - must be one of table nodes: ",{anchorNode:t,focusNode:n}),null;let e=(0,$n.$isTableNode)(t)?t:t.getParents().find(r=>(0,$n.$isTableNode)(r)),s=(0,$n.$createTableSelection)();return s.set(e.getKey(),t.getKey(),n.getKey()),s}static createNodeSelection(t,n){if(n||(n=t),!Bn(t)||!Bn(n))return ut.warn("[createNodeSelection] invalid anchor/focus - must be decorators: ",{anchorNode:t,focusNode:n}),null;let e=(0,bt.$createNodeSelection)(),s=t.getNodesBetween(n),r=s.filter(o=>Bn(o));return s.length!==r.length?(ut.warn("[createNodeSelection] nodes list contains unexpected nodes: ",{allNodes:s,decoratorNodes:r}),null):(r.forEach(o=>{e.add(o.__key)}),e)}static findClosestParentElementNode(t){if(!t)return null;let n=t.getParent();return n?Dc(n)?n:Wt.findClosestParentElementNode(n):null}static createRangeSelection(t,n,e,s,r,o){if(!(arguments.length>6&&arguments[6]!==void 0&&arguments[6])){if(!(ar(t)||Dc(t)||(ut.warn("[createRangeSelection] anchor node is not text or element node - finding closest parent element node "),t=Wt.findClosestParentElementNode(t))))return ut.warn("[createRangeSelection] unable to find anchor closest parent element node - dropping to null"),null;if(!(ar(n)||Dc(n)||(ut.warn("[createRangeSelection] focus node is not text or element node - finding closest parent element node "),n=Wt.findClosestParentElementNode(n))))return ut.warn("[createRangeSelection] unable to find focus closest parent element node - dropping to null"),null}let i=(0,bt.$createRangeSelection)();i.format=r,i.setStyle(o);let u=ar(t)?la.text:la.element,a=ar(n)?la.text:la.element;return i.anchor.set(t.getKey(),e,u),i.focus.set(n.getKey(),s,a),i.dirty=!1,i}static getSelectedCandidateFromParentChildren(t,n){let e=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=null,r=n;if(n===0){const o=t.getFirstChild();s=ar(o)?o:t}else{let o=t.getChildren(),i=[];for(let a of o)if(pa(a)||Bn(a))i.push(a);else{let f=Wt.getAllNodeLeaves(a);i.push(...f)}let u=n;for(let a of i)if(pa(a)||Bn(a)){let f=Bn(a)?1:a.getTextContentSize();if(u<=f){if(Mb(a)){let l=a.getNextSibling();l&&ar(l)?(s=l,r=0):(s=t,r=a.getPreviousSiblings().length+1);break}Bn(a)&&(e||(u=0)),s=a,r=u;break}u-=f}if(!s){const a=t.getLastChild();ar(a)?(s=a,r=a.getTextContentSize()):(s=t,r=t.getChildrenSize())}}return{candidate:s,candidateOffset:r}}static getSelectedParentAndOffset(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=t.getParent(),s=t.getPreviousSiblings().length+1;return(Lc(e)||!Bn(t)&&al(e))&&(e=t,s=n),{parent:e,parentOffset:s}}static JSONToLexical(t){if(ut.debug("[JSONToLexical]: ",{selectionJson:t}),!t)return null;let{anchor:{codoxId:n,offset:e},focus:{codoxId:s,offset:r},format:o,style:i}=t,u=!n.length,a=null;if(u)a=(0,bt.$getRoot)();else{let D=n[n.length-1];a=D?Wn.get(D):null}let f=!s.length,l=null;if(f)l=(0,bt.$getRoot)();else{let D=s[s.length-1];l=D?Wn.get(D):null}if(!a||!l)return ut.debug(" [JSONToLexical] anchorNode or focusNode not found in lexical nodes - selection will be dropped to null: ",{anchorParentNode:a,focusParentNode:l,anchorOffset:e,focusOffset:r,selectionJson:t}),null;if(a&&!a.isAttached()||l&&!l.isAttached())return ut.debug("[JSONToLexical] anchorNode or focusNode is no longer attached to editor - marked for GC: ",{anchorParentNode:a,focusParentNode:l,isAnchorNodeAttached:a.isAttached(),isFocusParentNodeAttached:l.isAttached()}),null;if(Lc(a)&&Lc(l)&&e===null&&r===null)return Wt.createTableSelection(a,l);if(Bn(a)&&Bn(l)&&e!==r)return Wt.createNodeSelection(a,l);if(Bn(a)&&Bn(l)&&e===r&&uO(a)&&uO(l)){let D=(0,bt.$getRoot)(),W=D.getChildren(),J=W.findIndex(z=>z.getKey()===a.getKey()),M=W.findIndex(z=>z.getKey()===l.getKey());return Wt.createRangeSelection(D,D,J,M,o,i)}let d,p,h,m,g=!!a.getChildrenSize,y=!!l.getChildrenSize,b=g&&a.getChildrenSize()===0,v=y&&l.getChildrenSize()===0;if(b&&v)return Wt.createRangeSelection(a,l,e,r,o,i);let _=g&&a.getChildrenSize()>0,w=y&&l.getChildrenSize()>0;if(_){let{candidate:D,candidateOffset:W}=Wt.getSelectedCandidateFromParentChildren(a,e);d=D,h=W}else{let{parent:D,parentOffset:W}=Wt.getSelectedParentAndOffset(a,e);d=D,h=W}if(w){let{candidate:D,candidateOffset:W}=Wt.getSelectedCandidateFromParentChildren(l,r,!0);p=D,m=W}else{let{parent:D,parentOffset:W}=Wt.getSelectedParentAndOffset(l,r);p=D,m=W}if(!d||!p)return null;let x=ar(d),S=ar(p),E=Bn(d),O=Bn(p),j=a.getKey()===l.getKey(),A=j&&r-e==1,T=j&&r===e&&d.getKey()===p.getKey(),I=e!==r,k=d.getKey()===p.getKey();if(E&&O&&T){let D=d.getNextSibling();if(D&&ar(D))return Wt.createRangeSelection(D,D,0,0,o,i);if(D&&(0,bt.$isParagraphNode)(D))return Wt.createNodeSelection(d,p);let{parent:W,parentOffset:J}=Wt.getSelectedParentAndOffset(d);return Wt.createRangeSelection(W,W,J,J,o,i)}let $=Wt.createRangeSelection(d,p,h,m,o,i,!0),H=$.isBackward(),U=$.getNodes();if(E&&O&&!k){if(A)return Wt.createNodeSelection(p);if(U.every(D=>Bn(D)))return Wt.createNodeSelection(d,p);{let D,W,J,M,z=d.getNextSibling();if(z&&ar(z))D=z,J=0;else{let{parent:G,parentOffset:F}=Wt.getSelectedParentAndOffset(d);D=G,J=F}let V=p.getNextSibling();if(V&&ar(V))W=V,M=0;else{let{parent:G,parentOffset:F}=Wt.getSelectedParentAndOffset(p);W=G,M=F}return Wt.createRangeSelection(D,W,J,M,o,i)}}if(x&&S&&I)if(H){let D=m===p.getTextContentSize(),W=p.getNextSibling();if(D&&W&&ar(W))return Wt.createRangeSelection(d,W,h,0,o,i)}else{let D=h===d.getTextContentSize(),W=d.getNextSibling();if(D&&W&&ar(W))return Wt.createRangeSelection(W,p,0,m,o,i)}if(I&&!E&&O){if(A)return Wt.createNodeSelection(p);let[D,...W]=U,J=W.every(z=>Bn(z));if(ar(D)&&h===D.getTextContentSize()&&J)return Wt.createNodeSelection(W[0],p);let M=p.getNextSibling();if(ar(d)&&d.getTextContentSize()===h&&!H){let z=d.getNextSibling();z&&ar(z)&&(d=z,h=0)}if(M&&ar(M))return Wt.createRangeSelection(d,M,h,0,o,i);{let{parent:z,parentOffset:V}=Wt.getSelectedParentAndOffset(p);return Wt.createRangeSelection(d,z,h,V,o,i)}}if(I&&E&&!O){let[D,...W]=U,J=W.every(z=>Bn(z));if(ar(D)&&m===D.getTextContentSize()&&J)return Wt.createNodeSelection(d,W[0]);let M=d.getNextSibling();if(M&&ar(M))return Wt.createRangeSelection(M,p,0,m,o,i);{let{parent:z,parentOffset:V}=Wt.getSelectedParentAndOffset(d);return Wt.createRangeSelection(z,p,V,m,o,i)}}return Wt.createRangeSelection(d,p,h,m,o,i)}}var U4=c=>{var t={};return un.d(t,c),t};const Ge=U4({Fragment:()=>mn.Fragment,createContext:()=>mn.createContext,createElement:()=>mn.createElement,forwardRef:()=>mn.forwardRef,useCallback:()=>mn.useCallback,useContext:()=>mn.useContext,useEffect:()=>mn.useEffect,useImperativeHandle:()=>mn.useImperativeHandle,useLayoutEffect:()=>mn.useLayoutEffect,useMemo:()=>mn.useMemo,useRef:()=>mn.useRef,useState:()=>mn.useState});function $E(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function zE(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$E(Object(n),!0).forEach(function(e){H4(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):$E(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function H4(c,t,n){return(t=K4(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function K4(c){var t=W4(c,"string");return typeof t=="symbol"?t:t+""}function W4(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}const Sb="comments_change";class q4 extends RE{constructor(){super(),this.initialCommentThreads=[],this.commentThreads=[],this.dataTypes={comment:"comment",thread:"thread"},this.ID_PREFIX="codox",this.relatedNodeKeys={},this.activeThreadIds={},this._uiRefreshTriggered=!1}_triggerUIRefresh(){this._uiRefreshTriggered||(this._uiRefreshTriggered=!0,Promise.resolve().then(()=>{ut.debug("[_triggerUIRefresh] emitted"),this.emit(Sb),this._uiRefreshTriggered=!1}))}_copyThreads(t){return[...t]}_getActiveCommentThreads(){return this.commentThreads.filter(t=>!!this.activeThreadIds[t.codoxId])}_setCommentThreads(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.commentThreads=[...t],[...t],this._triggerUIRefresh()}clear(){this.resetComments(),super.clear()}gcInternalStates(){this.relatedNodeKeys={},this.activeThreadIds={}}resetComments(){this.gcInternalStates(),this._setCommentThreads([])}getAllComments(){return this.commentThreads}setAllComments(t){Array.isArray(t)?this._setCommentThreads(t):ut.warn("[setAllComments]: incomming comments are not array: ",{newCommentThreads:t})}addRelatedNodeKey(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!Array.isArray(n)||!n.length)return;let s=n.filter(r=>typeof r=="string"&&r.startsWith(this.ID_PREFIX));if(s.length){if(e)for(let r of s)this.activeThreadIds[r]?this.activeThreadIds[r].add(t):this.activeThreadIds[r]=new Set([t]);else if(this.relatedNodeKeys[t]){let r=[...this.relatedNodeKeys[t]],o=s,i=o.length>r.length,u=r.length>o.length;i?o.filter(a=>!r.includes(a)).forEach(a=>{this.activeThreadIds[a].add(t)}):u&&r.filter(a=>!o.includes(a)).forEach(a=>{this.activeThreadIds[a].size>1?this.activeThreadIds[a].delete(t):delete this.activeThreadIds[a]})}this.relatedNodeKeys[t]=s,this._triggerUIRefresh()}}removeRelatedNodeKey(t){if(this.relatedNodeKeys[t]){let n=this.relatedNodeKeys[t];ut.debug("[CodoxComments][removeRelatedNodeKey]: ",{nodeKey:t,threadIds:n,activeThreads:this.activeThreadIds}),n.forEach(e=>{this.activeThreadIds[e]&&(this.activeThreadIds[e].size>1?this.activeThreadIds[e].delete(t):delete this.activeThreadIds[e])}),delete this.relatedNodeKeys[t],this._triggerUIRefresh()}}createCommentId(){return`${this.ID_PREFIX}-${Pb()}`}createNewCommentObj(t){let{content:n,author:e,codoxId:s,timeStamp:r}=t;return{author:e,content:n,codoxId:s||this.createCommentId(),timeStamp:r,type:this.dataTypes.comment}}createNewThreadObj(t){let{quote:n,comments:e,codoxId:s}=t;return{comments:e,codoxId:s||this.createCommentId(),quote:n,type:this.dataTypes.thread}}addCommentThread(t){let n=[...this.commentThreads,t];this._setCommentThreads(n)}addComment(t,n){let e=this.commentThreads.map(s=>{if(s.codoxId===t){let r=zE({},s);return r.comments=[...r.comments,n],r}return s});this._setCommentThreads(e)}removeCommentThread(t){}removeComment(t,n){ut.debug("[CodoxComments][removeCommentFromPlugin]: ",{commentId:n,threadId:t});let e=this.commentThreads.map(s=>{if(s.codoxId===t){let r=zE({},s);return r.comments=r.comments.filter(o=>o.codoxId!==n),r}return s});this._setCommentThreads(e)}gcAbandonedNodeKeys(t){let n=Object.keys(this.relatedNodeKeys);for(let e of n)t.has(e)||this.removeRelatedNodeKey(e)}refreshComments(){this._triggerUIRefresh()}setInitialComments(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Array.isArray(t)&&(ut.debug("[CodoxComments][setInitialComments]: ",[...t]),this.initialCommentThreads=[...t])}activateInitialComments(t){this.setAllComments(this.initialCommentThreads),console.log("COMMENTS: ",{initComments:[...this.initialCommentThreads]}),t.getEditorState().read(()=>{let n=(0,bt.$nodesOfType)(qo.MarkNode);for(let e of n)console.log("COMMENTS: ",{node:e}),this.addRelatedNodeKey(e.__key,e.__ids,!0)}),console.log("IVAN: ",{self:this}),this.initialCommentThreads=[]}initialCommentsExist(){return!!this.initialCommentThreads.length}}const Ln=new q4;function J4(){let c=Ln._getActiveCommentThreads.bind(Ln);const[t,n]=(0,Ge.useState)(c());return(0,Ge.useEffect)(()=>{Ln.on(Sb,()=>{let e=c();ut.log(`[useCodoxComments] "${Sb}" event: `,e),n(e)})},[]),t}const Cb=(0,bt.createCommand)("INSERT_COMMENT");var V4=c=>{var t={};return un.d(t,c),t};const Pc=V4({mergeRegister:()=>Xr,registerNestedElementResolver:()=>I5});var G4=un(967),is=un.n(G4),Y4=Object.getOwnPropertyNames,X4=Object.getOwnPropertySymbols,Z4=Object.prototype.hasOwnProperty;function UE(c,t){return function(n,e,s){return c(n,e,s)&&t(n,e,s)}}function $h(c){return function(t,n,e){if(!t||!n||typeof t!="object"||typeof n!="object")return c(t,n,e);var s=e.cache,r=s.get(t),o=s.get(n);if(r&&o)return r===n&&o===t;s.set(t,n),s.set(n,t);var i=c(t,n,e);return s.delete(t),s.delete(n),i}}function HE(c){return Y4(c).concat(X4(c))}var KE=Object.hasOwn||function(c,t){return Z4.call(c,t)};function Mc(c,t){return c||t?c===t:c===t||c!=c&&t!=t}var WE="_owner",qE=Object.getOwnPropertyDescriptor,JE=Object.keys;function Q4(c,t,n){var e=c.length;if(t.length!==e)return!1;for(;e-- >0;)if(!n.equals(c[e],t[e],e,e,c,t,n))return!1;return!0}function eL(c,t){return Mc(c.getTime(),t.getTime())}function VE(c,t,n){if(c.size!==t.size)return!1;for(var e,s,r={},o=c.entries(),i=0;(e=o.next())&&!e.done;){for(var u=t.entries(),a=!1,f=0;(s=u.next())&&!s.done;){var l=e.value,d=l[0],p=l[1],h=s.value,m=h[0],g=h[1];a||r[f]||!(a=n.equals(d,m,i,f,c,t,n)&&n.equals(p,g,d,m,c,t,n))||(r[f]=!0),f++}if(!a)return!1;i++}return!0}function tL(c,t,n){var e,s=JE(c),r=s.length;if(JE(t).length!==r)return!1;for(;r-- >0;)if((e=s[r])===WE&&(c.$$typeof||t.$$typeof)&&c.$$typeof!==t.$$typeof||!KE(t,e)||!n.equals(c[e],t[e],e,e,c,t,n))return!1;return!0}function Ld(c,t,n){var e,s,r,o=HE(c),i=o.length;if(HE(t).length!==i)return!1;for(;i-- >0;)if((e=o[i])===WE&&(c.$$typeof||t.$$typeof)&&c.$$typeof!==t.$$typeof||!KE(t,e)||!n.equals(c[e],t[e],e,e,c,t,n)||(s=qE(c,e),r=qE(t,e),(s||r)&&(!s||!r||s.configurable!==r.configurable||s.enumerable!==r.enumerable||s.writable!==r.writable)))return!1;return!0}function nL(c,t){return Mc(c.valueOf(),t.valueOf())}function rL(c,t){return c.source===t.source&&c.flags===t.flags}function GE(c,t,n){if(c.size!==t.size)return!1;for(var e,s,r={},o=c.values();(e=o.next())&&!e.done;){for(var i=t.values(),u=!1,a=0;(s=i.next())&&!s.done;)u||r[a]||!(u=n.equals(e.value,s.value,e.value,s.value,c,t,n))||(r[a]=!0),a++;if(!u)return!1}return!0}function oL(c,t){var n=c.length;if(t.length!==n)return!1;for(;n-- >0;)if(c[n]!==t[n])return!1;return!0}var iL="[object Arguments]",sL="[object Boolean]",aL="[object Date]",lL="[object Map]",cL="[object Number]",uL="[object Object]",dL="[object RegExp]",fL="[object Set]",pL="[object String]",hL=Array.isArray,YE=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,XE=Object.assign,gL=Object.prototype.toString.call.bind(Object.prototype.toString);function mL(c){var t=c.areArraysEqual,n=c.areDatesEqual,e=c.areMapsEqual,s=c.areObjectsEqual,r=c.arePrimitiveWrappersEqual,o=c.areRegExpsEqual,i=c.areSetsEqual,u=c.areTypedArraysEqual;return function(a,f,l){if(a===f)return!0;if(a==null||f==null||typeof a!="object"||typeof f!="object")return a!=a&&f!=f;var d=a.constructor;if(d!==f.constructor)return!1;if(d===Object)return s(a,f,l);if(hL(a))return t(a,f,l);if(YE!=null&&YE(a))return u(a,f,l);if(d===Date)return n(a,f,l);if(d===RegExp)return o(a,f,l);if(d===Map)return e(a,f,l);if(d===Set)return i(a,f,l);var p=gL(a);return p===aL?n(a,f,l):p===dL?o(a,f,l):p===lL?e(a,f,l):p===fL?i(a,f,l):p===uL?typeof a.then!="function"&&typeof f.then!="function"&&s(a,f,l):p===iL?s(a,f,l):(p===sL||p===cL||p===pL)&&r(a,f,l)}}function yL(c){var t=c.circular,n=c.createCustomConfig,e=c.strict,s={areArraysEqual:e?Ld:Q4,areDatesEqual:eL,areMapsEqual:e?UE(VE,Ld):VE,areObjectsEqual:e?Ld:tL,arePrimitiveWrappersEqual:nL,areRegExpsEqual:rL,areSetsEqual:e?UE(GE,Ld):GE,areTypedArraysEqual:e?Ld:oL};if(n&&(s=XE({},s,n(s))),t){var r=$h(s.areArraysEqual),o=$h(s.areMapsEqual),i=$h(s.areObjectsEqual),u=$h(s.areSetsEqual);s=XE({},s,{areArraysEqual:r,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:u})}return s}function bL(c){return function(t,n,e,s,r,o,i){return c(t,n,i)}}function vL(c){var t=c.circular,n=c.comparator,e=c.createState,s=c.equals,r=c.strict;if(e)return function(i,u){var a=e(),f=a.cache,l=f===void 0?t?new WeakMap:void 0:f,d=a.meta;return n(i,u,{cache:l,equals:s,meta:d,strict:r})};if(t)return function(i,u){return n(i,u,{cache:new WeakMap,equals:s,meta:void 0,strict:r})};var o={cache:void 0,equals:s,meta:void 0,strict:r};return function(i,u){return n(i,u,o)}}var Eb=ua();ua({strict:!0}),ua({circular:!0}),ua({circular:!0,strict:!0}),ua({createInternalComparator:function(){return Mc}}),ua({strict:!0,createInternalComparator:function(){return Mc}}),ua({circular:!0,createInternalComparator:function(){return Mc}}),ua({circular:!0,createInternalComparator:function(){return Mc},strict:!0});function ua(c){c===void 0&&(c={});var t=c.circular,n=t!==void 0&&t,e=c.createInternalComparator,s=c.createState,r=c.strict,o=r!==void 0&&r,i=mL(yL(c));return vL({circular:n,comparator:i,createState:s,equals:e?e(i):bL(i),strict:o})}var _L=un(256),xL=un.n(_L),wL=c=>{var t={};return un.d(t,c),t};const il=wL({$getSelectionStyleValueForProperty:()=>YS,$patchStyleText:()=>XS,createDOMRange:()=>ZI,createRectsFromDOMRange:()=>ky});class zh{static composeLexicalDOMNodeKeyAttrName(t){return`__lexicalKey_${t._key}`}static extractLexicalKeyFromLexicalDOMNodeKeyAttr(t){return t.split("__lexicalKey_")[1]||""}static extractSelectionUserId(t){return t.meta.author.id}static createRemoteSelectionColors(t){const n={caretColor:t,highlightColor:"",tooltipBGColor:""};if(t.startsWith("rgb")){let e=t,[s]=e.split(")");n.highlightColor=`${s},0.3)`,n.tooltipBGColor=`${s},0.85)`}else if(t.startsWith("#"))n.highlightColor=`${t}${Math.floor(76.5).toString(16).padStart(2,0)}`,n.tooltipBGColor=`${t}${Math.floor(216.75).toString(16).padStart(2,0)}`;else{const[e,s,r]=xL().keyword.rgb(t);n.highlightColor=`rgb(${e},${s}, ${r},0.3)`,n.tooltipBGColor=`rgb(${e},${s}, ${r},0.85)`}return n}static formatRemoteSelectionUsername(t){let n=t;return n=n.trim(),n.length>=17?`${n.substring(0,14)}...`:n}static isMousePositionWithinElementCords(t,n){return t.clientX>=n.x-5&&t.clientX<=n.x+n.width+5&&t.clientY>=n.y-5&&t.clientY<=n.y+n.height+5}static createDOMRange(t,n,e,s,r){return(0,il.createDOMRange)(t,n,e,s,r)}static createRectsFromDOMRange(t,n){let{keepFullWidthRects:e=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=t.getRootElement();if(s===null)return[];const r=s.getBoundingClientRect(),o=getComputedStyle(s),i=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),u=Array.from(n.getClientRects());let a=d=>u.splice(d,1),f=new Set;for(let d=0;d<u.length;d++){let p=u[d],h=u[d-1];if(!p||!h)continue;let m=`${(l=p).top}_${l.left}_${l.width}_${l.height}`;if(f.has(m))a(d--);else if(f.add(m),p.top===h.top&&p.height===h.height&&p.left-(h.left+h.width)<5){let g=DOMRect.fromRect({x:h.x,y:h.y,width:h.width+p.width,height:h.height});u[d-1]=g,a(d--)}else p.width+i!==r.width||e?h.top<=p.top&&h.bottom>=p.bottom&&h.left<=p.left&&h.right>=p.right&&a(d--):a(d--)}var l;return u}static getEmptyRootRect(t){let n=t.getRootElement(),e=n.getBoundingClientRect();const s=getComputedStyle(n),r=parseFloat(s.paddingLeft),o=parseFloat(s.paddingTop),i=parseFloat(s.paddingBottom);return[new DOMRect(e.x+r,e.y+o,0,e.height-i-o)]}}kf(zh,"remoteSelectionClassName","codox_remote_selection"),kf(zh,"remoteSelectionRect","codox_remote_selection_rect"),kf(zh,"tooltipAnimations",{hideAtOnce:"codox_hide_tooltip 0s linear 0s forwards",hideWithDelay:"codox_hide_tooltip 0s linear 2s forwards",showAtOnce:"codox_show_tooltip 0s linear 0s forwards",unset:"unset"});const Sr=zh;function ZE(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function SL(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZE(Object(n),!0).forEach(function(e){CL(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):ZE(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function CL(c,t,n){return(t=EL(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function EL(c){var t=OL(c,"string");return typeof t=="symbol"?t:t+""}function OL(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}class So{static _logInvalid(t,n,e){for(var s=arguments.length,r=new Array(s>3?s-3:0),o=3;o<s;o++)r[o-3]=arguments[o];ut.warn("[JSON SELECTION VALIDATION]: ",SL({selectBelongsTo:t||"not provided",reason:n,jsonSelection:e},r))}static _isObject(t){return typeof t=="object"&&!Array.isArray(t)}static _validateSelectionSide(t){let{type:n,side:e,sideName:s,fullSelection:r}=t;if(!So._isObject(e))return So._logInvalid(n,`selection.${s} must be object`,r),!1;let o=e.codoxId;if(!Array.isArray(o))return So._logInvalid(n,`selection.${s}.codoxId must be array`,r),!1;if(o.length){let u=o.findIndex(f=>f===ol.editorState),a=u!==-1;for(let f=0;f<o.length;f++){if(a){if(f===u||f===u+2)continue;if(f===u+1&&o[f]!=="root")return So._logInvalid(n,`selection.${s}.codoxId path invalid: nested selection must include "editorState" and "root": [..."editorState", "root"...]`,r,Wn),!1;continue}let l=o[f];if(!Wn.has(l))return So._logInvalid(n,`selection.${s}.codoxId path invalid: node for id ${l} does not exist`,r,Wn),!1}}let i=e.offset;return typeof i=="number"||i===null?i>=0||i===null||(So._logInvalid(n,`selection.${s}.offset must be gte 0 or -1`,r),!1):(So._logInvalid(n,`selection.${s}.offset must be number or null`,r),!1)}static validateJSONSelection(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t===null)return!0;if(!t)return So._logInvalid(n,"invalid json selection data type",t),!1;if(!So._isObject(t))return So._logInvalid(n,"json selection must be object",t),!1;let{anchor:e,focus:s}=t;return!!So._validateSelectionSide({type:n,side:e,sideName:"anchor",fullSelection:t})&&!!So._validateSelectionSide({type:n,side:s,sideName:"focus",fullSelection:t})}}const Ob=So;var TL=un(186),ss=un.n(TL),NL=un(155),as=un.n(NL),kL=un(433),ls=un.n(kL),AL=un(626),cs=un.n(AL),PL=un(990),us=un.n(PL),ML=un(827),ds=un.n(ML),Uh=un(500),Ic={};Ic.styleTagTransform=ds(),Ic.setAttributes=cs(),Ic.insert=ls().bind(null,"head"),Ic.domAPI=as(),Ic.insertStyleElement=us(),ss()(Uh.A,Ic),Uh.A&&Uh.A.locals&&Uh.A.locals;class IL{constructor(){kf(this,"paintSingleRemoteSelection",t=>{let{editor:n,selectionJSON:e,lexicalSelection:s,selectedNodes:r,isBackward:o}=t;this.activeEditorsKeys[n._key]||(this.activeEditorsKeys[n._key]=n._key);const i=Sr.extractSelectionUserId(e),u=Sr.formatRemoteSelectionUsername(e.meta.author.name),a=Sr.createRemoteSelectionColors(e.meta.color);let f=null,l=null,d=0,p=0;(0,bt.$isNodeSelection)(s)?(f=r[0],l=r[r.length-1],d=0,p=1):(f=n._editorState._nodeMap.get(s.anchor.key),l=n._editorState._nodeMap.get(s.focus.key),d=s.anchor.offset,p=s.focus.offset);let h=(0,$n.$isTableSelection)(s),m=(0,bt.$isNodeSelection)(s),g=(0,bt.$isRangeSelection)(s);for(let w of r)this.trackedNodesKeys.add(`${w.getKey()}__${n._key}`);r.length===1&&Mb(r[0])&&d===p&&p++;let y=null,b=[];if(h&&(0,$n.$isTableCellNode)(f)&&(0,$n.$isTableCellNode)(l)){let w=r.filter(x=>(0,$n.$isTableCellNode)(x));for(let x of w)if(d=(0,$n.$getTableColumnIndexFromTableCellNode)(x),p=(0,$n.$getTableColumnIndexFromTableCellNode)(x)+1,f=x.getParent(),l=x.getParent(),y=Sr.createDOMRange(n,f,d,l,p),y){let[S]=Sr.createRectsFromDOMRange(n,y);b.push(S)}}else if(m){let w=s.getNodes();for(let x of w)if(y=Sr.createDOMRange(n,x,0,x,1),y){let[S]=Sr.createRectsFromDOMRange(n,y);b.push(S)}}else g&&(al(f)&&al(l)&&d===0&&p===0?b=Sr.getEmptyRootRect(n):(y=Sr.createDOMRange(n,f,d,l,p),y&&(b=Sr.createRectsFromDOMRange(n,y,{keepFullWidthRects:!0}))));let v=null,_=document.createElement("span");_.classList.add(Sr.remoteSelectionClassName),_.setAttribute("codox_remote_user",i),document.body.append(_),this.remoteSelectionDOMsMap[i]=_;for(let w=0;w<b.length;w++){let x=b[w];if(!x)continue;let S=w===0,E=w===b.length-1,O=x.width,j=x.height,A=x.top,T=x.left,I=o&&S||!o&&E,k=document.createElement("span");if(_.append(k),k.classList.add(Sr.remoteSelectionRect),k.style.cssText=`
|
|
1409
|
+
/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),r.styleTagTransform(i,s,r.options)})(n,t,e)},remove:function(){(function(e){if(e.parentNode===null)return!1;e.parentNode.removeChild(e)})(n)}}}},827:c=>{c.exports=function(t,n){if(n.styleSheet)n.styleSheet.cssText=t;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(t))}}}},AE={};function un(c){var t=AE[c];if(t!==void 0)return t.exports;var n=AE[c]={id:c,exports:{}};return d4[c](n,n.exports,un),n.exports}un.n=c=>{var t=c&&c.__esModule?()=>c.default:()=>c;return un.d(t,{a:t}),t},un.d=(c,t)=>{for(var n in t)un.o(t,n)&&!un.o(c,n)&&Object.defineProperty(c,n,{enumerable:!0,get:t[n]})},un.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),un.o=(c,t)=>Object.prototype.hasOwnProperty.call(c,t),un.nc=void 0;var aa={};un.d(aa,{yy:()=>t6,_U:()=>u8,a8:()=>T8,Vs:()=>E8,Cn:()=>Cb,gK:()=>E6,vv:()=>WL});var f4=c=>{var t={};return un.d(t,c),t};const bt=f4({$addUpdateTag:()=>DM,$createNodeSelection:()=>LM,$createParagraphNode:()=>An,$createRangeSelection:()=>ud,$getNodeByKey:()=>Ro,$getRoot:()=>Un,$getSelection:()=>st,$isDecoratorNode:()=>uo,$isElementNode:()=>Rt,$isLineBreakNode:()=>dd,$isNodeSelection:()=>fo,$isParagraphNode:()=>xy,$isRangeSelection:()=>at,$isTextNode:()=>zt,$nodesOfType:()=>BM,$setSelection:()=>kr,CAN_REDO_COMMAND:()=>Oi,CAN_UNDO_COMMAND:()=>Ti,CLEAR_EDITOR_COMMAND:()=>fd,COMMAND_PRIORITY_CRITICAL:()=>mr,COMMAND_PRIORITY_EDITOR:()=>Ct,CUT_COMMAND:()=>pd,DecoratorNode:()=>FM,ElementNode:()=>po,KEY_BACKSPACE_COMMAND:()=>Va,KEY_DELETE_COMMAND:()=>Ga,KEY_ESCAPE_COMMAND:()=>hd,LineBreakNode:()=>$M,PASTE_COMMAND:()=>gd,ParagraphNode:()=>zM,REDO_COMMAND:()=>Qp,RootNode:()=>UM,TextNode:()=>Ya,UNDO_COMMAND:()=>rh,createCommand:()=>Xa,createEditor:()=>wy});var p4=c=>{var t={};return un.d(t,c),t};const h4=p4({$isLinkNode:()=>Uj});var g4=c=>{var t={};return un.d(t,c),t};const qo=g4({$createMarkNode:()=>Xj,$getMarkIDs:()=>Zj,$isMarkNode:()=>Qj,$unwrapMarkNode:()=>eD,$wrapSelectionInMarkNode:()=>tD,MarkNode:()=>nD});var m4=c=>{var t={};return un.d(t,c),t};const $n=m4({$createTableCellNode:()=>ZD,$createTableRowNode:()=>QD,$createTableSelection:()=>e3,$getTableColumnIndexFromTableCellNode:()=>t3,$isTableCellNode:()=>n3,$isTableNode:()=>r3,$isTableRowNode:()=>o3,$isTableSelection:()=>i3,TableCellNode:()=>s3,TableNode:()=>a3,TableRowNode:()=>l3}),y4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),PE={randomUUID:y4};let Bh;const b4=new Uint8Array(16);function v4(){if(!Bh&&(Bh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bh(b4)}const Ur=[];for(let c=0;c<256;++c)Ur.push((c+256).toString(16).slice(1));function _4(c,t=0){return Ur[c[t+0]]+Ur[c[t+1]]+Ur[c[t+2]]+Ur[c[t+3]]+"-"+Ur[c[t+4]]+Ur[c[t+5]]+"-"+Ur[c[t+6]]+Ur[c[t+7]]+"-"+Ur[c[t+8]]+Ur[c[t+9]]+"-"+Ur[c[t+10]]+Ur[c[t+11]]+Ur[c[t+12]]+Ur[c[t+13]]+Ur[c[t+14]]+Ur[c[t+15]]}function x4(c,t,n){if(PE.randomUUID&&!t&&!c)return PE.randomUUID();const e=(c=c||{}).random||(c.rng||v4)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,t){n=n||0;for(let s=0;s<16;++s)t[n+s]=e[s];return t}return _4(e)}const w4=x4;let S4=()=>{},Rd=function(){return S4};const C4=Rd(),E4=Rd(),O4=Rd(),T4=Rd(),N4=Rd(),k4={log:C4,info:E4,warn:T4,debug:O4,error:N4},ut=k4,A4=[c=>c.hasFormat("bold")&&"bold",c=>c.hasFormat("code")&&"code",c=>c.hasFormat("italic")&&"italic",c=>c.hasFormat("strikethrough")&&"strikethrough",c=>c.hasFormat("subscript")&&"subscript",c=>c.hasFormat("superscript")&&"superscript",c=>c.hasFormat("underline")&&"underline"],ME={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},P4={center:2,end:6,justify:4,left:1,right:3,start:5};function M4(c){if(!c||!c.length)return 0;let t=c.split(",");if(t=t.map(e=>e.trim()),t.length===1&&!ME[t[0]])return c;let n=0;for(const e of t){const s=ME[e];s&&(n^=s)}return n}function I4(c){return c?A4.map(t=>t(c)).filter(Boolean).join(","):""}function R4(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return c&&P4[c]||0}function jd(c){return`__${c}`}function xb(c){return c.split("__")[1]||""}class j4{constructor(){this.subscribers={}}on(t,n){t&&n&&(this.subscribers[t]||(this.subscribers[t]=[]),this.subscribers[t].push(n))}emit(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.subscribers[t]&&this.subscribers[t].length)for(const e of this.subscribers[t])typeof e=="function"&&e(n)}clear(){this.subscribers={}}}const IE=j4,Jo={historic:"historic",historyMerge:"history-merge",historyPush:"history-push"},D4={paste:"application/x-lexical-editor",drag:"application/x-lexical-drag",dragBlock:"application/x-lexical-drag-block",plainText:"text/plain"},jo={created:"created",updated:"updated",destroyed:"destroyed"},la={text:"text",element:"element",whitelist:["text","element"]},Qr={mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keypress:"keypress",keyup:"keyup",resize:"resize",scroll:"scroll"},RE=[Qr.mousemove,Qr.mouseover,Qr.mouseout],Fh={text:"text",linebreak:"linebreak",horizontalrule:"horizontalrule"},wb={local:"local",remote:"remote"},ol={editorState:"editorState",root:"root"},ca={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},Dd="codox_comments_change",jE={horizontalrule:["table","image","inline-image","sticky"],"page-break":["image","inline-image","table","sticky"],"collapsible-container":["table","image","inline-image","collapsible-container","sticky"],"layout-container":["table","image","inline-image","layout-container","sticky"],image:["image","inline-image","sticky"],"inline-image":["image","inline-image","sticky"],table:["image","inline-image","table","sticky"],poll:["image","inline-image","sticky"],excalidraw:["image","inline-image","sticky"]},L4="Invalid state - forbidden content nesting found",DE={local:"local",remote:"remote"};function LE(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function BE(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LE(Object(n),!0).forEach(function(e){B4(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):LE(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function B4(c,t,n){return(t=F4(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function F4(c){var t=$4(c,"string");return typeof t=="symbol"?t:t+""}function $4(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}class Wt{static equalSelectionsJSON(t,n){return!((t||n)&&(t&&!n||n&&!t||t.anchor.codoxId.toString()!==n.anchor.codoxId.toString()||t.anchor.offset!==n.anchor.offset||t.focus.codoxId.toString()!==n.focus.codoxId.toString()||t.focus.offset!==n.focus.offset))}static getNodeAncestorsList(t){return t.getParents()}static getAllNodeLeaves(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(g6(t))return n.push(t),n;let e=t.getChildren();if(!e.length)return n;for(const s of e)n=Wt.getAllNodeLeaves(s,n);return n}static splitCodoxIdPathIntoMainAndNested(t){let n=t.findIndex(s=>s===ol.editorState),e=n+1;return{mainPath:t.slice(0,n),nestedPath:t.slice(e+1)}}static getCodoxIdAndOffsetFromRootNode(t,n){let e=t.getChildren()[n];return{codoxIdArray:e&&e.codoxId?[e.codoxId]:[],offset:0}}static isNestedSelectionJSON(t){return!!t&&!(!t.anchor.codoxId.includes(ol.editorState)||!t.focus.codoxId.includes(ol.editorState))}static lexicalToJSONNested(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=Wt.lexicalToJSON(t);if(!s)return null;let r=[...e,n,ol.editorState,ol.root];return s.anchor.codoxId=[...r,...s.anchor.codoxId],s.focus.codoxId=[...r,...s.focus.codoxId],s}static getNestedSelectionJSONFromMainSelectionJSON(t){let n={nestedSelectionJSON:null,nestedEditor:null},{mainPath:e,nestedPath:s}=Wt.splitCodoxIdPathIntoMainAndNested(t.anchor.codoxId),{mainPath:r,nestedPath:o}=Wt.splitCodoxIdPathIntoMainAndNested(t.focus.codoxId);e.toString()===r.toString()||ut.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Nested selection main path part must point to same node in main editor: ",{anchorCodoxIds:t.anchor.codoxId,mainAnchorPath:e,nestedAnchorPath:s,focusCodoxIds:t.focus.codoxId,mainFocusPath:r,nestedFocusPath:o});let i=e,u=i[i.length-1],a=i[i.length-2],f=Wn.get(a);if(!f){let p=i[i.length-3];if(p){let h=Wn.get(p);h&&(f=h.getChildren().find(m=>m.codoxDId===a))}}if(!f)return ut.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Lexical node with nested editor not found in codox nodes map - selection will be dropped",{jsonSelection:t,targetNodeCodoxId:a}),n;let l=jd(u),d=f[l];return xt.isLexicalEditorInstance(d)?(n.nestedSelectionJSON=BE(BE({},t),{},{anchor:{codoxId:s,offset:t.anchor.offset},focus:{codoxId:o,offset:t.focus.offset}}),n.nestedEditor=d,n):(ut.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Found nested editor is not LexicalEditor instance",{jsonSelection:t,targetLexicalNode:f,targetLexicalNodeAttrName:l,nestedEditorCandidate:d}),n)}static getNodeAncestorsCodoxIds(t){let n=[],e=Wt.getNodeAncestorsList(t);if(e.length===1&&e[0].__type==="root")return n.push(t.codoxId),n;for(let s=e.length-2;s>=0;s--){let r=e[s];r.codoxId&&n.push(r.codoxId)}return t.codoxId&&t.getChildren&&n.push(t.codoxId),n}static getParentOffsetOutOfNodeOffset(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(arguments.length>2&&arguments[2]!==void 0&&arguments[2]){if(t.getChildrenSize&&t.getChildrenSize()===0||n===0&&t.codoxId)return n;let o=n,i=[];if(t.codoxId)i=t.getChildren();else{const a=t.getParents().find(l=>!!l.codoxId);let f=!1;for(const l of a.getChildren()){if(l.__key===t.__key&&(f=!!n&&(Fd(l)||Bd(l)),!f))break;if(pa(l))i.push(l),o+=l.getTextContentSize();else if(Bn(l))i.push(l),o++;else{let d=Wt.getAllNodeLeaves(l),p=d.reduce((h,m)=>(pa(m)?h+=m.getTextContentSize():Bn(m)&&h++,h),0);i.push(...d),o+=p}if(f)break}}let u=0;for(const a of i){if(o<=0)break;let f=0;f=Bn(a)?1:a.getTextContentSize(),u+=f,Bn(a)?o--:o-=f}return u}let e=t.getParents().find(o=>!!o.codoxId);if(!e)return n;let s=[];for(const o of e.getChildren())if(pa(o)||Bn(o))s.push(o);else{let i=Wt.getAllNodeLeaves(o);s.push(...i)}if(s.length===1&&s[0].__key===t.__key)return n;let r=0;for(const o of s){if(o.__key===t.__key){r+=n;break}let i=0;i=Bn(o)?1:o.getTextContentSize(),r+=i}return r}static lexicalToJSON(t){if(!t)return null;let n=[],e=0,s=[],r=0,o="",i=0,u=!0;if((0,bt.$isRangeSelection)(t)){let a=(0,bt.$getNodeByKey)(t.anchor.key);if(al(a)){let{codoxIdArray:l,offset:d}=Wt.getCodoxIdAndOffsetFromRootNode(a,t.anchor.offset);n=l,e=d}else{if((0,$n.$isTableCellNode)(a)){let p=a.getFirstChild();p&&Dc(p)&&(a=p)}n=Wt.getNodeAncestorsCodoxIds(a);const l=t.anchor.offset,d=t.anchor.type===la.element;e=Wt.getParentOffsetOutOfNodeOffset(a,l,d,"anchor")}let f=(0,bt.$getNodeByKey)(t.focus.key);if(al(f)){let{codoxIdArray:l,offset:d}=Wt.getCodoxIdAndOffsetFromRootNode(f,t.focus.offset);s=l,r=d}else{if((0,$n.$isTableCellNode)(f)){let p=f.getFirstChild();p&&Dc(p)&&(f=p)}s=Wt.getNodeAncestorsCodoxIds(f);const l=t.focus.offset,d=t.focus.type===la.element;r=Wt.getParentOffsetOutOfNodeOffset(f,l,d,"focus")}o=t.style,i=t.format,u=t.dirty}else if((0,bt.$isNodeSelection)(t)){let a=t.getNodes();if(!a.length)return null;let f=a[0],l=a[a.length-1],d=(0,bt.$createRangeSelection)();d.anchor.set(f.getKey(),0,la.element),d.focus.set(l.getKey(),0,la.element);let p=d.isBackward();n=Wt.getNodeAncestorsCodoxIds(f),s=Wt.getNodeAncestorsCodoxIds(l);let h=p?1:0,m=p?0:1;e=Wt.getParentOffsetOutOfNodeOffset(f,h),r=Wt.getParentOffsetOutOfNodeOffset(l,m)}else if((0,$n.$isTableSelection)(t)){e=r=null;let a=(0,bt.$getNodeByKey)(t.anchor.key),f=(0,bt.$getNodeByKey)(t.focus.key);n=Wt.getNodeAncestorsCodoxIds(a),s=Wt.getNodeAncestorsCodoxIds(f)}return{anchor:{codoxId:n,offset:e},focus:{codoxId:s,offset:r},style:o,format:i,dirty:u}}static createTableSelection(t,n){if(!Lc(t)||!Lc(n))return ut.warn("[createTableSelection] invalid anchor/focus nodes - must be one of table nodes: ",{anchorNode:t,focusNode:n}),null;let e=(0,$n.$isTableNode)(t)?t:t.getParents().find(r=>(0,$n.$isTableNode)(r)),s=(0,$n.$createTableSelection)();return s.set(e.getKey(),t.getKey(),n.getKey()),s}static createNodeSelection(t,n){if(n||(n=t),!Bn(t)||!Bn(n))return ut.warn("[createNodeSelection] invalid anchor/focus - must be decorators: ",{anchorNode:t,focusNode:n}),null;let e=(0,bt.$createNodeSelection)(),s=t.getNodesBetween(n),r=s.filter(o=>Bn(o));return s.length!==r.length?(ut.warn("[createNodeSelection] nodes list contains unexpected nodes: ",{allNodes:s,decoratorNodes:r}),null):(r.forEach(o=>{e.add(o.__key)}),e)}static findClosestParentElementNode(t){if(!t)return null;let n=t.getParent();return n?Dc(n)?n:Wt.findClosestParentElementNode(n):null}static createRangeSelection(t,n,e,s,r,o){if(!(arguments.length>6&&arguments[6]!==void 0&&arguments[6])){if(!(ar(t)||Dc(t)||(ut.warn("[createRangeSelection] anchor node is not text or element node - finding closest parent element node "),t=Wt.findClosestParentElementNode(t))))return ut.warn("[createRangeSelection] unable to find anchor closest parent element node - dropping to null"),null;if(!(ar(n)||Dc(n)||(ut.warn("[createRangeSelection] focus node is not text or element node - finding closest parent element node "),n=Wt.findClosestParentElementNode(n))))return ut.warn("[createRangeSelection] unable to find focus closest parent element node - dropping to null"),null}let i=(0,bt.$createRangeSelection)();i.format=r,i.setStyle(o);let u=ar(t)?la.text:la.element,a=ar(n)?la.text:la.element;return i.anchor.set(t.getKey(),e,u),i.focus.set(n.getKey(),s,a),i.dirty=!1,i}static getSelectedCandidateFromParentChildren(t,n){let e=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=null,r=n;if(n===0){const o=t.getFirstChild();s=ar(o)?o:t}else{let o=t.getChildren(),i=[];for(let a of o)if(pa(a)||Bn(a))i.push(a);else{let f=Wt.getAllNodeLeaves(a);i.push(...f)}let u=n;for(let a of i)if(pa(a)||Bn(a)){let f=Bn(a)?1:a.getTextContentSize();if(u<=f){if(Mb(a)){let l=a.getNextSibling();l&&ar(l)?(s=l,r=0):(s=t,r=a.getPreviousSiblings().length+1);break}Bn(a)&&(e||(u=0)),s=a,r=u;break}u-=f}if(!s){const a=t.getLastChild();ar(a)?(s=a,r=a.getTextContentSize()):(s=t,r=t.getChildrenSize())}}return{candidate:s,candidateOffset:r}}static getSelectedParentAndOffset(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=t.getParent(),s=t.getPreviousSiblings().length+1;return(Lc(e)||!Bn(t)&&al(e))&&(e=t,s=n),{parent:e,parentOffset:s}}static JSONToLexical(t){if(ut.debug("[JSONToLexical]: ",{selectionJson:t}),!t)return null;let{anchor:{codoxId:n,offset:e},focus:{codoxId:s,offset:r},format:o,style:i}=t,u=!n.length,a=null;if(u)a=(0,bt.$getRoot)();else{let D=n[n.length-1];a=D?Wn.get(D):null}let f=!s.length,l=null;if(f)l=(0,bt.$getRoot)();else{let D=s[s.length-1];l=D?Wn.get(D):null}if(!a||!l)return ut.debug(" [JSONToLexical] anchorNode or focusNode not found in lexical nodes - selection will be dropped to null: ",{anchorParentNode:a,focusParentNode:l,anchorOffset:e,focusOffset:r,selectionJson:t}),null;if(a&&!a.isAttached()||l&&!l.isAttached())return ut.debug("[JSONToLexical] anchorNode or focusNode is no longer attached to editor - marked for GC: ",{anchorParentNode:a,focusParentNode:l,isAnchorNodeAttached:a.isAttached(),isFocusParentNodeAttached:l.isAttached()}),null;if(Lc(a)&&Lc(l)&&e===null&&r===null)return Wt.createTableSelection(a,l);if(Bn(a)&&Bn(l)&&e!==r)return Wt.createNodeSelection(a,l);if(Bn(a)&&Bn(l)&&e===r&&cO(a)&&cO(l)){let D=(0,bt.$getRoot)(),W=D.getChildren(),J=W.findIndex(z=>z.getKey()===a.getKey()),M=W.findIndex(z=>z.getKey()===l.getKey());return Wt.createRangeSelection(D,D,J,M,o,i)}let d,p,h,m,g=!!a.getChildrenSize,y=!!l.getChildrenSize,b=g&&a.getChildrenSize()===0,v=y&&l.getChildrenSize()===0;if(b&&v)return Wt.createRangeSelection(a,l,e,r,o,i);let _=g&&a.getChildrenSize()>0,w=y&&l.getChildrenSize()>0;if(_){let{candidate:D,candidateOffset:W}=Wt.getSelectedCandidateFromParentChildren(a,e);d=D,h=W}else{let{parent:D,parentOffset:W}=Wt.getSelectedParentAndOffset(a,e);d=D,h=W}if(w){let{candidate:D,candidateOffset:W}=Wt.getSelectedCandidateFromParentChildren(l,r,!0);p=D,m=W}else{let{parent:D,parentOffset:W}=Wt.getSelectedParentAndOffset(l,r);p=D,m=W}if(!d||!p)return null;let x=ar(d),S=ar(p),E=Bn(d),O=Bn(p),j=a.getKey()===l.getKey(),A=j&&r-e==1,T=j&&r===e&&d.getKey()===p.getKey(),I=e!==r,k=d.getKey()===p.getKey();if(E&&O&&T){let D=d.getNextSibling();if(D&&ar(D))return Wt.createRangeSelection(D,D,0,0,o,i);if(D&&(0,bt.$isParagraphNode)(D))return Wt.createNodeSelection(d,p);let{parent:W,parentOffset:J}=Wt.getSelectedParentAndOffset(d);return Wt.createRangeSelection(W,W,J,J,o,i)}let $=Wt.createRangeSelection(d,p,h,m,o,i,!0),H=$.isBackward(),U=$.getNodes();if(E&&O&&!k){if(A)return Wt.createNodeSelection(p);if(U.every(D=>Bn(D)))return Wt.createNodeSelection(d,p);{let D,W,J,M,z=d.getNextSibling();if(z&&ar(z))D=z,J=0;else{let{parent:G,parentOffset:F}=Wt.getSelectedParentAndOffset(d);D=G,J=F}let V=p.getNextSibling();if(V&&ar(V))W=V,M=0;else{let{parent:G,parentOffset:F}=Wt.getSelectedParentAndOffset(p);W=G,M=F}return Wt.createRangeSelection(D,W,J,M,o,i)}}if(x&&S&&I)if(H){let D=m===p.getTextContentSize(),W=p.getNextSibling();if(D&&W&&ar(W))return Wt.createRangeSelection(d,W,h,0,o,i)}else{let D=h===d.getTextContentSize(),W=d.getNextSibling();if(D&&W&&ar(W))return Wt.createRangeSelection(W,p,0,m,o,i)}if(I&&!E&&O){if(A)return Wt.createNodeSelection(p);let[D,...W]=U,J=W.every(z=>Bn(z));if(ar(D)&&h===D.getTextContentSize()&&J)return Wt.createNodeSelection(W[0],p);let M=p.getNextSibling();if(ar(d)&&d.getTextContentSize()===h&&!H){let z=d.getNextSibling();z&&ar(z)&&(d=z,h=0)}if(M&&ar(M))return Wt.createRangeSelection(d,M,h,0,o,i);{let{parent:z,parentOffset:V}=Wt.getSelectedParentAndOffset(p);return Wt.createRangeSelection(d,z,h,V,o,i)}}if(I&&E&&!O){let[D,...W]=U,J=W.every(z=>Bn(z));if(ar(D)&&m===D.getTextContentSize()&&J)return Wt.createNodeSelection(d,W[0]);let M=d.getNextSibling();if(M&&ar(M))return Wt.createRangeSelection(M,p,0,m,o,i);{let{parent:z,parentOffset:V}=Wt.getSelectedParentAndOffset(d);return Wt.createRangeSelection(z,p,V,m,o,i)}}return Wt.createRangeSelection(d,p,h,m,o,i)}}var z4=c=>{var t={};return un.d(t,c),t};const Ge=z4({Fragment:()=>gn.Fragment,createContext:()=>gn.createContext,createElement:()=>gn.createElement,forwardRef:()=>gn.forwardRef,useCallback:()=>gn.useCallback,useContext:()=>gn.useContext,useEffect:()=>gn.useEffect,useImperativeHandle:()=>gn.useImperativeHandle,useLayoutEffect:()=>gn.useLayoutEffect,useMemo:()=>gn.useMemo,useRef:()=>gn.useRef,useState:()=>gn.useState});function FE(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function $E(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FE(Object(n),!0).forEach(function(e){U4(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):FE(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function U4(c,t,n){return(t=H4(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function H4(c){var t=K4(c,"string");return typeof t=="symbol"?t:t+""}function K4(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}const Sb="comments_change";class W4 extends IE{constructor(){super(),this.initialCommentThreads=[],this.commentThreads=[],this.dataTypes={comment:"comment",thread:"thread"},this.ID_PREFIX="codox",this.relatedNodeKeys={},this.activeThreadIds={},this._uiRefreshTriggered=!1}_triggerUIRefresh(){this._uiRefreshTriggered||(this._uiRefreshTriggered=!0,Promise.resolve().then(()=>{ut.debug("[_triggerUIRefresh] emitted"),this.emit(Sb),this._uiRefreshTriggered=!1}))}_copyThreads(t){return[...t]}_getActiveCommentThreads(){return this.commentThreads.filter(t=>!!this.activeThreadIds[t.codoxId])}_setCommentThreads(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.commentThreads=[...t],[...t],this._triggerUIRefresh()}clear(){this.resetComments(),super.clear()}gcInternalStates(){this.relatedNodeKeys={},this.activeThreadIds={}}resetComments(){this.gcInternalStates(),this._setCommentThreads([])}getAllComments(){return this.commentThreads}setAllComments(t){Array.isArray(t)?this._setCommentThreads(t):ut.warn("[setAllComments]: incomming comments are not array: ",{newCommentThreads:t})}addRelatedNodeKey(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!Array.isArray(n)||!n.length)return;let s=n.filter(r=>typeof r=="string"&&r.startsWith(this.ID_PREFIX));if(s.length){if(e)for(let r of s)this.activeThreadIds[r]?this.activeThreadIds[r].add(t):this.activeThreadIds[r]=new Set([t]);else if(this.relatedNodeKeys[t]){let r=[...this.relatedNodeKeys[t]],o=s,i=o.length>r.length,u=r.length>o.length;i?o.filter(a=>!r.includes(a)).forEach(a=>{this.activeThreadIds[a].add(t)}):u&&r.filter(a=>!o.includes(a)).forEach(a=>{this.activeThreadIds[a].size>1?this.activeThreadIds[a].delete(t):delete this.activeThreadIds[a]})}this.relatedNodeKeys[t]=s,this._triggerUIRefresh()}}removeRelatedNodeKey(t){if(this.relatedNodeKeys[t]){let n=this.relatedNodeKeys[t];ut.debug("[CodoxComments][removeRelatedNodeKey]: ",{nodeKey:t,threadIds:n,activeThreads:this.activeThreadIds}),n.forEach(e=>{this.activeThreadIds[e]&&(this.activeThreadIds[e].size>1?this.activeThreadIds[e].delete(t):delete this.activeThreadIds[e])}),delete this.relatedNodeKeys[t],this._triggerUIRefresh()}}createCommentId(){return`${this.ID_PREFIX}-${Pb()}`}createNewCommentObj(t){let{content:n,author:e,codoxId:s,timeStamp:r}=t;return{author:e,content:n,codoxId:s||this.createCommentId(),timeStamp:r,type:this.dataTypes.comment}}createNewThreadObj(t){let{quote:n,comments:e,codoxId:s}=t;return{comments:e,codoxId:s||this.createCommentId(),quote:n,type:this.dataTypes.thread}}addCommentThread(t){let n=[...this.commentThreads,t];this._setCommentThreads(n)}addComment(t,n){let e=this.commentThreads.map(s=>{if(s.codoxId===t){let r=$E({},s);return r.comments=[...r.comments,n],r}return s});this._setCommentThreads(e)}removeCommentThread(t){}removeComment(t,n){ut.debug("[CodoxComments][removeCommentFromPlugin]: ",{commentId:n,threadId:t});let e=this.commentThreads.map(s=>{if(s.codoxId===t){let r=$E({},s);return r.comments=r.comments.filter(o=>o.codoxId!==n),r}return s});this._setCommentThreads(e)}gcAbandonedNodeKeys(t){let n=Object.keys(this.relatedNodeKeys);for(let e of n)t.has(e)||this.removeRelatedNodeKey(e)}refreshComments(){this._triggerUIRefresh()}setInitialComments(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Array.isArray(t)&&(ut.debug("[CodoxComments][setInitialComments]: ",[...t]),this.initialCommentThreads=[...t])}activateInitialComments(t){this.setAllComments(this.initialCommentThreads),console.log("COMMENTS: ",{initComments:[...this.initialCommentThreads]}),t.getEditorState().read(()=>{let n=(0,bt.$nodesOfType)(qo.MarkNode);for(let e of n)console.log("COMMENTS: ",{node:e}),this.addRelatedNodeKey(e.__key,e.__ids,!0)}),console.log("IVAN: ",{self:this}),this.initialCommentThreads=[]}initialCommentsExist(){return!!this.initialCommentThreads.length}}const Ln=new W4;function q4(){let c=Ln._getActiveCommentThreads.bind(Ln);const[t,n]=(0,Ge.useState)(c());return(0,Ge.useEffect)(()=>{Ln.on(Sb,()=>{let e=c();ut.log(`[useCodoxComments] "${Sb}" event: `,e),n(e)})},[]),t}const Cb=(0,bt.createCommand)("INSERT_COMMENT");var J4=c=>{var t={};return un.d(t,c),t};const Pc=J4({mergeRegister:()=>Xr,registerNestedElementResolver:()=>M5});var V4=un(967),is=un.n(V4),G4=Object.getOwnPropertyNames,Y4=Object.getOwnPropertySymbols,X4=Object.prototype.hasOwnProperty;function zE(c,t){return function(n,e,s){return c(n,e,s)&&t(n,e,s)}}function $h(c){return function(t,n,e){if(!t||!n||typeof t!="object"||typeof n!="object")return c(t,n,e);var s=e.cache,r=s.get(t),o=s.get(n);if(r&&o)return r===n&&o===t;s.set(t,n),s.set(n,t);var i=c(t,n,e);return s.delete(t),s.delete(n),i}}function UE(c){return G4(c).concat(Y4(c))}var HE=Object.hasOwn||function(c,t){return X4.call(c,t)};function Mc(c,t){return c||t?c===t:c===t||c!=c&&t!=t}var KE="_owner",WE=Object.getOwnPropertyDescriptor,qE=Object.keys;function Z4(c,t,n){var e=c.length;if(t.length!==e)return!1;for(;e-- >0;)if(!n.equals(c[e],t[e],e,e,c,t,n))return!1;return!0}function Q4(c,t){return Mc(c.getTime(),t.getTime())}function JE(c,t,n){if(c.size!==t.size)return!1;for(var e,s,r={},o=c.entries(),i=0;(e=o.next())&&!e.done;){for(var u=t.entries(),a=!1,f=0;(s=u.next())&&!s.done;){var l=e.value,d=l[0],p=l[1],h=s.value,m=h[0],g=h[1];a||r[f]||!(a=n.equals(d,m,i,f,c,t,n)&&n.equals(p,g,d,m,c,t,n))||(r[f]=!0),f++}if(!a)return!1;i++}return!0}function eL(c,t,n){var e,s=qE(c),r=s.length;if(qE(t).length!==r)return!1;for(;r-- >0;)if((e=s[r])===KE&&(c.$$typeof||t.$$typeof)&&c.$$typeof!==t.$$typeof||!HE(t,e)||!n.equals(c[e],t[e],e,e,c,t,n))return!1;return!0}function Ld(c,t,n){var e,s,r,o=UE(c),i=o.length;if(UE(t).length!==i)return!1;for(;i-- >0;)if((e=o[i])===KE&&(c.$$typeof||t.$$typeof)&&c.$$typeof!==t.$$typeof||!HE(t,e)||!n.equals(c[e],t[e],e,e,c,t,n)||(s=WE(c,e),r=WE(t,e),(s||r)&&(!s||!r||s.configurable!==r.configurable||s.enumerable!==r.enumerable||s.writable!==r.writable)))return!1;return!0}function tL(c,t){return Mc(c.valueOf(),t.valueOf())}function nL(c,t){return c.source===t.source&&c.flags===t.flags}function VE(c,t,n){if(c.size!==t.size)return!1;for(var e,s,r={},o=c.values();(e=o.next())&&!e.done;){for(var i=t.values(),u=!1,a=0;(s=i.next())&&!s.done;)u||r[a]||!(u=n.equals(e.value,s.value,e.value,s.value,c,t,n))||(r[a]=!0),a++;if(!u)return!1}return!0}function rL(c,t){var n=c.length;if(t.length!==n)return!1;for(;n-- >0;)if(c[n]!==t[n])return!1;return!0}var oL="[object Arguments]",iL="[object Boolean]",sL="[object Date]",aL="[object Map]",lL="[object Number]",cL="[object Object]",uL="[object RegExp]",dL="[object Set]",fL="[object String]",pL=Array.isArray,GE=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,YE=Object.assign,hL=Object.prototype.toString.call.bind(Object.prototype.toString);function gL(c){var t=c.areArraysEqual,n=c.areDatesEqual,e=c.areMapsEqual,s=c.areObjectsEqual,r=c.arePrimitiveWrappersEqual,o=c.areRegExpsEqual,i=c.areSetsEqual,u=c.areTypedArraysEqual;return function(a,f,l){if(a===f)return!0;if(a==null||f==null||typeof a!="object"||typeof f!="object")return a!=a&&f!=f;var d=a.constructor;if(d!==f.constructor)return!1;if(d===Object)return s(a,f,l);if(pL(a))return t(a,f,l);if(GE!=null&&GE(a))return u(a,f,l);if(d===Date)return n(a,f,l);if(d===RegExp)return o(a,f,l);if(d===Map)return e(a,f,l);if(d===Set)return i(a,f,l);var p=hL(a);return p===sL?n(a,f,l):p===uL?o(a,f,l):p===aL?e(a,f,l):p===dL?i(a,f,l):p===cL?typeof a.then!="function"&&typeof f.then!="function"&&s(a,f,l):p===oL?s(a,f,l):(p===iL||p===lL||p===fL)&&r(a,f,l)}}function mL(c){var t=c.circular,n=c.createCustomConfig,e=c.strict,s={areArraysEqual:e?Ld:Z4,areDatesEqual:Q4,areMapsEqual:e?zE(JE,Ld):JE,areObjectsEqual:e?Ld:eL,arePrimitiveWrappersEqual:tL,areRegExpsEqual:nL,areSetsEqual:e?zE(VE,Ld):VE,areTypedArraysEqual:e?Ld:rL};if(n&&(s=YE({},s,n(s))),t){var r=$h(s.areArraysEqual),o=$h(s.areMapsEqual),i=$h(s.areObjectsEqual),u=$h(s.areSetsEqual);s=YE({},s,{areArraysEqual:r,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:u})}return s}function yL(c){return function(t,n,e,s,r,o,i){return c(t,n,i)}}function bL(c){var t=c.circular,n=c.comparator,e=c.createState,s=c.equals,r=c.strict;if(e)return function(i,u){var a=e(),f=a.cache,l=f===void 0?t?new WeakMap:void 0:f,d=a.meta;return n(i,u,{cache:l,equals:s,meta:d,strict:r})};if(t)return function(i,u){return n(i,u,{cache:new WeakMap,equals:s,meta:void 0,strict:r})};var o={cache:void 0,equals:s,meta:void 0,strict:r};return function(i,u){return n(i,u,o)}}var Eb=ua();ua({strict:!0}),ua({circular:!0}),ua({circular:!0,strict:!0}),ua({createInternalComparator:function(){return Mc}}),ua({strict:!0,createInternalComparator:function(){return Mc}}),ua({circular:!0,createInternalComparator:function(){return Mc}}),ua({circular:!0,createInternalComparator:function(){return Mc},strict:!0});function ua(c){c===void 0&&(c={});var t=c.circular,n=t!==void 0&&t,e=c.createInternalComparator,s=c.createState,r=c.strict,o=r!==void 0&&r,i=gL(mL(c));return bL({circular:n,comparator:i,createState:s,equals:e?e(i):yL(i),strict:o})}var vL=un(256),_L=un.n(vL),xL=c=>{var t={};return un.d(t,c),t};const il=xL({$getSelectionStyleValueForProperty:()=>GS,$patchStyleText:()=>YS,createDOMRange:()=>XI,createRectsFromDOMRange:()=>ky});class zh{static composeLexicalDOMNodeKeyAttrName(t){return`__lexicalKey_${t._key}`}static extractLexicalKeyFromLexicalDOMNodeKeyAttr(t){return t.split("__lexicalKey_")[1]||""}static extractSelectionUserId(t){return t.meta.author.id}static createRemoteSelectionColors(t){const n={caretColor:t,highlightColor:"",tooltipBGColor:""};if(t.startsWith("rgb")){let e=t,[s]=e.split(")");n.highlightColor=`${s},0.3)`,n.tooltipBGColor=`${s},0.85)`}else if(t.startsWith("#"))n.highlightColor=`${t}${Math.floor(76.5).toString(16).padStart(2,0)}`,n.tooltipBGColor=`${t}${Math.floor(216.75).toString(16).padStart(2,0)}`;else{const[e,s,r]=_L().keyword.rgb(t);n.highlightColor=`rgb(${e},${s}, ${r},0.3)`,n.tooltipBGColor=`rgb(${e},${s}, ${r},0.85)`}return n}static formatRemoteSelectionUsername(t){let n=t;return n=n.trim(),n.length>=17?`${n.substring(0,14)}...`:n}static isMousePositionWithinElementCords(t,n){return t.clientX>=n.x-5&&t.clientX<=n.x+n.width+5&&t.clientY>=n.y-5&&t.clientY<=n.y+n.height+5}static createDOMRange(t,n,e,s,r){return(0,il.createDOMRange)(t,n,e,s,r)}static createRectsFromDOMRange(t,n){let{keepFullWidthRects:e=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=t.getRootElement();if(s===null)return[];const r=s.getBoundingClientRect(),o=getComputedStyle(s),i=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),u=Array.from(n.getClientRects());let a=d=>u.splice(d,1),f=new Set;for(let d=0;d<u.length;d++){let p=u[d],h=u[d-1];if(!p||!h)continue;let m=`${(l=p).top}_${l.left}_${l.width}_${l.height}`;if(f.has(m))a(d--);else if(f.add(m),p.top===h.top&&p.height===h.height&&p.left-(h.left+h.width)<5){let g=DOMRect.fromRect({x:h.x,y:h.y,width:h.width+p.width,height:h.height});u[d-1]=g,a(d--)}else p.width+i!==r.width||e?h.top<=p.top&&h.bottom>=p.bottom&&h.left<=p.left&&h.right>=p.right&&a(d--):a(d--)}var l;return u}static getEmptyRootRect(t){let n=t.getRootElement(),e=n.getBoundingClientRect();const s=getComputedStyle(n),r=parseFloat(s.paddingLeft),o=parseFloat(s.paddingTop),i=parseFloat(s.paddingBottom);return[new DOMRect(e.x+r,e.y+o,0,e.height-i-o)]}}kf(zh,"remoteSelectionClassName","codox_remote_selection"),kf(zh,"remoteSelectionRect","codox_remote_selection_rect"),kf(zh,"tooltipAnimations",{hideAtOnce:"codox_hide_tooltip 0s linear 0s forwards",hideWithDelay:"codox_hide_tooltip 0s linear 2s forwards",showAtOnce:"codox_show_tooltip 0s linear 0s forwards",unset:"unset"});const Sr=zh;function XE(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function wL(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XE(Object(n),!0).forEach(function(e){SL(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):XE(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function SL(c,t,n){return(t=CL(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function CL(c){var t=EL(c,"string");return typeof t=="symbol"?t:t+""}function EL(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}class So{static _logInvalid(t,n,e){for(var s=arguments.length,r=new Array(s>3?s-3:0),o=3;o<s;o++)r[o-3]=arguments[o];ut.warn("[JSON SELECTION VALIDATION]: ",wL({selectBelongsTo:t||"not provided",reason:n,jsonSelection:e},r))}static _isObject(t){return typeof t=="object"&&!Array.isArray(t)}static _validateSelectionSide(t){let{type:n,side:e,sideName:s,fullSelection:r}=t;if(!So._isObject(e))return So._logInvalid(n,`selection.${s} must be object`,r),!1;let o=e.codoxId;if(!Array.isArray(o))return So._logInvalid(n,`selection.${s}.codoxId must be array`,r),!1;if(o.length){let u=o.findIndex(f=>f===ol.editorState),a=u!==-1;for(let f=0;f<o.length;f++){if(a){if(f===u||f===u+2)continue;if(f===u+1&&o[f]!=="root")return So._logInvalid(n,`selection.${s}.codoxId path invalid: nested selection must include "editorState" and "root": [..."editorState", "root"...]`,r,Wn),!1;continue}let l=o[f];if(!Wn.has(l))return So._logInvalid(n,`selection.${s}.codoxId path invalid: node for id ${l} does not exist`,r,Wn),!1}}let i=e.offset;return typeof i=="number"||i===null?i>=0||i===null||(So._logInvalid(n,`selection.${s}.offset must be gte 0 or -1`,r),!1):(So._logInvalid(n,`selection.${s}.offset must be number or null`,r),!1)}static validateJSONSelection(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t===null)return!0;if(!t)return So._logInvalid(n,"invalid json selection data type",t),!1;if(!So._isObject(t))return So._logInvalid(n,"json selection must be object",t),!1;let{anchor:e,focus:s}=t;return!!So._validateSelectionSide({type:n,side:e,sideName:"anchor",fullSelection:t})&&!!So._validateSelectionSide({type:n,side:s,sideName:"focus",fullSelection:t})}}const Ob=So;var OL=un(186),ss=un.n(OL),TL=un(155),as=un.n(TL),NL=un(433),ls=un.n(NL),kL=un(626),cs=un.n(kL),AL=un(990),us=un.n(AL),PL=un(827),ds=un.n(PL),Uh=un(500),Ic={};Ic.styleTagTransform=ds(),Ic.setAttributes=cs(),Ic.insert=ls().bind(null,"head"),Ic.domAPI=as(),Ic.insertStyleElement=us(),ss()(Uh.A,Ic),Uh.A&&Uh.A.locals&&Uh.A.locals;class ML{constructor(){kf(this,"paintSingleRemoteSelection",t=>{let{editor:n,selectionJSON:e,lexicalSelection:s,selectedNodes:r,isBackward:o}=t;this.activeEditorsKeys[n._key]||(this.activeEditorsKeys[n._key]=n._key);const i=Sr.extractSelectionUserId(e),u=Sr.formatRemoteSelectionUsername(e.meta.author.name),a=Sr.createRemoteSelectionColors(e.meta.color);let f=null,l=null,d=0,p=0;(0,bt.$isNodeSelection)(s)?(f=r[0],l=r[r.length-1],d=0,p=1):(f=n._editorState._nodeMap.get(s.anchor.key),l=n._editorState._nodeMap.get(s.focus.key),d=s.anchor.offset,p=s.focus.offset);let h=(0,$n.$isTableSelection)(s),m=(0,bt.$isNodeSelection)(s),g=(0,bt.$isRangeSelection)(s);for(let w of r)this.trackedNodesKeys.add(`${w.getKey()}__${n._key}`);r.length===1&&Mb(r[0])&&d===p&&p++;let y=null,b=[];if(h&&(0,$n.$isTableCellNode)(f)&&(0,$n.$isTableCellNode)(l)){let w=r.filter(x=>(0,$n.$isTableCellNode)(x));for(let x of w)if(d=(0,$n.$getTableColumnIndexFromTableCellNode)(x),p=(0,$n.$getTableColumnIndexFromTableCellNode)(x)+1,f=x.getParent(),l=x.getParent(),y=Sr.createDOMRange(n,f,d,l,p),y){let[S]=Sr.createRectsFromDOMRange(n,y);b.push(S)}}else if(m){let w=s.getNodes();for(let x of w)if(y=Sr.createDOMRange(n,x,0,x,1),y){let[S]=Sr.createRectsFromDOMRange(n,y);b.push(S)}}else g&&(al(f)&&al(l)&&d===0&&p===0?b=Sr.getEmptyRootRect(n):(y=Sr.createDOMRange(n,f,d,l,p),y&&(b=Sr.createRectsFromDOMRange(n,y,{keepFullWidthRects:!0}))));let v=null,_=document.createElement("span");_.classList.add(Sr.remoteSelectionClassName),_.setAttribute("codox_remote_user",i),document.body.append(_),this.remoteSelectionDOMsMap[i]=_;for(let w=0;w<b.length;w++){let x=b[w];if(!x)continue;let S=w===0,E=w===b.length-1,O=x.width,j=x.height,A=x.top,T=x.left,I=o&&S||!o&&E,k=document.createElement("span");if(_.append(k),k.classList.add(Sr.remoteSelectionRect),k.style.cssText=`
|
|
1410
1410
|
display: block;
|
|
1411
1411
|
pointer-events: none;
|
|
1412
1412
|
user-select: none;
|
|
@@ -1443,35 +1443,35 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1443
1443
|
animation: ${this.isEditingInProgress?Sr.tooltipAnimations.hideAtOnce:Sr.tooltipAnimations.hideWithDelay};
|
|
1444
1444
|
left: ${o?"0px":"100%"};
|
|
1445
1445
|
z-index: 10;
|
|
1446
|
-
`,k.append(H),v=H}!I&&x.width<1&&r.length>1&&(k.style.width="3px")}b.forEach(w=>{this.hoverList.push([w,v,i])})});this.remoteSelections=[],this.isEditingInProgress=!1,this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelectionDOMsMap={},this.activeEditorsKeys={},this.keyboardBindedListener=this._keyboardEventsListener.bind(this),this.mouseBindedListener=this._mouseEventsListener.bind(this),this.resizeBindedListener=this._resizeEventListener.bind(this),this.hideInUI=!1}_mouseEventsListener(t){let n=!1,e=t.target,s=!1,r=3;for(;r&&e;){if(e.__codox_track){n=!0;break}if(e.__lexicalEditor){n=!0,s=!0;break}e=e.parentNode,r--}if(!n)return;let o=null;for(let a in this.activeEditorsKeys){if(e[`__lexicalKey_${a}`]){o=a;break}e.__lexicalEditor&&(o=e.__lexicalEditor._key)}if(!o)return;let i=s?"root":e[`__lexicalKey_${o}`];if(!i||!this.trackedNodesKeys.has(`${i}__${o}`))return;let u=new Set;for(let a=0;a<this.hoverList.length;a++){let f=this.hoverList[a],[l,d,p]=f;if(u.has(p))continue;let h=Sr.isMousePositionWithinElementCords(t,l);t.type===Qr.mouseover&&h&&(d.style.animation=this.isEditingInProgress?Sr.tooltipAnimations.hideAtOnce:Sr.tooltipAnimations.showAtOnce,u.add(p)),t.type===Qr.mouseout&&(d.style.animation=Sr.tooltipAnimations.hideWithDelay,u.add(p)),t.type===Qr.mousemove&&h&&(d.style.animation=this.isEditingInProgress?Sr.tooltipAnimations.hideAtOnce:Sr.tooltipAnimations.showAtOnce,u.add(p))}}_keyboardEventsListener(t){t.type===Qr.keypress&&(this.isEditingInProgress||(this.isEditingInProgress=!0)),t.type===Qr.keyup&&this.isEditingInProgress&&(this.isEditingInProgress=!1)}_resizeEventListener(t){xt.mainEditorExists()&&this.paintRemoteSelections(this.remoteSelections)}mount(){window.addEventListener(Qr.keypress,this.keyboardBindedListener),window.addEventListener(Qr.keyup,this.keyboardBindedListener),window.addEventListener(Qr.resize,this.resizeBindedListener),window.addEventListener(Qr.scroll,this.resizeBindedListener);for(const t of jE)window.addEventListener(t,this.mouseBindedListener)}unmount(){window.removeEventListener(Qr.keypress,this.keyboardBindedListener),window.removeEventListener(Qr.keyup,this.keyboardBindedListener),window.removeEventListener(Qr.resize,this.resizeBindedListener),window.removeEventListener(Qr.scroll,this.resizeBindedListener);for(const t of jE)window.removeEventListener(t,this.mouseBindedListener);this.gcPrevPaintedRemoteSelections()}shouldUpdateRemoteSelections(){return!0}gcPrevPaintedRemoteSelections(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(let n in this.remoteSelectionDOMsMap)this.remoteSelectionDOMsMap[n].remove();this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelections=t||[],this.remoteSelectionDOMsMap={},this.activeEditorsKeys={}}paintRemoteSelections(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.gcPrevPaintedRemoteSelections(t);let n=xt.getMainEditorState();n.read&&n.read(()=>{for(let e of this.remoteSelections)if(Ob.validateJSONSelection(e,wb.remote))if(Wt.isNestedSelectionJSON(e)){let{nestedSelectionJSON:s,nestedEditor:r}=Wt.getNestedSelectionJSONFromMainSelectionJSON(e);if(!r)continue;r.getEditorState().read(()=>{let o=Wt.JSONToLexical(s);if(o)try{this.paintSingleRemoteSelection({editor:r,selectionJSON:e,lexicalSelection:o,selectedNodes:o.getNodes(),isBackward:o.isBackward()})}catch(i){ut.warn("[PAINT REMOTE SELECTION] failed for nested editor - ",{error:i,nestedSelectionJSON:s,fullSelection:e,lexicalSelection:o})}else ut.error("DEBUGGER: [paintRemoteSelections] nested selection from json to lexical is null: ",{selection:e,nestedSelectionJSON:s,lexicalSelection:o})})}else{let s=Wt.JSONToLexical(e);if(!s){ut.error("DEBUGGER: [paintRemoteSelections] selection from json to lexical is null: ",{selection:e,lexicalSelection:s});continue}try{this.paintSingleRemoteSelection({editor:xt.getMainEditor(),selectionJSON:e,lexicalSelection:s,selectedNodes:s.getNodes(),isBackward:s.isBackward()})}catch(r){ut.warn("[PAINT REMOTE SELECTION] failed - ",{error:r,fullSelection:e,lexicalSelection:s})}}})}updateRemoteSelections(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";this.shouldUpdateRemoteSelections(t)&&(ut.log("[updateRemoteSelections] "+n,{newRemoteSelections:t}),Promise.resolve().then(()=>{this.paintRemoteSelections(t),this.hideInUI&&this.hideRemoteSelectionsFromUI()}))}clear(){this.gcPrevPaintedRemoteSelections()}getCurrentRemoteSelections(){return this.remoteSelections}hideRemoteSelectionsFromUI(){this.hideInUI||(this.hideInUI=!0);const t=document.querySelectorAll(".codox_remote_selection");for(let n of t)n.classList.add("hidden_codox_remote_selection")}showHiddenRemoteSelectionsInUI(){this.hideInUI=!1;const t=document.querySelectorAll(".hidden_codox_remote_selection");for(let n of t)n.classList.remove("hidden_codox_remote_selection")}}const di=new IL;function RL(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).findIndex(c=>c===ol.editorState)}function Hh(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=xt.getMainEditorNodesClassesMap();const{klass:e}=n.get(c.type)||{};if(!e)return;const s=e.importJSON(c);if(c.children&&c.children.length)for(const r of c.children)Hh(r,s);return t&&t.getChildrenSize&&t.splice(t.getChildrenSize(),0,[s]),s}function Kh(c){if(c.getChildren)for(let t of c.getChildren())Kh(t);c.remove()}function QE(c){c.__parent=null,c.__next=null,c.__prev=null}function eO(c,t){return!!xt.isLexicalEditorInstance(c)&&!(typeof t!="object"||!t.editorState||(c.update(()=>{try{let n=(0,bt.$getSelection)();const e=c.parseEditorState(t.editorState);if(e.isEmpty())return(0,bt.$getRoot)().clear(),!0;(0,bt.$setSelection)(n),c.setEditorState(e)}catch(n){ut.error("[stateUpdates][updateNestedEditorState] update nested state and selection error: ",n)}}),0))}function jL(c,t){let n=t;for(const e of c)n=n[e];return n}function sl(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],e=null,s=jL(c,n?t:xt.getMainEditorState().toJSON());return s&&(e=al(s)?(0,bt.$getRoot)():Wn.get(s.codoxId)),e||ut.debug("[WARNING][getLexicalNodeByPathOutOfJSONState] lexical node not found: ",{jsonNode:s,lexicalNode:e,pathArray:c,currentStateJSON:xt.getMainEditorState().toJSON(),newStateJSON:t,codoxNodes:Wn.nodesToArray(),searchInNewState:n}),e||(n?e:sl(c,t,!0))}function tO(c){ut.log("[applyFullLexicalStateReplace] clear current state and apply new");const t=(0,bt.$getRoot)();t.clear();let n=xt.getMainEditorNodesClassesMap();function e(s){const r=n.get(s.type).klass.importJSON(s);if(s.children)for(const o of s.children)r.append(e(o));return r}for(const s of c.root.children)t.append(e(s))}function DL(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(t.length){ut.log("[applyDeltasToLexicalState] Original Deltas: ",{newStateJSON:c,deltas:JSON.parse(JSON.stringify(t))});for(const n of t){let{p:e}=n;const s=e[e.length-1],r=s==="children",o=typeof s=="number",i=!o&&!r,u=RL(e),a=u!==-1,f=n.hasOwnProperty("lm")&&typeof n.lm=="number";if(e.length)if(a){let l=u-1,d=sl(e.slice(0,l),c);if(d){let p=e.slice(0,u),h=c;for(const g of p)h=h[g];let m=jd(e[l]);eO(d.getWritable()[m],h)}}else{if(r){let l=n.oi;if(!l){ut.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi attr expected for path",{delta:n});continue}if(l.some(p=>!(!p.hasOwnProperty("text")||typeof p.text=="string"))){ut.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi children contain invalid text value",{delta:n});continue}e.length=e.length-1;let d=sl(e,c);if(!d)continue;if(l.some(p=>!!p.codoxDId)){try{d=d.getWritable()}catch(g){ut.debug("[applyDeltasToLexicalState][shouldUpdateLeaves] getWritable error: ",{err:g,delta:n,fullStateJSON:c});continue}let p={};for(let g of d.getChildren())g.codoxDId?p[g.codoxDId]=g:Kh(g);let h=[],m=["codoxDId","codoxId","__key","__parent","__prev","__next"];for(let g=0;g<l.length;g++){let y=l[g],b=g===0,v=g===l.length-1,_=null,w=g>=0?h[g-1]:null;if(y.codoxDId){let x=p[y.codoxDId];if(x){x=x.getWritable();let S=Hh(y);if(ut.debug("[DELTA_DECORATOR_UPDATE]: ",{exisingDecorator:x,tmpDecorator:S}),!S){ut.debug("[DELTA_DECORATOR_UPDATE] UPADATE SKIPPED: ",{exisingDecorator:x,tmpDecorator:S});continue}for(let E in S)if(S.hasOwnProperty(E)&&!m.includes(E))if(xt.isLexicalEditorInstance(S[E])){let O={editorState:S[E].getEditorState().toJSON()};eO(x[E],O)}else{let O=xb(E),j=y[O];if(j===x[E]||!y.hasOwnProperty(O))continue;let A=j!==void 0&&S[E]!==j?j:S[E];O!=="height"&&O!=="width"||S[E]==="inherit"&&j===0&&(A=S[E]),x[E]=A}S.remove(),QE(x),_=x,delete p[y.codoxDId]}}_||(_=Hh(y),_.codoxDId&&_.__type==="excalidraw"&&_.__data==="[]"&&(_.__data="{}")),_=_.getWritable(),h.push(_),_.__parent=d.__key,b?(d.__first=_.__key,_.__prev=null,v&&(d.__last=_.__key)):v?(d.__last=_.__key,_.__next=null,_.__prev=w.__key,w.__next=_.__key):(_.__prev=w.__key,w.__next=_.__key),d.__size=h.length}for(let g in p){let y=p[g];y=y.getWritable(),QE(y),Kh(y),delete p[g]}}else{let p=l.map(h=>Hh(h));d.splice(0,d.getChildrenSize(),p)}}if(o){if(n.ld){const l=n.ld,d=Wn.get(l.codoxId);d.getChildrenSize&&d.getChildrenSize()?Kh(d):d.remove()}if(n.li){let l=xt.getMainEditorNodesClassesMap();const d=n.li,p=l.get(d.type).klass.importJSON(d);if(e.length===1&&e[0]==="root")(0,bt.$getRoot)().splice(0,0,[p]);else{const h=e[e.length-1];e.length=e.length-2;let m=sl(e,c);m&&m.splice(h,0,[p])}if(d.children&&d.children.length){let h=function(m,g){const y=l.get(m.type).klass.importJSON(m);if(g.splice(g.getChildrenSize(),0,[y]),m.children&&m.children.length)for(const b of m.children)h(b,y)};for(const m of d.children)h(m,p)}}if(n.oi||n.od){let{p:l,oi:d,od:p}=n,h=sl(l,c);if(h)try{let m=h.getWritable();if(d){let g=Object.keys(d);for(let y of g)m[jd(y)]=d[y]}if(p){let g=Object.keys(p);for(let y of g)delete m[jd(y)]}}catch(m){ut.debug("[applyDeltasToLexicalState][delta oi/od] getWritable error: ",{err:m,delta:n})}}if(f){let{p:l,lm:d}=n,p=l[l.length-1],h=d,m=h<p,g=sl(l,c);if(g){let y=g.getParent().getChildren(),b=y[p],v=y[h];m?v.insertBefore(b):v.insertAfter(b)}}}if(i){const l=e[e.length-1];let d=jd(l);e.length=e.length-1;let p,h=sl(e,c);if(!h){ut.error("Missing node when update node attr from delta: ",{path:e,delta:n,fullStateJSON:c,currentEditorState:xt.getMainEditorState().toJSON()});continue}try{p=h.getWritable()}catch(g){ut.debug("[applyDeltasToLexicalState][shouldUpdateBlockAttr] getWritable error: ",{err:g,delta:n})}if(!p)continue;let m=n.oi;if(l==="format"&&(m=j4(m)),l==="direction"&&(h.hasOwnProperty(d)||(d="__dir")),!p.hasOwnProperty(d)){let g=Object.keys(p);for(let y of g){let b=xb(y);if(l.startsWith(b)){d=y;break}}}p[d]=m}}else if(n.oi&&n.oi.root)return tO(n.oi)}}else ut.log("[applyDeltasToLexicalState] stop, no deltas: ",t)}function LL(c){let t=c.clipboardData.getData(L4.paste),n=!1;try{t=JSON.parse(t),typeof t=="object"&&t.nodes&&Array.isArray(t.nodes)&&(n=!0)}catch{return!1}if(!n)return!1;if(n){Wn.clearPastedIds();const e=s=>{if(s.codoxId&&Wn.addPastedId(s.codoxId),s.children&&s.children.length)for(const r of s.children)e(r)};for(const s of t.nodes)e(s)}return!1}var BL=c=>{var t={};return un.d(t,c),t};const nO=BL({useCollaborationContext:()=>h3});var FL=c=>{var t={};return un.d(t,c),t};const da=FL({LexicalComposerContext:()=>Cy,useLexicalComposerContext:()=>pr});class rO{constructor(){this.blacklist=Object.keys(DE).reduce((t,n)=>{let e=DE[n];return t[n]=e.reduce((s,r)=>(s[r]=r,s),{}),t},{}),this._isBlacklistedFound=!1,this._clientCallback=null}_shouldSkipNode(t){return t instanceof bt.TextNode||t instanceof bt.ParagraphNode||t instanceof bt.RootNode}setClientCallback(t){this._clientCallback=t}removeClientCallback(){this._clientCallback=null}invokeClientCallback(){this._clientCallback&&this._clientCallback()}trackBlacklisted(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0;if(Tb||n!==jo.created||this._isBlacklistedFound||!t||!t.__type||this._shouldSkipNode(t))return;let s=e||xt.getMainEditorState(),r=t.__type,o=this.blacklist[r];o&&s.read(()=>{let i=t.getParent();for(;i!==null;){let u=i?i.__type:null;if(!u)return;if(o[u])return ut.warn("[ContentNestingsWatcher][trackBlacklisted] FOUND: ",{targetNode:t,targetType:r,parent:i,parentType:u,mutationType:n}),void(this._isBlacklistedFound=!0);i=i.getParent()}})}trackBlacklistedInNestedEditor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=arguments.length>3?arguments[3]:void 0;if(n!==jo.created||this._isBlacklistedFound||this._shouldSkipNode(t))return;let s=e.__type,r=t.__type;if(!s||!r)return;let o=this.blacklist[r];o&&o[s]&&(this._isBlacklistedFound=!0,ut.warn("[ContentNestingsWatcher][trackBlacklistedInNestedEditor] FOUND: ",{targetNode:t,targetType:r,rootNode:e,rootType:s,mutationType:n}))}isBlacklistedFound(){let t=this._isBlacklistedFound;return t&&(this._isBlacklistedFound=!1),t}}const $L=new rO,fa=$L,zL=["editorState","prevEditorState","dirtyElements","dirtyLeaves"];function UL(c,t){if(c==null)return{};var n,e,s=HL(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function HL(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}class KL{constructor(){this.nestedEditorsListenersMap={}}_createNestedEditorUpdatesListener(t,n){let e=!1;return function(s){let{editorState:r,prevEditorState:o,dirtyElements:i,dirtyLeaves:u}=s,a=(UL(s,zL),xt.getMainEditor()),f=xt.getMainEditorState(),l=r.toJSON(),d=o.toJSON(),p=Eb(l,d),h=r._selection,m=o._selection,g=!1,y=null,b=xt.isOnlySelectionChanged(i,u),v=t[n];if(ut.debug("[NESTED EDITOR LISTENER] invoked: ",{lexicalNode:t,key:t.__key,onlySelectionChanged:b,newEditorStateJSON:l,prevEditorStateJSON:d,isSameState:p,lexicalSelection:h,prevLexicalSelection:m,mainDirtyLeaves:a._dirtyLeaves.size,mainDirtyElements:a._dirtyElements.size,nestedDirtyLeaves:v._dirtyLeaves.size,nestedDirtyElements:v._dirtyElements.size,nestedEditorKey:v._key}),fa.isBlacklistedFound())return e=!0,ut.debug("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - revert to prev state"),xt.scanLexicalNodeForNestedEditorAttribute(t)?(v.update(()=>{try{const _=v.parseEditorState(d);if(_.isEmpty())return(0,bt.$getRoot)().clear(),!0;v.setEditorState(_)}catch(_){ut.error("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - ROLLBACK ERROR: ",_)}}),void fa.invokeClientCallback()):void 0;if(e)e=!1;else{if(t.codoxId||t.codoxDId){let _=null;f.read(()=>{_=Wt.getNodeAncestorsCodoxIds(t),!t.codoxId&&t.codoxDId&&_.push(t.codoxDId)}),r.read(()=>{let w=xb(n),x=Wt.lexicalToJSONNested(h,w,_);y=xt.getCurrentNestedSelectionJSON(),g=Wt.equalSelectionsJSON(y,x),g||xt.setNestedSelectionJSON(x)})}p&&g||a.update(()=>{try{ut.debug("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE",{mainTags:a._updateTags,nestedTags:v&&v._updateTags,isSameState:p,isSameSelection:g,onlyNestedSelectionChanged:b,mainDirtyLeaves:a._dirtyLeaves.size,mainDirtyElements:a._dirtyElements.size,nestedDirtyLeaves:v._dirtyLeaves.size,nestedDirtyElements:v._dirtyElements.size,lexicalNode:t,lexicalSelection:h,prevLexicalSelection:m,mainEditorTags:a._updateTags,mainEditorTagsSize:a._updateTags.size}),xt.addUpdateTag({fromNestedEditor:!0}),t.markDirty()}catch(_){ut.error("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE - ERROR: ",_)}})}}}_isNestedEditorManaged(t){return!!this.nestedEditorsListenersMap[t]}gc(){for(let t in this.nestedEditorsListenersMap)if(!xt.getLexicalNodeByKey(t)){let n=this.nestedEditorsListenersMap[t];n&&n(),delete this.nestedEditorsListenersMap[t]}}manageNestedEditorInLexicalNode(t){if(this._isNestedEditorManaged(t.getKey()))return;let n=xt.scanLexicalNodeForNestedEditorAttribute(t);if(n){let e=t[n],s=this._createNestedEditorUpdatesListener(t,n),r=[];e._nodes.forEach((u,a,f)=>{let{klass:l}=u,d=e.registerMutationListener(l,p=>{for(let[h,m]of p)if(m===jo.created){let g=e.getEditorState()._nodeMap.get(h);g&&fa.trackBlacklistedInNestedEditor(g,m,e.getEditorState(),t)}});r.push(d)});let o=(0,Pc.mergeRegister)(e.registerUpdateListener(s),...r),i=t.getKey();this.nestedEditorsListenersMap[i]=o}}gcNestedEditorListenerInLexicalNode(t){let n=t.getKey(),e=this.nestedEditorsListenersMap[n];e&&(e(),delete this.nestedEditorsListenersMap[n])}manageNestedEditorInClonedLexicalNode(t,n){let e=t.getKey();e!==n.getKey()&&this._isNestedEditorManaged(e)&&(this.gcNestedEditorListenerInLexicalNode(t),this.manageNestedEditorInLexicalNode(n))}setNestedEditorSelection(t){let{nestedSelectionJSON:n,nestedEditor:e}=Wt.getNestedSelectionJSONFromMainSelectionJSON(t);if(!e)return!1;let s=!0;return e.update(()=>{try{let r=Wt.JSONToLexical(n);(0,bt.$setSelection)(r),ut.debug("[setNestedEditorSelection]: lexical nested selection: ",r)}catch(r){ut.error("[setNestedEditorSelection] set nested selection error: ",r),s=!1}}),s}clearListeners(){for(let t in this.nestedEditorsListenersMap){let n=this.nestedEditorsListenersMap[t];n&&n(),delete this.nestedEditorsListenersMap[t]}}}const WL=new KL,fs=WL,qL=function(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];try{let n=(0,bt.createEditor)({namespace:"validation",nodes:[...t],onError:i=>{throw i},parentEditor:null});const e=new rO,s=n.parseEditorState(c);if(s.isEmpty())return;n.setEditorState(s);let r=n.getEditorState();const o=r._nodeMap[Symbol.iterator]();for(const i of o){let[u,a]=i;if(a&&(e.trackBlacklisted(a,jo.created,r),e.isBlacklistedFound()))throw new Error(B4)}}catch(n){throw n}};class JL{constructor(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}_scanForCellHeaderState(t,n,e,s){if(n.length<s)return null;let r,o=n.some(u=>u.__headerState===ca.BOTH||u.__headerState===ca.ROW),i=t.some((u,a)=>{if(u.__size<s)return!1;let f=u.getChildAtIndex(e);return!(!f||f.__headerState!==ca.BOTH&&f.__headerState!==ca.COLUMN)});return o&&i?r=ca.BOTH:o&&!i?r=ca.ROW:i&&!o&&(r=ca.COLUMN),r}_isValidCellChildren(t){for(let n of t)if(Lc(n)||!Dc(n)&&Bn(n))return!1;return!0}_createEmptyCell(){let t=(0,$n.$createTableCellNode)();return t.append((0,bt.$createParagraphNode)()),t}_wrapInvalidCellChildrenIntoParagraph(t){let n=(0,bt.$createParagraphNode)().getWritable(),e=t.getChildren();(t=t.getWritable()).__first=n.__key,t.__last=n.__key,t.__size=1,n.__parent=t.__key,e.forEach((s,r)=>{(s=s.getWritable()).__parent=null,n.append(s)})}_createFixAction_APPEND_CELLS_TO_ROW(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - APPEND_CELLS_TO_ROW] invoked: ",{rowKey:t,numOfCellsToAppend:n});let e=(0,bt.$getNodeByKey)(t);for(;n;){let s=(0,$n.$createTableCellNode)().append((0,bt.$createParagraphNode)());s.setRowSpan(1).setColSpan(1),e.append(s),n--}}}_createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(t){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - ADD_PARAGRAPH_TO_EMPTY_CELL] invoked: ",{cellKey:t}),(0,bt.$getNodeByKey)(t).append((0,bt.$createParagraphNode)())}}_createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(t){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - WRAP_CELL_CHILDREN_IN_PARAGRAPH] invoked: ",{cellKey:t});let n=(0,bt.$getNodeByKey)(t);this._wrapInvalidCellChildrenIntoParagraph(n)}}_createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(t){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - ADD_ROW_CELL_TO_EMPTY_TABLE_NODE] invoked: ",{tableKey:t});let n=(0,bt.$getNodeByKey)(t),e=(0,$n.$createTableRowNode)();e.append(this._createEmptyCell()),n.append(e)}}_createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(t,n){return()=>{for(n||(n=1);n;)(0,bt.$getNodeByKey)(t).append(this._createEmptyCell()),n--}}_createFixAction_WRAP_INVALID_ROW_NODE(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_ROW_NODE] invoked: ",{tableKey:t,rowKey:n});let e=(0,bt.$getNodeByKey)(t);if(!e)return;let s=(0,bt.$getNodeByKey)(n);if(!s)return;e=e.getWritable(),s=s.getWritable();let r=s.getPreviousSibling(),o=s.getNextSibling();s.__parent=null,s.__prev=null,s.__next=null;let i=(0,$n.$createTableRowNode)();if((0,$n.$isTableCellNode)(s))s.getChildren().length?this._isValidCellChildren()||this._wrapInvalidCellChildrenIntoParagraph(s):s.append((0,bt.$createParagraphNode)()),i.append(s);else{let u=this._isValidCellChildren([s]),a=(0,$n.$createTableCellNode)();if(i.append(a),u)a.append(s);else{let f=(0,bt.$createParagraphNode)();f.append(s),a.append(f)}}i.__parent=e.__key,e.__first===s.__key&&(e.__first=i.__key),e.__last===s.__key&&(e.__last=i.__key),r&&(r=r.getWritable(),r.__next=i.__key,i.__prev=r.__key),o&&(o=o.getWritable(),o.__prev=i.__key,i.__next=o.__key)}}_createFixAction_WRAP_INVALID_CELL_NODE(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_CELL_NODE] invoked: ",{rowKey:t,cellKey:n});let e=(0,bt.$getNodeByKey)(t);if(!e)return;let s=(0,bt.$getNodeByKey)(n);if(s.remove(),s=(0,bt.$createParagraphNode)(),!s)return;e=e.getWritable(),s=s.getWritable();let r=s.getPreviousSibling(),o=s.getNextSibling(),i=(0,$n.$createTableCellNode)();if(i.__parent=e.__key,e.__first===s.__key&&(e.__first=i.__key),e.__last===s.__key&&(e.__last=i.__key),r&&(r=r.getWritable(),r.__next=i.__key,i.__prev=r.__key),o&&(o=o.getWritable(),o.__prev=i.__key,i.__next=o.__key),s.__parent=null,s.__prev=null,s.__next=null,this._isValidCellChildren([s]))i.append(s);else{let u=(0,bt.$createParagraphNode)();u.append(s),i.append(u)}}}_createFixAction_APPLY_HEADER_STATE_TO_CELL(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - APPLY_HEADER_STATE_TO_CELL] invoked: ",{cellKey:t,headerStateToApply:n});let e=(0,bt.$getNodeByKey)(t);e&&(e=e.getWritable(),e.__headerState=n)}}clear(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}tableRemoveEventListener(t){let n=xt.getMainEditorState()._selection;if(ut.debug(`[${t}]`,{selection:n}),!(0,bt.$isRangeSelection)(n))return;let e=[];try{let s=xt.getLexicalNodeByKey(n.anchor.key),r=xt.getLexicalNodeByKey(n.focus.key);s&&r&&(e=n.isBackward()?r.getNodesBetween(s):s.getNodesBetween(r))}catch(s){ut.warn("[TablesValidator][tableRemoveEventListener] get range selection nodes internal lexical error: ",s)}e.forEach(s=>{(0,$n.$isTableNode)(s)&&this.removeCandidateTableKeys.add(s.__key)})}tableNodeRemoveListener(t){this.removeCandidateTableKeys.has(t)&&this.removeCandidateTableKeys.delete(t)}shouldGCRemovedTables(){return!!this.removeCandidateTableKeys.size}gcRemovedTables(){ut.debug("[TablesValidator][gcRemovedTable] candidate table keys ",{tableKeys:this.removeCandidateTableKeys}),xt.getMainEditor().update(()=>{Array.from(this.removeCandidateTableKeys).forEach(t=>{let n=(0,bt.$getNodeByKey)(t);n&&n.remove()}),this.removeCandidateTableKeys.clear(),(0,bt.$addUpdateTag)(Jo.historic)})}tableUpdateListener(t){this.validateTableCandidateKeys.add(t)}tableRowNodeChangesListener(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],e=xt.getLexicalNodeByKey(t);if(!e)return void(n&&ut.debug("[TablesValidator][tableRowNodeChangesListener] no row node found in lexical: ",{tableRowNodeKey:t}));let s=e.__parent;s?this.validateTableCandidateKeys.add(s):ut.debug("[tableRowNodeChangesListener] no parent table for row node found in lexical: ",{rowNode:e})}tableCellNodeChangesListener(t){let n=xt.getLexicalNodeByKey(t);if(!n||!n.__parent)return;let e=xt.getLexicalNodeByKey(n.__parent);e&&e.__parent&&this.validateTableCandidateKeys.add(e.__parent)}shouldValidateUpdatedTables(){return!!this.validateTableCandidateKeys.size}validateUpdatedTables(){let t=Array.from(this.validateTableCandidateKeys);return xt.getMainEditorState().read(()=>{for(let n of t){let e=xt.getLexicalNodeByKey(n);if(!e)continue;let s=e.getChildren();if(!s.length){this.tableFixActions.push(this._createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(n));continue}let r=0;s.forEach(a=>{a.__size>r&&(r=a.__size)});let o=[],i=s.map((a,f)=>{if(!(0,$n.$isTableRowNode)(a))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_ROW_NODE(n,a.__key)),"invalid_row_node";let l=a.getChildren();if(!l.length&&!o.length)return this.tableFixActions.push(this._createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(a.__key,r)),"empty_row_should_add_cell";if(!l.length&&o.length)return o=[],"empty_row_should_be_empty";let d=0;if(o.length){let h=[];o.forEach(m=>{let[g,y]=m;d+=y,g--,g&&h.push([g,y])}),o=[...h]}let p=l.map((h,m)=>{if(!(0,$n.$isTableCellNode)(h))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_CELL_NODE(a.__key,h.__key)),d++,"invalid_cell_node_should_wrap_in_cell";let g,y=h.getChildren(),b=!y.length;if(b?this.tableFixActions.push(this._createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(h.__key)):(g=this._isValidCellChildren(y),g||this.tableFixActions.push(this._createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(h.__key))),h.__rowSpan>1){let v=h.__rowSpan,_=h.__colSpan;o.push([v-1,_])}if(d+=h.__colSpan,h.__headerState===ca.NO_STATUS){let v=this._scanForCellHeaderState(s,l,m,r);v&&this.tableFixActions.push(this._createFixAction_APPLY_HEADER_STATE_TO_CELL(h.__key,v))}return{cellKey:h.__key,rowKey:a.__key,tableKey:n,colSpan:h.__colSpan,rowSpan:h.__rowSpan,headerState:h.__headerState,childrenAreValid:g,isEmptyCell:b}});if(d<r){let h=r-d;this.tableFixActions.push(this._createFixAction_APPEND_CELLS_TO_ROW(a.__key,h))}return{realRowLength:d,rowKey:a.__key,tableKey:n,cells:p}}),u=!this.tableFixActions.length;ut[u?"debug":"warn"](`[TablesValidator][validateUpdatedTables] IS TABLE VALID: ${u}`,{tableNodeKey:n,tableValidationMatrix:i,requiredRowLength:r}),this.validateTableCandidateKeys.delete(n)}}),!this.tableFixActions.length}shouldFixTablesStructure(){return!!this.tableFixActions.length}fixTablesStructure(){if(!this.tableFixActions.length)return;let t=xt.getMainEditor();ut.log("[TablesValidator][fixTablesStructure]: fix actions to apply - count: ",this.tableFixActions.length),t.update(()=>{for(let n of this.tableFixActions)n();this.tableFixActions=[],(0,bt.$addUpdateTag)(Jo.historic)})}ensureDocTablesAreValid(t){return this.shouldGCRemovedTables()?(ut.warn("[TablesValidator][GARBAGE COLLECT TABLE NODES AFTER TABLE REMOVAL ATTEMPT]"),this.gcRemovedTables(),!1):!(this.shouldValidateUpdatedTables()&&(ut.debug("[TablesValidator][shouldValidateUpdatedTables] invoked"),!this.validateUpdatedTables()))||(ut.warn("[TablesValidator][shouldValidateUpdatedTables] INVALID LEXICAL TABLE(S) STRUCTURE FOUND - FIXING",{state:JSON.parse(JSON.stringify(t.toJSON()))}),this.fixTablesStructure(),!1)}}const Ii=new JL,VL=["contentChanged"],GL=["state","remoteSelection"];function oO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function Rc(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oO(Object(n),!0).forEach(function(e){YL(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):oO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function YL(c,t,n){return(t=XL(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function XL(c){var t=ZL(c,"string");return typeof t=="symbol"?t:t+""}function ZL(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}function iO(c,t){if(c==null)return{};var n,e,s=QL(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function QL(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}const Tb={DEBUG:!1,VERSION:"1.0.2",NAME:"@codoxhq/lexical-provider",SDKUI_SOURCE_PATH:"../../../sdkui/dist-production2/codox.bundle.js"}.LOCAL==="true";ut.info("MODE: ","production");const e6=c=>async()=>{const{state:t,timestamp:n}=await c();if(!xt.isValidJSONState(t))throw new Error("Invalid state received from fetchDocOnNetworkReconnect hook");const{commentThreads:e,root:s}=t,r={content:{comments:e,root:s},timestamp:n};return ut.info("[decorateFetchOnReconnctHook] hook invoked: ",{returnObj:r}),r};let Wh=0,ps=null,Nb=!1,fi={},kb={};const t6=(0,Ge.forwardRef)((c,t)=>{let{onBlacklistedInsert:n}=c;const e=(0,Ge.useContext)(da.LexicalComposerContext);if(!e)throw new Error("[CodoxCollabPlugin] CodoxCollabPlugin must be inited inside <LexicalComposer> component - LexicalComposerContext is missing");const[s]=(0,da.useLexicalComposerContext)(),r=(0,nO.useCollaborationContext)();(0,Ge.useEffect)(()=>{if(ut.debug("[INIT] lexical context check: ",{lexicalContext:e,editor:s}),!s)return;ut.log("[useEffect][editor] Editor instance changed: ",{editor:s,key:s._key}),xt.setMainEditor(s),Wn.gcAbandonedNodes(),fs.gc(),Ii.clear(),ut.log("[useEffect][editor] subscribe to editor changes");const b=(0,Pc.mergeRegister)(s.registerUpdateListener(m),s.registerCommand(bt.PASTE_COMMAND,LL,bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.UNDO_COMMAND,()=>{xt.setUndoInvoked(!0)},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.REDO_COMMAND,()=>{xt.setRedoInvoked(!0)},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.KEY_DELETE_COMMAND,(_,w)=>{Ii.tableRemoveEventListener("KEY_DELETE_COMMAND")},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.KEY_BACKSPACE_COMMAND,(_,w)=>{Ii.tableRemoveEventListener("KEY_BACKSPACE_COMMAND")},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.CUT_COMMAND,(_,w)=>{Ii.tableRemoveEventListener("CUT_COMMAND")},bt.COMMAND_PRIORITY_CRITICAL),...g());di.mount(),xt.alignStateSelectionJSONsFromLatestEditor(),ut.debug("New editor mounted: ",{isCodoxStarted:xt.isCodoxStarted,codoxLexicalEditorManager:xt,nestedEditorsProcessor:fs});let v=s._onError;return s._onError=_=>{ut.error("[ERROR HANDLER WRAPPER] error from editor: ",_),v&&v(_),h()},n&&fa.setClientCallback(n),()=>{xt.getMainEditorKey()&&(ut.debug("Unmount prev editor"),b(),xt.removeMainEditor(),di.unmount(),xt.clearJSONs(),Ln.clear(),Ii.clear(),xt.isCodoxStarted&&(ut.debug("EDITOR USE_EFFECT stopping codox"),o(),xt.setIsCodoxStarted(!1)),fa.removeClientCallback())}},[s]);const o=()=>{xt.isCodoxStarted&&(ut.log("[stopCodoxInstance] stopping codox"),xt.setIsCodoxStarted(!1),Tb||is().stop(),xt.clearJSONs(),Wn.clearAll(),di.clear(),Ln.resetComments(),fs.clearListeners())},i=async b=>{ut.debug("[startCodoxInstance] invoked"),is().createNewInstance(),ut.debug("[startCodoxInstance] instance created");for(let T in kb)is().instance.on(T,kb[T]);if(ut.debug("[startCodoxInstance] events subscribed"),fi=b,ps=fi.docId,!ps)return ut.error("[startCodoxInstance] - start codox skipped - docId is missing",{docId:ps});let v=Ln.initialCommentsExist();ut.debug("[startCodoxInstance] initCommentsExist: ",v),v&&(Ln.activateInitialComments(s,Wn),ut.log("[activateInitialComments] "));let _=xt.getMainEditorState().toJSON();if(!xt.isValidJSONState(_))throw ut.error("[startCodoxInstance] - start codox skipped - invalid init state",{docId:ps,initJSONState:_}),new Error("start codox skipped - invalid init state");ut.log("[startCodoxInstance] starting codox with: ",{docId:ps,initJSONState:_,config:fi,codoxComments:Ln}),xt.currentContentStateJSON||xt.setCurrentContentStateJSON(_),xt.isCodoxStarted&&o();let{username:w,apiKey:x,getServerState:S,domain:E="",demo:O=!1,hooks:j}=fi;j&&j.fetchDocOnNetworkReconnect&&(j.fetchDocOnNetworkReconnect=e6(j.fetchDocOnNetworkReconnect));const A=iO(j,VL);await is().start(is().createConfig(Rc(Rc({},fi),{},{docId:ps,username:w,apiKey:x,domain:E,hooks:Rc({syncState:f,getState:a,getServerState:async()=>await S(ps)},A),editorInstanceHooks:{getSelection:()=>xt.getCurrentActiveSelectionJSON(),setSelection:T=>l(T),getState:a,setState:T=>{const{root:I,comments:k}=T;ut.info("DEBUG: EDITOR INSTANCE setState:",{fullState:T}),d({state:{root:I},selection:xt.getCurrentActiveSelectionJSON()},di.getCurrentRemoteSelections()),Ln.setAllComments(k)},enableEditor:()=>{xt.disableEditorReadOnlyMode()},disableEditor:()=>{xt.enableEditorReadOnlyMode(),di.updateRemoteSelections([])},getContent:()=>{let T=xt.composeFullStateWithRootAndComments();return ut.info("[getContent]: ",T),{state:T}}},appServer:fi.appServer,demo:O}))),ut.log("[startCodoxInstance] codox started - first sync invoking"),xt.setIsCodoxStarted(!0),r.clientID=fi.username,r.name=fi.username,p()},u=()=>{let b=xt.composeFullStateWithRootAndComments({directlyFromEditor:!0});i(b)},a=()=>({state:Rc(Rc({},xt.getMainEditorState().toJSON()),{},{comments:Ln.getAllComments()}),docId:ps}),f=b=>{if(!xt.isCodoxStarted)return;ut.log("[SYNC_STATE]: Before sync payload = ",b);const v=is().sync({meta:b}),{state:_,remoteSelection:w=[]}=v,x=iO(v,GL);if(ut.log("[SYNC_STATE]: After sync",{state:_,remoteSelection:w,rest:x}),!_)return ut.error("[SYNC_STATE] abort apply - synced state is not valid - restarting codox"),u();const S=_.state;ut.log("[SYNC_STATE] synced state: ",{synced:JSON.parse(JSON.stringify(S))});let{stateFromSync:E,commentsFromSync:O}=xt.extractStateAndCommentsFromSynced(S);if(!xt.isValidJSONState(E.state))return ut.error("[SYNC_STATE] - invalid state from sync - local update skipped - restarting codox",{contentState:E.state}),u();d(E,w),Ln.setAllComments(O)},l=b=>{if(!xt.isCodoxStarted||(ut.log("[setLocalSelectionFromSync] synced selection: ",{syncedSelectionJSON:b}),!Ob.validateJSONSelection(b,wb.local)))return;let v=xt.getCurrentActiveSelectionJSON();if(Wt.equalSelectionsJSON(v,b))return void ut.log("[setLocalSelectionFromSync] STOP - local and synced selections are equal");let _=Wt.isNestedSelectionJSON(b);s.update(()=>{ut.log("[setLocalSelectionFromSync] json selection to apply: ",{syncedSelectionJSON:b});const w=Wt.JSONToLexical(b);if(ut.log("[setLocalSelectionFromSync] lexical selection to apply: ",w),_){let x=fs.setNestedEditorSelection(b);xt.setNestedSelectionJSON(x?b:null)}else(0,bt.$setSelection)(w),xt.setMainSelectionJSON(b);ut.log("[setLocalSelectionFromSync] selection updated. latest selection: ",{latestSelectionJSON:xt.getCurrentActiveSelectionJSON()})})},d=function(){let{state:b,selection:v,stateReplace:_}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",S=xt.getCurrentContentStateJSON();ut.log("[updateEditor] invoked: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:JSON.parse(JSON.stringify(b)),newSelectionJSON:v,remoteSelection:w,stateReplace:_,editor:s}),v===void 0&&ut.error("SELECTION FROm SYNC IS UNDEFINED - will default prev selection",v);const E=Eb(S,b),O=Wt.equalSelectionsJSON(xt.getCurrentActiveSelectionJSON(),v);s.update(()=>{if(xt.addUpdateTag({isSameState:E,isSameSelection:O,updateTag:x}),_)ut.log("[updateEditor] invoke full stateReplace after sync"),tO(b),S=xt.setCurrentContentStateJSON(b),(0,bt.$addUpdateTag)("codox_sync_state_changes"),ut.log("[updateEditor] state updated: ",S);else{ut.log("[updateEditor] invoke deltas diff");let A=is().diff(S,b,{keyNames:{default:"codoxId"}});ut.log("JSON_DIFF_ANALYSIS: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:b,deltas:A&&JSON.parse(JSON.stringify(A))}),A&&A.length&&(ut.log("[updateEditor] apply deltas to lexical state"),DL(b,A),S=xt.setCurrentContentStateJSON(b),(0,bt.$addUpdateTag)("codox_sync_state_changes"),ut.log("[updateEditor] state updated: ",S))}let j=Wt.isNestedSelectionJSON(v);if(Ob.validateJSONSelection(v,wb.local)||(v=xt.getCurrentActiveSelectionJSON()),j){let A=fs.setNestedEditorSelection(v);xt.setNestedSelectionJSON(A?v:null),ut.log("[updateEditor] nested selection updated",A?v:null)}else if(v!==void 0){const A=Wt.JSONToLexical(v);ut.log("[updateEditor] updated selection to apply: ",{isSameSelection:O,newSelectionJSON:v,lexicalSelection:A}),(0,bt.$setSelection)(A),xt.setMainSelectionJSON(v),ut.log("[updateEditor] selection updated",v)}},{onUpdate:()=>{E||di.updateRemoteSelections(w,"from onUpdate hook")}}),E&&di.updateRemoteSelections(w,"from direct updateEditor")},p=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(!xt.isCodoxStarted)return;ut.log("[invokeSync] SYNC INVOKED ",{upd_call_counter:b});let v=xt.composeFullStateWithRootAndComments();const _={docId:ps,state:{state:v,selection:xt.getCurrentActiveSelectionJSON()}};ut.log("[codoxSync]: Before sync",{local:_,upd_call_counter:b}),ut.log("[codoxSync]: Before sync state",JSON.parse(JSON.stringify(_.state)));let{state:w,remoteSelection:x=[],changes:S}=is().sync({state:_,meta:{}});if(ut.log("[codoxSync]: After sync",{afterSyncState:JSON.parse(JSON.stringify(w)),remoteSelection:x,changes:S}),!w)return ut.error("[codoxSync] abort apply - synced state is not valid - restarting codox "),u();const E=w.state;ut.log("[codoxSync]: synced state: ",JSON.parse(JSON.stringify(E)),b);let{stateFromSync:O,commentsFromSync:j}=xt.extractStateAndCommentsFromSynced(E);if(!xt.isValidJSONState(O.state))return ut.error("[invokeSync] - invalid state from sync - local update skipped - restarting codox",{contentState:O.state}),u();d(O,x),Ln.setAllComments(j)},h=()=>{ut.warn("[rollbackStateDuringUpdateError] rollback invoked"),ut.log("[rollbackStateDuringUpdateError] values: ",{prevState:xt.getPrevContentStateJSON(),currentState:xt.getCurrentContentStateJSON(),prevSelection:xt.getPrevMainSelectionJSON(),currentSelection:xt.getCurrentActiveSelectionJSON(),codoxComments:Ln});let b=xt.getPrevContentStateJSON(),v=xt.getPrevMainSelectionJSON();d({state:b,selection:v},di.getCurrentRemoteSelections(),Jo.historic);let _=xt.undoInvoked(),w=xt.redoInvoked();Ln.gcAbandonedNodeKeys(xt.getMainEditorState()._nodeMap),_&&s.dispatchCommand(bt.CAN_REDO_COMMAND,!1),w&&s.dispatchCommand(bt.CAN_UNDO_COMMAND,!1)},m=b=>{let{editorState:v,prevEditorState:_,tags:w,dirtyElements:x,dirtyLeaves:S}=b;if(Nb)return Nb=!1,void ut.debug("[editorUpdatesListener] invoked blacklisted queued selection change - stop");if(fa.isBlacklistedFound())return Nb=!0,ut.warn("[editorUpdatesListener] BLACKLISTED CHANGES FOUND - revert back to prev state"),((V,G)=>{let F=null,K=null;G.read(()=>{F=Wt.lexicalToJSON(G._selection),K=G.toJSON()});let N=null,R=null;V.read(()=>{let L=(0,bt.$getSelection)();R=Wt.lexicalToJSON(L),N=V.toJSON()}),xt.setCurrentContentStateJSON(N),xt.setMainSelectionJSON(R),d({state:K,selection:F},di.getCurrentRemoteSelections(),Jo.historic),s.dispatchCommand(bt.CAN_REDO_COMMAND,!1),s.dispatchCommand(bt.CAN_UNDO_COMMAND,!1)})(v,_),void fa.invokeClientCallback();if(!Ii.ensureDocTablesAreValid(v))return;Wh++,ut.log("[editorUpdatesListener] invoked by lexical. call counter: ",{upd_call_counter:Wh,isCodoxStarted:xt.isCodoxStarted});let E=xt.isOnlySelectionChanged(x,S),O=null,j=null,A=null,T=null,I=xt.getCurrentContentStateJSON(),k=w.has("codox_sync_state_changes"),$=w.has(Dd),H=xt.undoInvoked(),U=xt.redoInvoked(),D=xt.canUndo(),W=xt.canRedo();O=v.toJSON(),j=_.toJSON(),_.read(()=>{T=Wt.lexicalToJSON(_._selection)}),v.read(()=>{let V=(0,bt.$getSelection)();A=Wt.lexicalToJSON(V);let G=Wt.JSONToLexical(A),F=V===null&&G===null||V.is(G);ut.log("[editorUpdatesListener] new values: ",{newContentStateJSON:O,currentContentStateJSON:JSON.parse(JSON.stringify(I)),prevContentStateJSON:JSON.parse(JSON.stringify(j)),currentCommentsJSON:JSON.parse(JSON.stringify(Ln.getAllComments())),newSelectionJSON:JSON.parse(JSON.stringify(A)),currentMainSelectionJSON:JSON.parse(JSON.stringify(xt.getCurrentMainSelectionJSON())),currentNestedSelectionJSON:JSON.parse(JSON.stringify(xt.getCurrentNestedSelectionJSON())),currentActiveSelectionJSON:JSON.parse(JSON.stringify(xt.getCurrentActiveSelectionJSON())),lexicalSelection:V,convertedBackMainSelection:G,isMainSelectionConvertionCorrect:F,nodes:s._editorState._nodeMap,fullEditor:s,codoxNodesMap:Wn.toArray(),codoxComments:Ln,isUpdateFromSync:k,isUpdateFromComments:$,tags:w,onlySelectionChanged:E,undoInvoked:H,redoInvoked:U,canUndo:D,canRedo:W})});let J=Eb(I,O),M=Wt.equalSelectionsJSON(xt.getCurrentActiveSelectionJSON(),A);ut.log("[editorUpdatesListener] compares: ",{isStateSame:J,isSelectionSame:M});let z=J&&M&&!$;if(!J||$||k){let V=Rc({},J?I:O),G=Ln.getAllComments();G.length&&(V.commentThreads=G);let F={source:k?LE.remote:LE.local,content:V};fi.hooks&&fi.hooks.contentChanged&&fi.hooks.contentChanged(F),is().instance.emit("content_changed",F)}if(z)ut.log("[editorUpdatesListener] STOP - state and selection and comments are same ",Wh);else if(xt.undoInvoked()&&xt.setUndoInvoked(!1),xt.redoInvoked()&&xt.setRedoInvoked(!1),xt.setCurrentContentStateJSON(O),xt.setPrevContentStateJSON(j),xt.setMainSelectionJSON(A),xt.setPrevMainSelectionJSON(T),Tb){let V=xt.getCurrentActiveSelectionJSON();d({state:xt.getCurrentContentStateJSON(),selection:V},[])}else p(Wh)},g=()=>{let b=[];return xt.getMainEditorNodesClassesMap().forEach((v,_,w)=>{let{klass:x}=v,S=s.registerMutationListener(x,E=>{for(let[O,j]of E){if(!jo[j])continue;const A=xt.getLexicalNodeByKey(O);if(j===jo.created&&A&&fa.trackBlacklisted(A,j),x.name===$n.TableNode.name&&(j===jo.destroyed?Ii.tableNodeRemoveListener(O):Ii.tableUpdateListener(O)),x.name===$n.TableRowNode.name&&j!==jo.destroyed&&Ii.tableRowNodeChangesListener(O,j===jo.updated),x.name===$n.TableCellNode.name&&j===jo.updated&&Ii.tableCellNodeChangesListener(O),x.name===qo.MarkNode.name&&(ut.debug("[MUTATION LISTENER] MARK node: ",{nodeKey:O,node:A,mutationType:j,codoxComments:Ln}),j===jo.destroyed?Ln.removeRelatedNodeKey(O):A&&Ln.addRelatedNodeKey(A.__key,A.__ids,j===jo.created)),A&&A.codoxId){if(j===jo.destroyed)return void(A.codoxId&&Wn.remove(A.codoxId));pO(A)||ut.warn("[MutationListener Error] duplicating codoxId detected - such codoxId already exists in codoxNodesMap - updating node ref to latest: ",{mutationType:j,node:A}),Wn.add(A.codoxId,A)}}b.push(S)})}),b},y={start:i,stop:o,on:(b,v)=>{ut.info(`Subscribing client to codox ${b} event`),kb[b]=v},cursor:{hide:()=>{di.hideRemoteSelectionsFromUI()},show:()=>{di.showHiddenRemoteSelectionsInUI()}},initComments:b=>{Ln.setInitialComments(b)}};return(0,Ge.useImperativeHandle)(t,()=>y),null}),n6=t6,r6=["comments"];function sO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function Ab(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sO(Object(n),!0).forEach(function(e){o6(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):sO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function o6(c,t,n){return(t=i6(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function i6(c){var t=s6(c,"string");return typeof t=="symbol"?t:t+""}function s6(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}function a6(c,t){if(c==null)return{};var n,e,s=l6(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function l6(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}class c6 extends RE{constructor(){super(),this.mainEditor=null,this.mainEditorKey=null,this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this._isCodoxStarted=!1,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1}setCanUndo(t){this._canUndo=t}setCanRedo(t){this._canRedo=t}canUndo(){return this._canUndo}canRedo(){return this._canRedo}setUndoInvoked(t){this._undoInvoked=t}setRedoInvoked(t){this._redoInvoked=t}undoInvoked(){return this._undoInvoked}redoInvoked(){return this._redoInvoked}setIsCodoxStarted(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this._isCodoxStarted=t}get isCodoxStarted(){return this._isCodoxStarted}getMainEditorKey(){return this.mainEditorKey}setMainEditor(t){this.mainEditor=t,this.mainEditorKey=t._key}clearJSONs(){ut.debug("[CodoxLexicalEditorManager][clearJSONs] invoked"),this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null}removeMainEditor(){this.mainEditor=null,this.mainEditorKey=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1,super.clear()}getMainEditor(){return this.mainEditor}alignStateSelectionJSONsFromLatestEditor(){this.getMainEditorState().read(()=>{this.setCurrentContentStateJSON(this.getMainEditorState().toJSON()),this.setMainSelectionJSON(Wt.lexicalToJSON((0,bt.$getSelection)()))})}mainEditorExists(){return!!this.mainEditor}getMainEditorState(){return this.mainEditor?this.mainEditor.getEditorState():{}}getMainEditorNodesClassesMap(){return this.mainEditor?this.mainEditor._nodes:new Map}getLexicalNodeByKey(t){return this.mainEditor?this.getMainEditorState()._nodeMap.get(t):null}isLexicalEditorInstance(t){return t&&typeof t=="object"&&!!t.setEditorState}setCurrentContentStateJSON(t){return this.currentContentStateJSON=t,this.currentContentStateJSON}getCurrentContentStateJSON(){return this.currentContentStateJSON}setPrevContentStateJSON(t){this.prevContentStateJSON=t}getPrevContentStateJSON(){return this.prevContentStateJSON}setMainSelectionJSON(t){this.currentMainSelectionJSON=t,this.currentMainSelectionJSON&&this.currentNestedSelectionJSON&&(this.currentNestedSelectionJSON=null)}setNestedSelectionJSON(t){this.currentNestedSelectionJSON=t,this.currentNestedSelectionJSON&&this.currentMainSelectionJSON&&(this.currentMainSelectionJSON=null)}getCurrentMainSelectionJSON(){return this.currentMainSelectionJSON}getCurrentNestedSelectionJSON(){return this.currentNestedSelectionJSON}getCurrentActiveSelectionJSON(){return!this.currentMainSelectionJSON&&this.currentNestedSelectionJSON?this.currentNestedSelectionJSON:this.currentMainSelectionJSON}clearSelectionJSON(){this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null}setPrevMainSelectionJSON(t){this.prevMainSelectionJSON=t}getPrevMainSelectionJSON(){return this.prevMainSelectionJSON}extractStateAndCommentsFromSynced(t){let{state:{comments:n},selection:e,stateReplace:s}=t;return{stateFromSync:{state:Ab({},a6(t.state,r6)),selection:e,stateReplace:s},commentsFromSync:n}}composeFullStateWithRootAndComments(){let{directlyFromEditor:t=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ab(Ab({},t?this.getMainEditorState().toJSON():this.currentContentStateJSON),{},{comments:Ln.getAllComments()})}isValidJSONState(t){let n=!1;try{if(!t)throw new Error("State is undefined");if(!t.root)throw new Error("State 'root' node is missing");let e=this.getMainEditorNodesClassesMap(),s=function(r){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=r,u=e.get(i.type);if(!u)throw new Error(`Node with type "${i.type}" is not registered in editor`);let{klass:a}=u;if(o==="root"){let f=a.prototype instanceof bt.ElementNode,l=a.prototype instanceof bt.DecoratorNode;if(!f&&!l)throw new Error("State root node can have only element nodes as children")}if(i.children)for(let f of i.children)s(f,i.type)};s(t.root),n=!0}catch(e){ut.error("[isValidJSONState] invalid state found: ",e.message),n=!1}return n}scanLexicalNodeForNestedEditorAttribute(t){for(let n in t){let e=t[n];if(this.isLexicalEditorInstance(e))return n}return""}isOnlySelectionChanged(t,n){return t.size===0&&n.size===0}addUpdateTag(){let{isSameState:t,isSameSelection:n,fromNestedEditor:e=!1,updateTag:s=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return s?(ut.log(`[addUpdateTag] explicit add of tag "${s}" `),void(0,bt.$addUpdateTag)(s)):e?(ut.log(`[addUpdateTag] add "${Jo.historic}" tag - change invoked by nested editor`),void(0,bt.$addUpdateTag)(Jo.historic)):void(t?(ut.log(`[addUpdateTag] add "${Jo.historic}" tag - state is same`),(0,bt.$addUpdateTag)(Jo.historic)):(ut.log(`[addUpdateTag] add "${Jo.historyMerge}" tag - state is different`),(0,bt.$addUpdateTag)(Jo.historyMerge)))}enableEditorReadOnlyMode(){this.mainEditor&&this.mainEditor.isEditable()&&this.mainEditor.setEditable(!1)}disableEditorReadOnlyMode(){this.mainEditor&&(this.mainEditor.isEditable()||this.mainEditor.setEditable(!0))}}const u6=new c6,xt=u6;class d6{constructor(){this._nodesMap=new Map,this._pastedNodesCodoxIds=new Set}get size(){return this._nodesMap.size}add(t,n){this._nodesMap.set(t,n)}get(t){return this._nodesMap.get(t)||null}remove(t){this._nodesMap.delete(t)}has(t){return this._nodesMap.has(t)}nodesToArray(){return Array.from(this._nodesMap.values())}keysToArray(){return Array.from(this._nodesMap.keys())}toArray(){return Array.from(this._nodesMap.entries())}addPastedId(t){this._pastedNodesCodoxIds.add(t)}removePastedId(t){this._pastedNodesCodoxIds.delete(t)}hasPastedId(t){return this._pastedNodesCodoxIds.has(t)}clearPastedIds(){this._pastedNodesCodoxIds.size>0&&this._pastedNodesCodoxIds.clear()}isEmptyPastedIds(){return this._pastedNodesCodoxIds.size===0}getPastedIdsSize(){return this._pastedNodesCodoxIds.size}clearAll(){this._nodesMap.clear(),this._pastedNodesCodoxIds.clear()}gcAbandonedNodes(){let t=xt.getMainEditorState();if(!t._nodeMap)return;let n=this.nodesToArray();for(let e of n)t._nodeMap.has(e.__key)||this.remove(e.codoxId)}}const f6=new d6,Wn=f6;function aO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function lO(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aO(Object(n),!0).forEach(function(e){p6(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):aO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function p6(c,t,n){return(t=h6(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function h6(c){var t=g6(c,"string");return typeof t=="symbol"?t:t+""}function g6(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}const Pb=()=>S4(),cO=c=>typeof c=="number";function jc(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=function(){for(var e=arguments.length,s=new Array(e),r=0;r<e;r++)s[r]=arguments[r];return c.apply(this,s)};return Object.defineProperty(n,"name",{value:t,writable:!0}),n}const al=c=>c.__type==="root"||c.type==="root",uO=c=>al(c.getParent()),ar=c=>c.__type===Fh.text||c.type===Fh.text||c.hasOwnProperty("__text")||c.hasOwnProperty("text"),Dc=c=>(0,bt.$isElementNode)(c),Lc=c=>(0,$n.$isTableNode)(c)||(0,$n.$isTableRowNode)(c)||(0,$n.$isTableCellNode)(c),m6=c=>!c.getChildren,dO=c=>!!c.getChildren,Bn=c=>(0,bt.$isDecoratorNode)(c),Bd=c=>(0,g4.$isLinkNode)(c),Fd=c=>c.__type==="mark"||c.type==="mark",Mb=c=>(0,bt.$isLineBreakNode)(c),pa=c=>ar(c)||Mb(c),Ib=c=>c.__type===Fh.horizontalrule||c.type===Fh.horizontalrule,fO=c=>{if(pa(c)||Bd(c)||Fd(c))return!1;if(!c.__parent||c.__parent==="root"||(0,bt.$isParagraphNode)(c))return!0;let t=c.getParent().getChildren();return t.length===1&&t[0].__key===c.__key?!((Bn(c)||Bd(c)||Fd(c))&&!Ib(c)):!t.some(n=>{let e=Ib(n);return n.__key!==c.__key&&(pa(n)||Bn(n)&&!e||Bd(n)||Fd(n))})},pO=c=>{const t=Wn.get(c.codoxId);return!t||c.__key===t.__key},Bc=function(c){const t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||Pb();c.codoxId=t,Wn.add(t,c)},hO=c=>{Wn.remove(c.codoxId),delete c.codoxId},y6=c=>{if(!dO(c)||!c.getChildrenSize())return;const t=c.getChildren();if(t.some(s=>!!(0,bt.$isParagraphNode)(s)))return;let n=!1,e=[];for(let s of t)(pa(s)||Bn(s)||Bd(s)||Fd(s))&&!n&&(Ib(s)||(n=!0)),(dO(s)||Bn(s))&&e.push(s);for(let s of e)n||s.codoxId?n&&s.codoxId&&(s=s.getWritable(),hO(s)):(s=s.getWritable(),Bc(s))},b6=c=>{const t=lO({},c);for(const n in c)c[n]===void 0&&c.hasOwnProperty(n)&&delete t[n];return t},v6=c=>{const t=`__nativeCreateDOM_${c.name}`;c.prototype[t]=jc(c.prototype.createDOM,t),c.prototype.createDOM=function(n,e){if(fO(this))if(this.codoxId){if(!pO(this)){let r=Wn.get(this.codoxId);r.__type===this.__type&&this.isAttached()&&!r.isAttached()?(ut.warn("[createDOM][Non-unique codoxId] overwrite abandoned existing node with latest: ",{latestNode:this,existingNode:r}),Wn.add(this.codoxId,this)):Bc(this)}}else Bc(this);else this.codoxId&&hO(this);Bn(this)&&!this.codoxDId&&(this.codoxDId=Pb()),fs.manageNestedEditorInLexicalNode(this);let s=this[t](n,e);return s.__codox_track=!0,s}},_6=c=>{const t=`__nativeUpdateDOM_${c.name}`;return c.prototype[t]=jc(c.prototype.updateDOM,t),c.prototype.updateDOM=function(){const n=this[t](...arguments);return y6(this),n},c},x6=c=>{const t=`__nativeRemove_${c.name}`;return c.prototype[t]=jc(c.prototype.remove,t),c.prototype.remove=function(){const n=this.codoxId;return n&&Wn.remove(n),fs.gcNestedEditorListenerInLexicalNode(this),this[t](...arguments)},c},w6=c=>{const t=`__nativeExportJSON_${c.name}`;c.prototype[t]=jc(c.prototype.exportJSON,t),c.prototype.exportJSON=function(){const n=this[t]();return this.codoxId&&(n.codoxId=this.codoxId),this.codoxDId&&(n.codoxDId=this.codoxDId),ar(this)&&cO(n.format)&&this.hasFormat&&(n.format=R4(this)),b6(n)}},S6=c=>{const t="__nativeImportJSON";c[t]=jc(c.importJSON,t),c.importJSON=function(n){const e=lO({},n);ar(e)&&!cO(e.format)&&(e.format=I4(e.format));const s=c[t](e);fs.manageNestedEditorInLexicalNode(s);const r=fO(s);return r&&e.codoxId&&(Wn.hasPastedId(e.codoxId)&&Wn.has(e.codoxId)?(Wn.removePastedId(e.codoxId),Bc(s)):Bc(s,e.codoxId)),r&&!s.codoxId&&Bc(s),e.codoxDId&&(s.codoxDId=e.codoxDId),s}},C6=c=>{const t="__nativeClone";c[t]=jc(c.clone,t),c.clone=function(n){const e=c[t](n);return n.codoxId&&(e.codoxId=n.codoxId),n.codoxDId&&(e.codoxDId=n.codoxDId),fs.manageNestedEditorInClonedLexicalNode(n,e),e}},E6=c=>{let t=!1,n=!1,e=!1,s=!1;c.forEach(o=>{o.name===bt.TextNode.name?t=!0:o.name===bt.ParagraphNode.name?n=!0:o.name===bt.LineBreakNode.name?e=!0:o.name===qo.MarkNode.name&&(s=!0)});let r=[];return t||r.push(bt.TextNode),n||r.push(bt.ParagraphNode),e||r.push(bt.LineBreakNode),s||r.push(qo.MarkNode),r.length?[...r,...c]:c},O6=function(){return E6(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(c=>(c.hasOwnProperty("__isCodoxExtended")||(v6(c),_6(c),w6(c),x6(c),S6(c),C6(c),Object.defineProperty(c,"__isCodoxExtended",{value:!0,writable:!1})),c))};var qh=un(777),Fc={};Fc.styleTagTransform=ds(),Fc.setAttributes=cs(),Fc.insert=ls().bind(null,"head"),Fc.domAPI=as(),Fc.insertStyleElement=us(),ss()(qh.A,Fc),qh.A&&qh.A.locals&&qh.A.locals;var T6=c=>{var t={};return un.d(t,c),t};const N6=T6({AutoFocusPlugin:()=>IS});var k6=c=>{var t={};return un.d(t,c),t};const A6=k6({ClearEditorPlugin:()=>x3});var P6=c=>{var t={};return un.d(t,c),t};const M6=P6({LexicalComposer:()=>MS});var I6=c=>{var t={};return un.d(t,c),t};const gO=I6({default:()=>A3});var R6=c=>{var t={};return un.d(t,c),t};const j6=R6({HistoryPlugin:()=>gC});var D6=c=>{var t={};return un.d(t,c),t};const L6=D6({OnChangePlugin:()=>L3});var B6=c=>{var t={};return un.d(t,c),t};const F6=B6({PlainTextPlugin:()=>d4});var $6=c=>{var t={};return un.d(t,c),t};const mO=$6({$isRootTextContentEmpty:()=>CR,$rootTextContent:()=>ER});var z6=c=>{var t={};return un.d(t,c),t};const $c=z6({createPortal:()=>SN.createPortal}),U6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,H6=U6?Ge.useLayoutEffect:Ge.useEffect,yO=H6;var Jh=un(253),zc={};zc.styleTagTransform=ds(),zc.setAttributes=cs(),zc.insert=ls().bind(null,"head"),zc.domAPI=as(),zc.insertStyleElement=us(),ss()(Jh.A,zc),Jh.A&&Jh.A.locals&&Jh.A.locals;function K6(c){let{onClose:t,children:n,title:e,closeOnClickOutside:s}=c;const r=(0,Ge.useRef)(null);return(0,Ge.useEffect)(()=>{r.current!==null&&r.current.focus()},[]),(0,Ge.useEffect)(()=>{let o=null;const i=f=>{f.key==="Escape"&&t()},u=f=>{const l=f.target;r.current!==null&&!r.current.contains(l)&&s&&t()},a=r.current;return a!==null&&(o=a.parentElement,o!==null&&o.addEventListener("click",u)),window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i),o!==null&&(o==null||o.removeEventListener("click",u))}},[s,t]),Ge.createElement("div",{className:"Modal__overlay",role:"dialog"},Ge.createElement("div",{className:"Modal__modal",tabIndex:-1,ref:r},Ge.createElement("h2",{className:"Modal__title"},e),Ge.createElement("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:t},"X"),Ge.createElement("div",{className:"Modal__content"},n)))}function W6(c){let{onClose:t,children:n,title:e,closeOnClickOutside:s=!1}=c;return(0,$c.createPortal)(Ge.createElement(K6,{onClose:t,title:e,closeOnClickOutside:s},n),document.body)}function bO(){const[c,t]=(0,Ge.useState)(null),n=(0,Ge.useCallback)(()=>{t(null)},[]),e=(0,Ge.useMemo)(()=>{if(c===null)return null;const{title:r,content:o,closeOnClickOutside:i}=c;return Ge.createElement(W6,{onClose:n,title:r,closeOnClickOutside:i},o)},[c,n]),s=(0,Ge.useCallback)(function(r,o){t({closeOnClickOutside:arguments.length>2&&arguments[2]!==void 0&&arguments[2],content:o(n),title:r})},[n]);return[e,s]}var Vh=un(191),Uc={};Uc.styleTagTransform=ds(),Uc.setAttributes=cs(),Uc.insert=ls().bind(null,"head"),Uc.domAPI=as(),Uc.insertStyleElement=us(),ss()(Vh.A,Uc),Vh.A&&Vh.A.locals&&Vh.A.locals;const q6={blockCursor:"CommentEditorTheme__blockCursor",characterLimit:"CommentEditorTheme__characterLimit",code:"CommentEditorTheme__code",codeHighlight:{atrule:"CommentEditorTheme__tokenAttr",attr:"CommentEditorTheme__tokenAttr",boolean:"CommentEditorTheme__tokenProperty",builtin:"CommentEditorTheme__tokenSelector",cdata:"CommentEditorTheme__tokenComment",char:"CommentEditorTheme__tokenSelector",class:"CommentEditorTheme__tokenFunction","class-name":"CommentEditorTheme__tokenFunction",comment:"CommentEditorTheme__tokenComment",constant:"CommentEditorTheme__tokenProperty",deleted:"CommentEditorTheme__tokenProperty",doctype:"CommentEditorTheme__tokenComment",entity:"CommentEditorTheme__tokenOperator",function:"CommentEditorTheme__tokenFunction",important:"CommentEditorTheme__tokenVariable",inserted:"CommentEditorTheme__tokenSelector",keyword:"CommentEditorTheme__tokenAttr",namespace:"CommentEditorTheme__tokenVariable",number:"CommentEditorTheme__tokenProperty",operator:"CommentEditorTheme__tokenOperator",prolog:"CommentEditorTheme__tokenComment",property:"CommentEditorTheme__tokenProperty",punctuation:"CommentEditorTheme__tokenPunctuation",regex:"CommentEditorTheme__tokenVariable",selector:"CommentEditorTheme__tokenSelector",string:"CommentEditorTheme__tokenSelector",symbol:"CommentEditorTheme__tokenProperty",tag:"CommentEditorTheme__tokenProperty",url:"CommentEditorTheme__tokenOperator",variable:"CommentEditorTheme__tokenVariable"},embedBlock:{base:"CommentEditorTheme__embedBlock",focus:"CommentEditorTheme__embedBlockFocus"},hashtag:"CommentEditorTheme__hashtag",heading:{h1:"CommentEditorTheme__h1",h2:"CommentEditorTheme__h2",h3:"CommentEditorTheme__h3",h4:"CommentEditorTheme__h4",h5:"CommentEditorTheme__h5",h6:"CommentEditorTheme__h6"},image:"editor-image",indent:"CommentEditorTheme__indent",inlineImage:"inline-editor-image",layoutContainer:"CommentEditorTheme__layoutContainer",layoutItem:"CommentEditorTheme__layoutItem",link:"CommentEditorTheme__link",list:{checklist:"CommentEditorTheme__checklist",listitem:"CommentEditorTheme__listItem",listitemChecked:"CommentEditorTheme__listItemChecked",listitemUnchecked:"CommentEditorTheme__listItemUnchecked",nested:{listitem:"CommentEditorTheme__nestedListItem"},olDepth:["CommentEditorTheme__ol1","CommentEditorTheme__ol2","CommentEditorTheme__ol3","CommentEditorTheme__ol4","CommentEditorTheme__ol5"],ul:"CommentEditorTheme__ul"},ltr:"CommentEditorTheme__ltr",mark:"CommentEditorTheme__mark",markOverlap:"CommentEditorTheme__markOverlap",paragraph:"CommentEditorTheme__paragraph",quote:"CommentEditorTheme__quote",rtl:"CommentEditorTheme__rtl",table:"CommentEditorTheme__table",tableCell:"CommentEditorTheme__tableCell",tableCellActionButton:"CommentEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"CommentEditorTheme__tableCellActionButtonContainer",tableCellEditing:"CommentEditorTheme__tableCellEditing",tableCellHeader:"CommentEditorTheme__tableCellHeader",tableCellPrimarySelected:"CommentEditorTheme__tableCellPrimarySelected",tableCellResizer:"CommentEditorTheme__tableCellResizer",tableCellSelected:"CommentEditorTheme__tableCellSelected",tableCellSortedIndicator:"CommentEditorTheme__tableCellSortedIndicator",tableResizeRuler:"CommentEditorTheme__tableCellResizeRuler",tableSelected:"CommentEditorTheme__tableSelected",tableSelection:"CommentEditorTheme__tableSelection",text:{bold:"CommentEditorTheme__textBold",code:"CommentEditorTheme__textCode",italic:"CommentEditorTheme__textItalic",strikethrough:"CommentEditorTheme__textStrikethrough",subscript:"CommentEditorTheme__textSubscript",superscript:"CommentEditorTheme__textSuperscript",underline:"CommentEditorTheme__textUnderline",underlineStrikethrough:"CommentEditorTheme__textUnderlineStrikethrough"}},J6=q6;var Gh=un(72),Hc={};Hc.styleTagTransform=ds(),Hc.setAttributes=cs(),Hc.insert=ls().bind(null,"head"),Hc.domAPI=as(),Hc.insertStyleElement=us(),ss()(Gh.A,Hc),Gh.A&&Gh.A.locals&&Gh.A.locals;function V6(){for(var c=arguments.length,t=new Array(c),n=0;n<c;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function Rb(){return Rb=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)({}).hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Rb.apply(null,arguments)}function ha(c){let{"data-test-id":t,children:n,className:e,onClick:s,disabled:r,small:o,title:i}=c;return Ge.createElement("button",Rb({disabled:r,className:V6("Button__root",r&&"Button__disabled",o&&"Button__small",e),onClick:s,title:i,"aria-label":i},t&&{"data-test-id":t}),n)}var Yh=un(129),Kc={};Kc.styleTagTransform=ds(),Kc.setAttributes=cs(),Kc.insert=ls().bind(null,"head"),Kc.domAPI=as(),Kc.insertStyleElement=us(),ss()(Yh.A,Kc),Yh.A&&Yh.A.locals&&Yh.A.locals;var G6=c=>{var t={};return un.d(t,c),t};const Y6=G6({ContentEditable:()=>RS});function X6(c){let{className:t}=c;return Ge.createElement(Y6.ContentEditable,{className:t||"ContentEditable__root"})}var Xh=un(457),Wc={};Wc.styleTagTransform=ds(),Wc.setAttributes=cs(),Wc.insert=ls().bind(null,"head"),Wc.domAPI=as(),Wc.insertStyleElement=us(),ss()(Xh.A,Wc),Xh.A&&Xh.A.locals&&Xh.A.locals;function Z6(c){let{children:t,className:n}=c;return Ge.createElement("div",{className:n||"Placeholder__root"},t)}const Q6=gO.default.LexicalErrorBoundary||gO.default,e8=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#050505",className:"codox-add-comment-right"},Ge.createElement("path",{d:"M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4.414A2 2 0 0 0 3 11.586l-2 2V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12.793a.5.5 0 0 0 .854.353l2.853-2.853A1 1 0 0 1 4.414 12H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}),Ge.createElement("path",{d:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3 6a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 6zm0 2.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"})),vO=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",className:"codox-remove-comment"},Ge.createElement("path",{d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z"})),t8=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"codox-add-comment"},Ge.createElement("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"})),n8=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"#0000008c",className:"codox-hide-show-comments"},Ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 5.885v1.166a3.95 3.95 0 0 1-3.949 3.95H6.917a.748.748 0 0 0-.45.15l-1.345 1.007a.752.752 0 0 0-.032 1.181A2.933 2.933 0 0 0 6.95 14h2.716l2.534 1.901a.506.506 0 0 0 .524.047A.501.501 0 0 0 13 15.5V14h.051a2.949 2.949 0 0 0 2.95-2.949v-3.05a3.002 3.002 0 0 0-2.002-2.83.756.756 0 0 0-.999.714"}),Ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.05 1H2.95A2.952 2.952 0 0 0 0 3.949v3.102A2.952 2.952 0 0 0 2.949 10H3v1.5a.502.502 0 0 0 .8.4L6.334 10H9.05A2.952 2.952 0 0 0 12 7.05V3.95A2.952 2.952 0 0 0 9.05 1"}));function _O(c,t,n){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:performance.now(),s=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return Ln.createNewCommentObj({content:c,author:t,codoxId:n,timeStamp:e,deleted:s})}function r8(c,t,n){return Ln.createNewThreadObj({quote:c,comments:t,codoxId:n})}function o8(c){let{anchorKey:t,editor:n,onAddComment:e}=c;const s=(0,Ge.useRef)(null),r=(0,Ge.useCallback)(()=>{const o=s.current,i=n.getRootElement(),u=n.getElementByKey(t);if(o!==null&&i!==null&&u!==null){const{right:a}=i.getBoundingClientRect(),{top:f}=u.getBoundingClientRect();o.style.left=a-20+"px",o.style.top=f-30+"px"}},[t,n]);return(0,Ge.useEffect)(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[n,r]),yO(()=>{r()},[t,n,r]),Ge.createElement("div",{className:"CodoxCommentPlugin_AddCommentBox",ref:s},Ge.createElement("button",{className:"CodoxCommentPlugin_AddCommentBox_button",onClick:e},Ge.createElement(e8,null)))}function i8(c){let{onEscape:t}=c;const[n]=(0,da.useLexicalComposerContext)();return(0,Ge.useEffect)(()=>n.registerCommand(bt.KEY_ESCAPE_COMMAND,e=>t(e),2),[n,t]),null}function s8(c){let{editorRef:t}=c;const[n]=(0,da.useLexicalComposerContext)();return typeof t=="function"?t(n):typeof t=="object"&&(t.current=n),null}function xO(c){let{className:t,autoFocus:n,onEscape:e,onChange:s,editorRef:r,placeholder:o="Type a comment...",onEditorClick:i=()=>{}}=c;const u={namespace:"Commenting",nodes:[],onError:a=>{throw a},theme:J6};return Ge.createElement(M6.LexicalComposer,{initialConfig:u},Ge.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_EditorContainer",onClick:i},Ge.createElement(F6.PlainTextPlugin,{contentEditable:Ge.createElement(X6,{className:t}),placeholder:Ge.createElement(Z6,null,o),ErrorBoundary:Q6}),Ge.createElement(L6.OnChangePlugin,{onChange:s}),Ge.createElement(j6.HistoryPlugin,null),n!==!1&&Ge.createElement(N6.AutoFocusPlugin,null),Ge.createElement(i8,{onEscape:e}),Ge.createElement(A6.ClearEditorPlugin,null),r!==void 0&&Ge.createElement(s8,{editorRef:r})))}function wO(c,t){return(0,Ge.useCallback)((n,e)=>{n.read(()=>{c((0,mO.$rootTextContent)()),t(!(0,mO.$isRootTextContentEmpty)(e.isComposing(),!0))})},[t,c])}function a8(c){let{editor:t,cancelAddComment:n,submitAddComment:e}=c;const[s,r]=(0,Ge.useState)(""),[o,i]=(0,Ge.useState)(!1),u=(0,Ge.useRef)(null),a=(0,Ge.useMemo)(()=>({container:document.createElement("div"),elements:[]}),[]),f=(0,Ge.useRef)(null),l=EO(),d=(0,Ge.useCallback)(()=>{t.getEditorState().read(()=>{const h=(0,bt.$getSelection)();if((0,bt.$isRangeSelection)(h)){f.current=h.clone();const m=h.anchor,g=h.focus,y=(0,il.createDOMRange)(t,m.getNode(),m.offset,g.getNode(),g.offset),b=u.current;if(y!==null&&b!==null){const{left:v,bottom:_,width:w}=y.getBoundingClientRect(),x=(0,il.createRectsFromDOMRange)(t,y);let S=x.length===1?v+w/2-125:v-125;S<10&&(S=10),b.style.left=`${S}px`,b.style.top=`${_+20+(window.pageYOffset||document.documentElement.scrollTop)}px`;const E=x.length,{container:O}=a,j=a.elements,A=j.length;for(let T=0;T<E;T++){const I=x[T];let k=j[T];k===void 0&&(k=document.createElement("span"),j[T]=k,O.appendChild(k));const $="255, 212, 0",H=`position:absolute;top:${I.top+(window.pageYOffset||document.documentElement.scrollTop)}px;left:${I.left}px;height:${I.height}px;width:${I.width}px;background-color:rgba(${$}, 0.3);pointer-events:none;z-index:5;`;k.style.cssText=H}for(let T=A-1;T>=E;T--){const I=j[T];O.removeChild(I),j.pop()}}}})},[t,a]);yO(()=>{d();const h=a.container,m=document.body;if(m!==null)return m.appendChild(h),()=>{m.removeChild(h)}},[a.container,d]),(0,Ge.useEffect)(()=>(window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]);const p=wO(r,i);return Ge.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox",ref:u},Ge.createElement(xO,{className:"CodoxCommentPlugin_CommentInputBox_Editor",onEscape:h=>(h.preventDefault(),n(),!0),onChange:p}),Ge.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_Buttons"},Ge.createElement(ha,{onClick:n,className:"CodoxCommentPlugin_CommentInputBox_Button"},"Cancel"),Ge.createElement(ha,{onClick:()=>{if(o){let h=t.getEditorState().read(()=>{const m=f.current;return m?m.getTextContent():""});h.length>100&&(h=h.slice(0,99)+"…"),e(r8(h,[_O(s,l)]),!0,void 0,f.current),f.current=null}},disabled:!o,className:"CodoxCommentPlugin_CommentInputBox_Button primary"},"Comment")))}function l8(c){let{submitAddComment:t,thread:n,placeholder:e}=c;const[s,r]=(0,Ge.useState)(""),[o,i]=(0,Ge.useState)(!1),u=(0,Ge.useRef)(null),a=EO(),f=wO(r,i);return Ge.createElement(Ge.Fragment,null,Ge.createElement(xO,{className:"CodoxCommentPlugin_CommentsPanel_Editor",autoFocus:!1,onEscape:()=>!0,onChange:f,editorRef:u,placeholder:e}),Ge.createElement(ha,{className:"CodoxCommentPlugin_CommentsPanel_SendButton",onClick:()=>{if(o){t(_O(s,a),!1,n);const l=u.current;l!==null&&l.dispatchCommand(bt.CLEAR_EDITOR_COMMAND,void 0)}},disabled:!o},Ge.createElement(t8,null)))}function SO(c){let{commentOrThread:t,deleteCommentOrThread:n,onClose:e,thread:s}=c;return Ge.createElement(Ge.Fragment,null,"Are you sure you want to delete this ",t.type,"?",Ge.createElement("div",{className:"Modal__content"},Ge.createElement(ha,{onClick:()=>{n(t,s),e()}},"Delete")," ",Ge.createElement(ha,{onClick:()=>{e()}},"Cancel")))}function CO(c){let{comment:t,deleteComment:n,thread:e,rtf:s}=c;const r=Math.round((t.timeStamp-performance.now())/1e3),o=Math.round(r/60),[i,u]=bO();return Ge.createElement("li",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment"},Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Details"},Ge.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Author"},t.author),Ge.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Time"},"· ",r>-10?"Just now":s.format(o,"minute"))),Ge.createElement("p",{className:t.deleted?"CodoxCommentPlugin_CommentsPanel_DeletedComment":""},t.content),!t.deleted&&Ge.createElement(Ge.Fragment,null,Ge.createElement(ha,{onClick:()=>{u("Delete Comment",a=>Ge.createElement(SO,{commentOrThread:t,deleteCommentOrThread:n,thread:e,onClose:a}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Ge.createElement(vO,null)),i))}function c8(c){let{activeIDs:t,comments:n,deleteCommentOrThread:e,listRef:s,submitAddComment:r,markNodeMap:o}=c;const[i]=(0,da.useLexicalComposerContext)(),[u,a]=(0,Ge.useState)(0),[f,l]=bO(),d=(0,Ge.useMemo)(()=>new Intl.RelativeTimeFormat("en",{localeMatcher:"best fit",numeric:"auto",style:"short"}),[]);return(0,Ge.useEffect)(()=>{const p=setTimeout(()=>{a(u+1)},1e4);return()=>{clearTimeout(p)}},[u]),Ge.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List",ref:s},n.map(p=>{const h=p.codoxId;if(!h)return null;if(p.type==="thread"){const m=()=>{if(o.get(h)!==void 0&&(t===null||t.indexOf(h)===-1)){const g=document.activeElement;i.update(()=>{(0,bt.$setSelection)(null)},{onUpdate(){g!==null&&g.focus()}})}};return Ge.createElement("li",{key:h,onClick:m,className:`CodoxCommentPlugin_CommentsPanel_List_Thread ${o.has(h)?"interactive":""} ${t.indexOf(h)===-1?"":"active"}`},Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_QuoteBox"},Ge.createElement("blockquote",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Quote"},"> ",Ge.createElement("span",null,p.quote)),Ge.createElement(ha,{onClick:()=>{l("Delete Thread",g=>Ge.createElement(SO,{commentOrThread:p,deleteCommentOrThread:e,onClose:g}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Ge.createElement(vO,null)),f),Ge.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Comments"},p.comments.map(g=>Ge.createElement(CO,{key:g.codoxId,comment:g,deleteComment:e,thread:p,rtf:d}))),Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Editor"},Ge.createElement(l8,{submitAddComment:r,thread:p,placeholder:"Reply to comment..."})))}return Ge.createElement(CO,{key:h,comment:p,deleteComment:e,rtf:d})}))}function u8(c){let{activeIDs:t,deleteCommentOrThread:n,comments:e,submitAddComment:s,markNodeMap:r}=c;const o=(0,Ge.useRef)(null),i=e.length===0;return Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel"},Ge.createElement("h2",{className:"CodoxCommentPlugin_CommentsPanel_Heading"},"Comments"),i?Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_Empty"},"No Comments"):Ge.createElement(c8,{activeIDs:t,comments:e,deleteCommentOrThread:n,listRef:o,submitAddComment:s,markNodeMap:r}))}function EO(){const c=(0,nO.useCollaborationContext)(),{yjsDocMap:t,name:n}=c;return n||"Playground User"}function d8(c){const[t]=(0,da.useLexicalComposerContext)(),n=J4(),e=(0,Ge.useMemo)(()=>new Map,[]),[s,r]=(0,Ge.useState)(),[o,i]=(0,Ge.useState)([]),[u,a]=(0,Ge.useState)(!1),[f,l]=(0,Ge.useState)(!1);(0,Ge.useEffect)(()=>{!n.length&&f?l(!1):n.length},[n]);const d=(0,Ge.useCallback)(()=>{t.update(()=>{const m=(0,bt.$getSelection)();m!==null&&(m.dirty=!0)}),a(!1)},[t]),p=(0,Ge.useCallback)((m,g)=>{if(m.type==="comment"){if(ut.log("[deleteCommentOrThread]: type comment new values",{comment:m,thread:g,markNodeMap:e}),Ln.removeComment(g.codoxId,m.codoxId),!g)return;const y=g.codoxId,b=e.get(y);t.update(()=>{b?b.forEach((v,_)=>{const w=(0,bt.$getNodeByKey)(_);ut.log("[deleteCommentOrThread]: type comment new values",{lexicalNode:w}),w&&w.markDirty()}):(0,bt.$getRoot)().markDirty(),(0,bt.$addUpdateTag)(Jo.historic),(0,bt.$addUpdateTag)(Dd)})}else{ut.log("[deleteCommentOrThread]: type thread new values",{comment:m,markNodeMap:e});const y=g!==void 0?g.codoxId:m.codoxId,b=e.get(y);setTimeout(()=>{t.update(()=>{if(b)for(const v of b){const _=(0,bt.$getNodeByKey)(v);ut.log("[deleteCommentOrThread]: type thread new values",{node:_}),(0,qo.$isMarkNode)(_)&&(_.deleteID(y),_.getIDs().length===0&&(0,qo.$unwrapMarkNode)(_))}else(0,bt.$getRoot)().markDirty(),ut.debug("[deleteCommentOrThread][refreshComments]");Ln.refreshComments(!0),(0,bt.$addUpdateTag)(Dd)})})}},[t,e]),h=(0,Ge.useCallback)((m,g,y,b)=>{if(ut.log("[submitAddComment]: new values",{commentOrThread:m,isInlineComment:g,thread:y,markNodeMap:e}),y?Ln.addComment(y.codoxId,m):Ln.addCommentThread(m),g)t.update(()=>{if((0,bt.$isRangeSelection)(b)){const v=b.isBackward(),_=m.codoxId;(0,qo.$wrapSelectionInMarkNode)(b,v,_),(0,bt.$addUpdateTag)(Dd)}}),a(!1);else if(!g&&y){const v=y.codoxId,_=e.get(v);if(!_)return void Ln.removeComment(y.codoxId,m.codoxId);t.update(()=>{_.forEach((w,x)=>{let S=(0,bt.$getNodeByKey)(x);S&&S.markDirty()}),(0,bt.$addUpdateTag)(Jo.historic),(0,bt.$addUpdateTag)(Dd)})}},[t]);return(0,Ge.useEffect)(()=>{const m=[];for(let g=0;g<o.length;g++){const y=o[g],b=e.get(y);if(b!==void 0)for(const v of b){const _=t.getElementByKey(v);_!==null&&(_.classList.add("selected"),m.push(_),l(!0))}}return()=>{for(let g=0;g<m.length;g++)m[g].classList.remove("selected")}},[o,t,e]),(0,Ge.useEffect)(()=>{const m=new Map;return(0,Pc.mergeRegister)((0,Pc.registerNestedElementResolver)(t,qo.MarkNode,g=>(0,qo.$createMarkNode)(g.getIDs()),(g,y)=>{g.getIDs().forEach(b=>{y.addID(b)})}),t.registerMutationListener(qo.MarkNode,g=>{t.getEditorState().read(()=>{for(const[y,b]of g){const v=(0,bt.$getNodeByKey)(y);let _=[];b==="destroyed"?_=m.get(y)||[]:(0,qo.$isMarkNode)(v)&&(_=v.getIDs());for(let w=0;w<_.length;w++){const x=_[w];let S=e.get(x);m.set(y,_),b==="destroyed"?S!==void 0&&(S.delete(y),S.size===0&&e.delete(x)):(S===void 0&&(S=new Set,e.set(x,S)),S.has(y)||S.add(y))}}})}),t.registerUpdateListener(g=>{let{editorState:y,tags:b}=g;y.read(()=>{const v=(0,bt.$getSelection)();let _=!1,w=!1;if((0,bt.$isRangeSelection)(v)){const x=v.anchor.getNode();if((0,bt.$isTextNode)(x)){const S=(0,qo.$getMarkIDs)(x,v.anchor.offset);S!==null&&(i(S),_=!0),v.isCollapsed()||(r(x.getKey()),w=!0)}}_||i(x=>x.length===0?x:[]),w||r(null),(0,bt.$isRangeSelection)(v)&&a(!1)})}),t.registerCommand(Cb,()=>{const g=window.getSelection();return g!==null&&g.removeAllRanges(),a(!0),!0},bt.COMMAND_PRIORITY_EDITOR))},[t,e]),Ge.createElement(Ge.Fragment,null,u&&(0,$c.createPortal)(Ge.createElement(a8,{editor:t,cancelAddComment:d,submitAddComment:h}),document.body),s!=null&&!u&&(0,$c.createPortal)(Ge.createElement(o8,{anchorKey:s,editor:t,onAddComment:()=>{t.dispatchCommand(Cb,void 0)}}),document.body),(0,$c.createPortal)(Ge.createElement(ha,{className:"CodoxCommentPlugin_ShowCommentsButton "+(f?"active":""),onClick:()=>l(!f),title:f?"Hide Comments":"Show Comments"},Ge.createElement(n8,null)),document.body),f&&(0,$c.createPortal)(Ge.createElement(u8,{comments:n,submitAddComment:h,deleteCommentOrThread:p,activeIDs:o,markNodeMap:e}),document.body))}var Zh=un(766),qc={};qc.styleTagTransform=ds(),qc.setAttributes=cs(),qc.insert=ls().bind(null,"head"),qc.domAPI=as(),qc.insertStyleElement=us(),ss()(Zh.A,qc),Zh.A&&Zh.A.locals&&Zh.A.locals;var Qh=un(225),Jc={};Jc.styleTagTransform=ds(),Jc.setAttributes=cs(),Jc.insert=ls().bind(null,"head"),Jc.domAPI=as(),Jc.insertStyleElement=us(),ss()(Qh.A,Jc),Qh.A&&Qh.A.locals&&Qh.A.locals;function f8(c){let{label:t,value:n,onChange:e,placeholder:s="","data-test-id":r,type:o="text"}=c;return Ge.createElement("div",{className:"CodoxInput__wrapper"},Ge.createElement("label",{className:"CodoxInput__label"},t),Ge.createElement("input",{type:o,className:"CodoxInput__input",placeholder:s,value:n,onChange:i=>{e(i.target.value)},"data-test-id":r}))}function OO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function eg(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OO(Object(n),!0).forEach(function(e){p8(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):OO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function p8(c,t,n){return(t=h8(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function h8(c){var t=g8(c,"string");return typeof t=="symbol"?t:t+""}function g8(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}let $d=!1;const m8=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],zd=214,TO=150;function y8(c){let{color:t,onChange:n}=c;const[e,s]=(0,Ge.useState)(Vc("hex",t)),[r,o]=(0,Ge.useState)(t),i=(0,Ge.useRef)(null),u=(0,Ge.useMemo)(()=>({x:e.hsv.s/100*zd,y:(100-e.hsv.v)/100*TO}),[e.hsv.s,e.hsv.v]),a=(0,Ge.useMemo)(()=>({x:e.hsv.h/360*zd}),[e.hsv]);return(0,Ge.useEffect)(()=>{i.current!==null&&n&&o(e.hex)},[e,n]),(0,Ge.useEffect)(()=>{if(t===void 0)return;const f=Vc("hex",t);s(f),o(f.hex)},[t]),Ge.createElement("div",{className:"codox-color-picker-wrapper",style:{width:zd},ref:i},Ge.createElement(f8,{label:"Hex",onChange:f=>{if(o(f),/^#[0-9A-Fa-f]{6}$/i.test(f)){const l=Vc("hex",f);s(l)}},value:r}),Ge.createElement("div",{className:"codox-color-picker-basic-color"},m8.map(f=>Ge.createElement("button",{className:f===e.hex?" active":"",key:f,style:{backgroundColor:f},onClick:()=>(l=>{o(l);let d=Vc("hex",l);s(d),n(d.hex,$d)})(f)}))),Ge.createElement(NO,{className:"codox-color-picker-saturation",style:{backgroundColor:`hsl(${e.hsv.h}, 100%, 50%)`},onChange:f=>{let{x:l,y:d}=f;const p=Vc("hsv",eg(eg({},e.hsv),{},{s:l/zd*100,v:100-d/TO*100}));s(p),o(p.hex),n(p.hex,$d)}},Ge.createElement("div",{className:"codox-color-picker-saturation_cursor",style:{backgroundColor:e.hex,left:u.x,top:u.y}})),Ge.createElement(NO,{className:"codox-color-picker-hue",onChange:f=>{let{x:l}=f;const d=Vc("hsv",eg(eg({},e.hsv),{},{h:l/zd*360}));s(d),o(d.hex),n(d.hex,$d)}},Ge.createElement("div",{className:"codox-color-picker-hue_cursor",style:{backgroundColor:`hsl(${e.hsv.h}, 100%, 50%)`,left:a.x}})),Ge.createElement("div",{className:"codox-color-picker-color",style:{backgroundColor:e.hex}}))}function NO(c){let{className:t,style:n,onChange:e,children:s}=c;const r=(0,Ge.useRef)(null),o=(0,Ge.useRef)(!1),i=u=>{if(r.current){const{current:a}=r,{width:f,height:l,left:d,top:p}=a.getBoundingClientRect(),h=kO(u.clientX-d,f,0),m=kO(u.clientY-p,l,0);e({x:h,y:m})}};return Ge.createElement("div",{ref:r,className:t,style:n,onMouseDown:u=>{if(u.button!==0)return;i(u);const a=l=>{o.current=!0,$d=!0,i(l)},f=l=>{o.current&&($d=!1),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",f,!1),i(l),o.current=!1};document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",f,!1)}},s)}function kO(c,t,n){return c>t?t:c<n?n:c}function AO(c){if(!c.startsWith("#")){const t=document.createElement("canvas").getContext("2d");if(!t)throw new Error("2d context not supported or canvas already initialized");return t.fillStyle=c,t.fillStyle}return c.length===4||c.length===5?c=c.split("").map((t,n)=>n?t+t:"#").join(""):c.length===7||c.length===9?c:"#000000"}function PO(c){const t=(c.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(n,e,s,r)=>"#"+e+e+s+s+r+r).substring(1).match(/.{2}/g)||[]).map(n=>parseInt(n,16));return{b:t[2],g:t[1],r:t[0]}}function jb(c){let{r:t,g:n,b:e}=c;t/=255,n/=255,e/=255;const s=Math.max(t,n,e),r=s-Math.min(t,n,e);return{h:r?60*(s===t?(n-e)/r+(n<e?6:0):s===n?2+(e-t)/r:4+(t-n)/r):0,s:s?r/s*100:0,v:100*s}}function b8(c){let{h:t,s:n,v:e}=c;n/=100,e/=100;const s=~~(t/60),r=t/60-s,o=e*(1-n),i=e*(1-n*r),u=e*(1-n*(1-r)),a=s%6,f=Math.round(255*[e,i,o,o,u,e][a]),l=Math.round(255*[u,e,e,i,o,o][a]);return{b:Math.round(255*[o,o,u,e,e,i][a]),g:l,r:f}}function MO(c){let{b:t,g:n,r:e}=c;return"#"+[e,n,t].map(s=>s.toString(16).padStart(2,"0")).join("")}function Vc(c,t){let n=AO("#121212"),e=PO(n),s=jb(e);return c==="hex"?(n=AO(t),e=PO(n),s=jb(e)):c==="rgb"?(e=t,n=MO(e),s=jb(e)):c==="hsv"&&(s=t,e=b8(s),n=MO(e)),{hex:n,hsv:s,rgb:e}}const v8=Ge.createContext(null),IO=4;function _8(c){let{children:t,dropDownRef:n,onClose:e,dropdownClassName:s}=c;const[r,o]=(0,Ge.useState)(),[i,u]=(0,Ge.useState)(),a=(0,Ge.useCallback)(l=>{o(d=>d?[...d,l]:[l])},[o]),f=(0,Ge.useMemo)(()=>({registerItem:a}),[a]);return(0,Ge.useEffect)(()=>{r&&!i&&u(r[0]),i&&i.current&&i.current.focus()},[r,i]),Ge.createElement(v8.Provider,{value:f},Ge.createElement("div",{className:s,ref:n,onKeyDown:l=>{if(!r)return;const d=l.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(d)&&l.preventDefault(),d==="Escape"||d==="Tab"?e():d==="ArrowUp"?u(p=>{if(!p)return r[0];const h=r.indexOf(p)-1;return r[h===-1?r.length-1:h]}):d==="ArrowDown"&&u(p=>p?r[r.indexOf(p)+1]:r[0])}},t))}function x8(c){let{disabled:t=!1,buttonLabel:n,buttonAriaLabel:e,buttonClassName:s,buttonIconClassName:r,children:o,stopCloseOnClickSelf:i,dropdownClassName:u,buttonLabelClassName:a,dropdownChevronClassName:f}=c;const l=(0,Ge.useRef)(null),d=(0,Ge.useRef)(null),[p,h]=(0,Ge.useState)(!1);return(0,Ge.useEffect)(()=>{const m=d.current,g=l.current;if(p&&m!==null&&g!==null){const{top:y,left:b}=m.getBoundingClientRect();g.style.top=`${y+m.offsetHeight+IO}px`,g.style.left=`${Math.min(b,window.innerWidth-g.offsetWidth-20)}px`}},[l,d,p]),(0,Ge.useEffect)(()=>{const m=d.current;if(m!==null&&p){const g=y=>{const b=y.target;i&&l.current&&l.current.contains(b)||m.contains(b)||h(!1)};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}}},[l,d,p,i]),(0,Ge.useEffect)(()=>{const m=()=>{if(p){const g=d.current,y=l.current;if(g!==null&&y!==null){const{top:b}=g.getBoundingClientRect(),v=b+g.offsetHeight+IO;v!==y.getBoundingClientRect().top&&(y.style.top=`${v}px`)}}};return document.addEventListener("scroll",m),()=>{document.removeEventListener("scroll",m)}},[d,l,p]),Ge.createElement(Ge.Fragment,null,Ge.createElement("button",{type:"button",disabled:t,"aria-label":e||n,className:s,onClick:()=>h(!p),ref:d},r&&Ge.createElement("span",{className:r}),n&&Ge.createElement("span",{className:a},n),Ge.createElement("i",{className:f})),p&&(0,$c.createPortal)(Ge.createElement(_8,{dropDownRef:l,onClose:()=>{h(!1),d&&d.current&&d.current.focus()},dropdownClassName:u},o),document.body))}const w8=["disabled","stopCloseOnClickSelf","color","onChange"];function Db(){return Db=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)({}).hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Db.apply(null,arguments)}function S8(c,t){if(c==null)return{};var n,e,s=C8(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function C8(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}function RO(c){let{disabled:t=!1,stopCloseOnClickSelf:n=!0,color:e,onChange:s}=c,r=S8(c,w8);return Ge.createElement(x8,Db({},r,{disabled:t,stopCloseOnClickSelf:n}),Ge.createElement(y8,{color:e,onChange:s}))}const E8=c=>{let{onColorChange:t,buttonClassName:n,buttonIconClassName:e,buttonAriaLabel:s,buttonLabel:r,dropdownClassName:o,buttonLabelClassName:i,dropdownChevronClassName:u}=c;const[a]=(0,da.useLexicalComposerContext)(),[f,l]=(0,Ge.useState)(()=>a.isEditable()),[d,p]=(0,Ge.useState)("");(0,Ge.useEffect)(()=>(0,Pc.mergeRegister)(a.registerEditableListener(m=>{l(m)}),a.registerUpdateListener(m=>{let{editorState:g}=m;g.read(()=>{const y=(0,bt.$getSelection)();if((0,bt.$isRangeSelection)(y)){let b=(0,il.$getSelectionStyleValueForProperty)(y,"color");b!==d&&(p(b||""),t(b))}})})),[a]);const h=(0,Ge.useCallback)((m,g)=>{a.update(()=>{const y=(0,bt.$getSelection)();y!==null&&(0,il.$patchStyleText)(y,{color:m})})},[a]);return Ge.createElement(RO,{disabled:!f,color:d,onChange:h,buttonClassName:n||"",buttonIconClassName:e||"",buttonAriaLabel:s||"",buttonLabel:r||"",dropdownClassName:o||"",buttonLabelClassName:i||"",dropdownChevronClassName:u||""})},O8=E8,T8=c=>{let{onColorChange:t,buttonClassName:n,buttonIconClassName:e,buttonAriaLabel:s,buttonLabel:r,dropdownClassName:o,buttonLabelClassName:i,dropdownChevronClassName:u}=c;const[a]=(0,da.useLexicalComposerContext)(),[f,l]=(0,Ge.useState)(()=>a.isEditable()),[d,p]=(0,Ge.useState)("#fff");(0,Ge.useEffect)(()=>(0,Pc.mergeRegister)(a.registerEditableListener(m=>{l(m)}),a.registerUpdateListener(m=>{let{editorState:g}=m;g.read(()=>{const y=(0,bt.$getSelection)();if((0,bt.$isRangeSelection)(y)){let b=(0,il.$getSelectionStyleValueForProperty)(y,"background-color");b!==d&&(p(b||""),t(b))}})})),[a]);const h=(0,Ge.useCallback)((m,g)=>{a.update(()=>{const y=(0,bt.$getSelection)();y!==null&&(0,il.$patchStyleText)(y,{"background-color":m})})},[a]);return Ge.createElement(RO,{disabled:!f,color:d,onChange:h,buttonClassName:n||"",buttonIconClassName:e||"",buttonAriaLabel:s||"",buttonLabel:r||"",dropdownClassName:o||"",buttonLabelClassName:i||"",dropdownChevronClassName:u||""})},N8=T8;var k8=aa.yy;aa._U,aa.a8,aa.Vs,aa.Cn;var A8=aa.gK,P8=aa.vv;const M8={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},I8="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDE1IDE1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMDAwMDEgOC4zMzMzM0wxLjkwMDAxIDEzLjhMMS4xMDAwMSAxMy4yTDUuMzc1MDEgNy41TDEuMTAwMDEgMS44TDEuOTAwMDEgMS4yTDYuMDAwMDEgNi42NjY2N0wxMC4xIDEuMkwxMC45IDEuOEw2LjYyNTAxIDcuNUwxMC45IDEzLjJMMTAuMSAxMy44TDYuMDAwMDEgOC4zMzMzM1pNMTIgMTIuNUMxMiAxMS42NzE2IDEyLjY3MTYgMTEgMTMuNSAxMUgxMy43OTI5QzE0LjQ1OTYgMTEgMTUgMTEuNTQwNCAxNSAxMi4yMDcxQzE1IDEyLjUyNzMgMTQuODcyOCAxMi44MzQzIDE0LjY0NjUgMTMuMDYwN0wxMy43MDcxIDE0SDE1VjE1SDEyLjVDMTIuMjk3OCAxNSAxMi4xMTU1IDE0Ljg3ODIgMTIuMDM4MSAxNC42OTEzQzExLjk2MDcgMTQuNTA0NSAxMi4wMDM1IDE0LjI4OTQgMTIuMTQ2NSAxNC4xNDY0TDEzLjkzOTMgMTIuMzUzNkMxMy45NzgyIDEyLjMxNDcgMTQgMTIuMjYyIDE0IDEyLjIwNzFDMTQgMTIuMDkyNyAxMy45MDczIDEyIDEzLjc5MjkgMTJIMTMuNUMxMy4yMjM5IDEyIDEzIDEyLjIyMzkgMTMgMTIuNUgxMloiIGZpbGw9IiMwMDAwMDAiLz4KPC9zdmc+",R8="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",j8="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik00IDEySDIwTTEyIDRWMjAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4NCjwvc3ZnPg==",D8="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik02IDEyTDE4IDEyIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8L3N2Zz4=",ll=8,cl=60,L8=11;var Lb=(c=>(c[c.increment=1]="increment",c[c.decrement=2]="decrement",c))(Lb||{});function B8({selectionFontSize:c,editor:t}){const[n,e]=mn.useState(c),s=(u,a)=>{if(!a)return u;let f=u;switch(a){case 2:switch(!0){case u>cl:f=cl;break;case u>=50:f-=12;break;case u>=24:f-=4;break;case u>=14:f-=2;break;case u>=9:f-=1;break;default:f=ll;break}break;case 1:switch(!0){case u<ll:f=ll;break;case u<12:f+=1;break;case u<20:f+=2;break;case u<36:f+=4;break;case u<=50:f+=12;break;default:f=cl;break}break}return f},r=mn.useCallback((u,a)=>{const f=l=>(l||(l=`${L8}px`),l=l.slice(0,-2),`${s(Number(l),a)}px`);t.update(()=>{if(t.isEditable()){const l=st();l!==null&&XS(l,{"font-size":u||f})}})},[t]),o=u=>{const a=Number(n);if(["e","E","+","-"].includes(u.key)||isNaN(a)){u.preventDefault(),e(String(Lb)),r(String(Lb)+"px",null);return}if(u.key==="Enter"){u.preventDefault();let f=a;a>cl?f=cl:a<ll&&(f=ll),e(String(f)),r(String(f)+"px",null)}},i=u=>{if(n!==""){const a=s(Number(n),u);r(String(a)+"px",null)}else r(null,u)};return mn.useEffect(()=>{e(c)},[c]),gn.jsxs(gn.Fragment,{children:[gn.jsx("button",{type:"button",disabled:c!==""&&Number(n)<=ll,onClick:()=>i(2),className:"toolbar-item font-decrement",children:gn.jsx("img",{src:D8,height:16,width:16,style:{marginTop:"5px"}})}),gn.jsx("input",{disabled:!0,type:"number",value:n,className:"font-size-input",min:ll,max:cl,onChange:u=>e(u.target.value),onKeyDown:o}),gn.jsx("button",{type:"button",disabled:c!==""&&Number(n)>=cl,onClick:()=>i(1),className:"toolbar-item font-increment",children:gn.jsx("img",{src:j8,height:16,width:16,style:{marginTop:"5px"}})})]})}const Bb=1;function Fb(){return gn.jsx("div",{className:"divider"})}function F8(){const[c]=pr(),t=St.useRef(null),[n,e]=St.useState(!1),[s,r]=St.useState(!1),[o,i]=St.useState(!1),[u,a]=St.useState(!1),[f,l]=St.useState(!1),[d,p]=St.useState(!1),[h,m]=St.useState(!1),[g,y]=St.useState(!1),[b,v]=St.useState("11px"),_=St.useCallback(()=>{const w=st();at(w)&&(i(w.hasFormat("bold")),a(w.hasFormat("italic")),l(w.hasFormat("underline")),p(w.hasFormat("strikethrough")),m(w.hasFormat("subscript")),y(w.hasFormat("superscript")),v(YS(w,"font-size","11px")))},[]);return St.useEffect(()=>Xr(c.registerUpdateListener(({editorState:w})=>{w.read(()=>{_()})}),c.registerCommand(ai,(w,x)=>(_(),!1),Bb),c.registerCommand(Ti,w=>(e(w),!1),Bb),c.registerCommand(Oi,w=>(r(w),!1),Bb)),[c,_]),gn.jsxs("div",{className:"toolbar",ref:t,children:[gn.jsx("button",{disabled:!n,onClick:()=>{c.dispatchCommand(rh,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:gn.jsx("i",{className:"format undo"})}),gn.jsx("button",{disabled:!s,onClick:()=>{c.dispatchCommand(Qp,void 0)},className:"toolbar-item","aria-label":"Redo",children:gn.jsx("i",{className:"format redo"})}),gn.jsx(Fb,{}),gn.jsx(B8,{selectionFontSize:b.slice(0,-2),editor:c}),gn.jsx(Fb,{}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"bold")},className:"toolbar-item spaced "+(o?"active":""),"aria-label":"Format Bold",children:gn.jsx("i",{className:"format bold"})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"italic")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Italics",children:gn.jsx("i",{className:"format italic"})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"underline")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Underline",children:gn.jsx("i",{className:"format underline"})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:gn.jsx("i",{className:"format strikethrough"})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"superscript")},className:"toolbar-item spaced "+(g?"active":""),"aria-label":"Format SuperScript",children:gn.jsx("img",{src:R8,height:16,width:16,style:{marginTop:"1px"}})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"subscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Subscript",children:gn.jsx("img",{src:I8,height:16,width:16,style:{marginTop:"1px"}})}),gn.jsx(Fb,{}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:gn.jsx("i",{className:"format left-align"})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:gn.jsx("i",{className:"format center-align"})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:gn.jsx("i",{className:"format right-align"})}),gn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:gn.jsx("i",{className:"format justify-align"})})," "]})}var $b={exports:{}},On=String,jO=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On,blackBright:On,redBright:On,greenBright:On,yellowBright:On,blueBright:On,magentaBright:On,cyanBright:On,whiteBright:On,bgBlackBright:On,bgRedBright:On,bgGreenBright:On,bgYellowBright:On,bgBlueBright:On,bgMagentaBright:On,bgCyanBright:On,bgWhiteBright:On}};$b.exports=jO(),$b.exports.createColors=jO;var $8=$b.exports;const pi=EN(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let DO=$8,LO=pi,zb=class _N extends Error{constructor(t,n,e,s,r,o){super(t),this.name="CssSyntaxError",this.reason=t,r&&(this.file=r),s&&(this.source=s),o&&(this.plugin=o),typeof n<"u"&&typeof e<"u"&&(typeof n=="number"?(this.line=n,this.column=e):(this.line=n.line,this.column=n.column,this.endLine=e.line,this.endColumn=e.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,_N)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=DO.isColorSupported);let e=f=>f,s=f=>f,r=f=>f;if(t){let{bold:f,gray:l,red:d}=DO.createColors(!0);s=p=>f(d(p)),e=p=>l(p),LO&&(r=p=>LO(p))}let o=n.split(/\r?\n/),i=Math.max(this.line-3,0),u=Math.min(this.line+2,o.length),a=String(u).length;return o.slice(i,u).map((f,l)=>{let d=i+1+l,p=" "+(" "+d).slice(-a)+" | ";if(d===this.line){if(f.length>160){let m=20,g=Math.max(0,this.column-m),y=Math.max(this.column+m,this.endColumn+m),b=f.slice(g,y),v=e(p.replace(/\d/g," "))+f.slice(0,Math.min(this.column-1,m-1)).replace(/[^\t]/g," ");return s(">")+e(p)+r(b)+`
|
|
1446
|
+
`,k.append(H),v=H}!I&&x.width<1&&r.length>1&&(k.style.width="3px")}b.forEach(w=>{this.hoverList.push([w,v,i])})});this.remoteSelections=[],this.isEditingInProgress=!1,this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelectionDOMsMap={},this.activeEditorsKeys={},this.keyboardBindedListener=this._keyboardEventsListener.bind(this),this.mouseBindedListener=this._mouseEventsListener.bind(this),this.resizeBindedListener=this._resizeEventListener.bind(this),this.hideInUI=!1}_mouseEventsListener(t){let n=!1,e=t.target,s=!1,r=3;for(;r&&e;){if(e.__codox_track){n=!0;break}if(e.__lexicalEditor){n=!0,s=!0;break}e=e.parentNode,r--}if(!n)return;let o=null;for(let a in this.activeEditorsKeys){if(e[`__lexicalKey_${a}`]){o=a;break}e.__lexicalEditor&&(o=e.__lexicalEditor._key)}if(!o)return;let i=s?"root":e[`__lexicalKey_${o}`];if(!i||!this.trackedNodesKeys.has(`${i}__${o}`))return;let u=new Set;for(let a=0;a<this.hoverList.length;a++){let f=this.hoverList[a],[l,d,p]=f;if(u.has(p))continue;let h=Sr.isMousePositionWithinElementCords(t,l);t.type===Qr.mouseover&&h&&(d.style.animation=this.isEditingInProgress?Sr.tooltipAnimations.hideAtOnce:Sr.tooltipAnimations.showAtOnce,u.add(p)),t.type===Qr.mouseout&&(d.style.animation=Sr.tooltipAnimations.hideWithDelay,u.add(p)),t.type===Qr.mousemove&&h&&(d.style.animation=this.isEditingInProgress?Sr.tooltipAnimations.hideAtOnce:Sr.tooltipAnimations.showAtOnce,u.add(p))}}_keyboardEventsListener(t){t.type===Qr.keypress&&(this.isEditingInProgress||(this.isEditingInProgress=!0)),t.type===Qr.keyup&&this.isEditingInProgress&&(this.isEditingInProgress=!1)}_resizeEventListener(t){xt.mainEditorExists()&&this.paintRemoteSelections(this.remoteSelections)}mount(){window.addEventListener(Qr.keypress,this.keyboardBindedListener),window.addEventListener(Qr.keyup,this.keyboardBindedListener),window.addEventListener(Qr.resize,this.resizeBindedListener),window.addEventListener(Qr.scroll,this.resizeBindedListener);for(const t of RE)window.addEventListener(t,this.mouseBindedListener)}unmount(){window.removeEventListener(Qr.keypress,this.keyboardBindedListener),window.removeEventListener(Qr.keyup,this.keyboardBindedListener),window.removeEventListener(Qr.resize,this.resizeBindedListener),window.removeEventListener(Qr.scroll,this.resizeBindedListener);for(const t of RE)window.removeEventListener(t,this.mouseBindedListener);this.gcPrevPaintedRemoteSelections()}shouldUpdateRemoteSelections(){return!0}gcPrevPaintedRemoteSelections(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(let n in this.remoteSelectionDOMsMap)this.remoteSelectionDOMsMap[n].remove();this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelections=t||[],this.remoteSelectionDOMsMap={},this.activeEditorsKeys={}}paintRemoteSelections(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.gcPrevPaintedRemoteSelections(t);let n=xt.getMainEditorState();n.read&&n.read(()=>{for(let e of this.remoteSelections)if(Ob.validateJSONSelection(e,wb.remote))if(Wt.isNestedSelectionJSON(e)){let{nestedSelectionJSON:s,nestedEditor:r}=Wt.getNestedSelectionJSONFromMainSelectionJSON(e);if(!r)continue;r.getEditorState().read(()=>{let o=Wt.JSONToLexical(s);if(o)try{this.paintSingleRemoteSelection({editor:r,selectionJSON:e,lexicalSelection:o,selectedNodes:o.getNodes(),isBackward:o.isBackward()})}catch(i){ut.warn("[PAINT REMOTE SELECTION] failed for nested editor - ",{error:i,nestedSelectionJSON:s,fullSelection:e,lexicalSelection:o})}else ut.error("DEBUGGER: [paintRemoteSelections] nested selection from json to lexical is null: ",{selection:e,nestedSelectionJSON:s,lexicalSelection:o})})}else{let s=Wt.JSONToLexical(e);if(!s){ut.error("DEBUGGER: [paintRemoteSelections] selection from json to lexical is null: ",{selection:e,lexicalSelection:s});continue}try{this.paintSingleRemoteSelection({editor:xt.getMainEditor(),selectionJSON:e,lexicalSelection:s,selectedNodes:s.getNodes(),isBackward:s.isBackward()})}catch(r){ut.warn("[PAINT REMOTE SELECTION] failed - ",{error:r,fullSelection:e,lexicalSelection:s})}}})}updateRemoteSelections(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";this.shouldUpdateRemoteSelections(t)&&(ut.log("[updateRemoteSelections] "+n,{newRemoteSelections:t}),Promise.resolve().then(()=>{this.paintRemoteSelections(t),this.hideInUI&&this.hideRemoteSelectionsFromUI()}))}clear(){this.gcPrevPaintedRemoteSelections()}getCurrentRemoteSelections(){return this.remoteSelections}hideRemoteSelectionsFromUI(){this.hideInUI||(this.hideInUI=!0);const t=document.querySelectorAll(".codox_remote_selection");for(let n of t)n.classList.add("hidden_codox_remote_selection")}showHiddenRemoteSelectionsInUI(){this.hideInUI=!1;const t=document.querySelectorAll(".hidden_codox_remote_selection");for(let n of t)n.classList.remove("hidden_codox_remote_selection")}}const di=new ML;function IL(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).findIndex(c=>c===ol.editorState)}function Hh(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=xt.getMainEditorNodesClassesMap();const{klass:e}=n.get(c.type)||{};if(!e)return;const s=e.importJSON(c);if(c.children&&c.children.length)for(const r of c.children)Hh(r,s);return t&&t.getChildrenSize&&t.splice(t.getChildrenSize(),0,[s]),s}function Kh(c){if(c.getChildren)for(let t of c.getChildren())Kh(t);c.remove()}function ZE(c){c.__parent=null,c.__next=null,c.__prev=null}function QE(c,t){return!!xt.isLexicalEditorInstance(c)&&!(typeof t!="object"||!t.editorState||(c.update(()=>{try{let n=(0,bt.$getSelection)();const e=c.parseEditorState(t.editorState);if(e.isEmpty())return(0,bt.$getRoot)().clear(),!0;(0,bt.$setSelection)(n),c.setEditorState(e)}catch(n){ut.error("[stateUpdates][updateNestedEditorState] update nested state and selection error: ",n)}}),0))}function RL(c,t){let n=t;for(const e of c)n=n[e];return n}function sl(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],e=null,s=RL(c,n?t:xt.getMainEditorState().toJSON());return s&&(e=al(s)?(0,bt.$getRoot)():Wn.get(s.codoxId)),e||ut.debug("[WARNING][getLexicalNodeByPathOutOfJSONState] lexical node not found: ",{jsonNode:s,lexicalNode:e,pathArray:c,currentStateJSON:xt.getMainEditorState().toJSON(),newStateJSON:t,codoxNodes:Wn.nodesToArray(),searchInNewState:n}),e||(n?e:sl(c,t,!0))}function eO(c){ut.log("[applyFullLexicalStateReplace] clear current state and apply new");const t=(0,bt.$getRoot)();t.clear();let n=xt.getMainEditorNodesClassesMap();function e(s){const r=n.get(s.type).klass.importJSON(s);if(s.children)for(const o of s.children)r.append(e(o));return r}for(const s of c.root.children)t.append(e(s))}function jL(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(t.length){ut.log("[applyDeltasToLexicalState] Original Deltas: ",{newStateJSON:c,deltas:JSON.parse(JSON.stringify(t))});for(const n of t){let{p:e}=n;const s=e[e.length-1],r=s==="children",o=typeof s=="number",i=!o&&!r,u=IL(e),a=u!==-1,f=n.hasOwnProperty("lm")&&typeof n.lm=="number";if(e.length)if(a){let l=u-1,d=sl(e.slice(0,l),c);if(d){let p=e.slice(0,u),h=c;for(const g of p)h=h[g];let m=jd(e[l]);QE(d.getWritable()[m],h)}}else{if(r){let l=n.oi;if(!l){ut.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi attr expected for path",{delta:n});continue}if(l.some(p=>!(!p.hasOwnProperty("text")||typeof p.text=="string"))){ut.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi children contain invalid text value",{delta:n});continue}e.length=e.length-1;let d=sl(e,c);if(!d)continue;if(l.some(p=>!!p.codoxDId)){try{d=d.getWritable()}catch(g){ut.debug("[applyDeltasToLexicalState][shouldUpdateLeaves] getWritable error: ",{err:g,delta:n,fullStateJSON:c});continue}let p={};for(let g of d.getChildren())g.codoxDId?p[g.codoxDId]=g:Kh(g);let h=[],m=["codoxDId","codoxId","__key","__parent","__prev","__next"];for(let g=0;g<l.length;g++){let y=l[g],b=g===0,v=g===l.length-1,_=null,w=g>=0?h[g-1]:null;if(y.codoxDId){let x=p[y.codoxDId];if(x){x=x.getWritable();let S=Hh(y);if(ut.debug("[DELTA_DECORATOR_UPDATE]: ",{exisingDecorator:x,tmpDecorator:S}),!S){ut.debug("[DELTA_DECORATOR_UPDATE] UPADATE SKIPPED: ",{exisingDecorator:x,tmpDecorator:S});continue}for(let E in S)if(S.hasOwnProperty(E)&&!m.includes(E))if(xt.isLexicalEditorInstance(S[E])){let O={editorState:S[E].getEditorState().toJSON()};QE(x[E],O)}else{let O=xb(E),j=y[O];if(j===x[E]||!y.hasOwnProperty(O))continue;let A=j!==void 0&&S[E]!==j?j:S[E];O!=="height"&&O!=="width"||S[E]==="inherit"&&j===0&&(A=S[E]),x[E]=A}S.remove(),ZE(x),_=x,delete p[y.codoxDId]}}_||(_=Hh(y),_.codoxDId&&_.__type==="excalidraw"&&_.__data==="[]"&&(_.__data="{}")),_=_.getWritable(),h.push(_),_.__parent=d.__key,b?(d.__first=_.__key,_.__prev=null,v&&(d.__last=_.__key)):v?(d.__last=_.__key,_.__next=null,_.__prev=w.__key,w.__next=_.__key):(_.__prev=w.__key,w.__next=_.__key),d.__size=h.length}for(let g in p){let y=p[g];y=y.getWritable(),ZE(y),Kh(y),delete p[g]}}else{let p=l.map(h=>Hh(h));d.splice(0,d.getChildrenSize(),p)}}if(o){if(n.ld){const l=n.ld,d=Wn.get(l.codoxId);d.getChildrenSize&&d.getChildrenSize()?Kh(d):d.remove()}if(n.li){let l=xt.getMainEditorNodesClassesMap();const d=n.li,p=l.get(d.type).klass.importJSON(d);if(e.length===1&&e[0]==="root")(0,bt.$getRoot)().splice(0,0,[p]);else{const h=e[e.length-1];e.length=e.length-2;let m=sl(e,c);m&&m.splice(h,0,[p])}if(d.children&&d.children.length){let h=function(m,g){const y=l.get(m.type).klass.importJSON(m);if(g.splice(g.getChildrenSize(),0,[y]),m.children&&m.children.length)for(const b of m.children)h(b,y)};for(const m of d.children)h(m,p)}}if(n.oi||n.od){let{p:l,oi:d,od:p}=n,h=sl(l,c);if(h)try{let m=h.getWritable();if(d){let g=Object.keys(d);for(let y of g)m[jd(y)]=d[y]}if(p){let g=Object.keys(p);for(let y of g)delete m[jd(y)]}}catch(m){ut.debug("[applyDeltasToLexicalState][delta oi/od] getWritable error: ",{err:m,delta:n})}}if(f){let{p:l,lm:d}=n,p=l[l.length-1],h=d,m=h<p,g=sl(l,c);if(g){let y=g.getParent().getChildren(),b=y[p],v=y[h];m?v.insertBefore(b):v.insertAfter(b)}}}if(i){const l=e[e.length-1];let d=jd(l);e.length=e.length-1;let p,h=sl(e,c);if(!h){ut.error("Missing node when update node attr from delta: ",{path:e,delta:n,fullStateJSON:c,currentEditorState:xt.getMainEditorState().toJSON()});continue}try{p=h.getWritable()}catch(g){ut.debug("[applyDeltasToLexicalState][shouldUpdateBlockAttr] getWritable error: ",{err:g,delta:n})}if(!p)continue;let m=n.oi;if(l==="format"&&(m=R4(m)),l==="direction"&&(h.hasOwnProperty(d)||(d="__dir")),!p.hasOwnProperty(d)){let g=Object.keys(p);for(let y of g){let b=xb(y);if(l.startsWith(b)){d=y;break}}}p[d]=m}}else if(n.oi&&n.oi.root)return eO(n.oi)}}else ut.log("[applyDeltasToLexicalState] stop, no deltas: ",t)}function DL(c){let t=c.clipboardData.getData(D4.paste),n=!1;try{t=JSON.parse(t),typeof t=="object"&&t.nodes&&Array.isArray(t.nodes)&&(n=!0)}catch{return!1}if(!n)return!1;if(n){Wn.clearPastedIds();const e=s=>{if(s.codoxId&&Wn.addPastedId(s.codoxId),s.children&&s.children.length)for(const r of s.children)e(r)};for(const s of t.nodes)e(s)}return!1}var LL=c=>{var t={};return un.d(t,c),t};const tO=LL({useCollaborationContext:()=>p3});var BL=c=>{var t={};return un.d(t,c),t};const da=BL({LexicalComposerContext:()=>Cy,useLexicalComposerContext:()=>pr});class nO{constructor(){this.blacklist=Object.keys(jE).reduce((t,n)=>{let e=jE[n];return t[n]=e.reduce((s,r)=>(s[r]=r,s),{}),t},{}),this._isBlacklistedFound=!1,this._clientCallback=null}_shouldSkipNode(t){return t instanceof bt.TextNode||t instanceof bt.ParagraphNode||t instanceof bt.RootNode}setClientCallback(t){this._clientCallback=t}removeClientCallback(){this._clientCallback=null}invokeClientCallback(){this._clientCallback&&this._clientCallback()}trackBlacklisted(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0;if(Tb||n!==jo.created||this._isBlacklistedFound||!t||!t.__type||this._shouldSkipNode(t))return;let s=e||xt.getMainEditorState(),r=t.__type,o=this.blacklist[r];o&&s.read(()=>{let i=t.getParent();for(;i!==null;){let u=i?i.__type:null;if(!u)return;if(o[u])return ut.warn("[ContentNestingsWatcher][trackBlacklisted] FOUND: ",{targetNode:t,targetType:r,parent:i,parentType:u,mutationType:n}),void(this._isBlacklistedFound=!0);i=i.getParent()}})}trackBlacklistedInNestedEditor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=arguments.length>3?arguments[3]:void 0;if(n!==jo.created||this._isBlacklistedFound||this._shouldSkipNode(t))return;let s=e.__type,r=t.__type;if(!s||!r)return;let o=this.blacklist[r];o&&o[s]&&(this._isBlacklistedFound=!0,ut.warn("[ContentNestingsWatcher][trackBlacklistedInNestedEditor] FOUND: ",{targetNode:t,targetType:r,rootNode:e,rootType:s,mutationType:n}))}isBlacklistedFound(){let t=this._isBlacklistedFound;return t&&(this._isBlacklistedFound=!1),t}}const FL=new nO,fa=FL,$L=["editorState","prevEditorState","dirtyElements","dirtyLeaves"];function zL(c,t){if(c==null)return{};var n,e,s=UL(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function UL(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}class HL{constructor(){this.nestedEditorsListenersMap={}}_createNestedEditorUpdatesListener(t,n){let e=!1;return function(s){let{editorState:r,prevEditorState:o,dirtyElements:i,dirtyLeaves:u}=s,a=(zL(s,$L),xt.getMainEditor()),f=xt.getMainEditorState(),l=r.toJSON(),d=o.toJSON(),p=Eb(l,d),h=r._selection,m=o._selection,g=!1,y=null,b=xt.isOnlySelectionChanged(i,u),v=t[n];if(ut.debug("[NESTED EDITOR LISTENER] invoked: ",{lexicalNode:t,key:t.__key,onlySelectionChanged:b,newEditorStateJSON:l,prevEditorStateJSON:d,isSameState:p,lexicalSelection:h,prevLexicalSelection:m,mainDirtyLeaves:a._dirtyLeaves.size,mainDirtyElements:a._dirtyElements.size,nestedDirtyLeaves:v._dirtyLeaves.size,nestedDirtyElements:v._dirtyElements.size,nestedEditorKey:v._key}),fa.isBlacklistedFound())return e=!0,ut.debug("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - revert to prev state"),xt.scanLexicalNodeForNestedEditorAttribute(t)?(v.update(()=>{try{const _=v.parseEditorState(d);if(_.isEmpty())return(0,bt.$getRoot)().clear(),!0;v.setEditorState(_)}catch(_){ut.error("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - ROLLBACK ERROR: ",_)}}),void fa.invokeClientCallback()):void 0;if(e)e=!1;else{if(t.codoxId||t.codoxDId){let _=null;f.read(()=>{_=Wt.getNodeAncestorsCodoxIds(t),!t.codoxId&&t.codoxDId&&_.push(t.codoxDId)}),r.read(()=>{let w=xb(n),x=Wt.lexicalToJSONNested(h,w,_);y=xt.getCurrentNestedSelectionJSON(),g=Wt.equalSelectionsJSON(y,x),g||xt.setNestedSelectionJSON(x)})}p&&g||a.update(()=>{try{ut.debug("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE",{mainTags:a._updateTags,nestedTags:v&&v._updateTags,isSameState:p,isSameSelection:g,onlyNestedSelectionChanged:b,mainDirtyLeaves:a._dirtyLeaves.size,mainDirtyElements:a._dirtyElements.size,nestedDirtyLeaves:v._dirtyLeaves.size,nestedDirtyElements:v._dirtyElements.size,lexicalNode:t,lexicalSelection:h,prevLexicalSelection:m,mainEditorTags:a._updateTags,mainEditorTagsSize:a._updateTags.size}),xt.addUpdateTag({fromNestedEditor:!0}),t.markDirty()}catch(_){ut.error("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE - ERROR: ",_)}})}}}_isNestedEditorManaged(t){return!!this.nestedEditorsListenersMap[t]}gc(){for(let t in this.nestedEditorsListenersMap)if(!xt.getLexicalNodeByKey(t)){let n=this.nestedEditorsListenersMap[t];n&&n(),delete this.nestedEditorsListenersMap[t]}}manageNestedEditorInLexicalNode(t){if(this._isNestedEditorManaged(t.getKey()))return;let n=xt.scanLexicalNodeForNestedEditorAttribute(t);if(n){let e=t[n],s=this._createNestedEditorUpdatesListener(t,n),r=[];e._nodes.forEach((u,a,f)=>{let{klass:l}=u,d=e.registerMutationListener(l,p=>{for(let[h,m]of p)if(m===jo.created){let g=e.getEditorState()._nodeMap.get(h);g&&fa.trackBlacklistedInNestedEditor(g,m,e.getEditorState(),t)}});r.push(d)});let o=(0,Pc.mergeRegister)(e.registerUpdateListener(s),...r),i=t.getKey();this.nestedEditorsListenersMap[i]=o}}gcNestedEditorListenerInLexicalNode(t){let n=t.getKey(),e=this.nestedEditorsListenersMap[n];e&&(e(),delete this.nestedEditorsListenersMap[n])}manageNestedEditorInClonedLexicalNode(t,n){let e=t.getKey();e!==n.getKey()&&this._isNestedEditorManaged(e)&&(this.gcNestedEditorListenerInLexicalNode(t),this.manageNestedEditorInLexicalNode(n))}setNestedEditorSelection(t){let{nestedSelectionJSON:n,nestedEditor:e}=Wt.getNestedSelectionJSONFromMainSelectionJSON(t);if(!e)return!1;let s=!0;return e.update(()=>{try{let r=Wt.JSONToLexical(n);(0,bt.$setSelection)(r),ut.debug("[setNestedEditorSelection]: lexical nested selection: ",r)}catch(r){ut.error("[setNestedEditorSelection] set nested selection error: ",r),s=!1}}),s}clearListeners(){for(let t in this.nestedEditorsListenersMap){let n=this.nestedEditorsListenersMap[t];n&&n(),delete this.nestedEditorsListenersMap[t]}}}const KL=new HL,fs=KL,WL=function(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];try{let n=(0,bt.createEditor)({namespace:"validation",nodes:[...t],onError:i=>{throw i},parentEditor:null});const e=new nO,s=n.parseEditorState(c);if(s.isEmpty())return;n.setEditorState(s);let r=n.getEditorState();const o=r._nodeMap[Symbol.iterator]();for(const i of o){let[u,a]=i;if(a&&(e.trackBlacklisted(a,jo.created,r),e.isBlacklistedFound()))throw new Error(L4)}}catch(n){throw n}};class qL{constructor(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}_scanForCellHeaderState(t,n,e,s){if(n.length<s)return null;let r,o=n.some(u=>u.__headerState===ca.BOTH||u.__headerState===ca.ROW),i=t.some((u,a)=>{if(u.__size<s)return!1;let f=u.getChildAtIndex(e);return!(!f||f.__headerState!==ca.BOTH&&f.__headerState!==ca.COLUMN)});return o&&i?r=ca.BOTH:o&&!i?r=ca.ROW:i&&!o&&(r=ca.COLUMN),r}_isValidCellChildren(t){for(let n of t)if(Lc(n)||!Dc(n)&&Bn(n))return!1;return!0}_createEmptyCell(){let t=(0,$n.$createTableCellNode)();return t.append((0,bt.$createParagraphNode)()),t}_wrapInvalidCellChildrenIntoParagraph(t){let n=(0,bt.$createParagraphNode)().getWritable(),e=t.getChildren();(t=t.getWritable()).__first=n.__key,t.__last=n.__key,t.__size=1,n.__parent=t.__key,e.forEach((s,r)=>{(s=s.getWritable()).__parent=null,n.append(s)})}_createFixAction_APPEND_CELLS_TO_ROW(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - APPEND_CELLS_TO_ROW] invoked: ",{rowKey:t,numOfCellsToAppend:n});let e=(0,bt.$getNodeByKey)(t);for(;n;){let s=(0,$n.$createTableCellNode)().append((0,bt.$createParagraphNode)());s.setRowSpan(1).setColSpan(1),e.append(s),n--}}}_createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(t){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - ADD_PARAGRAPH_TO_EMPTY_CELL] invoked: ",{cellKey:t}),(0,bt.$getNodeByKey)(t).append((0,bt.$createParagraphNode)())}}_createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(t){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - WRAP_CELL_CHILDREN_IN_PARAGRAPH] invoked: ",{cellKey:t});let n=(0,bt.$getNodeByKey)(t);this._wrapInvalidCellChildrenIntoParagraph(n)}}_createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(t){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - ADD_ROW_CELL_TO_EMPTY_TABLE_NODE] invoked: ",{tableKey:t});let n=(0,bt.$getNodeByKey)(t),e=(0,$n.$createTableRowNode)();e.append(this._createEmptyCell()),n.append(e)}}_createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(t,n){return()=>{for(n||(n=1);n;)(0,bt.$getNodeByKey)(t).append(this._createEmptyCell()),n--}}_createFixAction_WRAP_INVALID_ROW_NODE(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_ROW_NODE] invoked: ",{tableKey:t,rowKey:n});let e=(0,bt.$getNodeByKey)(t);if(!e)return;let s=(0,bt.$getNodeByKey)(n);if(!s)return;e=e.getWritable(),s=s.getWritable();let r=s.getPreviousSibling(),o=s.getNextSibling();s.__parent=null,s.__prev=null,s.__next=null;let i=(0,$n.$createTableRowNode)();if((0,$n.$isTableCellNode)(s))s.getChildren().length?this._isValidCellChildren()||this._wrapInvalidCellChildrenIntoParagraph(s):s.append((0,bt.$createParagraphNode)()),i.append(s);else{let u=this._isValidCellChildren([s]),a=(0,$n.$createTableCellNode)();if(i.append(a),u)a.append(s);else{let f=(0,bt.$createParagraphNode)();f.append(s),a.append(f)}}i.__parent=e.__key,e.__first===s.__key&&(e.__first=i.__key),e.__last===s.__key&&(e.__last=i.__key),r&&(r=r.getWritable(),r.__next=i.__key,i.__prev=r.__key),o&&(o=o.getWritable(),o.__prev=i.__key,i.__next=o.__key)}}_createFixAction_WRAP_INVALID_CELL_NODE(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_CELL_NODE] invoked: ",{rowKey:t,cellKey:n});let e=(0,bt.$getNodeByKey)(t);if(!e)return;let s=(0,bt.$getNodeByKey)(n);if(s.remove(),s=(0,bt.$createParagraphNode)(),!s)return;e=e.getWritable(),s=s.getWritable();let r=s.getPreviousSibling(),o=s.getNextSibling(),i=(0,$n.$createTableCellNode)();if(i.__parent=e.__key,e.__first===s.__key&&(e.__first=i.__key),e.__last===s.__key&&(e.__last=i.__key),r&&(r=r.getWritable(),r.__next=i.__key,i.__prev=r.__key),o&&(o=o.getWritable(),o.__prev=i.__key,i.__next=o.__key),s.__parent=null,s.__prev=null,s.__next=null,this._isValidCellChildren([s]))i.append(s);else{let u=(0,bt.$createParagraphNode)();u.append(s),i.append(u)}}}_createFixAction_APPLY_HEADER_STATE_TO_CELL(t,n){return()=>{ut.debug("[TablesValidator][FIX TABLE ACTION - APPLY_HEADER_STATE_TO_CELL] invoked: ",{cellKey:t,headerStateToApply:n});let e=(0,bt.$getNodeByKey)(t);e&&(e=e.getWritable(),e.__headerState=n)}}clear(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}tableRemoveEventListener(t){let n=xt.getMainEditorState()._selection;if(ut.debug(`[${t}]`,{selection:n}),!(0,bt.$isRangeSelection)(n))return;let e=[];try{let s=xt.getLexicalNodeByKey(n.anchor.key),r=xt.getLexicalNodeByKey(n.focus.key);s&&r&&(e=n.isBackward()?r.getNodesBetween(s):s.getNodesBetween(r))}catch(s){ut.warn("[TablesValidator][tableRemoveEventListener] get range selection nodes internal lexical error: ",s)}e.forEach(s=>{(0,$n.$isTableNode)(s)&&this.removeCandidateTableKeys.add(s.__key)})}tableNodeRemoveListener(t){this.removeCandidateTableKeys.has(t)&&this.removeCandidateTableKeys.delete(t)}shouldGCRemovedTables(){return!!this.removeCandidateTableKeys.size}gcRemovedTables(){ut.debug("[TablesValidator][gcRemovedTable] candidate table keys ",{tableKeys:this.removeCandidateTableKeys}),xt.getMainEditor().update(()=>{Array.from(this.removeCandidateTableKeys).forEach(t=>{let n=(0,bt.$getNodeByKey)(t);n&&n.remove()}),this.removeCandidateTableKeys.clear(),(0,bt.$addUpdateTag)(Jo.historic)})}tableUpdateListener(t){this.validateTableCandidateKeys.add(t)}tableRowNodeChangesListener(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],e=xt.getLexicalNodeByKey(t);if(!e)return void(n&&ut.debug("[TablesValidator][tableRowNodeChangesListener] no row node found in lexical: ",{tableRowNodeKey:t}));let s=e.__parent;s?this.validateTableCandidateKeys.add(s):ut.debug("[tableRowNodeChangesListener] no parent table for row node found in lexical: ",{rowNode:e})}tableCellNodeChangesListener(t){let n=xt.getLexicalNodeByKey(t);if(!n||!n.__parent)return;let e=xt.getLexicalNodeByKey(n.__parent);e&&e.__parent&&this.validateTableCandidateKeys.add(e.__parent)}shouldValidateUpdatedTables(){return!!this.validateTableCandidateKeys.size}validateUpdatedTables(){let t=Array.from(this.validateTableCandidateKeys);return xt.getMainEditorState().read(()=>{for(let n of t){let e=xt.getLexicalNodeByKey(n);if(!e)continue;let s=e.getChildren();if(!s.length){this.tableFixActions.push(this._createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(n));continue}let r=0;s.forEach(a=>{a.__size>r&&(r=a.__size)});let o=[],i=s.map((a,f)=>{if(!(0,$n.$isTableRowNode)(a))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_ROW_NODE(n,a.__key)),"invalid_row_node";let l=a.getChildren();if(!l.length&&!o.length)return this.tableFixActions.push(this._createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(a.__key,r)),"empty_row_should_add_cell";if(!l.length&&o.length)return o=[],"empty_row_should_be_empty";let d=0;if(o.length){let h=[];o.forEach(m=>{let[g,y]=m;d+=y,g--,g&&h.push([g,y])}),o=[...h]}let p=l.map((h,m)=>{if(!(0,$n.$isTableCellNode)(h))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_CELL_NODE(a.__key,h.__key)),d++,"invalid_cell_node_should_wrap_in_cell";let g,y=h.getChildren(),b=!y.length;if(b?this.tableFixActions.push(this._createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(h.__key)):(g=this._isValidCellChildren(y),g||this.tableFixActions.push(this._createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(h.__key))),h.__rowSpan>1){let v=h.__rowSpan,_=h.__colSpan;o.push([v-1,_])}if(d+=h.__colSpan,h.__headerState===ca.NO_STATUS){let v=this._scanForCellHeaderState(s,l,m,r);v&&this.tableFixActions.push(this._createFixAction_APPLY_HEADER_STATE_TO_CELL(h.__key,v))}return{cellKey:h.__key,rowKey:a.__key,tableKey:n,colSpan:h.__colSpan,rowSpan:h.__rowSpan,headerState:h.__headerState,childrenAreValid:g,isEmptyCell:b}});if(d<r){let h=r-d;this.tableFixActions.push(this._createFixAction_APPEND_CELLS_TO_ROW(a.__key,h))}return{realRowLength:d,rowKey:a.__key,tableKey:n,cells:p}}),u=!this.tableFixActions.length;ut[u?"debug":"warn"](`[TablesValidator][validateUpdatedTables] IS TABLE VALID: ${u}`,{tableNodeKey:n,tableValidationMatrix:i,requiredRowLength:r}),this.validateTableCandidateKeys.delete(n)}}),!this.tableFixActions.length}shouldFixTablesStructure(){return!!this.tableFixActions.length}fixTablesStructure(){if(!this.tableFixActions.length)return;let t=xt.getMainEditor();ut.log("[TablesValidator][fixTablesStructure]: fix actions to apply - count: ",this.tableFixActions.length),t.update(()=>{for(let n of this.tableFixActions)n();this.tableFixActions=[],(0,bt.$addUpdateTag)(Jo.historic)})}ensureDocTablesAreValid(t){return this.shouldGCRemovedTables()?(ut.warn("[TablesValidator][GARBAGE COLLECT TABLE NODES AFTER TABLE REMOVAL ATTEMPT]"),this.gcRemovedTables(),!1):!(this.shouldValidateUpdatedTables()&&(ut.debug("[TablesValidator][shouldValidateUpdatedTables] invoked"),!this.validateUpdatedTables()))||(ut.warn("[TablesValidator][shouldValidateUpdatedTables] INVALID LEXICAL TABLE(S) STRUCTURE FOUND - FIXING",{state:JSON.parse(JSON.stringify(t.toJSON()))}),this.fixTablesStructure(),!1)}}const Ii=new qL,JL=["contentChanged"],VL=["state","remoteSelection"];function rO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function Rc(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rO(Object(n),!0).forEach(function(e){GL(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):rO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function GL(c,t,n){return(t=YL(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function YL(c){var t=XL(c,"string");return typeof t=="symbol"?t:t+""}function XL(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}function oO(c,t){if(c==null)return{};var n,e,s=ZL(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function ZL(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}const Tb={DEBUG:!1,VERSION:"1.0.2",NAME:"@codoxhq/lexical-provider",SDKUI_SOURCE_PATH:"../../../sdkui/dist-production2/codox.bundle.js"}.LOCAL==="true";ut.info("MODE: ","production");const QL=c=>async()=>{const{state:t,timestamp:n}=await c();if(!xt.isValidJSONState(t))throw new Error("Invalid state received from fetchDocOnNetworkReconnect hook");const{commentThreads:e,root:s}=t,r={content:{comments:e,root:s},timestamp:n};return ut.info("[decorateFetchOnReconnctHook] hook invoked: ",{returnObj:r}),r};let Wh=0,ps=null,Nb=!1,fi={},kb={};const e6=(0,Ge.forwardRef)((c,t)=>{let{onBlacklistedInsert:n}=c;const e=(0,Ge.useContext)(da.LexicalComposerContext);if(!e)throw new Error("[CodoxCollabPlugin] CodoxCollabPlugin must be inited inside <LexicalComposer> component - LexicalComposerContext is missing");const[s]=(0,da.useLexicalComposerContext)(),r=(0,tO.useCollaborationContext)();(0,Ge.useEffect)(()=>{if(ut.debug("[INIT] lexical context check: ",{lexicalContext:e,editor:s}),!s)return;ut.log("[useEffect][editor] Editor instance changed: ",{editor:s,key:s._key}),xt.setMainEditor(s),Wn.gcAbandonedNodes(),fs.gc(),Ii.clear(),ut.log("[useEffect][editor] subscribe to editor changes");const b=(0,Pc.mergeRegister)(s.registerUpdateListener(m),s.registerCommand(bt.PASTE_COMMAND,DL,bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.UNDO_COMMAND,()=>{xt.setUndoInvoked(!0)},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.REDO_COMMAND,()=>{xt.setRedoInvoked(!0)},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.KEY_DELETE_COMMAND,(_,w)=>{Ii.tableRemoveEventListener("KEY_DELETE_COMMAND")},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.KEY_BACKSPACE_COMMAND,(_,w)=>{Ii.tableRemoveEventListener("KEY_BACKSPACE_COMMAND")},bt.COMMAND_PRIORITY_CRITICAL),s.registerCommand(bt.CUT_COMMAND,(_,w)=>{Ii.tableRemoveEventListener("CUT_COMMAND")},bt.COMMAND_PRIORITY_CRITICAL),...g());di.mount(),xt.alignStateSelectionJSONsFromLatestEditor(),ut.debug("New editor mounted: ",{isCodoxStarted:xt.isCodoxStarted,codoxLexicalEditorManager:xt,nestedEditorsProcessor:fs});let v=s._onError;return s._onError=_=>{ut.error("[ERROR HANDLER WRAPPER] error from editor: ",_),v&&v(_),h()},n&&fa.setClientCallback(n),()=>{xt.getMainEditorKey()&&(ut.debug("Unmount prev editor"),b(),xt.removeMainEditor(),di.unmount(),xt.clearJSONs(),Ln.clear(),Ii.clear(),xt.isCodoxStarted&&(ut.debug("EDITOR USE_EFFECT stopping codox"),o(),xt.setIsCodoxStarted(!1)),fa.removeClientCallback())}},[s]);const o=()=>{xt.isCodoxStarted&&(ut.log("[stopCodoxInstance] stopping codox"),xt.setIsCodoxStarted(!1),Tb||is().stop(),xt.clearJSONs(),Wn.clearAll(),di.clear(),Ln.resetComments(),fs.clearListeners())},i=async b=>{ut.debug("[startCodoxInstance] invoked"),is().createNewInstance(),ut.debug("[startCodoxInstance] instance created");for(let T in kb)is().instance.on(T,kb[T]);if(ut.debug("[startCodoxInstance] events subscribed"),fi=b,ps=fi.docId,!ps)return ut.error("[startCodoxInstance] - start codox skipped - docId is missing",{docId:ps});let v=Ln.initialCommentsExist();ut.debug("[startCodoxInstance] initCommentsExist: ",v),v&&(Ln.activateInitialComments(s,Wn),ut.log("[activateInitialComments] "));let _=xt.getMainEditorState().toJSON();if(!xt.isValidJSONState(_))throw ut.error("[startCodoxInstance] - start codox skipped - invalid init state",{docId:ps,initJSONState:_}),new Error("start codox skipped - invalid init state");ut.log("[startCodoxInstance] starting codox with: ",{docId:ps,initJSONState:_,config:fi,codoxComments:Ln}),xt.currentContentStateJSON||xt.setCurrentContentStateJSON(_),xt.isCodoxStarted&&o();let{username:w,apiKey:x,getServerState:S,domain:E="",demo:O=!1,hooks:j}=fi;j&&j.fetchDocOnNetworkReconnect&&(j.fetchDocOnNetworkReconnect=QL(j.fetchDocOnNetworkReconnect));const A=oO(j,JL);await is().start(is().createConfig(Rc(Rc({},fi),{},{docId:ps,username:w,apiKey:x,domain:E,hooks:Rc({syncState:f,getState:a,getServerState:async()=>await S(ps)},A),editorInstanceHooks:{getSelection:()=>xt.getCurrentActiveSelectionJSON(),setSelection:T=>l(T),getState:a,setState:T=>{const{root:I,comments:k}=T;ut.info("DEBUG: EDITOR INSTANCE setState:",{fullState:T}),d({state:{root:I},selection:xt.getCurrentActiveSelectionJSON()},di.getCurrentRemoteSelections()),Ln.setAllComments(k)},enableEditor:()=>{xt.disableEditorReadOnlyMode()},disableEditor:()=>{xt.enableEditorReadOnlyMode(),di.updateRemoteSelections([])},getContent:()=>{let T=xt.composeFullStateWithRootAndComments();return ut.info("[getContent]: ",T),{state:T}}},appServer:fi.appServer,demo:O}))),ut.log("[startCodoxInstance] codox started - first sync invoking"),xt.setIsCodoxStarted(!0),r.clientID=fi.username,r.name=fi.username,p()},u=()=>{let b=xt.composeFullStateWithRootAndComments({directlyFromEditor:!0});i(b)},a=()=>({state:Rc(Rc({},xt.getMainEditorState().toJSON()),{},{comments:Ln.getAllComments()}),docId:ps}),f=b=>{if(!xt.isCodoxStarted)return;ut.log("[SYNC_STATE]: Before sync payload = ",b);const v=is().sync({meta:b}),{state:_,remoteSelection:w=[]}=v,x=oO(v,VL);if(ut.log("[SYNC_STATE]: After sync",{state:_,remoteSelection:w,rest:x}),!_)return ut.error("[SYNC_STATE] abort apply - synced state is not valid - restarting codox"),u();const S=_.state;ut.log("[SYNC_STATE] synced state: ",{synced:JSON.parse(JSON.stringify(S))});let{stateFromSync:E,commentsFromSync:O}=xt.extractStateAndCommentsFromSynced(S);if(!xt.isValidJSONState(E.state))return ut.error("[SYNC_STATE] - invalid state from sync - local update skipped - restarting codox",{contentState:E.state}),u();d(E,w),Ln.setAllComments(O)},l=b=>{if(!xt.isCodoxStarted||(ut.log("[setLocalSelectionFromSync] synced selection: ",{syncedSelectionJSON:b}),!Ob.validateJSONSelection(b,wb.local)))return;let v=xt.getCurrentActiveSelectionJSON();if(Wt.equalSelectionsJSON(v,b))return void ut.log("[setLocalSelectionFromSync] STOP - local and synced selections are equal");let _=Wt.isNestedSelectionJSON(b);s.update(()=>{ut.log("[setLocalSelectionFromSync] json selection to apply: ",{syncedSelectionJSON:b});const w=Wt.JSONToLexical(b);if(ut.log("[setLocalSelectionFromSync] lexical selection to apply: ",w),_){let x=fs.setNestedEditorSelection(b);xt.setNestedSelectionJSON(x?b:null)}else(0,bt.$setSelection)(w),xt.setMainSelectionJSON(b);ut.log("[setLocalSelectionFromSync] selection updated. latest selection: ",{latestSelectionJSON:xt.getCurrentActiveSelectionJSON()})})},d=function(){let{state:b,selection:v,stateReplace:_}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",S=xt.getCurrentContentStateJSON();ut.log("[updateEditor] invoked: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:JSON.parse(JSON.stringify(b)),newSelectionJSON:v,remoteSelection:w,stateReplace:_,editor:s}),v===void 0&&ut.error("SELECTION FROm SYNC IS UNDEFINED - will default prev selection",v);const E=Eb(S,b),O=Wt.equalSelectionsJSON(xt.getCurrentActiveSelectionJSON(),v);s.update(()=>{if(xt.addUpdateTag({isSameState:E,isSameSelection:O,updateTag:x}),_)ut.log("[updateEditor] invoke full stateReplace after sync"),eO(b),S=xt.setCurrentContentStateJSON(b),(0,bt.$addUpdateTag)("codox_sync_state_changes"),ut.log("[updateEditor] state updated: ",S);else{ut.log("[updateEditor] invoke deltas diff");let A=is().diff(S,b,{keyNames:{default:"codoxId"}});ut.log("JSON_DIFF_ANALYSIS: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:b,deltas:A&&JSON.parse(JSON.stringify(A))}),A&&A.length&&(ut.log("[updateEditor] apply deltas to lexical state"),jL(b,A),S=xt.setCurrentContentStateJSON(b),(0,bt.$addUpdateTag)("codox_sync_state_changes"),ut.log("[updateEditor] state updated: ",S))}let j=Wt.isNestedSelectionJSON(v);if(Ob.validateJSONSelection(v,wb.local)||(v=xt.getCurrentActiveSelectionJSON()),j){let A=fs.setNestedEditorSelection(v);xt.setNestedSelectionJSON(A?v:null),ut.log("[updateEditor] nested selection updated",A?v:null)}else if(v!==void 0){const A=Wt.JSONToLexical(v);ut.log("[updateEditor] updated selection to apply: ",{isSameSelection:O,newSelectionJSON:v,lexicalSelection:A}),(0,bt.$setSelection)(A),xt.setMainSelectionJSON(v),ut.log("[updateEditor] selection updated",v)}},{onUpdate:()=>{E||di.updateRemoteSelections(w,"from onUpdate hook")}}),E&&di.updateRemoteSelections(w,"from direct updateEditor")},p=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(!xt.isCodoxStarted)return;ut.log("[invokeSync] SYNC INVOKED ",{upd_call_counter:b});let v=xt.composeFullStateWithRootAndComments();const _={docId:ps,state:{state:v,selection:xt.getCurrentActiveSelectionJSON()}};ut.log("[codoxSync]: Before sync",{local:_,upd_call_counter:b}),ut.log("[codoxSync]: Before sync state",JSON.parse(JSON.stringify(_.state)));let{state:w,remoteSelection:x=[],changes:S}=is().sync({state:_,meta:{}});if(ut.log("[codoxSync]: After sync",{afterSyncState:JSON.parse(JSON.stringify(w)),remoteSelection:x,changes:S}),!w)return ut.error("[codoxSync] abort apply - synced state is not valid - restarting codox "),u();const E=w.state;ut.log("[codoxSync]: synced state: ",JSON.parse(JSON.stringify(E)),b);let{stateFromSync:O,commentsFromSync:j}=xt.extractStateAndCommentsFromSynced(E);if(!xt.isValidJSONState(O.state))return ut.error("[invokeSync] - invalid state from sync - local update skipped - restarting codox",{contentState:O.state}),u();d(O,x),Ln.setAllComments(j)},h=()=>{ut.warn("[rollbackStateDuringUpdateError] rollback invoked"),ut.log("[rollbackStateDuringUpdateError] values: ",{prevState:xt.getPrevContentStateJSON(),currentState:xt.getCurrentContentStateJSON(),prevSelection:xt.getPrevMainSelectionJSON(),currentSelection:xt.getCurrentActiveSelectionJSON(),codoxComments:Ln});let b=xt.getPrevContentStateJSON(),v=xt.getPrevMainSelectionJSON();d({state:b,selection:v},di.getCurrentRemoteSelections(),Jo.historic);let _=xt.undoInvoked(),w=xt.redoInvoked();Ln.gcAbandonedNodeKeys(xt.getMainEditorState()._nodeMap),_&&s.dispatchCommand(bt.CAN_REDO_COMMAND,!1),w&&s.dispatchCommand(bt.CAN_UNDO_COMMAND,!1)},m=b=>{let{editorState:v,prevEditorState:_,tags:w,dirtyElements:x,dirtyLeaves:S}=b;if(Nb)return Nb=!1,void ut.debug("[editorUpdatesListener] invoked blacklisted queued selection change - stop");if(fa.isBlacklistedFound())return Nb=!0,ut.warn("[editorUpdatesListener] BLACKLISTED CHANGES FOUND - revert back to prev state"),((V,G)=>{let F=null,K=null;G.read(()=>{F=Wt.lexicalToJSON(G._selection),K=G.toJSON()});let N=null,R=null;V.read(()=>{let L=(0,bt.$getSelection)();R=Wt.lexicalToJSON(L),N=V.toJSON()}),xt.setCurrentContentStateJSON(N),xt.setMainSelectionJSON(R),d({state:K,selection:F},di.getCurrentRemoteSelections(),Jo.historic),s.dispatchCommand(bt.CAN_REDO_COMMAND,!1),s.dispatchCommand(bt.CAN_UNDO_COMMAND,!1)})(v,_),void fa.invokeClientCallback();if(!Ii.ensureDocTablesAreValid(v))return;Wh++,ut.log("[editorUpdatesListener] invoked by lexical. call counter: ",{upd_call_counter:Wh,isCodoxStarted:xt.isCodoxStarted});let E=xt.isOnlySelectionChanged(x,S),O=null,j=null,A=null,T=null,I=xt.getCurrentContentStateJSON(),k=w.has("codox_sync_state_changes"),$=w.has(Dd),H=xt.undoInvoked(),U=xt.redoInvoked(),D=xt.canUndo(),W=xt.canRedo();O=v.toJSON(),j=_.toJSON(),_.read(()=>{T=Wt.lexicalToJSON(_._selection)}),v.read(()=>{let V=(0,bt.$getSelection)();A=Wt.lexicalToJSON(V);let G=Wt.JSONToLexical(A),F=V===null&&G===null||V.is(G);ut.log("[editorUpdatesListener] new values: ",{newContentStateJSON:O,currentContentStateJSON:JSON.parse(JSON.stringify(I)),prevContentStateJSON:JSON.parse(JSON.stringify(j)),currentCommentsJSON:JSON.parse(JSON.stringify(Ln.getAllComments())),newSelectionJSON:JSON.parse(JSON.stringify(A)),currentMainSelectionJSON:JSON.parse(JSON.stringify(xt.getCurrentMainSelectionJSON())),currentNestedSelectionJSON:JSON.parse(JSON.stringify(xt.getCurrentNestedSelectionJSON())),currentActiveSelectionJSON:JSON.parse(JSON.stringify(xt.getCurrentActiveSelectionJSON())),lexicalSelection:V,convertedBackMainSelection:G,isMainSelectionConvertionCorrect:F,nodes:s._editorState._nodeMap,fullEditor:s,codoxNodesMap:Wn.toArray(),codoxComments:Ln,isUpdateFromSync:k,isUpdateFromComments:$,tags:w,onlySelectionChanged:E,undoInvoked:H,redoInvoked:U,canUndo:D,canRedo:W})});let J=Eb(I,O),M=Wt.equalSelectionsJSON(xt.getCurrentActiveSelectionJSON(),A);ut.log("[editorUpdatesListener] compares: ",{isStateSame:J,isSelectionSame:M});let z=J&&M&&!$;if(!J||$||k){let V=Rc({},J?I:O),G=Ln.getAllComments();G.length&&(V.commentThreads=G);let F={source:k?DE.remote:DE.local,content:V};fi.hooks&&fi.hooks.contentChanged&&fi.hooks.contentChanged(F),is().instance.emit("content_changed",F)}if(z)ut.log("[editorUpdatesListener] STOP - state and selection and comments are same ",Wh);else if(xt.undoInvoked()&&xt.setUndoInvoked(!1),xt.redoInvoked()&&xt.setRedoInvoked(!1),xt.setCurrentContentStateJSON(O),xt.setPrevContentStateJSON(j),xt.setMainSelectionJSON(A),xt.setPrevMainSelectionJSON(T),Tb){let V=xt.getCurrentActiveSelectionJSON();d({state:xt.getCurrentContentStateJSON(),selection:V},[])}else p(Wh)},g=()=>{let b=[];return xt.getMainEditorNodesClassesMap().forEach((v,_,w)=>{let{klass:x}=v,S=s.registerMutationListener(x,E=>{for(let[O,j]of E){if(!jo[j])continue;const A=xt.getLexicalNodeByKey(O);if(j===jo.created&&A&&fa.trackBlacklisted(A,j),x.name===$n.TableNode.name&&(j===jo.destroyed?Ii.tableNodeRemoveListener(O):Ii.tableUpdateListener(O)),x.name===$n.TableRowNode.name&&j!==jo.destroyed&&Ii.tableRowNodeChangesListener(O,j===jo.updated),x.name===$n.TableCellNode.name&&j===jo.updated&&Ii.tableCellNodeChangesListener(O),x.name===qo.MarkNode.name&&(ut.debug("[MUTATION LISTENER] MARK node: ",{nodeKey:O,node:A,mutationType:j,codoxComments:Ln}),j===jo.destroyed?Ln.removeRelatedNodeKey(O):A&&Ln.addRelatedNodeKey(A.__key,A.__ids,j===jo.created)),A&&A.codoxId){if(j===jo.destroyed)return void(A.codoxId&&Wn.remove(A.codoxId));fO(A)||ut.warn("[MutationListener Error] duplicating codoxId detected - such codoxId already exists in codoxNodesMap - updating node ref to latest: ",{mutationType:j,node:A}),Wn.add(A.codoxId,A)}}b.push(S)})}),b},y={start:i,stop:o,on:(b,v)=>{ut.info(`Subscribing client to codox ${b} event`),kb[b]=v},cursor:{hide:()=>{di.hideRemoteSelectionsFromUI()},show:()=>{di.showHiddenRemoteSelectionsInUI()}},initComments:b=>{Ln.setInitialComments(b)}};return(0,Ge.useImperativeHandle)(t,()=>y),null}),t6=e6,n6=["comments"];function iO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function Ab(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iO(Object(n),!0).forEach(function(e){r6(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):iO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function r6(c,t,n){return(t=o6(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function o6(c){var t=i6(c,"string");return typeof t=="symbol"?t:t+""}function i6(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}function s6(c,t){if(c==null)return{};var n,e,s=a6(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function a6(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}class l6 extends IE{constructor(){super(),this.mainEditor=null,this.mainEditorKey=null,this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this._isCodoxStarted=!1,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1}setCanUndo(t){this._canUndo=t}setCanRedo(t){this._canRedo=t}canUndo(){return this._canUndo}canRedo(){return this._canRedo}setUndoInvoked(t){this._undoInvoked=t}setRedoInvoked(t){this._redoInvoked=t}undoInvoked(){return this._undoInvoked}redoInvoked(){return this._redoInvoked}setIsCodoxStarted(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this._isCodoxStarted=t}get isCodoxStarted(){return this._isCodoxStarted}getMainEditorKey(){return this.mainEditorKey}setMainEditor(t){this.mainEditor=t,this.mainEditorKey=t._key}clearJSONs(){ut.debug("[CodoxLexicalEditorManager][clearJSONs] invoked"),this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null}removeMainEditor(){this.mainEditor=null,this.mainEditorKey=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1,super.clear()}getMainEditor(){return this.mainEditor}alignStateSelectionJSONsFromLatestEditor(){this.getMainEditorState().read(()=>{this.setCurrentContentStateJSON(this.getMainEditorState().toJSON()),this.setMainSelectionJSON(Wt.lexicalToJSON((0,bt.$getSelection)()))})}mainEditorExists(){return!!this.mainEditor}getMainEditorState(){return this.mainEditor?this.mainEditor.getEditorState():{}}getMainEditorNodesClassesMap(){return this.mainEditor?this.mainEditor._nodes:new Map}getLexicalNodeByKey(t){return this.mainEditor?this.getMainEditorState()._nodeMap.get(t):null}isLexicalEditorInstance(t){return t&&typeof t=="object"&&!!t.setEditorState}setCurrentContentStateJSON(t){return this.currentContentStateJSON=t,this.currentContentStateJSON}getCurrentContentStateJSON(){return this.currentContentStateJSON}setPrevContentStateJSON(t){this.prevContentStateJSON=t}getPrevContentStateJSON(){return this.prevContentStateJSON}setMainSelectionJSON(t){this.currentMainSelectionJSON=t,this.currentMainSelectionJSON&&this.currentNestedSelectionJSON&&(this.currentNestedSelectionJSON=null)}setNestedSelectionJSON(t){this.currentNestedSelectionJSON=t,this.currentNestedSelectionJSON&&this.currentMainSelectionJSON&&(this.currentMainSelectionJSON=null)}getCurrentMainSelectionJSON(){return this.currentMainSelectionJSON}getCurrentNestedSelectionJSON(){return this.currentNestedSelectionJSON}getCurrentActiveSelectionJSON(){return!this.currentMainSelectionJSON&&this.currentNestedSelectionJSON?this.currentNestedSelectionJSON:this.currentMainSelectionJSON}clearSelectionJSON(){this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null}setPrevMainSelectionJSON(t){this.prevMainSelectionJSON=t}getPrevMainSelectionJSON(){return this.prevMainSelectionJSON}extractStateAndCommentsFromSynced(t){let{state:{comments:n},selection:e,stateReplace:s}=t;return{stateFromSync:{state:Ab({},s6(t.state,n6)),selection:e,stateReplace:s},commentsFromSync:n}}composeFullStateWithRootAndComments(){let{directlyFromEditor:t=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ab(Ab({},t?this.getMainEditorState().toJSON():this.currentContentStateJSON),{},{comments:Ln.getAllComments()})}isValidJSONState(t){let n=!1;try{if(!t)throw new Error("State is undefined");if(!t.root)throw new Error("State 'root' node is missing");let e=this.getMainEditorNodesClassesMap(),s=function(r){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=r,u=e.get(i.type);if(!u)throw new Error(`Node with type "${i.type}" is not registered in editor`);let{klass:a}=u;if(o==="root"){let f=a.prototype instanceof bt.ElementNode,l=a.prototype instanceof bt.DecoratorNode;if(!f&&!l)throw new Error("State root node can have only element nodes as children")}if(i.children)for(let f of i.children)s(f,i.type)};s(t.root),n=!0}catch(e){ut.error("[isValidJSONState] invalid state found: ",e.message),n=!1}return n}scanLexicalNodeForNestedEditorAttribute(t){for(let n in t){let e=t[n];if(this.isLexicalEditorInstance(e))return n}return""}isOnlySelectionChanged(t,n){return t.size===0&&n.size===0}addUpdateTag(){let{isSameState:t,isSameSelection:n,fromNestedEditor:e=!1,updateTag:s=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return s?(ut.log(`[addUpdateTag] explicit add of tag "${s}" `),void(0,bt.$addUpdateTag)(s)):e?(ut.log(`[addUpdateTag] add "${Jo.historic}" tag - change invoked by nested editor`),void(0,bt.$addUpdateTag)(Jo.historic)):void(t?(ut.log(`[addUpdateTag] add "${Jo.historic}" tag - state is same`),(0,bt.$addUpdateTag)(Jo.historic)):(ut.log(`[addUpdateTag] add "${Jo.historyMerge}" tag - state is different`),(0,bt.$addUpdateTag)(Jo.historyMerge)))}enableEditorReadOnlyMode(){this.mainEditor&&this.mainEditor.isEditable()&&this.mainEditor.setEditable(!1)}disableEditorReadOnlyMode(){this.mainEditor&&(this.mainEditor.isEditable()||this.mainEditor.setEditable(!0))}}const c6=new l6,xt=c6;class u6{constructor(){this._nodesMap=new Map,this._pastedNodesCodoxIds=new Set}get size(){return this._nodesMap.size}add(t,n){this._nodesMap.set(t,n)}get(t){return this._nodesMap.get(t)||null}remove(t){this._nodesMap.delete(t)}has(t){return this._nodesMap.has(t)}nodesToArray(){return Array.from(this._nodesMap.values())}keysToArray(){return Array.from(this._nodesMap.keys())}toArray(){return Array.from(this._nodesMap.entries())}addPastedId(t){this._pastedNodesCodoxIds.add(t)}removePastedId(t){this._pastedNodesCodoxIds.delete(t)}hasPastedId(t){return this._pastedNodesCodoxIds.has(t)}clearPastedIds(){this._pastedNodesCodoxIds.size>0&&this._pastedNodesCodoxIds.clear()}isEmptyPastedIds(){return this._pastedNodesCodoxIds.size===0}getPastedIdsSize(){return this._pastedNodesCodoxIds.size}clearAll(){this._nodesMap.clear(),this._pastedNodesCodoxIds.clear()}gcAbandonedNodes(){let t=xt.getMainEditorState();if(!t._nodeMap)return;let n=this.nodesToArray();for(let e of n)t._nodeMap.has(e.__key)||this.remove(e.codoxId)}}const d6=new u6,Wn=d6;function sO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function aO(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sO(Object(n),!0).forEach(function(e){f6(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):sO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function f6(c,t,n){return(t=p6(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function p6(c){var t=h6(c,"string");return typeof t=="symbol"?t:t+""}function h6(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}const Pb=()=>w4(),lO=c=>typeof c=="number";function jc(c){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=function(){for(var e=arguments.length,s=new Array(e),r=0;r<e;r++)s[r]=arguments[r];return c.apply(this,s)};return Object.defineProperty(n,"name",{value:t,writable:!0}),n}const al=c=>c.__type==="root"||c.type==="root",cO=c=>al(c.getParent()),ar=c=>c.__type===Fh.text||c.type===Fh.text||c.hasOwnProperty("__text")||c.hasOwnProperty("text"),Dc=c=>(0,bt.$isElementNode)(c),Lc=c=>(0,$n.$isTableNode)(c)||(0,$n.$isTableRowNode)(c)||(0,$n.$isTableCellNode)(c),g6=c=>!c.getChildren,uO=c=>!!c.getChildren,Bn=c=>(0,bt.$isDecoratorNode)(c),Bd=c=>(0,h4.$isLinkNode)(c),Fd=c=>c.__type==="mark"||c.type==="mark",Mb=c=>(0,bt.$isLineBreakNode)(c),pa=c=>ar(c)||Mb(c),Ib=c=>c.__type===Fh.horizontalrule||c.type===Fh.horizontalrule,dO=c=>{if(pa(c)||Bd(c)||Fd(c))return!1;if(!c.__parent||c.__parent==="root"||(0,bt.$isParagraphNode)(c))return!0;let t=c.getParent().getChildren();return t.length===1&&t[0].__key===c.__key?!((Bn(c)||Bd(c)||Fd(c))&&!Ib(c)):!t.some(n=>{let e=Ib(n);return n.__key!==c.__key&&(pa(n)||Bn(n)&&!e||Bd(n)||Fd(n))})},fO=c=>{const t=Wn.get(c.codoxId);return!t||c.__key===t.__key},Bc=function(c){const t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||Pb();c.codoxId=t,Wn.add(t,c)},pO=c=>{Wn.remove(c.codoxId),delete c.codoxId},m6=c=>{if(!uO(c)||!c.getChildrenSize())return;const t=c.getChildren();if(t.some(s=>!!(0,bt.$isParagraphNode)(s)))return;let n=!1,e=[];for(let s of t)(pa(s)||Bn(s)||Bd(s)||Fd(s))&&!n&&(Ib(s)||(n=!0)),(uO(s)||Bn(s))&&e.push(s);for(let s of e)n||s.codoxId?n&&s.codoxId&&(s=s.getWritable(),pO(s)):(s=s.getWritable(),Bc(s))},y6=c=>{const t=aO({},c);for(const n in c)c[n]===void 0&&c.hasOwnProperty(n)&&delete t[n];return t},b6=c=>{const t=`__nativeCreateDOM_${c.name}`;c.prototype[t]=jc(c.prototype.createDOM,t),c.prototype.createDOM=function(n,e){if(dO(this))if(this.codoxId){if(!fO(this)){let r=Wn.get(this.codoxId);r.__type===this.__type&&this.isAttached()&&!r.isAttached()?(ut.warn("[createDOM][Non-unique codoxId] overwrite abandoned existing node with latest: ",{latestNode:this,existingNode:r}),Wn.add(this.codoxId,this)):Bc(this)}}else Bc(this);else this.codoxId&&pO(this);Bn(this)&&!this.codoxDId&&(this.codoxDId=Pb()),fs.manageNestedEditorInLexicalNode(this);let s=this[t](n,e);return s.__codox_track=!0,s}},v6=c=>{const t=`__nativeUpdateDOM_${c.name}`;return c.prototype[t]=jc(c.prototype.updateDOM,t),c.prototype.updateDOM=function(){const n=this[t](...arguments);return m6(this),n},c},_6=c=>{const t=`__nativeRemove_${c.name}`;return c.prototype[t]=jc(c.prototype.remove,t),c.prototype.remove=function(){const n=this.codoxId;return n&&Wn.remove(n),fs.gcNestedEditorListenerInLexicalNode(this),this[t](...arguments)},c},x6=c=>{const t=`__nativeExportJSON_${c.name}`;c.prototype[t]=jc(c.prototype.exportJSON,t),c.prototype.exportJSON=function(){const n=this[t]();return this.codoxId&&(n.codoxId=this.codoxId),this.codoxDId&&(n.codoxDId=this.codoxDId),ar(this)&&lO(n.format)&&this.hasFormat&&(n.format=I4(this)),y6(n)}},w6=c=>{const t="__nativeImportJSON";c[t]=jc(c.importJSON,t),c.importJSON=function(n){const e=aO({},n);ar(e)&&!lO(e.format)&&(e.format=M4(e.format));const s=c[t](e);fs.manageNestedEditorInLexicalNode(s);const r=dO(s);return r&&e.codoxId&&(Wn.hasPastedId(e.codoxId)&&Wn.has(e.codoxId)?(Wn.removePastedId(e.codoxId),Bc(s)):Bc(s,e.codoxId)),r&&!s.codoxId&&Bc(s),e.codoxDId&&(s.codoxDId=e.codoxDId),s}},S6=c=>{const t="__nativeClone";c[t]=jc(c.clone,t),c.clone=function(n){const e=c[t](n);return n.codoxId&&(e.codoxId=n.codoxId),n.codoxDId&&(e.codoxDId=n.codoxDId),fs.manageNestedEditorInClonedLexicalNode(n,e),e}},C6=c=>{let t=!1,n=!1,e=!1,s=!1;c.forEach(o=>{o.name===bt.TextNode.name?t=!0:o.name===bt.ParagraphNode.name?n=!0:o.name===bt.LineBreakNode.name?e=!0:o.name===qo.MarkNode.name&&(s=!0)});let r=[];return t||r.push(bt.TextNode),n||r.push(bt.ParagraphNode),e||r.push(bt.LineBreakNode),s||r.push(qo.MarkNode),r.length?[...r,...c]:c},E6=function(){return C6(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(c=>(c.hasOwnProperty("__isCodoxExtended")||(b6(c),v6(c),x6(c),_6(c),w6(c),S6(c),Object.defineProperty(c,"__isCodoxExtended",{value:!0,writable:!1})),c))};var qh=un(777),Fc={};Fc.styleTagTransform=ds(),Fc.setAttributes=cs(),Fc.insert=ls().bind(null,"head"),Fc.domAPI=as(),Fc.insertStyleElement=us(),ss()(qh.A,Fc),qh.A&&qh.A.locals&&qh.A.locals;var O6=c=>{var t={};return un.d(t,c),t};const T6=O6({AutoFocusPlugin:()=>MS});var N6=c=>{var t={};return un.d(t,c),t};const k6=N6({ClearEditorPlugin:()=>_3});var A6=c=>{var t={};return un.d(t,c),t};const P6=A6({LexicalComposer:()=>PS});var M6=c=>{var t={};return un.d(t,c),t};const hO=M6({default:()=>k3});var I6=c=>{var t={};return un.d(t,c),t};const R6=I6({HistoryPlugin:()=>hC});var j6=c=>{var t={};return un.d(t,c),t};const D6=j6({OnChangePlugin:()=>D3});var L6=c=>{var t={};return un.d(t,c),t};const B6=L6({PlainTextPlugin:()=>u4});var F6=c=>{var t={};return un.d(t,c),t};const gO=F6({$isRootTextContentEmpty:()=>SR,$rootTextContent:()=>CR});var $6=c=>{var t={};return un.d(t,c),t};const $c=$6({createPortal:()=>wN.createPortal}),z6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,U6=z6?Ge.useLayoutEffect:Ge.useEffect,mO=U6;var Jh=un(253),zc={};zc.styleTagTransform=ds(),zc.setAttributes=cs(),zc.insert=ls().bind(null,"head"),zc.domAPI=as(),zc.insertStyleElement=us(),ss()(Jh.A,zc),Jh.A&&Jh.A.locals&&Jh.A.locals;function H6(c){let{onClose:t,children:n,title:e,closeOnClickOutside:s}=c;const r=(0,Ge.useRef)(null);return(0,Ge.useEffect)(()=>{r.current!==null&&r.current.focus()},[]),(0,Ge.useEffect)(()=>{let o=null;const i=f=>{f.key==="Escape"&&t()},u=f=>{const l=f.target;r.current!==null&&!r.current.contains(l)&&s&&t()},a=r.current;return a!==null&&(o=a.parentElement,o!==null&&o.addEventListener("click",u)),window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i),o!==null&&(o==null||o.removeEventListener("click",u))}},[s,t]),Ge.createElement("div",{className:"Modal__overlay",role:"dialog"},Ge.createElement("div",{className:"Modal__modal",tabIndex:-1,ref:r},Ge.createElement("h2",{className:"Modal__title"},e),Ge.createElement("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:t},"X"),Ge.createElement("div",{className:"Modal__content"},n)))}function K6(c){let{onClose:t,children:n,title:e,closeOnClickOutside:s=!1}=c;return(0,$c.createPortal)(Ge.createElement(H6,{onClose:t,title:e,closeOnClickOutside:s},n),document.body)}function yO(){const[c,t]=(0,Ge.useState)(null),n=(0,Ge.useCallback)(()=>{t(null)},[]),e=(0,Ge.useMemo)(()=>{if(c===null)return null;const{title:r,content:o,closeOnClickOutside:i}=c;return Ge.createElement(K6,{onClose:n,title:r,closeOnClickOutside:i},o)},[c,n]),s=(0,Ge.useCallback)(function(r,o){t({closeOnClickOutside:arguments.length>2&&arguments[2]!==void 0&&arguments[2],content:o(n),title:r})},[n]);return[e,s]}var Vh=un(191),Uc={};Uc.styleTagTransform=ds(),Uc.setAttributes=cs(),Uc.insert=ls().bind(null,"head"),Uc.domAPI=as(),Uc.insertStyleElement=us(),ss()(Vh.A,Uc),Vh.A&&Vh.A.locals&&Vh.A.locals;const W6={blockCursor:"CommentEditorTheme__blockCursor",characterLimit:"CommentEditorTheme__characterLimit",code:"CommentEditorTheme__code",codeHighlight:{atrule:"CommentEditorTheme__tokenAttr",attr:"CommentEditorTheme__tokenAttr",boolean:"CommentEditorTheme__tokenProperty",builtin:"CommentEditorTheme__tokenSelector",cdata:"CommentEditorTheme__tokenComment",char:"CommentEditorTheme__tokenSelector",class:"CommentEditorTheme__tokenFunction","class-name":"CommentEditorTheme__tokenFunction",comment:"CommentEditorTheme__tokenComment",constant:"CommentEditorTheme__tokenProperty",deleted:"CommentEditorTheme__tokenProperty",doctype:"CommentEditorTheme__tokenComment",entity:"CommentEditorTheme__tokenOperator",function:"CommentEditorTheme__tokenFunction",important:"CommentEditorTheme__tokenVariable",inserted:"CommentEditorTheme__tokenSelector",keyword:"CommentEditorTheme__tokenAttr",namespace:"CommentEditorTheme__tokenVariable",number:"CommentEditorTheme__tokenProperty",operator:"CommentEditorTheme__tokenOperator",prolog:"CommentEditorTheme__tokenComment",property:"CommentEditorTheme__tokenProperty",punctuation:"CommentEditorTheme__tokenPunctuation",regex:"CommentEditorTheme__tokenVariable",selector:"CommentEditorTheme__tokenSelector",string:"CommentEditorTheme__tokenSelector",symbol:"CommentEditorTheme__tokenProperty",tag:"CommentEditorTheme__tokenProperty",url:"CommentEditorTheme__tokenOperator",variable:"CommentEditorTheme__tokenVariable"},embedBlock:{base:"CommentEditorTheme__embedBlock",focus:"CommentEditorTheme__embedBlockFocus"},hashtag:"CommentEditorTheme__hashtag",heading:{h1:"CommentEditorTheme__h1",h2:"CommentEditorTheme__h2",h3:"CommentEditorTheme__h3",h4:"CommentEditorTheme__h4",h5:"CommentEditorTheme__h5",h6:"CommentEditorTheme__h6"},image:"editor-image",indent:"CommentEditorTheme__indent",inlineImage:"inline-editor-image",layoutContainer:"CommentEditorTheme__layoutContainer",layoutItem:"CommentEditorTheme__layoutItem",link:"CommentEditorTheme__link",list:{checklist:"CommentEditorTheme__checklist",listitem:"CommentEditorTheme__listItem",listitemChecked:"CommentEditorTheme__listItemChecked",listitemUnchecked:"CommentEditorTheme__listItemUnchecked",nested:{listitem:"CommentEditorTheme__nestedListItem"},olDepth:["CommentEditorTheme__ol1","CommentEditorTheme__ol2","CommentEditorTheme__ol3","CommentEditorTheme__ol4","CommentEditorTheme__ol5"],ul:"CommentEditorTheme__ul"},ltr:"CommentEditorTheme__ltr",mark:"CommentEditorTheme__mark",markOverlap:"CommentEditorTheme__markOverlap",paragraph:"CommentEditorTheme__paragraph",quote:"CommentEditorTheme__quote",rtl:"CommentEditorTheme__rtl",table:"CommentEditorTheme__table",tableCell:"CommentEditorTheme__tableCell",tableCellActionButton:"CommentEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"CommentEditorTheme__tableCellActionButtonContainer",tableCellEditing:"CommentEditorTheme__tableCellEditing",tableCellHeader:"CommentEditorTheme__tableCellHeader",tableCellPrimarySelected:"CommentEditorTheme__tableCellPrimarySelected",tableCellResizer:"CommentEditorTheme__tableCellResizer",tableCellSelected:"CommentEditorTheme__tableCellSelected",tableCellSortedIndicator:"CommentEditorTheme__tableCellSortedIndicator",tableResizeRuler:"CommentEditorTheme__tableCellResizeRuler",tableSelected:"CommentEditorTheme__tableSelected",tableSelection:"CommentEditorTheme__tableSelection",text:{bold:"CommentEditorTheme__textBold",code:"CommentEditorTheme__textCode",italic:"CommentEditorTheme__textItalic",strikethrough:"CommentEditorTheme__textStrikethrough",subscript:"CommentEditorTheme__textSubscript",superscript:"CommentEditorTheme__textSuperscript",underline:"CommentEditorTheme__textUnderline",underlineStrikethrough:"CommentEditorTheme__textUnderlineStrikethrough"}},q6=W6;var Gh=un(72),Hc={};Hc.styleTagTransform=ds(),Hc.setAttributes=cs(),Hc.insert=ls().bind(null,"head"),Hc.domAPI=as(),Hc.insertStyleElement=us(),ss()(Gh.A,Hc),Gh.A&&Gh.A.locals&&Gh.A.locals;function J6(){for(var c=arguments.length,t=new Array(c),n=0;n<c;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function Rb(){return Rb=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)({}).hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Rb.apply(null,arguments)}function ha(c){let{"data-test-id":t,children:n,className:e,onClick:s,disabled:r,small:o,title:i}=c;return Ge.createElement("button",Rb({disabled:r,className:J6("Button__root",r&&"Button__disabled",o&&"Button__small",e),onClick:s,title:i,"aria-label":i},t&&{"data-test-id":t}),n)}var Yh=un(129),Kc={};Kc.styleTagTransform=ds(),Kc.setAttributes=cs(),Kc.insert=ls().bind(null,"head"),Kc.domAPI=as(),Kc.insertStyleElement=us(),ss()(Yh.A,Kc),Yh.A&&Yh.A.locals&&Yh.A.locals;var V6=c=>{var t={};return un.d(t,c),t};const G6=V6({ContentEditable:()=>IS});function Y6(c){let{className:t}=c;return Ge.createElement(G6.ContentEditable,{className:t||"ContentEditable__root"})}var Xh=un(457),Wc={};Wc.styleTagTransform=ds(),Wc.setAttributes=cs(),Wc.insert=ls().bind(null,"head"),Wc.domAPI=as(),Wc.insertStyleElement=us(),ss()(Xh.A,Wc),Xh.A&&Xh.A.locals&&Xh.A.locals;function X6(c){let{children:t,className:n}=c;return Ge.createElement("div",{className:n||"Placeholder__root"},t)}const Z6=hO.default.LexicalErrorBoundary||hO.default,Q6=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#050505",className:"codox-add-comment-right"},Ge.createElement("path",{d:"M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4.414A2 2 0 0 0 3 11.586l-2 2V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12.793a.5.5 0 0 0 .854.353l2.853-2.853A1 1 0 0 1 4.414 12H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}),Ge.createElement("path",{d:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3 6a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 6zm0 2.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"})),bO=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",className:"codox-remove-comment"},Ge.createElement("path",{d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z"})),e8=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"codox-add-comment"},Ge.createElement("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"})),t8=()=>Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"#0000008c",className:"codox-hide-show-comments"},Ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 5.885v1.166a3.95 3.95 0 0 1-3.949 3.95H6.917a.748.748 0 0 0-.45.15l-1.345 1.007a.752.752 0 0 0-.032 1.181A2.933 2.933 0 0 0 6.95 14h2.716l2.534 1.901a.506.506 0 0 0 .524.047A.501.501 0 0 0 13 15.5V14h.051a2.949 2.949 0 0 0 2.95-2.949v-3.05a3.002 3.002 0 0 0-2.002-2.83.756.756 0 0 0-.999.714"}),Ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.05 1H2.95A2.952 2.952 0 0 0 0 3.949v3.102A2.952 2.952 0 0 0 2.949 10H3v1.5a.502.502 0 0 0 .8.4L6.334 10H9.05A2.952 2.952 0 0 0 12 7.05V3.95A2.952 2.952 0 0 0 9.05 1"}));function vO(c,t,n){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:performance.now(),s=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return Ln.createNewCommentObj({content:c,author:t,codoxId:n,timeStamp:e,deleted:s})}function n8(c,t,n){return Ln.createNewThreadObj({quote:c,comments:t,codoxId:n})}function r8(c){let{anchorKey:t,editor:n,onAddComment:e}=c;const s=(0,Ge.useRef)(null),r=(0,Ge.useCallback)(()=>{const o=s.current,i=n.getRootElement(),u=n.getElementByKey(t);if(o!==null&&i!==null&&u!==null){const{right:a}=i.getBoundingClientRect(),{top:f}=u.getBoundingClientRect();o.style.left=a-20+"px",o.style.top=f-30+"px"}},[t,n]);return(0,Ge.useEffect)(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[n,r]),mO(()=>{r()},[t,n,r]),Ge.createElement("div",{className:"CodoxCommentPlugin_AddCommentBox",ref:s},Ge.createElement("button",{className:"CodoxCommentPlugin_AddCommentBox_button",onClick:e},Ge.createElement(Q6,null)))}function o8(c){let{onEscape:t}=c;const[n]=(0,da.useLexicalComposerContext)();return(0,Ge.useEffect)(()=>n.registerCommand(bt.KEY_ESCAPE_COMMAND,e=>t(e),2),[n,t]),null}function i8(c){let{editorRef:t}=c;const[n]=(0,da.useLexicalComposerContext)();return typeof t=="function"?t(n):typeof t=="object"&&(t.current=n),null}function _O(c){let{className:t,autoFocus:n,onEscape:e,onChange:s,editorRef:r,placeholder:o="Type a comment...",onEditorClick:i=()=>{}}=c;const u={namespace:"Commenting",nodes:[],onError:a=>{throw a},theme:q6};return Ge.createElement(P6.LexicalComposer,{initialConfig:u},Ge.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_EditorContainer",onClick:i},Ge.createElement(B6.PlainTextPlugin,{contentEditable:Ge.createElement(Y6,{className:t}),placeholder:Ge.createElement(X6,null,o),ErrorBoundary:Z6}),Ge.createElement(D6.OnChangePlugin,{onChange:s}),Ge.createElement(R6.HistoryPlugin,null),n!==!1&&Ge.createElement(T6.AutoFocusPlugin,null),Ge.createElement(o8,{onEscape:e}),Ge.createElement(k6.ClearEditorPlugin,null),r!==void 0&&Ge.createElement(i8,{editorRef:r})))}function xO(c,t){return(0,Ge.useCallback)((n,e)=>{n.read(()=>{c((0,gO.$rootTextContent)()),t(!(0,gO.$isRootTextContentEmpty)(e.isComposing(),!0))})},[t,c])}function s8(c){let{editor:t,cancelAddComment:n,submitAddComment:e}=c;const[s,r]=(0,Ge.useState)(""),[o,i]=(0,Ge.useState)(!1),u=(0,Ge.useRef)(null),a=(0,Ge.useMemo)(()=>({container:document.createElement("div"),elements:[]}),[]),f=(0,Ge.useRef)(null),l=CO(),d=(0,Ge.useCallback)(()=>{t.getEditorState().read(()=>{const h=(0,bt.$getSelection)();if((0,bt.$isRangeSelection)(h)){f.current=h.clone();const m=h.anchor,g=h.focus,y=(0,il.createDOMRange)(t,m.getNode(),m.offset,g.getNode(),g.offset),b=u.current;if(y!==null&&b!==null){const{left:v,bottom:_,width:w}=y.getBoundingClientRect(),x=(0,il.createRectsFromDOMRange)(t,y);let S=x.length===1?v+w/2-125:v-125;S<10&&(S=10),b.style.left=`${S}px`,b.style.top=`${_+20+(window.pageYOffset||document.documentElement.scrollTop)}px`;const E=x.length,{container:O}=a,j=a.elements,A=j.length;for(let T=0;T<E;T++){const I=x[T];let k=j[T];k===void 0&&(k=document.createElement("span"),j[T]=k,O.appendChild(k));const $="255, 212, 0",H=`position:absolute;top:${I.top+(window.pageYOffset||document.documentElement.scrollTop)}px;left:${I.left}px;height:${I.height}px;width:${I.width}px;background-color:rgba(${$}, 0.3);pointer-events:none;z-index:5;`;k.style.cssText=H}for(let T=A-1;T>=E;T--){const I=j[T];O.removeChild(I),j.pop()}}}})},[t,a]);mO(()=>{d();const h=a.container,m=document.body;if(m!==null)return m.appendChild(h),()=>{m.removeChild(h)}},[a.container,d]),(0,Ge.useEffect)(()=>(window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]);const p=xO(r,i);return Ge.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox",ref:u},Ge.createElement(_O,{className:"CodoxCommentPlugin_CommentInputBox_Editor",onEscape:h=>(h.preventDefault(),n(),!0),onChange:p}),Ge.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_Buttons"},Ge.createElement(ha,{onClick:n,className:"CodoxCommentPlugin_CommentInputBox_Button"},"Cancel"),Ge.createElement(ha,{onClick:()=>{if(o){let h=t.getEditorState().read(()=>{const m=f.current;return m?m.getTextContent():""});h.length>100&&(h=h.slice(0,99)+"…"),e(n8(h,[vO(s,l)]),!0,void 0,f.current),f.current=null}},disabled:!o,className:"CodoxCommentPlugin_CommentInputBox_Button primary"},"Comment")))}function a8(c){let{submitAddComment:t,thread:n,placeholder:e}=c;const[s,r]=(0,Ge.useState)(""),[o,i]=(0,Ge.useState)(!1),u=(0,Ge.useRef)(null),a=CO(),f=xO(r,i);return Ge.createElement(Ge.Fragment,null,Ge.createElement(_O,{className:"CodoxCommentPlugin_CommentsPanel_Editor",autoFocus:!1,onEscape:()=>!0,onChange:f,editorRef:u,placeholder:e}),Ge.createElement(ha,{className:"CodoxCommentPlugin_CommentsPanel_SendButton",onClick:()=>{if(o){t(vO(s,a),!1,n);const l=u.current;l!==null&&l.dispatchCommand(bt.CLEAR_EDITOR_COMMAND,void 0)}},disabled:!o},Ge.createElement(e8,null)))}function wO(c){let{commentOrThread:t,deleteCommentOrThread:n,onClose:e,thread:s}=c;return Ge.createElement(Ge.Fragment,null,"Are you sure you want to delete this ",t.type,"?",Ge.createElement("div",{className:"Modal__content"},Ge.createElement(ha,{onClick:()=>{n(t,s),e()}},"Delete")," ",Ge.createElement(ha,{onClick:()=>{e()}},"Cancel")))}function SO(c){let{comment:t,deleteComment:n,thread:e,rtf:s}=c;const r=Math.round((t.timeStamp-performance.now())/1e3),o=Math.round(r/60),[i,u]=yO();return Ge.createElement("li",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment"},Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Details"},Ge.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Author"},t.author),Ge.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Time"},"· ",r>-10?"Just now":s.format(o,"minute"))),Ge.createElement("p",{className:t.deleted?"CodoxCommentPlugin_CommentsPanel_DeletedComment":""},t.content),!t.deleted&&Ge.createElement(Ge.Fragment,null,Ge.createElement(ha,{onClick:()=>{u("Delete Comment",a=>Ge.createElement(wO,{commentOrThread:t,deleteCommentOrThread:n,thread:e,onClose:a}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Ge.createElement(bO,null)),i))}function l8(c){let{activeIDs:t,comments:n,deleteCommentOrThread:e,listRef:s,submitAddComment:r,markNodeMap:o}=c;const[i]=(0,da.useLexicalComposerContext)(),[u,a]=(0,Ge.useState)(0),[f,l]=yO(),d=(0,Ge.useMemo)(()=>new Intl.RelativeTimeFormat("en",{localeMatcher:"best fit",numeric:"auto",style:"short"}),[]);return(0,Ge.useEffect)(()=>{const p=setTimeout(()=>{a(u+1)},1e4);return()=>{clearTimeout(p)}},[u]),Ge.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List",ref:s},n.map(p=>{const h=p.codoxId;if(!h)return null;if(p.type==="thread"){const m=()=>{if(o.get(h)!==void 0&&(t===null||t.indexOf(h)===-1)){const g=document.activeElement;i.update(()=>{(0,bt.$setSelection)(null)},{onUpdate(){g!==null&&g.focus()}})}};return Ge.createElement("li",{key:h,onClick:m,className:`CodoxCommentPlugin_CommentsPanel_List_Thread ${o.has(h)?"interactive":""} ${t.indexOf(h)===-1?"":"active"}`},Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_QuoteBox"},Ge.createElement("blockquote",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Quote"},"> ",Ge.createElement("span",null,p.quote)),Ge.createElement(ha,{onClick:()=>{l("Delete Thread",g=>Ge.createElement(wO,{commentOrThread:p,deleteCommentOrThread:e,onClose:g}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Ge.createElement(bO,null)),f),Ge.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Comments"},p.comments.map(g=>Ge.createElement(SO,{key:g.codoxId,comment:g,deleteComment:e,thread:p,rtf:d}))),Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Editor"},Ge.createElement(a8,{submitAddComment:r,thread:p,placeholder:"Reply to comment..."})))}return Ge.createElement(SO,{key:h,comment:p,deleteComment:e,rtf:d})}))}function c8(c){let{activeIDs:t,deleteCommentOrThread:n,comments:e,submitAddComment:s,markNodeMap:r}=c;const o=(0,Ge.useRef)(null),i=e.length===0;return Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel"},Ge.createElement("h2",{className:"CodoxCommentPlugin_CommentsPanel_Heading"},"Comments"),i?Ge.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_Empty"},"No Comments"):Ge.createElement(l8,{activeIDs:t,comments:e,deleteCommentOrThread:n,listRef:o,submitAddComment:s,markNodeMap:r}))}function CO(){const c=(0,tO.useCollaborationContext)(),{yjsDocMap:t,name:n}=c;return n||"Playground User"}function u8(c){const[t]=(0,da.useLexicalComposerContext)(),n=q4(),e=(0,Ge.useMemo)(()=>new Map,[]),[s,r]=(0,Ge.useState)(),[o,i]=(0,Ge.useState)([]),[u,a]=(0,Ge.useState)(!1),[f,l]=(0,Ge.useState)(!1);(0,Ge.useEffect)(()=>{!n.length&&f?l(!1):n.length},[n]);const d=(0,Ge.useCallback)(()=>{t.update(()=>{const m=(0,bt.$getSelection)();m!==null&&(m.dirty=!0)}),a(!1)},[t]),p=(0,Ge.useCallback)((m,g)=>{if(m.type==="comment"){if(ut.log("[deleteCommentOrThread]: type comment new values",{comment:m,thread:g,markNodeMap:e}),Ln.removeComment(g.codoxId,m.codoxId),!g)return;const y=g.codoxId,b=e.get(y);t.update(()=>{b?b.forEach((v,_)=>{const w=(0,bt.$getNodeByKey)(_);ut.log("[deleteCommentOrThread]: type comment new values",{lexicalNode:w}),w&&w.markDirty()}):(0,bt.$getRoot)().markDirty(),(0,bt.$addUpdateTag)(Jo.historic),(0,bt.$addUpdateTag)(Dd)})}else{ut.log("[deleteCommentOrThread]: type thread new values",{comment:m,markNodeMap:e});const y=g!==void 0?g.codoxId:m.codoxId,b=e.get(y);setTimeout(()=>{t.update(()=>{if(b)for(const v of b){const _=(0,bt.$getNodeByKey)(v);ut.log("[deleteCommentOrThread]: type thread new values",{node:_}),(0,qo.$isMarkNode)(_)&&(_.deleteID(y),_.getIDs().length===0&&(0,qo.$unwrapMarkNode)(_))}else(0,bt.$getRoot)().markDirty(),ut.debug("[deleteCommentOrThread][refreshComments]");Ln.refreshComments(!0),(0,bt.$addUpdateTag)(Dd)})})}},[t,e]),h=(0,Ge.useCallback)((m,g,y,b)=>{if(ut.log("[submitAddComment]: new values",{commentOrThread:m,isInlineComment:g,thread:y,markNodeMap:e}),y?Ln.addComment(y.codoxId,m):Ln.addCommentThread(m),g)t.update(()=>{if((0,bt.$isRangeSelection)(b)){const v=b.isBackward(),_=m.codoxId;(0,qo.$wrapSelectionInMarkNode)(b,v,_),(0,bt.$addUpdateTag)(Dd)}}),a(!1);else if(!g&&y){const v=y.codoxId,_=e.get(v);if(!_)return void Ln.removeComment(y.codoxId,m.codoxId);t.update(()=>{_.forEach((w,x)=>{let S=(0,bt.$getNodeByKey)(x);S&&S.markDirty()}),(0,bt.$addUpdateTag)(Jo.historic),(0,bt.$addUpdateTag)(Dd)})}},[t]);return(0,Ge.useEffect)(()=>{const m=[];for(let g=0;g<o.length;g++){const y=o[g],b=e.get(y);if(b!==void 0)for(const v of b){const _=t.getElementByKey(v);_!==null&&(_.classList.add("selected"),m.push(_),l(!0))}}return()=>{for(let g=0;g<m.length;g++)m[g].classList.remove("selected")}},[o,t,e]),(0,Ge.useEffect)(()=>{const m=new Map;return(0,Pc.mergeRegister)((0,Pc.registerNestedElementResolver)(t,qo.MarkNode,g=>(0,qo.$createMarkNode)(g.getIDs()),(g,y)=>{g.getIDs().forEach(b=>{y.addID(b)})}),t.registerMutationListener(qo.MarkNode,g=>{t.getEditorState().read(()=>{for(const[y,b]of g){const v=(0,bt.$getNodeByKey)(y);let _=[];b==="destroyed"?_=m.get(y)||[]:(0,qo.$isMarkNode)(v)&&(_=v.getIDs());for(let w=0;w<_.length;w++){const x=_[w];let S=e.get(x);m.set(y,_),b==="destroyed"?S!==void 0&&(S.delete(y),S.size===0&&e.delete(x)):(S===void 0&&(S=new Set,e.set(x,S)),S.has(y)||S.add(y))}}})}),t.registerUpdateListener(g=>{let{editorState:y,tags:b}=g;y.read(()=>{const v=(0,bt.$getSelection)();let _=!1,w=!1;if((0,bt.$isRangeSelection)(v)){const x=v.anchor.getNode();if((0,bt.$isTextNode)(x)){const S=(0,qo.$getMarkIDs)(x,v.anchor.offset);S!==null&&(i(S),_=!0),v.isCollapsed()||(r(x.getKey()),w=!0)}}_||i(x=>x.length===0?x:[]),w||r(null),(0,bt.$isRangeSelection)(v)&&a(!1)})}),t.registerCommand(Cb,()=>{const g=window.getSelection();return g!==null&&g.removeAllRanges(),a(!0),!0},bt.COMMAND_PRIORITY_EDITOR))},[t,e]),Ge.createElement(Ge.Fragment,null,u&&(0,$c.createPortal)(Ge.createElement(s8,{editor:t,cancelAddComment:d,submitAddComment:h}),document.body),s!=null&&!u&&(0,$c.createPortal)(Ge.createElement(r8,{anchorKey:s,editor:t,onAddComment:()=>{t.dispatchCommand(Cb,void 0)}}),document.body),(0,$c.createPortal)(Ge.createElement(ha,{className:"CodoxCommentPlugin_ShowCommentsButton "+(f?"active":""),onClick:()=>l(!f),title:f?"Hide Comments":"Show Comments"},Ge.createElement(t8,null)),document.body),f&&(0,$c.createPortal)(Ge.createElement(c8,{comments:n,submitAddComment:h,deleteCommentOrThread:p,activeIDs:o,markNodeMap:e}),document.body))}var Zh=un(766),qc={};qc.styleTagTransform=ds(),qc.setAttributes=cs(),qc.insert=ls().bind(null,"head"),qc.domAPI=as(),qc.insertStyleElement=us(),ss()(Zh.A,qc),Zh.A&&Zh.A.locals&&Zh.A.locals;var Qh=un(225),Jc={};Jc.styleTagTransform=ds(),Jc.setAttributes=cs(),Jc.insert=ls().bind(null,"head"),Jc.domAPI=as(),Jc.insertStyleElement=us(),ss()(Qh.A,Jc),Qh.A&&Qh.A.locals&&Qh.A.locals;function d8(c){let{label:t,value:n,onChange:e,placeholder:s="","data-test-id":r,type:o="text"}=c;return Ge.createElement("div",{className:"CodoxInput__wrapper"},Ge.createElement("label",{className:"CodoxInput__label"},t),Ge.createElement("input",{type:o,className:"CodoxInput__input",placeholder:s,value:n,onChange:i=>{e(i.target.value)},"data-test-id":r}))}function EO(c,t){var n=Object.keys(c);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(c);t&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(c,s).enumerable})),n.push.apply(n,e)}return n}function eg(c){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EO(Object(n),!0).forEach(function(e){f8(c,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(n)):EO(Object(n)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(n,e))})}return c}function f8(c,t,n){return(t=p8(t))in c?Object.defineProperty(c,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[t]=n,c}function p8(c){var t=h8(c,"string");return typeof t=="symbol"?t:t+""}function h8(c,t){if(typeof c!="object"||!c)return c;var n=c[Symbol.toPrimitive];if(n!==void 0){var e=n.call(c,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(c)}let $d=!1;const g8=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],zd=214,OO=150;function m8(c){let{color:t,onChange:n}=c;const[e,s]=(0,Ge.useState)(Vc("hex",t)),[r,o]=(0,Ge.useState)(t),i=(0,Ge.useRef)(null),u=(0,Ge.useMemo)(()=>({x:e.hsv.s/100*zd,y:(100-e.hsv.v)/100*OO}),[e.hsv.s,e.hsv.v]),a=(0,Ge.useMemo)(()=>({x:e.hsv.h/360*zd}),[e.hsv]);return(0,Ge.useEffect)(()=>{i.current!==null&&n&&o(e.hex)},[e,n]),(0,Ge.useEffect)(()=>{if(t===void 0)return;const f=Vc("hex",t);s(f),o(f.hex)},[t]),Ge.createElement("div",{className:"codox-color-picker-wrapper",style:{width:zd},ref:i},Ge.createElement(d8,{label:"Hex",onChange:f=>{if(o(f),/^#[0-9A-Fa-f]{6}$/i.test(f)){const l=Vc("hex",f);s(l)}},value:r}),Ge.createElement("div",{className:"codox-color-picker-basic-color"},g8.map(f=>Ge.createElement("button",{className:f===e.hex?" active":"",key:f,style:{backgroundColor:f},onClick:()=>(l=>{o(l);let d=Vc("hex",l);s(d),n(d.hex,$d)})(f)}))),Ge.createElement(TO,{className:"codox-color-picker-saturation",style:{backgroundColor:`hsl(${e.hsv.h}, 100%, 50%)`},onChange:f=>{let{x:l,y:d}=f;const p=Vc("hsv",eg(eg({},e.hsv),{},{s:l/zd*100,v:100-d/OO*100}));s(p),o(p.hex),n(p.hex,$d)}},Ge.createElement("div",{className:"codox-color-picker-saturation_cursor",style:{backgroundColor:e.hex,left:u.x,top:u.y}})),Ge.createElement(TO,{className:"codox-color-picker-hue",onChange:f=>{let{x:l}=f;const d=Vc("hsv",eg(eg({},e.hsv),{},{h:l/zd*360}));s(d),o(d.hex),n(d.hex,$d)}},Ge.createElement("div",{className:"codox-color-picker-hue_cursor",style:{backgroundColor:`hsl(${e.hsv.h}, 100%, 50%)`,left:a.x}})),Ge.createElement("div",{className:"codox-color-picker-color",style:{backgroundColor:e.hex}}))}function TO(c){let{className:t,style:n,onChange:e,children:s}=c;const r=(0,Ge.useRef)(null),o=(0,Ge.useRef)(!1),i=u=>{if(r.current){const{current:a}=r,{width:f,height:l,left:d,top:p}=a.getBoundingClientRect(),h=NO(u.clientX-d,f,0),m=NO(u.clientY-p,l,0);e({x:h,y:m})}};return Ge.createElement("div",{ref:r,className:t,style:n,onMouseDown:u=>{if(u.button!==0)return;i(u);const a=l=>{o.current=!0,$d=!0,i(l)},f=l=>{o.current&&($d=!1),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",f,!1),i(l),o.current=!1};document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",f,!1)}},s)}function NO(c,t,n){return c>t?t:c<n?n:c}function kO(c){if(!c.startsWith("#")){const t=document.createElement("canvas").getContext("2d");if(!t)throw new Error("2d context not supported or canvas already initialized");return t.fillStyle=c,t.fillStyle}return c.length===4||c.length===5?c=c.split("").map((t,n)=>n?t+t:"#").join(""):c.length===7||c.length===9?c:"#000000"}function AO(c){const t=(c.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(n,e,s,r)=>"#"+e+e+s+s+r+r).substring(1).match(/.{2}/g)||[]).map(n=>parseInt(n,16));return{b:t[2],g:t[1],r:t[0]}}function jb(c){let{r:t,g:n,b:e}=c;t/=255,n/=255,e/=255;const s=Math.max(t,n,e),r=s-Math.min(t,n,e);return{h:r?60*(s===t?(n-e)/r+(n<e?6:0):s===n?2+(e-t)/r:4+(t-n)/r):0,s:s?r/s*100:0,v:100*s}}function y8(c){let{h:t,s:n,v:e}=c;n/=100,e/=100;const s=~~(t/60),r=t/60-s,o=e*(1-n),i=e*(1-n*r),u=e*(1-n*(1-r)),a=s%6,f=Math.round(255*[e,i,o,o,u,e][a]),l=Math.round(255*[u,e,e,i,o,o][a]);return{b:Math.round(255*[o,o,u,e,e,i][a]),g:l,r:f}}function PO(c){let{b:t,g:n,r:e}=c;return"#"+[e,n,t].map(s=>s.toString(16).padStart(2,"0")).join("")}function Vc(c,t){let n=kO("#121212"),e=AO(n),s=jb(e);return c==="hex"?(n=kO(t),e=AO(n),s=jb(e)):c==="rgb"?(e=t,n=PO(e),s=jb(e)):c==="hsv"&&(s=t,e=y8(s),n=PO(e)),{hex:n,hsv:s,rgb:e}}const b8=Ge.createContext(null),MO=4;function v8(c){let{children:t,dropDownRef:n,onClose:e,dropdownClassName:s}=c;const[r,o]=(0,Ge.useState)(),[i,u]=(0,Ge.useState)(),a=(0,Ge.useCallback)(l=>{o(d=>d?[...d,l]:[l])},[o]),f=(0,Ge.useMemo)(()=>({registerItem:a}),[a]);return(0,Ge.useEffect)(()=>{r&&!i&&u(r[0]),i&&i.current&&i.current.focus()},[r,i]),Ge.createElement(b8.Provider,{value:f},Ge.createElement("div",{className:s,ref:n,onKeyDown:l=>{if(!r)return;const d=l.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(d)&&l.preventDefault(),d==="Escape"||d==="Tab"?e():d==="ArrowUp"?u(p=>{if(!p)return r[0];const h=r.indexOf(p)-1;return r[h===-1?r.length-1:h]}):d==="ArrowDown"&&u(p=>p?r[r.indexOf(p)+1]:r[0])}},t))}function _8(c){let{disabled:t=!1,buttonLabel:n,buttonAriaLabel:e,buttonClassName:s,buttonIconClassName:r,children:o,stopCloseOnClickSelf:i,dropdownClassName:u,buttonLabelClassName:a,dropdownChevronClassName:f}=c;const l=(0,Ge.useRef)(null),d=(0,Ge.useRef)(null),[p,h]=(0,Ge.useState)(!1);return(0,Ge.useEffect)(()=>{const m=d.current,g=l.current;if(p&&m!==null&&g!==null){const{top:y,left:b}=m.getBoundingClientRect();g.style.top=`${y+m.offsetHeight+MO}px`,g.style.left=`${Math.min(b,window.innerWidth-g.offsetWidth-20)}px`}},[l,d,p]),(0,Ge.useEffect)(()=>{const m=d.current;if(m!==null&&p){const g=y=>{const b=y.target;i&&l.current&&l.current.contains(b)||m.contains(b)||h(!1)};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}}},[l,d,p,i]),(0,Ge.useEffect)(()=>{const m=()=>{if(p){const g=d.current,y=l.current;if(g!==null&&y!==null){const{top:b}=g.getBoundingClientRect(),v=b+g.offsetHeight+MO;v!==y.getBoundingClientRect().top&&(y.style.top=`${v}px`)}}};return document.addEventListener("scroll",m),()=>{document.removeEventListener("scroll",m)}},[d,l,p]),Ge.createElement(Ge.Fragment,null,Ge.createElement("button",{type:"button",disabled:t,"aria-label":e||n,className:s,onClick:()=>h(!p),ref:d},r&&Ge.createElement("span",{className:r}),n&&Ge.createElement("span",{className:a},n),Ge.createElement("i",{className:f})),p&&(0,$c.createPortal)(Ge.createElement(v8,{dropDownRef:l,onClose:()=>{h(!1),d&&d.current&&d.current.focus()},dropdownClassName:u},o),document.body))}const x8=["disabled","stopCloseOnClickSelf","color","onChange"];function Db(){return Db=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)({}).hasOwnProperty.call(n,e)&&(c[e]=n[e])}return c},Db.apply(null,arguments)}function w8(c,t){if(c==null)return{};var n,e,s=S8(c,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(c);for(e=0;e<r.length;e++)n=r[e],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(c,n)&&(s[n]=c[n])}return s}function S8(c,t){if(c==null)return{};var n={};for(var e in c)if({}.hasOwnProperty.call(c,e)){if(t.indexOf(e)>=0)continue;n[e]=c[e]}return n}function IO(c){let{disabled:t=!1,stopCloseOnClickSelf:n=!0,color:e,onChange:s}=c,r=w8(c,x8);return Ge.createElement(_8,Db({},r,{disabled:t,stopCloseOnClickSelf:n}),Ge.createElement(m8,{color:e,onChange:s}))}const C8=c=>{let{onColorChange:t,buttonClassName:n,buttonIconClassName:e,buttonAriaLabel:s,buttonLabel:r,dropdownClassName:o,buttonLabelClassName:i,dropdownChevronClassName:u}=c;const[a]=(0,da.useLexicalComposerContext)(),[f,l]=(0,Ge.useState)(()=>a.isEditable()),[d,p]=(0,Ge.useState)("");(0,Ge.useEffect)(()=>(0,Pc.mergeRegister)(a.registerEditableListener(m=>{l(m)}),a.registerUpdateListener(m=>{let{editorState:g}=m;g.read(()=>{const y=(0,bt.$getSelection)();if((0,bt.$isRangeSelection)(y)){let b=(0,il.$getSelectionStyleValueForProperty)(y,"color");b!==d&&(p(b||""),t(b))}})})),[a]);const h=(0,Ge.useCallback)((m,g)=>{a.update(()=>{const y=(0,bt.$getSelection)();y!==null&&(0,il.$patchStyleText)(y,{color:m})})},[a]);return Ge.createElement(IO,{disabled:!f,color:d,onChange:h,buttonClassName:n||"",buttonIconClassName:e||"",buttonAriaLabel:s||"",buttonLabel:r||"",dropdownClassName:o||"",buttonLabelClassName:i||"",dropdownChevronClassName:u||""})},E8=C8,O8=c=>{let{onColorChange:t,buttonClassName:n,buttonIconClassName:e,buttonAriaLabel:s,buttonLabel:r,dropdownClassName:o,buttonLabelClassName:i,dropdownChevronClassName:u}=c;const[a]=(0,da.useLexicalComposerContext)(),[f,l]=(0,Ge.useState)(()=>a.isEditable()),[d,p]=(0,Ge.useState)("#fff");(0,Ge.useEffect)(()=>(0,Pc.mergeRegister)(a.registerEditableListener(m=>{l(m)}),a.registerUpdateListener(m=>{let{editorState:g}=m;g.read(()=>{const y=(0,bt.$getSelection)();if((0,bt.$isRangeSelection)(y)){let b=(0,il.$getSelectionStyleValueForProperty)(y,"background-color");b!==d&&(p(b||""),t(b))}})})),[a]);const h=(0,Ge.useCallback)((m,g)=>{a.update(()=>{const y=(0,bt.$getSelection)();y!==null&&(0,il.$patchStyleText)(y,{"background-color":m})})},[a]);return Ge.createElement(IO,{disabled:!f,color:d,onChange:h,buttonClassName:n||"",buttonIconClassName:e||"",buttonAriaLabel:s||"",buttonLabel:r||"",dropdownClassName:o||"",buttonLabelClassName:i||"",dropdownChevronClassName:u||""})},T8=O8;var N8=aa.yy;aa._U,aa.a8,aa.Vs,aa.Cn;var k8=aa.gK,A8=aa.vv;const P8={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},M8="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDE1IDE1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMDAwMDEgOC4zMzMzM0wxLjkwMDAxIDEzLjhMMS4xMDAwMSAxMy4yTDUuMzc1MDEgNy41TDEuMTAwMDEgMS44TDEuOTAwMDEgMS4yTDYuMDAwMDEgNi42NjY2N0wxMC4xIDEuMkwxMC45IDEuOEw2LjYyNTAxIDcuNUwxMC45IDEzLjJMMTAuMSAxMy44TDYuMDAwMDEgOC4zMzMzM1pNMTIgMTIuNUMxMiAxMS42NzE2IDEyLjY3MTYgMTEgMTMuNSAxMUgxMy43OTI5QzE0LjQ1OTYgMTEgMTUgMTEuNTQwNCAxNSAxMi4yMDcxQzE1IDEyLjUyNzMgMTQuODcyOCAxMi44MzQzIDE0LjY0NjUgMTMuMDYwN0wxMy43MDcxIDE0SDE1VjE1SDEyLjVDMTIuMjk3OCAxNSAxMi4xMTU1IDE0Ljg3ODIgMTIuMDM4MSAxNC42OTEzQzExLjk2MDcgMTQuNTA0NSAxMi4wMDM1IDE0LjI4OTQgMTIuMTQ2NSAxNC4xNDY0TDEzLjkzOTMgMTIuMzUzNkMxMy45NzgyIDEyLjMxNDcgMTQgMTIuMjYyIDE0IDEyLjIwNzFDMTQgMTIuMDkyNyAxMy45MDczIDEyIDEzLjc5MjkgMTJIMTMuNUMxMy4yMjM5IDEyIDEzIDEyLjIyMzkgMTMgMTIuNUgxMloiIGZpbGw9IiMwMDAwMDAiLz4KPC9zdmc+",I8="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",R8="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik00IDEySDIwTTEyIDRWMjAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4NCjwvc3ZnPg==",j8="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik02IDEyTDE4IDEyIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8L3N2Zz4=",ll=8,cl=72,D8=15;function L8({selectionFontSize:c,disabled:t,editor:n}){const[e,s]=gn.useState(c),[r,o]=gn.useState(!1),i=(p,h)=>{if(!h)return p;let m=p;switch(h){case 2:switch(!0){case p>cl:m=cl;break;case p>=48:m-=12;break;case p>=24:m-=4;break;case p>=14:m-=2;break;case p>=9:m-=1;break;default:m=ll;break}break;case 1:switch(!0){case p<ll:m=ll;break;case p<12:m+=1;break;case p<20:m+=2;break;case p<36:m+=4;break;case p<=60:m+=12;break;default:m=cl;break}break}return m},u=gn.useCallback((p,h)=>{const m=g=>(g||(g=`${D8}px`),g=g.slice(0,-2),`${i(Number(g),h)}px`);n.update(()=>{if(n.isEditable()){const g=st();g!==null&&YS(g,{"font-size":p||m})}})},[n]),a=p=>{const h=Number(e);if(p.key!=="Tab"){if(["e","E","+","-"].includes(p.key)||isNaN(h)){p.preventDefault(),s("");return}o(!0),(p.key==="Enter"||p.key==="Escape")&&(p.preventDefault(),d(h))}},f=()=>{if(e!==""&&r){const p=Number(e);d(p)}},l=p=>{if(e!==""){const h=i(Number(e),p);u(String(h)+"px",null)}else u(null,p)},d=p=>{let h=p;p>cl?h=cl:p<ll&&(h=ll),s(String(h)),u(String(h)+"px",null),o(!1)};return gn.useEffect(()=>{s(c)},[c]),mn.jsxs(mn.Fragment,{children:[mn.jsx("button",{type:"button",disabled:t||c!==""&&Number(e)<=ll,onClick:()=>l(2),className:"toolbar-item font-decrement",children:mn.jsx("img",{src:j8,height:16,width:16,style:{marginTop:"5px"}})}),mn.jsx("input",{type:"number",value:e,disabled:t,className:"toolbar-item font-size-input",min:ll,max:cl,onChange:p=>s(p.target.value),onKeyDown:a,onBlur:f}),mn.jsx("button",{type:"button",disabled:t||c!==""&&Number(e)>=cl,onClick:()=>l(1),className:"toolbar-item font-increment",children:mn.jsx("img",{src:R8,height:16,width:16,style:{marginTop:"5px"}})})]})}const Lb=1;function Bb(){return mn.jsx("div",{className:"divider"})}function B8(){const[c]=pr(),t=St.useRef(null),[n,e]=St.useState(!1),[s,r]=St.useState(!1),[o,i]=St.useState(!1),[u,a]=St.useState(!1),[f,l]=St.useState(!1),[d,p]=St.useState(!1),[h,m]=St.useState(!1),[g,y]=St.useState(!1),[b,v]=St.useState("11px"),[_,w]=St.useState(()=>c.isEditable()),x=St.useCallback(()=>{const S=st();at(S)&&(i(S.hasFormat("bold")),a(S.hasFormat("italic")),l(S.hasFormat("underline")),p(S.hasFormat("strikethrough")),m(S.hasFormat("subscript")),y(S.hasFormat("superscript")),v(GS(S,"font-size","11px")))},[]);return St.useEffect(()=>Xr(c.registerUpdateListener(({editorState:S})=>{S.read(()=>{x()})}),c.registerCommand(ai,(S,E)=>(x(),!1),Lb),c.registerCommand(Ti,S=>(e(S),!1),Lb),c.registerCommand(Oi,S=>(r(S),!1),Lb)),[c,x]),mn.jsxs("div",{className:"toolbar",ref:t,children:[mn.jsx("button",{disabled:!n,onClick:()=>{c.dispatchCommand(rh,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:mn.jsx("i",{className:"format undo"})}),mn.jsx("button",{disabled:!s,onClick:()=>{c.dispatchCommand(Qp,void 0)},className:"toolbar-item","aria-label":"Redo",children:mn.jsx("i",{className:"format redo"})}),mn.jsx(Bb,{}),mn.jsx(L8,{selectionFontSize:b.slice(0,-2),editor:c,disabled:!_}),mn.jsx(Bb,{}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"bold")},className:"toolbar-item spaced "+(o?"active":""),"aria-label":"Format Bold",children:mn.jsx("i",{className:"format bold"})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"italic")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Italics",children:mn.jsx("i",{className:"format italic"})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"underline")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Underline",children:mn.jsx("i",{className:"format underline"})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:mn.jsx("i",{className:"format strikethrough"})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"superscript")},className:"toolbar-item spaced "+(g?"active":""),"aria-label":"Format SuperScript",children:mn.jsx("img",{src:I8,height:16,width:16,style:{marginTop:"1px"}})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(Ni,"subscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format SubScript",children:mn.jsx("img",{src:M8,height:16,width:16,style:{marginTop:"1px"}})}),mn.jsx(Bb,{}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:mn.jsx("i",{className:"format left-align"})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:mn.jsx("i",{className:"format center-align"})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:mn.jsx("i",{className:"format right-align"})}),mn.jsx("button",{onClick:()=>{c.dispatchCommand(ea,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:mn.jsx("i",{className:"format justify-align"})})," "]})}var Fb={exports:{}},On=String,RO=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On,blackBright:On,redBright:On,greenBright:On,yellowBright:On,blueBright:On,magentaBright:On,cyanBright:On,whiteBright:On,bgBlackBright:On,bgRedBright:On,bgGreenBright:On,bgYellowBright:On,bgBlueBright:On,bgMagentaBright:On,bgCyanBright:On,bgWhiteBright:On}};Fb.exports=RO(),Fb.exports.createColors=RO;var F8=Fb.exports;const pi=CN(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let jO=F8,DO=pi,$b=class vN extends Error{constructor(t,n,e,s,r,o){super(t),this.name="CssSyntaxError",this.reason=t,r&&(this.file=r),s&&(this.source=s),o&&(this.plugin=o),typeof n<"u"&&typeof e<"u"&&(typeof n=="number"?(this.line=n,this.column=e):(this.line=n.line,this.column=n.column,this.endLine=e.line,this.endColumn=e.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,vN)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=jO.isColorSupported);let e=f=>f,s=f=>f,r=f=>f;if(t){let{bold:f,gray:l,red:d}=jO.createColors(!0);s=p=>f(d(p)),e=p=>l(p),DO&&(r=p=>DO(p))}let o=n.split(/\r?\n/),i=Math.max(this.line-3,0),u=Math.min(this.line+2,o.length),a=String(u).length;return o.slice(i,u).map((f,l)=>{let d=i+1+l,p=" "+(" "+d).slice(-a)+" | ";if(d===this.line){if(f.length>160){let m=20,g=Math.max(0,this.column-m),y=Math.max(this.column+m,this.endColumn+m),b=f.slice(g,y),v=e(p.replace(/\d/g," "))+f.slice(0,Math.min(this.column-1,m-1)).replace(/[^\t]/g," ");return s(">")+e(p)+r(b)+`
|
|
1447
1447
|
`+v+s("^")}let h=e(p.replace(/\d/g," "))+f.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+e(p)+r(f)+`
|
|
1448
1448
|
`+h+s("^")}return" "+e(p)+r(f)}).join(`
|
|
1449
1449
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
1450
1450
|
|
|
1451
1451
|
`+t+`
|
|
1452
|
-
`),this.name+": "+this.message+t}};var
|
|
1452
|
+
`),this.name+": "+this.message+t}};var zb=$b;$b.default=$b;const LO={after:`
|
|
1453
1453
|
`,beforeClose:`
|
|
1454
1454
|
`,beforeComment:`
|
|
1455
1455
|
`,beforeDecl:`
|
|
1456
1456
|
`,beforeOpen:" ",beforeRule:`
|
|
1457
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
1458
|
-
`)){let o=this.raw(t,null,"indent");if(o.length)for(let i=0;i<r;i++)e+=o}return e}block(t,n){let e=this.raw(t,"between","beforeOpen");this.builder(n+e+"{",t,"start");let s;t.nodes&&t.nodes.length?(this.body(t),s=this.raw(t,"after")):s=this.raw(t,"after","emptyBody"),s&&this.builder(s),this.builder("}",t,"end")}body(t){let n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let e=this.raw(t,"semicolon");for(let s=0;s<t.nodes.length;s++){let r=t.nodes[s],o=this.raw(r,"before");o&&this.builder(o),this.stringify(r,n!==s||e)}}comment(t){let n=this.raw(t,"left","commentLeft"),e=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+e+"*/",t)}decl(t,n){let e=this.raw(t,"between","colon"),s=t.prop+e+this.rawValue(t,"value");t.important&&(s+=t.raws.important||" !important"),n&&(s+=";"),this.builder(s,t)}document(t){this.body(t)}raw(t,n,e){let s;if(e||(e=n),n&&(s=t.raws[n],typeof s<"u"))return s;let r=t.parent;if(e==="before"&&(!r||r.type==="root"&&r.first===t||r&&r.type==="document"))return"";if(!r)return
|
|
1457
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function $8(c){return c[0].toUpperCase()+c.slice(1)}let Ub=class{constructor(t){this.builder=t}atrule(t,n){let e="@"+t.name,s=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?e+=t.raws.afterName:s&&(e+=" "),t.nodes)this.block(t,e+s);else{let r=(t.raws.between||"")+(n?";":"");this.builder(e+s+r,t)}}beforeAfter(t,n){let e;t.type==="decl"?e=this.raw(t,null,"beforeDecl"):t.type==="comment"?e=this.raw(t,null,"beforeComment"):n==="before"?e=this.raw(t,null,"beforeRule"):e=this.raw(t,null,"beforeClose");let s=t.parent,r=0;for(;s&&s.type!=="root";)r+=1,s=s.parent;if(e.includes(`
|
|
1458
|
+
`)){let o=this.raw(t,null,"indent");if(o.length)for(let i=0;i<r;i++)e+=o}return e}block(t,n){let e=this.raw(t,"between","beforeOpen");this.builder(n+e+"{",t,"start");let s;t.nodes&&t.nodes.length?(this.body(t),s=this.raw(t,"after")):s=this.raw(t,"after","emptyBody"),s&&this.builder(s),this.builder("}",t,"end")}body(t){let n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let e=this.raw(t,"semicolon");for(let s=0;s<t.nodes.length;s++){let r=t.nodes[s],o=this.raw(r,"before");o&&this.builder(o),this.stringify(r,n!==s||e)}}comment(t){let n=this.raw(t,"left","commentLeft"),e=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+e+"*/",t)}decl(t,n){let e=this.raw(t,"between","colon"),s=t.prop+e+this.rawValue(t,"value");t.important&&(s+=t.raws.important||" !important"),n&&(s+=";"),this.builder(s,t)}document(t){this.body(t)}raw(t,n,e){let s;if(e||(e=n),n&&(s=t.raws[n],typeof s<"u"))return s;let r=t.parent;if(e==="before"&&(!r||r.type==="root"&&r.first===t||r&&r.type==="document"))return"";if(!r)return LO[e];let o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[e]<"u")return o.rawCache[e];if(e==="before"||e==="after")return this.beforeAfter(t,e);{let i="raw"+$8(e);this[i]?s=this[i](o,t):o.walk(u=>{if(s=u.raws[n],typeof s<"u")return!1})}return typeof s>"u"&&(s=LO[e]),o.rawCache[e]=s,s}rawBeforeClose(t){let n;return t.walk(e=>{if(e.nodes&&e.nodes.length>0&&typeof e.raws.after<"u")return n=e.raws.after,n.includes(`
|
|
1459
1459
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let e;return t.walkComments(s=>{if(typeof s.raws.before<"u")return e=s.raws.before,e.includes(`
|
|
1460
1460
|
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),typeof e>"u"?e=this.raw(n,null,"beforeDecl"):e&&(e=e.replace(/\S/g,"")),e}rawBeforeDecl(t,n){let e;return t.walkDecls(s=>{if(typeof s.raws.before<"u")return e=s.raws.before,e.includes(`
|
|
1461
1461
|
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),typeof e>"u"?e=this.raw(n,null,"beforeRule"):e&&(e=e.replace(/\S/g,"")),e}rawBeforeOpen(t){let n;return t.walk(e=>{if(e.type!=="decl"&&(n=e.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&typeof e.raws.before<"u")return n=e.raws.before,n.includes(`
|
|
1462
1462
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(e=>{if(typeof e.raws.between<"u")return n=e.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(e=>{if(e.nodes&&e.nodes.length===0&&(n=e.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(e=>{let s=e.parent;if(s&&s!==t&&s.parent&&s.parent===t&&typeof e.raws.before<"u"){let r=e.raws.before.split(`
|
|
1463
|
-
`);return n=r[r.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type==="decl"&&(n=e.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let e=t[n],s=t.raws[n];return s&&s.value===e?s.raw:e}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};var
|
|
1464
|
-
`?(s=1,r+=1):s+=1;return{column:s,line:r}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let n={column:this.source.start.column,line:this.source.start.line},e=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let s=this.toString(),r=s.indexOf(t.word);r!==-1&&(n=this.positionInside(r,s),e=this.positionInside(r+t.word.length,s))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?e={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?e=this.positionInside(t.endIndex):t.index&&(e=this.positionInside(t.index+1));return(e.line<n.line||e.line===n.line&&e.column<=n.column)&&(e={column:n.column+1,line:n.line}),{end:e,start:n}}raw(t,n){return new K8().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,e=!1;for(let s of t)s===this?e=!0:e?(this.parent.insertAfter(n,s),n=s):this.parent.insertBefore(n,s);e||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let e={},s=n==null;n=n||new Map;let r=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let i=this[o];if(Array.isArray(i))e[o]=i.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,n):u);else if(typeof i=="object"&&i.toJSON)e[o]=i.toJSON(null,n);else if(o==="source"){let u=n.get(i.input);u==null&&(u=r,n.set(i.input,r),r++),e[o]={end:i.end,inputId:u,start:i.start}}else e[o]=i}return s&&(e.inputs=[...n.keys()].map(o=>o.toJSON())),e}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=W8){t.stringify&&(t=t.stringify);let n="";return t(this,e=>{n+=e}),n}warn(t,n,e){let s={node:this};for(let r in e)s[r]=e[r];return t.warn(n,s)}get proxyOf(){return this}};var ng=qb;qb.default=qb;let J8=ng,Jb=class extends J8{constructor(t){super(t),this.type="comment"}};var rg=Jb;Jb.default=Jb;let V8=ng,Vb=class extends V8{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var og=Vb;Vb.default=Vb;let $O=rg,zO=og,G8=ng,{isClean:UO,my:HO}=Ud,Gb,KO,WO,Yb;function qO(c){return c.map(t=>(t.nodes&&(t.nodes=qO(t.nodes)),delete t.source,t))}function JO(c){if(c[UO]=!1,c.proxyOf.nodes)for(let t of c.proxyOf.nodes)JO(t)}let hs=class xN extends G8{append(...t){for(let n of t){let e=this.normalize(n,this.last);for(let s of e)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),e,s;for(;this.indexes[n]<this.proxyOf.nodes.length&&(e=this.indexes[n],s=t(this.proxyOf.nodes[e],e),s!==!1);)this.indexes[n]+=1;return delete this.indexes[n],s}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...e)=>t[n](...e.map(s=>typeof s=="function"?(r,o)=>s(r.toProxy(),o):s)):n==="every"||n==="some"?e=>t[n]((s,...r)=>e(s.toProxy(),...r)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(e=>e.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,e){return t[n]===e||(t[n]=e,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let e=this.index(t),s=this.normalize(n,this.proxyOf.nodes[e]).reverse();e=this.index(t);for(let o of s)this.proxyOf.nodes.splice(e+1,0,o);let r;for(let o in this.indexes)r=this.indexes[o],e<r&&(this.indexes[o]=r+s.length);return this.markDirty(),this}insertBefore(t,n){let e=this.index(t),s=e===0?"prepend":!1,r=this.normalize(n,this.proxyOf.nodes[e],s).reverse();e=this.index(t);for(let i of r)this.proxyOf.nodes.splice(e,0,i);let o;for(let i in this.indexes)o=this.indexes[i],e<=o&&(this.indexes[i]=o+r.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=qO(KO(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let s of t)s.parent&&s.parent.removeChild(s,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let s of t)s.parent&&s.parent.removeChild(s,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new zO(t)]}else if(t.selector||t.selectors)t=[new Yb(t)];else if(t.name)t=[new Gb(t)];else if(t.text)t=[new $O(t)];else throw new Error("Unknown node type in node creation");return t.map(s=>(s[HO]||xN.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[UO]&&JO(s),s.raws||(s.raws={}),typeof s.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(s.raws.before=n.raws.before.replace(/\S/g,"")),s.parent=this.proxyOf,s))}prepend(...t){t=t.reverse();for(let n of t){let e=this.normalize(n,this.first,"prepend").reverse();for(let s of e)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+e.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let e in this.indexes)n=this.indexes[e],n>=t&&(this.indexes[e]=n-1);return this.markDirty(),this}replaceValues(t,n,e){return e||(e=n,n={}),this.walkDecls(s=>{n.props&&!n.props.includes(s.prop)||n.fast&&!s.value.includes(n.fast)||(s.value=s.value.replace(t,e))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,e)=>{let s;try{s=t(n,e)}catch(r){throw n.addToError(r)}return s!==!1&&n.walk&&(s=n.walk(t)),s})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((e,s)=>{if(e.type==="atrule"&&t.test(e.name))return n(e,s)}):this.walk((e,s)=>{if(e.type==="atrule"&&e.name===t)return n(e,s)}):(n=t,this.walk((e,s)=>{if(e.type==="atrule")return n(e,s)}))}walkComments(t){return this.walk((n,e)=>{if(n.type==="comment")return t(n,e)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((e,s)=>{if(e.type==="decl"&&t.test(e.prop))return n(e,s)}):this.walk((e,s)=>{if(e.type==="decl"&&e.prop===t)return n(e,s)}):(n=t,this.walk((e,s)=>{if(e.type==="decl")return n(e,s)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((e,s)=>{if(e.type==="rule"&&t.test(e.selector))return n(e,s)}):this.walk((e,s)=>{if(e.type==="rule"&&e.selector===t)return n(e,s)}):(n=t,this.walk((e,s)=>{if(e.type==="rule")return n(e,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};hs.registerParse=c=>{KO=c},hs.registerRule=c=>{Yb=c},hs.registerAtRule=c=>{Gb=c},hs.registerRoot=c=>{WO=c};var ul=hs;hs.default=hs,hs.rebuild=c=>{c.type==="atrule"?Object.setPrototypeOf(c,Gb.prototype):c.type==="rule"?Object.setPrototypeOf(c,Yb.prototype):c.type==="decl"?Object.setPrototypeOf(c,zO.prototype):c.type==="comment"?Object.setPrototypeOf(c,$O.prototype):c.type==="root"&&Object.setPrototypeOf(c,WO.prototype),c[HO]=!0,c.nodes&&c.nodes.forEach(t=>{hs.rebuild(t)})};let VO=ul,ig=class extends VO{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Xb=ig;ig.default=ig,VO.registerAtRule(ig);let Y8=ul,GO,YO,Kd=class extends Y8{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new GO(new YO,this,t).stringify()}};Kd.registerLazyResult=c=>{GO=c},Kd.registerProcessor=c=>{YO=c};var Zb=Kd;Kd.default=Kd;let X8="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Z8={nanoid:(c=21)=>{let t="",n=c;for(;n--;)t+=X8[Math.random()*64|0];return t},customAlphabet:(c,t=21)=>(n=t)=>{let e="",s=n;for(;s--;)e+=c[Math.random()*c.length|0];return e}};let{existsSync:Q8,readFileSync:eB}=pi,{dirname:Qb,join:tB}=pi,{SourceMapConsumer:XO,SourceMapGenerator:ZO}=pi;function nB(c){return Buffer?Buffer.from(c,"base64").toString():window.atob(c)}let ev=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let e=n.map?n.map.prev:void 0,s=this.loadMap(n.from,e);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Qb(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new XO(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,e=/^data:application\/json;base64,/,s=/^data:application\/json;charset=utf-?8,/,r=/^data:application\/json,/,o=t.match(s)||t.match(r);if(o)return decodeURIComponent(t.substr(o[0].length));let i=t.match(n)||t.match(e);if(i)return nB(t.substr(i[0].length));let u=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/g);if(!n)return;let e=t.lastIndexOf(n.pop()),s=t.indexOf("*/",e);e>-1&&s>-1&&(this.annotation=this.getAnnotationURL(t.substring(e,s)))}loadFile(t){if(this.root=Qb(t),Q8(t))return this.mapFile=t,eB(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let e=n(t);if(e){let s=this.loadFile(e);if(!s)throw new Error("Unable to load previous source map: "+e.toString());return s}}else{if(n instanceof XO)return ZO.fromSourceMap(n).toString();if(n instanceof ZO)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=tB(Qb(t),e)),this.loadFile(e)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var QO=ev;ev.default=ev;let{nanoid:rB}=Z8,{isAbsolute:tv,resolve:nv}=pi,{SourceMapConsumer:oB,SourceMapGenerator:iB}=pi,{fileURLToPath:e2,pathToFileURL:sg}=pi,t2=Ub,sB=QO,rv=pi,ov=Symbol("fromOffsetCache"),aB=!!(oB&&iB),n2=!!(nv&&tv),ag=class{constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!n2||/^\w+:\/\//.test(n.from)||tv(n.from)?this.file=n.from:this.file=nv(n.from)),n2&&aB){let e=new sB(this.css,n);if(e.text){this.map=e;let s=e.consumer().file;!this.file&&s&&(this.file=this.mapResolve(s))}}this.file||(this.id="<input css "+rB(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,e,s={}){let r,o,i;if(n&&typeof n=="object"){let a=n,f=e;if(typeof a.offset=="number"){let l=this.fromOffset(a.offset);n=l.line,e=l.col}else n=a.line,e=a.column;if(typeof f.offset=="number"){let l=this.fromOffset(f.offset);o=l.line,r=l.col}else o=f.line,r=f.column}else if(!e){let a=this.fromOffset(n);n=a.line,e=a.col}let u=this.origin(n,e,o,r);return u?i=new t2(t,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,s.plugin):i=new t2(t,o===void 0?n:{column:e,line:n},o===void 0?e:{column:r,line:o},this.css,this.file,s.plugin),i.input={column:e,endColumn:r,endLine:o,line:n,source:this.css},this.file&&(sg&&(i.input.url=sg(this.file).toString()),i.input.file=this.file),i}fromOffset(t){let n,e;if(this[ov])e=this[ov];else{let r=this.css.split(`
|
|
1465
|
-
`);e=new Array(r.length);let o=0;for(let i=0,u=r.length;i<u;i++)e[i]=o,o+=r[i].length+1;this[
|
|
1466
|
-
`," "];return qd.split(c,t)},split(c,t,n){let e=[],s="",r=!1,o=0,i=!1,u="",a=!1;for(let f of c)a?a=!1:f==="\\"?a=!0:i?f===u&&(i=!1):f==='"'||f==="'"?(i=!0,u=f):f==="("?o+=1:f===")"?o>0&&(o-=1):o===0&&t.includes(f)&&(r=!0),r?(s!==""&&e.push(s.trim()),s="",r=!1):s+=f;return(n||s!=="")&&e.push(s.trim()),e}};var
|
|
1463
|
+
`);return n=r[r.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type==="decl"&&(n=e.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let e=t[n],s=t.raws[n];return s&&s.value===e?s.raw:e}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};var BO=Ub;Ub.default=Ub;let z8=BO;function Hb(c,t){new z8(t).stringify(c)}var tg=Hb;Hb.default=Hb;var Ud={};Ud.isClean=Symbol("isClean"),Ud.my=Symbol("my");let U8=zb,H8=BO,K8=tg,{isClean:Hd,my:W8}=Ud;function Kb(c,t){let n=new c.constructor;for(let e in c){if(!Object.prototype.hasOwnProperty.call(c,e)||e==="proxyCache")continue;let s=c[e],r=typeof s;e==="parent"&&r==="object"?t&&(n[e]=t):e==="source"?n[e]=s:Array.isArray(s)?n[e]=s.map(o=>Kb(o,n)):(r==="object"&&s!==null&&(s=Kb(s)),n[e]=s)}return n}let Wb=class{constructor(t={}){this.raws={},this[Hd]=!1,this[W8]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let e of t[n])typeof e.clone=="function"?this.append(e.clone()):this.append(e)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=Kb(this);for(let e in t)n[e]=t[e];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:e,start:s}=this.rangeBy(n);return this.source.input.error(t,{column:s.column,line:s.line},{column:e.column,line:e.line},n)}return new U8(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,e){return t[n]===e||(t[n]=e,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[Hd]=!0}markDirty(){if(this[Hd]){this[Hd]=!1;let t=this;for(;t=t.parent;)t[Hd]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let e=this.source.start;if(t.index)e=this.positionInside(t.index,n);else if(t.word){n=this.toString();let s=n.indexOf(t.word);s!==-1&&(e=this.positionInside(s,n))}return e}positionInside(t,n){let e=n||this.toString(),s=this.source.start.column,r=this.source.start.line;for(let o=0;o<t;o++)e[o]===`
|
|
1464
|
+
`?(s=1,r+=1):s+=1;return{column:s,line:r}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let n={column:this.source.start.column,line:this.source.start.line},e=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let s=this.toString(),r=s.indexOf(t.word);r!==-1&&(n=this.positionInside(r,s),e=this.positionInside(r+t.word.length,s))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?e={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?e=this.positionInside(t.endIndex):t.index&&(e=this.positionInside(t.index+1));return(e.line<n.line||e.line===n.line&&e.column<=n.column)&&(e={column:n.column+1,line:n.line}),{end:e,start:n}}raw(t,n){return new H8().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,e=!1;for(let s of t)s===this?e=!0:e?(this.parent.insertAfter(n,s),n=s):this.parent.insertBefore(n,s);e||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let e={},s=n==null;n=n||new Map;let r=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let i=this[o];if(Array.isArray(i))e[o]=i.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,n):u);else if(typeof i=="object"&&i.toJSON)e[o]=i.toJSON(null,n);else if(o==="source"){let u=n.get(i.input);u==null&&(u=r,n.set(i.input,r),r++),e[o]={end:i.end,inputId:u,start:i.start}}else e[o]=i}return s&&(e.inputs=[...n.keys()].map(o=>o.toJSON())),e}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=K8){t.stringify&&(t=t.stringify);let n="";return t(this,e=>{n+=e}),n}warn(t,n,e){let s={node:this};for(let r in e)s[r]=e[r];return t.warn(n,s)}get proxyOf(){return this}};var ng=Wb;Wb.default=Wb;let q8=ng,qb=class extends q8{constructor(t){super(t),this.type="comment"}};var rg=qb;qb.default=qb;let J8=ng,Jb=class extends J8{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var og=Jb;Jb.default=Jb;let FO=rg,$O=og,V8=ng,{isClean:zO,my:UO}=Ud,Vb,HO,KO,Gb;function WO(c){return c.map(t=>(t.nodes&&(t.nodes=WO(t.nodes)),delete t.source,t))}function qO(c){if(c[zO]=!1,c.proxyOf.nodes)for(let t of c.proxyOf.nodes)qO(t)}let hs=class _N extends V8{append(...t){for(let n of t){let e=this.normalize(n,this.last);for(let s of e)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),e,s;for(;this.indexes[n]<this.proxyOf.nodes.length&&(e=this.indexes[n],s=t(this.proxyOf.nodes[e],e),s!==!1);)this.indexes[n]+=1;return delete this.indexes[n],s}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...e)=>t[n](...e.map(s=>typeof s=="function"?(r,o)=>s(r.toProxy(),o):s)):n==="every"||n==="some"?e=>t[n]((s,...r)=>e(s.toProxy(),...r)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(e=>e.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,e){return t[n]===e||(t[n]=e,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let e=this.index(t),s=this.normalize(n,this.proxyOf.nodes[e]).reverse();e=this.index(t);for(let o of s)this.proxyOf.nodes.splice(e+1,0,o);let r;for(let o in this.indexes)r=this.indexes[o],e<r&&(this.indexes[o]=r+s.length);return this.markDirty(),this}insertBefore(t,n){let e=this.index(t),s=e===0?"prepend":!1,r=this.normalize(n,this.proxyOf.nodes[e],s).reverse();e=this.index(t);for(let i of r)this.proxyOf.nodes.splice(e,0,i);let o;for(let i in this.indexes)o=this.indexes[i],e<=o&&(this.indexes[i]=o+r.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=WO(HO(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let s of t)s.parent&&s.parent.removeChild(s,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let s of t)s.parent&&s.parent.removeChild(s,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new $O(t)]}else if(t.selector||t.selectors)t=[new Gb(t)];else if(t.name)t=[new Vb(t)];else if(t.text)t=[new FO(t)];else throw new Error("Unknown node type in node creation");return t.map(s=>(s[UO]||_N.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[zO]&&qO(s),s.raws||(s.raws={}),typeof s.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(s.raws.before=n.raws.before.replace(/\S/g,"")),s.parent=this.proxyOf,s))}prepend(...t){t=t.reverse();for(let n of t){let e=this.normalize(n,this.first,"prepend").reverse();for(let s of e)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+e.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let e in this.indexes)n=this.indexes[e],n>=t&&(this.indexes[e]=n-1);return this.markDirty(),this}replaceValues(t,n,e){return e||(e=n,n={}),this.walkDecls(s=>{n.props&&!n.props.includes(s.prop)||n.fast&&!s.value.includes(n.fast)||(s.value=s.value.replace(t,e))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,e)=>{let s;try{s=t(n,e)}catch(r){throw n.addToError(r)}return s!==!1&&n.walk&&(s=n.walk(t)),s})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((e,s)=>{if(e.type==="atrule"&&t.test(e.name))return n(e,s)}):this.walk((e,s)=>{if(e.type==="atrule"&&e.name===t)return n(e,s)}):(n=t,this.walk((e,s)=>{if(e.type==="atrule")return n(e,s)}))}walkComments(t){return this.walk((n,e)=>{if(n.type==="comment")return t(n,e)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((e,s)=>{if(e.type==="decl"&&t.test(e.prop))return n(e,s)}):this.walk((e,s)=>{if(e.type==="decl"&&e.prop===t)return n(e,s)}):(n=t,this.walk((e,s)=>{if(e.type==="decl")return n(e,s)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((e,s)=>{if(e.type==="rule"&&t.test(e.selector))return n(e,s)}):this.walk((e,s)=>{if(e.type==="rule"&&e.selector===t)return n(e,s)}):(n=t,this.walk((e,s)=>{if(e.type==="rule")return n(e,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};hs.registerParse=c=>{HO=c},hs.registerRule=c=>{Gb=c},hs.registerAtRule=c=>{Vb=c},hs.registerRoot=c=>{KO=c};var ul=hs;hs.default=hs,hs.rebuild=c=>{c.type==="atrule"?Object.setPrototypeOf(c,Vb.prototype):c.type==="rule"?Object.setPrototypeOf(c,Gb.prototype):c.type==="decl"?Object.setPrototypeOf(c,$O.prototype):c.type==="comment"?Object.setPrototypeOf(c,FO.prototype):c.type==="root"&&Object.setPrototypeOf(c,KO.prototype),c[UO]=!0,c.nodes&&c.nodes.forEach(t=>{hs.rebuild(t)})};let JO=ul,ig=class extends JO{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Yb=ig;ig.default=ig,JO.registerAtRule(ig);let G8=ul,VO,GO,Kd=class extends G8{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new VO(new GO,this,t).stringify()}};Kd.registerLazyResult=c=>{VO=c},Kd.registerProcessor=c=>{GO=c};var Xb=Kd;Kd.default=Kd;let Y8="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var X8={nanoid:(c=21)=>{let t="",n=c;for(;n--;)t+=Y8[Math.random()*64|0];return t},customAlphabet:(c,t=21)=>(n=t)=>{let e="",s=n;for(;s--;)e+=c[Math.random()*c.length|0];return e}};let{existsSync:Z8,readFileSync:Q8}=pi,{dirname:Zb,join:eB}=pi,{SourceMapConsumer:YO,SourceMapGenerator:XO}=pi;function tB(c){return Buffer?Buffer.from(c,"base64").toString():window.atob(c)}let Qb=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let e=n.map?n.map.prev:void 0,s=this.loadMap(n.from,e);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Zb(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new YO(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,e=/^data:application\/json;base64,/,s=/^data:application\/json;charset=utf-?8,/,r=/^data:application\/json,/,o=t.match(s)||t.match(r);if(o)return decodeURIComponent(t.substr(o[0].length));let i=t.match(n)||t.match(e);if(i)return tB(t.substr(i[0].length));let u=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/g);if(!n)return;let e=t.lastIndexOf(n.pop()),s=t.indexOf("*/",e);e>-1&&s>-1&&(this.annotation=this.getAnnotationURL(t.substring(e,s)))}loadFile(t){if(this.root=Zb(t),Z8(t))return this.mapFile=t,Q8(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let e=n(t);if(e){let s=this.loadFile(e);if(!s)throw new Error("Unable to load previous source map: "+e.toString());return s}}else{if(n instanceof YO)return XO.fromSourceMap(n).toString();if(n instanceof XO)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=eB(Zb(t),e)),this.loadFile(e)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ZO=Qb;Qb.default=Qb;let{nanoid:nB}=X8,{isAbsolute:ev,resolve:tv}=pi,{SourceMapConsumer:rB,SourceMapGenerator:oB}=pi,{fileURLToPath:QO,pathToFileURL:sg}=pi,e2=zb,iB=ZO,nv=pi,rv=Symbol("fromOffsetCache"),sB=!!(rB&&oB),t2=!!(tv&&ev),ag=class{constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!t2||/^\w+:\/\//.test(n.from)||ev(n.from)?this.file=n.from:this.file=tv(n.from)),t2&&sB){let e=new iB(this.css,n);if(e.text){this.map=e;let s=e.consumer().file;!this.file&&s&&(this.file=this.mapResolve(s))}}this.file||(this.id="<input css "+nB(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,e,s={}){let r,o,i;if(n&&typeof n=="object"){let a=n,f=e;if(typeof a.offset=="number"){let l=this.fromOffset(a.offset);n=l.line,e=l.col}else n=a.line,e=a.column;if(typeof f.offset=="number"){let l=this.fromOffset(f.offset);o=l.line,r=l.col}else o=f.line,r=f.column}else if(!e){let a=this.fromOffset(n);n=a.line,e=a.col}let u=this.origin(n,e,o,r);return u?i=new e2(t,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,s.plugin):i=new e2(t,o===void 0?n:{column:e,line:n},o===void 0?e:{column:r,line:o},this.css,this.file,s.plugin),i.input={column:e,endColumn:r,endLine:o,line:n,source:this.css},this.file&&(sg&&(i.input.url=sg(this.file).toString()),i.input.file=this.file),i}fromOffset(t){let n,e;if(this[rv])e=this[rv];else{let r=this.css.split(`
|
|
1465
|
+
`);e=new Array(r.length);let o=0;for(let i=0,u=r.length;i<u;i++)e[i]=o,o+=r[i].length+1;this[rv]=e}n=e[e.length-1];let s=0;if(t>=n)s=e.length-1;else{let r=e.length-2,o;for(;s<r;)if(o=s+(r-s>>1),t<e[o])r=o-1;else if(t>=e[o+1])s=o+1;else{s=o;break}}return{col:t-e[s]+1,line:s+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:tv(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,e,s){if(!this.map)return!1;let r=this.map.consumer(),o=r.originalPositionFor({column:n,line:t});if(!o.source)return!1;let i;typeof e=="number"&&(i=r.originalPositionFor({column:s,line:e}));let u;ev(o.source)?u=sg(o.source):u=new URL(o.source,this.map.consumer().sourceRoot||sg(this.map.mapFile));let a={column:o.column,endColumn:i&&i.column,endLine:i&&i.line,line:o.line,url:u.toString()};if(u.protocol==="file:")if(QO)a.file=QO(u);else throw new Error("file: protocol is not available in this PostCSS build");let f=r.sourceContentFor(o.source);return f&&(a.source=f),a}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}};var lg=ag;ag.default=ag,nv&&nv.registerInput&&nv.registerInput(ag);let n2=ul,r2,o2,Gc=class extends n2{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,e){let s=super.normalize(t);if(n){if(e==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let r of s)r.raws.before=n.raws.before}return s}removeChild(t,n){let e=this.index(t);return!n&&e===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[e].raws.before),super.removeChild(t)}toResult(t={}){return new r2(new o2,this,t).stringify()}};Gc.registerLazyResult=c=>{r2=c},Gc.registerProcessor=c=>{o2=c};var Wd=Gc;Gc.default=Gc,n2.registerRoot(Gc);let qd={comma(c){return qd.split(c,[","],!0)},space(c){let t=[" ",`
|
|
1466
|
+
`," "];return qd.split(c,t)},split(c,t,n){let e=[],s="",r=!1,o=0,i=!1,u="",a=!1;for(let f of c)a?a=!1:f==="\\"?a=!0:i?f===u&&(i=!1):f==='"'||f==="'"?(i=!0,u=f):f==="("?o+=1:f===")"?o>0&&(o-=1):o===0&&t.includes(f)&&(r=!0),r?(s!==""&&e.push(s.trim()),s="",r=!1):s+=f;return(n||s!=="")&&e.push(s.trim()),e}};var i2=qd;qd.default=qd;let s2=ul,aB=i2,cg=class extends s2{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return aB.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,e=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(e)}};var ov=cg;cg.default=cg,s2.registerRule(cg);let lB=Yb,cB=rg,uB=og,dB=lg,fB=ZO,pB=Wd,hB=ov;function Jd(c,t){if(Array.isArray(c))return c.map(s=>Jd(s));let{inputs:n,...e}=c;if(n){t=[];for(let s of n){let r={...s,__proto__:dB.prototype};r.map&&(r.map={...r.map,__proto__:fB.prototype}),t.push(r)}}if(e.nodes&&(e.nodes=c.nodes.map(s=>Jd(s,t))),e.source){let{inputId:s,...r}=e.source;e.source=r,s!=null&&(e.source.input=t[s])}if(e.type==="root")return new pB(e);if(e.type==="decl")return new uB(e);if(e.type==="rule")return new hB(e);if(e.type==="comment")return new cB(e);if(e.type==="atrule")return new lB(e);throw new Error("Unknown node type: "+c.type)}var gB=Jd;Jd.default=Jd;let{dirname:ug,relative:a2,resolve:l2,sep:c2}=pi,{SourceMapConsumer:u2,SourceMapGenerator:dg}=pi,{pathToFileURL:d2}=pi,mB=lg,yB=!!(u2&&dg),bB=!!(ug&&l2&&a2&&c2);var f2=class{constructor(t,n,e,s){this.stringify=t,this.mapOpts=e.map||{},this.root=n,this.opts=e,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
|
|
1467
1467
|
`;this.css.includes(`\r
|
|
1468
1468
|
`)&&(n=`\r
|
|
1469
|
-
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),e=t.root||ug(t.file),s;this.mapOpts.sourcesContent===!1?(s=new
|
|
1470
|
-
`),n=i.length-r):n+=i.length,u&&a!=="start"){let f=u.parent||{raws:{}};(!(u.type==="decl"||u.type==="atrule"&&!u.nodes)||u!==f.last||f.raws.semicolon)&&(u.source&&u.source.end?(s.source=this.sourcePath(u),s.original.line=u.source.end.line,s.original.column=u.source.end.column-1,s.generated.line=t,s.generated.column=n-2,this.map.addMapping(s)):(s.source=e,s.original.line=1,s.original.column=0,s.generated.line=t,s.generated.column=n-1,this.map.addMapping(s)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let e=this.opts.to?ug(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(e=ug(
|
|
1471
|
-
`.charCodeAt(0),Vd=" ".charCodeAt(0),hg="\f".charCodeAt(0),gg=" ".charCodeAt(0),mg="\r".charCodeAt(0),
|
|
1469
|
+
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),e=t.root||ug(t.file),s;this.mapOpts.sourcesContent===!1?(s=new u2(t.text),s.sourcesContent&&(s.sourcesContent=null)):s=t.consumer(),this.map.applySourceMap(s,n,this.toUrl(this.path(e)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),bB&&yB&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=dg.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new dg({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new dg({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,e="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""},r,o;this.stringify(this.root,(i,u,a)=>{if(this.css+=i,u&&a!=="end"&&(s.generated.line=t,s.generated.column=n-1,u.source&&u.source.start?(s.source=this.sourcePath(u),s.original.line=u.source.start.line,s.original.column=u.source.start.column-1,this.map.addMapping(s)):(s.source=e,s.original.line=1,s.original.column=0,this.map.addMapping(s))),o=i.match(/\n/g),o?(t+=o.length,r=i.lastIndexOf(`
|
|
1470
|
+
`),n=i.length-r):n+=i.length,u&&a!=="start"){let f=u.parent||{raws:{}};(!(u.type==="decl"||u.type==="atrule"&&!u.nodes)||u!==f.last||f.raws.semicolon)&&(u.source&&u.source.end?(s.source=this.sourcePath(u),s.original.line=u.source.end.line,s.original.column=u.source.end.column-1,s.generated.line=t,s.generated.column=n-2,this.map.addMapping(s)):(s.source=e,s.original.line=1,s.original.column=0,s.generated.line=t,s.generated.column=n-1,this.map.addMapping(s)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let e=this.opts.to?ug(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(e=ug(l2(e,this.mapOpts.annotation)));let s=a2(e,t);return this.memoizedPaths.set(t,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new mB(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let e=n.source.input.from;if(e&&!t[e]){t[e]=!0;let s=this.usesFileUrls?this.toFileUrl(e):this.toUrl(this.path(e));this.map.setSourceContent(s,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(d2){let e=d2(t).toString();return this.memoizedFileURLs.set(t,e),e}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;c2==="\\"&&(t=t.replace(/\\/g,"/"));let e=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,e),e}};const iv="'".charCodeAt(0),p2='"'.charCodeAt(0),fg="\\".charCodeAt(0),h2="/".charCodeAt(0),pg=`
|
|
1471
|
+
`.charCodeAt(0),Vd=" ".charCodeAt(0),hg="\f".charCodeAt(0),gg=" ".charCodeAt(0),mg="\r".charCodeAt(0),vB="[".charCodeAt(0),_B="]".charCodeAt(0),xB="(".charCodeAt(0),wB=")".charCodeAt(0),SB="{".charCodeAt(0),CB="}".charCodeAt(0),EB=";".charCodeAt(0),OB="*".charCodeAt(0),TB=":".charCodeAt(0),NB="@".charCodeAt(0),yg=/[\t\n\f\r "#'()/;[\\\]{}]/g,bg=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,kB=/.[\r\n"'(/\\]/,g2=/[\da-f]/i;var AB=function(t,n={}){let e=t.css.valueOf(),s=n.ignoreErrors,r,o,i,u,a,f,l,d,p,h,m=e.length,g=0,y=[],b=[];function v(){return g}function _(E){throw t.error("Unclosed "+E,g)}function w(){return b.length===0&&g>=m}function x(E){if(b.length)return b.pop();if(g>=m)return;let O=E?E.ignoreUnclosed:!1;switch(r=e.charCodeAt(g),r){case pg:case Vd:case gg:case mg:case hg:{u=g;do u+=1,r=e.charCodeAt(u);while(r===Vd||r===pg||r===gg||r===mg||r===hg);f=["space",e.slice(g,u)],g=u-1;break}case vB:case _B:case SB:case CB:case TB:case EB:case wB:{let j=String.fromCharCode(r);f=[j,j,g];break}case xB:{if(h=y.length?y.pop()[1]:"",p=e.charCodeAt(g+1),h==="url"&&p!==iv&&p!==p2&&p!==Vd&&p!==pg&&p!==gg&&p!==hg&&p!==mg){u=g;do{if(l=!1,u=e.indexOf(")",u+1),u===-1)if(s||O){u=g;break}else _("bracket");for(d=u;e.charCodeAt(d-1)===fg;)d-=1,l=!l}while(l);f=["brackets",e.slice(g,u+1),g,u],g=u}else u=e.indexOf(")",g+1),o=e.slice(g,u+1),u===-1||kB.test(o)?f=["(","(",g]:(f=["brackets",o,g,u],g=u);break}case iv:case p2:{a=r===iv?"'":'"',u=g;do{if(l=!1,u=e.indexOf(a,u+1),u===-1)if(s||O){u=g+1;break}else _("string");for(d=u;e.charCodeAt(d-1)===fg;)d-=1,l=!l}while(l);f=["string",e.slice(g,u+1),g,u],g=u;break}case NB:{yg.lastIndex=g+1,yg.test(e),yg.lastIndex===0?u=e.length-1:u=yg.lastIndex-2,f=["at-word",e.slice(g,u+1),g,u],g=u;break}case fg:{for(u=g,i=!0;e.charCodeAt(u+1)===fg;)u+=1,i=!i;if(r=e.charCodeAt(u+1),i&&r!==h2&&r!==Vd&&r!==pg&&r!==gg&&r!==mg&&r!==hg&&(u+=1,g2.test(e.charAt(u)))){for(;g2.test(e.charAt(u+1));)u+=1;e.charCodeAt(u+1)===Vd&&(u+=1)}f=["word",e.slice(g,u+1),g,u],g=u;break}default:{r===h2&&e.charCodeAt(g+1)===OB?(u=e.indexOf("*/",g+2)+1,u===0&&(s||O?u=e.length:_("comment")),f=["comment",e.slice(g,u+1),g,u],g=u):(bg.lastIndex=g+1,bg.test(e),bg.lastIndex===0?u=e.length-1:u=bg.lastIndex-2,f=["word",e.slice(g,u+1),g,u],y.push(f),g=u);break}}return g++,f}function S(E){b.push(E)}return{back:S,endOfFile:w,nextToken:x,position:v}};let PB=Yb,MB=rg,IB=og,RB=Wd,m2=ov,jB=AB;const y2={empty:!0,space:!0};function DB(c){for(let t=c.length-1;t>=0;t--){let n=c[t],e=n[3]||n[2];if(e)return e}}var LB=class{constructor(t){this.input=t,this.root=new RB,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new PB;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let e,s,r,o=!1,i=!1,u=[],a=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),e=t[0],e==="("||e==="["?a.push(e==="("?")":"]"):e==="{"&&a.length>0?a.push("}"):e===a[a.length-1]&&a.pop(),a.length===0)if(e===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(e==="{"){i=!0;break}else if(e==="}"){if(u.length>0){for(r=u.length-1,s=u[r];s&&s[0]==="space";)s=u[--r];s&&(n.source.end=this.getPosition(s[3]||s[2]),n.source.end.offset++)}this.end(t);break}else u.push(t);else u.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(u),u.length?(n.raws.afterName=this.spacesAndCommentsFromStart(u),this.raw(n,"params",u),o&&(t=u[u.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let e=0,s;for(let r=n-1;r>=0&&(s=t[r],!(s[0]!=="space"&&(e+=1,e===2)));r--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(t){let n=0,e,s,r;for(let[o,i]of t.entries()){if(s=i,r=s[0],r==="("&&(n+=1),r===")"&&(n-=1),n===0&&r===":")if(!e)this.doubleColon(s);else{if(e[0]==="word"&&e[1]==="progid")continue;return o}e=s}return!1}comment(t){let n=new MB;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let e=t[1].slice(2,-2);if(/^\s*$/.test(e))n.text="",n.raws.left=e,n.raws.right="";else{let s=e.match(/^(\s*)([^]*\S)(\s*)$/);n.text=s[2],n.raws.left=s[1],n.raws.right=s[3]}}createTokenizer(){this.tokenizer=jB(this.input)}decl(t,n){let e=new IB;this.init(e,t[0][2]);let s=t[t.length-1];for(s[0]===";"&&(this.semicolon=!0,t.pop()),e.source.end=this.getPosition(s[3]||s[2]||DB(t)),e.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),e.raws.before+=t.shift()[1];for(e.source.start=this.getPosition(t[0][2]),e.prop="";t.length;){let a=t[0][0];if(a===":"||a==="space"||a==="comment")break;e.prop+=t.shift()[1]}e.raws.between="";let r;for(;t.length;)if(r=t.shift(),r[0]===":"){e.raws.between+=r[1];break}else r[0]==="word"&&/\w/.test(r[1])&&this.unknownWord([r]),e.raws.between+=r[1];(e.prop[0]==="_"||e.prop[0]==="*")&&(e.raws.before+=e.prop[0],e.prop=e.prop.slice(1));let o=[],i;for(;t.length&&(i=t[0][0],!(i!=="space"&&i!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let a=t.length-1;a>=0;a--){if(r=t[a],r[1].toLowerCase()==="!important"){e.important=!0;let f=this.stringFrom(t,a);f=this.spacesFromEnd(t)+f,f!==" !important"&&(e.raws.important=f);break}else if(r[1].toLowerCase()==="important"){let f=t.slice(0),l="";for(let d=a;d>0;d--){let p=f[d][0];if(l.trim().startsWith("!")&&p!=="space")break;l=f.pop()[1]+l}l.trim().startsWith("!")&&(e.important=!0,e.raws.important=l,t=f)}if(r[0]!=="space"&&r[0]!=="comment")break}t.some(a=>a[0]!=="space"&&a[0]!=="comment")&&(e.raws.between+=o.map(a=>a[1]).join(""),o=[]),this.raw(e,"value",o.concat(t),n),e.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new m2;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,e=null,s=!1,r=null,o=[],i=t[1].startsWith("--"),u=[],a=t;for(;a;){if(e=a[0],u.push(a),e==="("||e==="[")r||(r=a),o.push(e==="("?")":"]");else if(i&&s&&e==="{")r||(r=a),o.push("}");else if(o.length===0)if(e===";")if(s){this.decl(u,i);return}else break;else if(e==="{"){this.rule(u);return}else if(e==="}"){this.tokenizer.back(u.pop()),n=!0;break}else e===":"&&(s=!0);else e===o[o.length-1]&&(o.pop(),o.length===0&&(r=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),o.length>0&&this.unclosedBracket(r),n&&s){if(!i)for(;u.length&&(a=u[u.length-1][0],!(a!=="space"&&a!=="comment"));)this.tokenizer.back(u.pop());this.decl(u,i)}else this.unknownWord(u)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,e,s){let r,o,i=e.length,u="",a=!0,f,l;for(let d=0;d<i;d+=1)r=e[d],o=r[0],o==="space"&&d===i-1&&!s?a=!1:o==="comment"?(l=e[d-1]?e[d-1][0]:"empty",f=e[d+1]?e[d+1][0]:"empty",!y2[l]&&!y2[f]?u.slice(-1)===","?a=!1:u+=r[1]:a=!1):u+=r[1];if(!a){let d=e.reduce((p,h)=>p+h[1],"");t.raws[n]={raw:d,value:u}}t[n]=u}rule(t){t.pop();let n=new m2;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,e="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)e=t.pop()[1]+e;return e}spacesAndCommentsFromStart(t){let n,e="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)e+=t.shift()[1];return e}spacesFromEnd(t){let n,e="";for(;t.length&&(n=t[t.length-1][0],n==="space");)e=t.pop()[1]+e;return e}stringFrom(t,n){let e="";for(let s=n;s<t.length;s++)e+=t[s][1];return t.splice(n,t.length-n),e}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};let BB=ul,FB=lg,$B=LB;function vg(c,t){let n=new FB(c,t),e=new $B(n);try{e.parse()}catch(s){throw process.env.NODE_ENV!=="production"&&s.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?s.message+=`
|
|
1472
1472
|
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?s.message+=`
|
|
1473
1473
|
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(s.message+=`
|
|
1474
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),s}return e.root}var av=vg;vg.default=vg,FB.registerParse(vg);let lv=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let e=n.node.rangeBy(n);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in n)this[e]=n[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var v2=lv;lv.default=lv;let UB=v2,cv=class{constructor(t,n,e){this.processor=t,this.messages=[],this.root=n,this.opts=e,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let e=new UB(t,n);return this.messages.push(e),e}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}};var uv=cv;cv.default=cv;let _2={};var x2=function(t){_2[t]||(_2[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let HB=ul,KB=Zb,WB=p2,qB=av,w2=uv,JB=Wd,VB=tg,{isClean:Ri,my:GB}=Ud,YB=x2;const XB={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ZB={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},QB={Once:!0,postcssPlugin:!0,prepare:!0},Yc=0;function Gd(c){return typeof c=="object"&&typeof c.then=="function"}function S2(c){let t=!1,n=XB[c.type];return c.type==="decl"?t=c.prop.toLowerCase():c.type==="atrule"&&(t=c.name.toLowerCase()),t&&c.append?[n,n+"-"+t,Yc,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:c.append?[n,Yc,n+"Exit"]:[n,n+"Exit"]}function C2(c){let t;return c.type==="document"?t=["Document",Yc,"DocumentExit"]:c.type==="root"?t=["Root",Yc,"RootExit"]:t=S2(c),{eventIndex:0,events:t,iterator:0,node:c,visitorIndex:0,visitors:[]}}function dv(c){return c[Ri]=!1,c.nodes&&c.nodes.forEach(t=>dv(t)),c}let fv={},Xc=class wN{constructor(t,n,e){this.stringified=!1,this.processed=!1;let s;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))s=dv(n);else if(n instanceof wN||n instanceof w2)s=dv(n.root),n.map&&(typeof e.map>"u"&&(e.map={}),e.map.inline||(e.map.inline=!1),e.map.prev=n.map);else{let r=qB;e.syntax&&(r=e.syntax.parse),e.parser&&(r=e.parser),r.parse&&(r=r.parse);try{s=r(n,e)}catch(o){this.processed=!0,this.error=o}s&&!s[GB]&&HB.rebuild(s)}this.result=new w2(t,s,e),this.helpers={...fv,postcss:fv,result:this.result},this.plugins=this.processor.plugins.map(r=>typeof r=="object"&&r.prepare?{...r,...r.prepare(this.result)}:r)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let e=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=e.postcssPlugin,t.setMessage();else if(e.postcssVersion&&process.env.NODE_ENV!=="production"){let s=e.postcssPlugin,r=e.postcssVersion,o=this.result.processor.version,i=r.split("."),u=o.split(".");(i[0]!==u[0]||parseInt(i[1])>parseInt(u[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+s+" uses "+r+". Perhaps this is the source of the error below.")}}catch(s){console&&console.error&&console.error(s)}return t}prepareVisitors(){this.listeners={};let t=(n,e,s)=>{this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push([n,s])};for(let n of this.plugins)if(typeof n=="object")for(let e in n){if(!ZB[e]&&/^[A-Z]/.test(e))throw new Error(`Unknown event ${e} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!QB[e])if(typeof n[e]=="object")for(let s in n[e])s==="*"?t(n,e,n[e][s]):t(n,e+"-"+s.toLowerCase(),n[e][s]);else typeof n[e]=="function"&&t(n,e,n[e])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],e=this.runOnRoot(n);if(Gd(e))try{await e}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ri];){t[Ri]=!0;let n=[C2(t)];for(;n.length>0;){let e=this.visitTick(n);if(Gd(e))try{await e}catch(s){let r=n[n.length-1].node;throw this.handleError(s,r)}}}if(this.listeners.OnceExit)for(let[n,e]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let s=t.nodes.map(r=>e(r,this.helpers));await Promise.all(s)}else await e(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(e=>t.Once(e,this.helpers));return Gd(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=VB;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let s=new WB(n,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(Gd(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ri];)t[Ri]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||YB("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[e,s]of t){this.result.lastPlugin=e;let r;try{r=s(n,this.helpers)}catch(o){throw this.handleError(o,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Gd(r))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:e,visitors:s}=n;if(e.type!=="root"&&e.type!=="document"&&!e.parent){t.pop();return}if(s.length>0&&n.visitorIndex<s.length){let[o,i]=s[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===s.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=o;try{return i(e.toProxy(),this.helpers)}catch(u){throw this.handleError(u,e)}}if(n.iterator!==0){let o=n.iterator,i;for(;i=e.nodes[e.indexes[o]];)if(e.indexes[o]+=1,!i[Ri]){i[Ri]=!0,t.push(C2(i));return}n.iterator=0,delete e.indexes[o]}let r=n.events;for(;n.eventIndex<r.length;){let o=r[n.eventIndex];if(n.eventIndex+=1,o===Yc){e.nodes&&e.nodes.length&&(e[Ri]=!0,n.iterator=e.getIterator());return}else if(this.listeners[o]){n.visitors=this.listeners[o];return}}t.pop()}walkSync(t){t[Ri]=!0;let n=S2(t);for(let e of n)if(e===Yc)t.nodes&&t.each(s=>{s[Ri]||this.walkSync(s)});else{let s=this.listeners[e];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Xc.registerPostcss=c=>{fv=c};var E2=Xc;Xc.default=Xc,JB.registerLazyResult(Xc),KB.registerLazyResult(Xc);let eF=p2,tF=av;const nF=uv;let rF=tg,oF=x2,pv=class{constructor(t,n,e){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=e,this._map=void 0;let s,r=rF;this.result=new nF(this._processor,s,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let i=new eF(r,s,this._opts,n);if(i.isMap()){let[u,a]=i.generate();u&&(this.result.css=u),a&&(this.result.map=a)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||oF("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=tF;try{t=n(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}};var iF=pv;pv.default=pv;let sF=Zb,aF=E2,lF=iF,cF=Wd,Yd=class{constructor(t=[]){this.version="8.4.47",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let e of t)if(e.postcss===!0?e=e():e.postcss&&(e=e.postcss),typeof e=="object"&&Array.isArray(e.plugins))n=n.concat(e.plugins);else if(typeof e=="object"&&e.postcssPlugin)n.push(e);else if(typeof e=="function")n.push(e);else if(typeof e=="object"&&(e.parse||e.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(e+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new lF(this,t,n):new aF(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var uF=Yd;Yd.default=Yd,cF.registerProcessor(Yd),sF.registerProcessor(Yd);let O2=Xb,T2=rg,dF=ul,fF=Ub,N2=og,k2=Zb,pF=mB,hF=lg,gF=E2,mF=s2,yF=ng,bF=av,hv=uF,vF=uv,A2=Wd,P2=iv,_F=tg,xF=v2;function Fn(...c){return c.length===1&&Array.isArray(c[0])&&(c=c[0]),new hv(c)}Fn.plugin=function(t,n){let e=!1;function s(...o){console&&console.warn&&!e&&(e=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
1474
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),s}return e.root}var sv=vg;vg.default=vg,BB.registerParse(vg);let av=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let e=n.node.rangeBy(n);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in n)this[e]=n[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var b2=av;av.default=av;let zB=b2,lv=class{constructor(t,n,e){this.processor=t,this.messages=[],this.root=n,this.opts=e,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let e=new zB(t,n);return this.messages.push(e),e}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}};var cv=lv;lv.default=lv;let v2={};var _2=function(t){v2[t]||(v2[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let UB=ul,HB=Xb,KB=f2,WB=sv,x2=cv,qB=Wd,JB=tg,{isClean:Ri,my:VB}=Ud,GB=_2;const YB={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},XB={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ZB={Once:!0,postcssPlugin:!0,prepare:!0},Yc=0;function Gd(c){return typeof c=="object"&&typeof c.then=="function"}function w2(c){let t=!1,n=YB[c.type];return c.type==="decl"?t=c.prop.toLowerCase():c.type==="atrule"&&(t=c.name.toLowerCase()),t&&c.append?[n,n+"-"+t,Yc,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:c.append?[n,Yc,n+"Exit"]:[n,n+"Exit"]}function S2(c){let t;return c.type==="document"?t=["Document",Yc,"DocumentExit"]:c.type==="root"?t=["Root",Yc,"RootExit"]:t=w2(c),{eventIndex:0,events:t,iterator:0,node:c,visitorIndex:0,visitors:[]}}function uv(c){return c[Ri]=!1,c.nodes&&c.nodes.forEach(t=>uv(t)),c}let dv={},Xc=class xN{constructor(t,n,e){this.stringified=!1,this.processed=!1;let s;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))s=uv(n);else if(n instanceof xN||n instanceof x2)s=uv(n.root),n.map&&(typeof e.map>"u"&&(e.map={}),e.map.inline||(e.map.inline=!1),e.map.prev=n.map);else{let r=WB;e.syntax&&(r=e.syntax.parse),e.parser&&(r=e.parser),r.parse&&(r=r.parse);try{s=r(n,e)}catch(o){this.processed=!0,this.error=o}s&&!s[VB]&&UB.rebuild(s)}this.result=new x2(t,s,e),this.helpers={...dv,postcss:dv,result:this.result},this.plugins=this.processor.plugins.map(r=>typeof r=="object"&&r.prepare?{...r,...r.prepare(this.result)}:r)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let e=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=e.postcssPlugin,t.setMessage();else if(e.postcssVersion&&process.env.NODE_ENV!=="production"){let s=e.postcssPlugin,r=e.postcssVersion,o=this.result.processor.version,i=r.split("."),u=o.split(".");(i[0]!==u[0]||parseInt(i[1])>parseInt(u[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+s+" uses "+r+". Perhaps this is the source of the error below.")}}catch(s){console&&console.error&&console.error(s)}return t}prepareVisitors(){this.listeners={};let t=(n,e,s)=>{this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push([n,s])};for(let n of this.plugins)if(typeof n=="object")for(let e in n){if(!XB[e]&&/^[A-Z]/.test(e))throw new Error(`Unknown event ${e} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ZB[e])if(typeof n[e]=="object")for(let s in n[e])s==="*"?t(n,e,n[e][s]):t(n,e+"-"+s.toLowerCase(),n[e][s]);else typeof n[e]=="function"&&t(n,e,n[e])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],e=this.runOnRoot(n);if(Gd(e))try{await e}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ri];){t[Ri]=!0;let n=[S2(t)];for(;n.length>0;){let e=this.visitTick(n);if(Gd(e))try{await e}catch(s){let r=n[n.length-1].node;throw this.handleError(s,r)}}}if(this.listeners.OnceExit)for(let[n,e]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let s=t.nodes.map(r=>e(r,this.helpers));await Promise.all(s)}else await e(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(e=>t.Once(e,this.helpers));return Gd(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=JB;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let s=new KB(n,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(Gd(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ri];)t[Ri]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||GB("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[e,s]of t){this.result.lastPlugin=e;let r;try{r=s(n,this.helpers)}catch(o){throw this.handleError(o,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Gd(r))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:e,visitors:s}=n;if(e.type!=="root"&&e.type!=="document"&&!e.parent){t.pop();return}if(s.length>0&&n.visitorIndex<s.length){let[o,i]=s[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===s.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=o;try{return i(e.toProxy(),this.helpers)}catch(u){throw this.handleError(u,e)}}if(n.iterator!==0){let o=n.iterator,i;for(;i=e.nodes[e.indexes[o]];)if(e.indexes[o]+=1,!i[Ri]){i[Ri]=!0,t.push(S2(i));return}n.iterator=0,delete e.indexes[o]}let r=n.events;for(;n.eventIndex<r.length;){let o=r[n.eventIndex];if(n.eventIndex+=1,o===Yc){e.nodes&&e.nodes.length&&(e[Ri]=!0,n.iterator=e.getIterator());return}else if(this.listeners[o]){n.visitors=this.listeners[o];return}}t.pop()}walkSync(t){t[Ri]=!0;let n=w2(t);for(let e of n)if(e===Yc)t.nodes&&t.each(s=>{s[Ri]||this.walkSync(s)});else{let s=this.listeners[e];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Xc.registerPostcss=c=>{dv=c};var C2=Xc;Xc.default=Xc,qB.registerLazyResult(Xc),HB.registerLazyResult(Xc);let QB=f2,eF=sv;const tF=cv;let nF=tg,rF=_2,fv=class{constructor(t,n,e){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=e,this._map=void 0;let s,r=nF;this.result=new tF(this._processor,s,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let i=new QB(r,s,this._opts,n);if(i.isMap()){let[u,a]=i.generate();u&&(this.result.css=u),a&&(this.result.map=a)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||rF("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=eF;try{t=n(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}};var oF=fv;fv.default=fv;let iF=Xb,sF=C2,aF=oF,lF=Wd,Yd=class{constructor(t=[]){this.version="8.4.47",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let e of t)if(e.postcss===!0?e=e():e.postcss&&(e=e.postcss),typeof e=="object"&&Array.isArray(e.plugins))n=n.concat(e.plugins);else if(typeof e=="object"&&e.postcssPlugin)n.push(e);else if(typeof e=="function")n.push(e);else if(typeof e=="object"&&(e.parse||e.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(e+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new aF(this,t,n):new sF(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var cF=Yd;Yd.default=Yd,lF.registerProcessor(Yd),iF.registerProcessor(Yd);let E2=Yb,O2=rg,uF=ul,dF=zb,T2=og,N2=Xb,fF=gB,pF=lg,hF=C2,gF=i2,mF=ng,yF=sv,pv=cF,bF=cv,k2=Wd,A2=ov,vF=tg,_F=b2;function Fn(...c){return c.length===1&&Array.isArray(c[0])&&(c=c[0]),new pv(c)}Fn.plugin=function(t,n){let e=!1;function s(...o){console&&console.warn&&!e&&(e=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
1475
1475
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
1476
|
-
https://www.w3ctech.com/topic/2226`));let i=n(...o);return i.postcssPlugin=t,i.postcssVersion=new
|
|
1476
|
+
https://www.w3ctech.com/topic/2226`));let i=n(...o);return i.postcssPlugin=t,i.postcssVersion=new pv().version,i}let r;return Object.defineProperty(s,"postcss",{get(){return r||(r=s()),r}}),s.process=function(o,i,u){return Fn([s(u)]).process(o,i)},s},Fn.stringify=vF,Fn.parse=yF,Fn.fromJSON=fF,Fn.list=gF,Fn.comment=c=>new O2(c),Fn.atRule=c=>new E2(c),Fn.decl=c=>new T2(c),Fn.rule=c=>new A2(c),Fn.root=c=>new k2(c),Fn.document=c=>new N2(c),Fn.CssSyntaxError=dF,Fn.Declaration=T2,Fn.Container=uF,Fn.Processor=pv,Fn.Document=N2,Fn.Comment=O2,Fn.Warning=_F,Fn.AtRule=E2,Fn.Result=bF,Fn.Input=pF,Fn.Rule=A2,Fn.Root=k2,Fn.Node=mF,hF.registerPostcss(Fn);var xF=Fn;Fn.default=Fn;const or=SN(xF);or.stringify,or.fromJSON,or.plugin,or.parse,or.list,or.document,or.comment,or.atRule,or.rule,or.decl,or.root,or.CssSyntaxError,or.Declaration,or.Container,or.Processor,or.Document,or.Comment,or.Warning,or.AtRule,or.Result,or.Input,or.Rule,or.Root,or.Node;const P2=k8([...[]]);function wF(){return mn.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}const SF={namespace:"React.js Demo",nodes:[],onError(c){throw c},theme:P8},CF=()=>mn.jsx(mn.Fragment,{children:"hello"});function EF({collabApiKey:c,spfList:t}){const[n,e]=St.useState(!1),[s,r]=St.useState("demo_docId_1"),[o,i]=St.useState({root:null}),u=St.useRef(),a={docId:s,apiKey:c,username:"demo_user",hooks:{contentChanged:({source:p,content:h})=>{console.log("[Lexical Demo][contentChanged hook] hook invoked by Codox: ",{source:p,content:h})},usersUpdate:p=>{console.log("[Lexical Demo][usersUpdate hook] hook invoked by Codox: ",p)}}},f=()=>{u.current&&u.current.start(a).then(()=>{console.log("[Lexical Demo][codox.start] success"),e(!0)}).catch(p=>console.log("[Lexical Demo][codox.start] error",p))},l=()=>{u.current&&u.current.stop(),e(!1)};let d={root:{children:[{children:[],direction:"ltr",format:"",indent:0,type:"paragraph",version:1,textFormat:0}],direction:"ltr",format:"",indent:0,type:"root",version:1}};return St.useEffect(()=>{(async()=>{if(!s)return;n&&l();let p=d;if(p)try{A8(p,P2),i(p)}catch(h){console.error("[APP] error: ",h)}})()},[s]),St.useEffect(()=>{console.log("inside lexical package spfList is ",t)},[t]),St.useEffect(()=>{o&&s&&!n&&f()},[o,s,n]),St.useMemo(()=>({editorState:o?JSON.stringify({root:o.root}):null,namespace:"Playground",nodes:P2,onError:p=>{throw p},theme:{}}),[o]),mn.jsx(PS,{initialConfig:SF,children:mn.jsxs("div",{className:"editor-container",children:[mn.jsx(B8,{}),mn.jsxs("div",{className:"editor-inner",children:[mn.jsx(Nj,{contentEditable:mn.jsx(IS,{className:"editor-input"}),placeholder:mn.jsx(wF,{}),ErrorBoundary:CF}),mn.jsx(N8,{ref:u}),mn.jsx(hC,{}),mn.jsx(MS,{})]})]})})}bo.Editor=EF,Object.defineProperty(bo,Symbol.toStringTag,{value:"Module"})});
|
|
1477
1477
|
//# sourceMappingURL=index.umd.js.map
|