@cuongtran001/kanna 1.112.2 → 1.112.3
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/client/assets/{BoardsPage-C4ENzt64.js → BoardsPage-C-XPAU3h.js} +1 -1
- package/dist/client/assets/{BoardsRoutePage-C5PTbi6Z.js → BoardsRoutePage-gPPjLYFJ.js} +1 -1
- package/dist/client/assets/{ChatPage-BHMfe4hl.js → ChatPage-BTvroV45.js} +4 -4
- package/dist/client/assets/{CronJobsPage-Bh091yEI.js → CronJobsPage-DWhHYDPy.js} +1 -1
- package/dist/client/assets/{FilePreviewSheet-C2s7k36v.js → FilePreviewSheet-DcMdV7hW.js} +1 -1
- package/dist/client/assets/{FlowSurface-jNQcFMOA.js → FlowSurface-DVqwtykb.js} +1 -1
- package/dist/client/assets/{GenUIBlock-hkkM4P_r.js → GenUIBlock-DAGKgmn9.js} +2 -2
- package/dist/client/assets/{InboundHandlerFields-CHcSqbMB.js → InboundHandlerFields-B-Oaf00T.js} +1 -1
- package/dist/client/assets/{InboxPage-BpqjwtXn.js → InboxPage-D974XFxa.js} +1 -1
- package/dist/client/assets/{LocalProjectsPage-lyxhfFS2.js → LocalProjectsPage-DoqYQOk_.js} +1 -1
- package/dist/client/assets/{PluginPage-CEmCB38q.js → PluginPage-DHzi5YJm.js} +1 -1
- package/dist/client/assets/{SettingsPage-BsQiWj_w.js → SettingsPage-CuZzlqsG.js} +1 -1
- package/dist/client/assets/{StackBoardsRoutePage-Dj88KTce.js → StackBoardsRoutePage-DeaUCg6R.js} +1 -1
- package/dist/client/assets/{ToolCallMessage-I5nT0rPg.js → ToolCallMessage-C7QI45cs.js} +1 -1
- package/dist/client/assets/{VChartSurface-DezqqT8Y.js → VChartSurface-RVaL5qrl.js} +1 -1
- package/dist/client/assets/{WebhooksPage-BCMse54G.js → WebhooksPage-heTo8A5m.js} +1 -1
- package/dist/client/assets/{WorkflowsPage-vWjQy33o.js → WorkflowsPage-YY8NQXiF.js} +1 -1
- package/dist/client/assets/{beacon-alias-DU-hx8ux.js → beacon-alias-CcevdUfB.js} +3 -3
- package/dist/client/assets/{contextWindow-D6tuokPX.js → contextWindow-BVVtk5Al.js} +1 -1
- package/dist/client/assets/{copyFeedbackStore-DHN0d0wY.js → copyFeedbackStore-B4X215_R.js} +1 -1
- package/dist/client/assets/{errors-W4jQ4RJU.js → errors-ewkwYZz5.js} +1 -1
- package/dist/client/assets/{inboxAutonomy-C7kYrLi-.js → inboxAutonomy-B8WAm9lN.js} +1 -1
- package/dist/client/assets/{index-DBSVTFCP.js → index-Bk7A56Tb.js} +18 -18
- package/dist/client/assets/{keybindings-CMDgT5Fr.js → keybindings-CqgNeQvJ.js} +1 -1
- package/dist/client/assets/{pendingActionsStore-BgvURrXK.js → pendingActionsStore-Bw87-8u6.js} +1 -1
- package/dist/client/assets/runDetached-Dt8QjzWN.js +1 -0
- package/dist/client/assets/{searchable-select-BdWimkUA.js → searchable-select-C5ZlaFYL.js} +1 -1
- package/dist/client/assets/{select-BzVGFhmQ.js → select-DNgFvwVk.js} +1 -1
- package/dist/client/assets/{settings-header-button-GQg0n1x9.js → settings-header-button-F_g1XSLK.js} +1 -1
- package/dist/client/assets/{textarea-DlZ4tGyx.js → textarea-DCKnXsZI.js} +1 -1
- package/dist/client/assets/{timer.adapter-DWVGc3wb.js → timer.adapter-t-ql2eaa.js} +1 -1
- package/dist/client/assets/{tools-CryRpKwA.js → tools-BFWoj5em.js} +1 -1
- package/dist/client/assets/{useAppGlobalState-BruhC_so.js → useAppGlobalState-Cs47JwWq.js} +1 -1
- package/dist/client/assets/{useProviderCatalog-Bi14KFxt.js → useProviderCatalog-DJqnDuQQ.js} +1 -1
- package/dist/client/index.html +15 -15
- package/package.json +1 -1
- package/src/server/agent.test.ts +1 -246
- package/src/server/claude-session-start.ts +1 -8
- package/src/server/claude-spawn-helpers.test.ts +0 -70
- package/src/server/claude-spawn-helpers.ts +0 -26
- package/src/server/kanna-mcp.test.ts +0 -30
- package/src/server/kanna-mcp.ts +0 -41
- package/src/server/permission-gate.test.ts +0 -30
- package/src/server/permission-gate.ts +0 -6
- package/dist/client/assets/runDetached-BkBQfi5b.js +0 -1
- package/src/server/kanna-mcp-tools/bash.adapter.ts +0 -53
- package/src/server/kanna-mcp-tools/bash.test.ts +0 -53
- package/src/server/kanna-mcp-tools/edit.adapter.ts +0 -47
- package/src/server/kanna-mcp-tools/edit.test.ts +0 -92
- package/src/server/kanna-mcp-tools/glob.adapter.ts +0 -35
- package/src/server/kanna-mcp-tools/glob.test.ts +0 -60
- package/src/server/kanna-mcp-tools/grep.adapter.ts +0 -71
- package/src/server/kanna-mcp-tools/grep.test.ts +0 -60
- package/src/server/kanna-mcp-tools/read.adapter.ts +0 -26
- package/src/server/kanna-mcp-tools/read.test.ts +0 -62
- package/src/server/kanna-mcp-tools/tool-callback-shim.ts +0 -64
- package/src/server/kanna-mcp-tools/walk-files.adapter.ts +0 -18
- package/src/server/kanna-mcp-tools/webfetch.test.ts +0 -81
- package/src/server/kanna-mcp-tools/webfetch.ts +0 -49
- package/src/server/kanna-mcp-tools/write.adapter.ts +0 -31
- package/src/server/kanna-mcp-tools/write.test.ts +0 -52
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GenUIBlock-
|
|
2
|
-
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{t}from"./react-BWPDF9mI.js";import{t as n}from"./jsx-runtime-BB9-612F.js";import{i as r,t as i}from"./utils-gw0dpHSZ.js";import{a,o,r as s}from"./copyFeedbackStore-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GenUIBlock-DAGKgmn9.js","assets/rolldown-runtime-BCiCTKAo.js","assets/react-BWPDF9mI.js","assets/jsx-runtime-BB9-612F.js","assets/utils-gw0dpHSZ.js","assets/code-xml-BjFagt-D.js","assets/select-DNgFvwVk.js","assets/react-dom-2r3XOwTS.js","assets/copyFeedbackStore-B4X215_R.js","assets/pendingActionsStore-Bw87-8u6.js","assets/log-8K5PdGJC.js","assets/errors-ewkwYZz5.js","assets/timer.adapter-t-ql2eaa.js","assets/focusOverlay-BNpERJzs.js","assets/dist-DQaZwNEz.js","assets/segmented-control-CthWIFFX.js","assets/index-Bk7A56Tb.js","assets/chunk-6KYCQHYJ-C0N1h4Su.js","assets/useAppGlobalState-Cs47JwWq.js","assets/contextWindow-BVVtk5Al.js","assets/useProviderCatalog-DJqnDuQQ.js","assets/input-Bkp2JE9C.js","assets/tool-call-types-CoEzmgyY.js","assets/core-types-BWpRMPSe.js","assets/types-tbL38EdO.js","assets/createScopedStore-BZ7oYp5V.js","assets/useTheme-Cb3XmN93.js","assets/dom.adapter-C26vNdMA.js","assets/pathUtils-BU6_uBbH.js","assets/sidebar-data-BV2p2vi6.js","assets/state-mark-p6veyUZZ.js","assets/storage.adapter-DafyA8In.js","assets/textarea-DCKnXsZI.js","assets/runDetached-Dt8QjzWN.js","assets/cronJobsStore-CkFW3wrj.js","assets/keybindings-CqgNeQvJ.js","assets/ToolCallMessage-C7QI45cs.js","assets/FilePreviewSheet-DcMdV7hW.js","assets/minus-C2PhdGp1.js","assets/plus-k8ypzgh4.js","assets/refresh-cw-BnSFXoQI.js","assets/triangle-alert-BlEPrBcS.js","assets/preload-helper-BLdHbfdN.js","assets/file-plus-corner-BfUy6cfa.js","assets/pencil-BnnPP0sI.js","assets/search-DaMiMFjO.js","assets/terminal-D7v6A2Rn.js","assets/formatDuration-BbWTR_M_.js","assets/tools-BFWoj5em.js","assets/index-B0_Z9Tv4.css","assets/info-DRKK3Ev3.js","assets/dist-Bk41vfIT.js","assets/dist-BkGNwYRA.js","assets/lib-BlOM_ItO.js","assets/engine-javascript-Dg4SYqUU.js","assets/dist-Bi13CDSi.js","assets/langs-Co02r6ba.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{t}from"./react-BWPDF9mI.js";import{t as n}from"./jsx-runtime-BB9-612F.js";import{i as r,t as i}from"./utils-gw0dpHSZ.js";import{a,o,r as s}from"./copyFeedbackStore-B4X215_R.js";import{d as c,l}from"./pendingActionsStore-Bw87-8u6.js";import{t as u}from"./log-8K5PdGJC.js";import{n as d,t as f}from"./createScopedStore-BZ7oYp5V.js";import{t as p}from"./preload-helper-BLdHbfdN.js";import{F as m,I as h,L as g,P as _,R as v,n as y,o as b}from"./useTheme-Cb3XmN93.js";import{t as x}from"./runDetached-Dt8QjzWN.js";import{t as ee}from"./dom.adapter-C26vNdMA.js";var te={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};te.node;var ne=r(te),re={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};re.node;var ie=r(re);function ae(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}async function oe(e){let t=await e.text();return t?JSON.parse(t):null}var se={async getJson(e,t={}){let n=await fetch(e,{method:`GET`,signal:t.signal,cache:t.cache,headers:{Accept:`application/json`,...t.headers}}),r=await oe(n);return{ok:n.ok,status:n.status,data:r,headers:ae(n.headers)}},async postJson(e,t,n={}){let r=await fetch(e,{method:`POST`,signal:n.signal,cache:n.cache,headers:{"Content-Type":`application/json`,Accept:`application/json`,...n.headers},body:JSON.stringify(t)}),i=await oe(r);return{ok:r.ok,status:r.status,data:i,headers:ae(r.headers)}},async postJsonBody(e,t,n={}){let r=await fetch(e,{method:`POST`,signal:n.signal,cache:n.cache,headers:{"Content-Type":`application/json`,Accept:`application/json`,...n.headers},body:JSON.stringify(t)}),i=await oe(r);return{ok:r.ok,status:r.status,data:i,headers:ae(r.headers)}},async head(e,t={}){let n=await fetch(e,{method:`HEAD`,signal:t.signal,headers:t.headers});return{ok:n.ok,status:n.status,headers:ae(n.headers)}},async del(e,t={}){let n=await fetch(e,{method:`DELETE`,signal:t.signal,headers:t.headers});return{ok:n.ok,status:n.status}},async streamBytes(e,t={}){let n=await fetch(e,{method:`GET`,signal:t.signal,headers:t.headers});return{body:n.body,ok:n.ok,status:n.status}}},ce=e(t(),1);function le(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function S(e,...t){throw le(e,...t)}function ue(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function de(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var fe=de();function pe(){return fe&&`documentMode`in document?document.documentMode:null}var me=pe();function he(e){return fe&&e.test(navigator.platform)}function ge(e){return fe&&e.test(navigator.userAgent)}var _e=he(/Mac|iPod|iPhone|iPad/),ve=ge(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function ye(){return!(!fe||!(`InputEvent`in window)||me)&&`getTargetRanges`in new window.InputEvent(`input`)}var be=ye();function xe(){return fe&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var Se=xe(),Ce=ge(/Android/),we=ge(/Version\/[\d.]+.*Safari/)&&!Ce,Te=ge(/^(?=.*Chrome).*/i),Ee=fe&&Ce&&Te,De=ge(/AppleWebKit\/[\d.]+/)&&_e&&!Te;function Oe(){return 2047}var ke=Oe(),Ae=we||Se||De?`\xA0`:``,je=`
|
|
3
3
|
|
|
4
4
|
`,Me=ve?`\xA0`:Ae,Ne={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Pe={directionless:1,unmergeable:2},Fe={center:2,end:6,justify:4,left:1,right:3,start:5};function Ie(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var Le=Ie(Fe),Re={normal:0,segmented:2,token:1},ze=Ie(Re),Be=Symbol.for(`@lexical/ctrlOrOtherKey`),Ve=`$config`;function He(e){return()=>{}}function C(e){return{type:e}}var Ue=C(`SELECTION_CHANGE_COMMAND`),We=C(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),Ge=C(`CLICK_COMMAND`),Ke=C(`BEFORE_INPUT_COMMAND`),qe=C(`INPUT_COMMAND`),Je=C(`COMPOSITION_START_COMMAND`),Ye=C(`COMPOSITION_END_COMMAND`),Xe=C(`DELETE_CHARACTER_COMMAND`),Ze=C(`INSERT_LINE_BREAK_COMMAND`),Qe=C(`INSERT_PARAGRAPH_COMMAND`),$e=C(`CONTROLLED_TEXT_INSERTION_COMMAND`),et=C(`PASTE_COMMAND`),tt=C(`REMOVE_TEXT_COMMAND`),nt=C(`DELETE_WORD_COMMAND`),rt=C(`DELETE_LINE_COMMAND`),it=C(`FORMAT_TEXT_COMMAND`),at=C(`SET_TEXT_FORMAT_COMMAND`),ot=C(`UNDO_COMMAND`),st=C(`REDO_COMMAND`),ct=C(`KEYDOWN_COMMAND`),lt=C(`KEY_ARROW_RIGHT_COMMAND`),ut=C(`MOVE_TO_END`),dt=C(`KEY_ARROW_LEFT_COMMAND`),ft=C(`MOVE_TO_START`),pt=C(`KEY_ARROW_UP_COMMAND`),mt=C(`KEY_ARROW_DOWN_COMMAND`),ht=C(`KEY_ENTER_COMMAND`),gt=C(`KEY_SPACE_COMMAND`),_t=C(`KEY_BACKSPACE_COMMAND`),vt=C(`KEY_ESCAPE_COMMAND`),yt=C(`KEY_DELETE_COMMAND`),bt=C(`KEY_TAB_COMMAND`),xt=C(`INSERT_TAB_COMMAND`),St=C(`INDENT_CONTENT_COMMAND`),Ct=C(`OUTDENT_CONTENT_COMMAND`),wt=C(`DROP_COMMAND`),Tt=C(`FORMAT_ELEMENT_COMMAND`),Et=C(`DRAGSTART_COMMAND`),Dt=C(`DRAGOVER_COMMAND`),Ot=C(`DRAGEND_COMMAND`),kt=C(`COPY_COMMAND`),At=C(`CUT_COMMAND`),jt=C(`SELECT_ALL_COMMAND`),Mt=C(`CLEAR_EDITOR_COMMAND`),Nt=C(`CLEAR_HISTORY_COMMAND`),Pt=C(`CAN_REDO_COMMAND`),Ft=C(`CAN_UNDO_COMMAND`),It=C(`FOCUS_COMMAND`),Lt=C(`BLUR_COMMAND`),Rt=C(`KEY_MODIFIER_COMMAND`);function zt(e,t){return{...t,[Be]:e}}var Bt=zt(`metaKey`,{ctrlKey:!_e,metaKey:_e}),Vt=zt(`altKey`,{altKey:_e,ctrlKey:!_e}),Ht=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function Ut(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var Wt=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||S(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of Ht){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))Ut(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?Ut(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&Ut(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of Ht)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function Gt(e){let t=new Wt;for(let n of e)t.add(n);return t}function Kt(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function qt(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Jt=qt(),Yt=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},Xt=null;function Zt(e,t=1e3){return e instanceof Qt?e.clone():e.size<t?new Map(e):new Qt().init(new Map(e),void 0,e.size)}var Qt=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===Xt?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===Xt?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==Xt&&n!==void 0||(this._size++,n===Xt&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,Xt),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==Xt&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===Xt||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},$t=!1;function en(e,t,...n){let r=$t,i;try{$t=e,i=t()}finally{$t=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||S(421),i}function tn(){return $t}function nn(e){let t=e.exportJSON($t),n=e.constructor;return t.type!==n.getType()&&S(130,n.name),k(e)&&!Array.isArray(t.children)&&S(59,n.name),t}function rn(){return H()._blockCursorElement}function an(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var on=De||Se||we;function sn(){let e=B().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function cn(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var ln=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&S(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&S(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&S(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=un(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=un(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function un(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var dn=class e extends ln{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;an(t);)e=t,t=t.nextSibling;cn(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===rn()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;an(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===rn()&&(t=t.previousSibling);return cn(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(sn(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(sn(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&an(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&on;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=B().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=B().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=rn(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=fn(t,n);i.push(r);let a=fn(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function fn(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&S(225),n.reverse()}var pn=!1,mn=0;function hn(){mn=performance.now()}function gn(e){return V(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function _n(e,t,n){let r=cs(Qo(n)),i=r&&_s(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&jo(t,s,a,o,!1)}function vn(e,t,n){if(K(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return io(t)&&n.isAttached()}function yn(e,t,n){for(let r=e;r&&!Gs(r);r=Wo(r)){let e=_o(r,t);if(e!==void 0){let t=F(e,n);if(t)return A(t)||!V(r)?void 0:[r,t]}}}function bn(e,t,n,r){pn=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-mn>100;try{Nl(e,()=>{let a=J()||function(e){return e.read(`latest`,()=>{let e=J();return e===null?null:e.clone()})}(e),o=new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=yn(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?N(m)&&m.isAttached()&&m.markDirty():i&&N(m)&&io(d)&&vn(a,d,m)&&_n(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=_o(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&V(t)&&t.hasAttribute(`data-lexical-slot`)||Gs(t)))){if(ve){let e=(V(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||cn(e)||gn(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||_o(n,e)||gn(n)||n.remove();n.takeRecords(),a!==null&&(l&&L(a),ve&&Ho(e)&&a.insertRawText(u))})}finally{pn=!1}}function xn(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&bn(e,i,r,t)}}function Sn(e){(function(e){Qo(e).addEventListener(`textInput`,hn,!0)})(e),e._observer=new MutationObserver((t,n)=>{bn(e,t,n)})}function Cn(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function wn(e,t){return Cn(e,t,e.defaultValue)}function Tn(e){return typeof e==`object`&&!!e}function En(e,t){let n=jn(e,t).getter;return Tn(n)&&n.getterTable!==void 0||S(405,t),An(n.getterTable)}function Dn(e,t){let n=jn(e,t).setter;return Tn(n)&&n.setterTable!==void 0||S(406,t),An(n.setterTable)}function On(e,t,n){let{meta:r}=jn(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return An(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:S(407,t,String(n))}function kn(e,t){let n=jn(e,t),{setter:r}=n;Tn(r)&&r.setterTable!==void 0||S(408,t);let i=String(n.defaultValue);return Bn(r.setterTable,i)||S(409,t,i),r.setterTable[i]}function An(e){return Object.assign(Object.create(null),e)}function jn(e,t){let n=e.get(t);return n===void 0&&S(410,t),n}function Mn(e,t,n,r,i){i!==void 0&&Nn.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&In(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var Nn=new WeakSet,Pn=new WeakSet;function Fn(e){return typeof e==`object`&&e&&Pn.add(e),e}function In(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!Pn.has(e)){Object.freeze(e);for(let t of Object.values(e))In(t)}}function Ln(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function Rn(e,t){return n=>t(n)||zn(e,n)}function zn(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return zn(e,t)?{parsed:e(t)}:void 0;let r=e(t);return wn(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function Bn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Vn(e=``){return Mn(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var Hn=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Un(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&Hn.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Mn(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function Wn(e=!1){return Mn(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function Gn(e,...t){let n=Fn(t.length===0?e[0]:t[0]),r=new Set(e);return Mn(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function Kn(e,t={}){let{defaultAsNull:n}=t;return Mn(t=>{if(t==null)return null;let r=e(t);return n&&wn(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,Ln(e),Rn(e,e=>e==null))}function qn(e,t={}){let{omitDefault:n}=t;return Mn(t=>{if(t===void 0)return;let r=e(t);return n&&wn(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,Ln(e),Rn(e,e=>e===void 0))}function Jn(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function Yn(e,t){let n=e=>typeof e==`string`&&Bn(t,e);return Mn(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||zn(e,t))}function Xn(e){return Mn(t=>{if(!Array.isArray(t))return[];let n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e(t[r]);return n},{item:e,kind:`array`},void 0,(t,n)=>{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!Cn(e,t[r],n[r]))return!1;return!0},e=>Array.isArray(e))}function Zn(e,t){return $n(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function Qn(e,t){return $n(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function $n(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var er=`latest`,tr=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||fr).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>Cn(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function nr(e,t){return new tr(e,t)}function rr(e,t,n=er){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function ir(e,t,n){let r;if(fl(),typeof n==`function`){let i=e.getLatest(),a=rr(i,t);if(r=ar(t,n(a)),t.isEqual(a,r))return i}else r=ar(t,n);let i=e.getWritable();return lr(i).updateFromKnown(t,r),i}function ar(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function or(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of Cc(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var sr=new Set([`__proto__`,`constructor`,`prototype`]),cr=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return dr(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(sr.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=dr(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if(sr.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function lr(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new cr(t,function(e){return e.__state?e.__state.sharedNodeState:qa(H(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function ur(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&lr(e).updateFromJSON(r),n}function dr(e){if(e)for(let t in e)return e}function fr(e){return e}function pr(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function mr(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function hr(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function gr(e){return!j(e)&&e.getTextContent!==O.prototype.getTextContent}var _r=Symbol.for(`@lexical/CachedTextSize`);function vr(e,t){return Mr.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=jr.get(r);if(i===void 0&&S(345,r),k(i)){let a=D.get(r);if(a!==void 0&&k(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=Nr.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&S(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else if(Yr(i).size>0)n+=i.getTextContentSize();else{let e=i[_r];e===void 0&&S(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:w})}function yr(e){k(e)||Yr(e).size>0||e[_r]===void 0&&(e[_r]=N(e)?e.__text.length:e.getTextContentSize())}var br=4,xr,w,Sr,T=``,E=null,Cr=null,wr=null;function Tr(){return{firstTextKey:wr,format:E,style:Cr}}function Er(e){e.firstTextKey!==null&&(E=e.format,Cr=e.style,wr=e.firstTextKey)}function Dr(e){if(wr!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&S(348),t===null)return;let n=D.get(t);N(n)&&(E=n.getFormat(),Cr=n.getStyle(),wr=t)}var Or,kr,Ar,jr,Mr,D,Nr,Pr,Fr,Ir,Lr=!1,Rr=!1;function zr(e,t){let n=jr.get(e),r=D.has(e);if(t!==null){let n=ui(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(w._keyToDOMMap.delete(e),k(n)){let e=Ec(n,jr);Br(e,0,e.length-1,null)}if(n!==void 0){for(let e of Yr(n).values()){let t=Zr(e);zr(e,null),t!==null&&t.remove()}Ro(Fr,Sr,Or,n,`destroyed`)}}}function Br(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&zr(t,r)}}function Vr(e,t){e.setProperty(`text-align`,t)}var Hr=`40px`;function Ur(e,t){let n=xr.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${Hr}))`),Io(e,`class`),Io(e,`style`)}function Wr(e,t){let n=e.style;t===0?Vr(n,``):t===1?Vr(n,`left`):t===2?Vr(n,`center`):t===3?Vr(n,`right`):t===4?Vr(n,`justify`):t===5?Vr(n,`start`):t===6&&Vr(n,`end`),Io(e,`style`)}function Gr(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(j(e))return null;let n=e.getParent();return n===null||z(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Kr(e){let t=B().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function qr(e,t,n){t||e.contentEditable===`false`?Ks(n,w):n.removeAttribute(`contenteditable`)}function Jr(e,t,n){let r=T,i=Tr();T=``;let a=``,o=A(e);for(let[r,i]of n){let n=Kr(r);qr(t,o,n),t.appendChild(n),T=``;let s=Tr();$r(i,Ns(e,n,w)),Er(s),Xr(e,r,t,n),a+=T}return Er(i),T=r,a}function Yr(e){return Ud(e)&&e.__slots!==null?e.__slots:Hd}function Xr(e,t,n,r){let i=Ir.$getSlotTargetElement(e,t,n,w);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function Zr(e){let t=Nr.get(e);return t===void 0?null:t.parentElement}function Qr(e,t,n){let r=Yr(e),i=Yr(t);for(let[e,t]of r)if(!i.has(e)){let e=Zr(t);zr(t,null),e!==null&&e.remove()}let a=T,o=Tr(),s=``,c=null,l=A(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:Zr(i);T=``;let u=Tr();if(o===null){o=Kr(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),$r(a,Ns(t,o,w))}else i===a?ai(a,o):(i!==void 0&&zr(i,o),$r(a,Ns(t,o,w)));if(Er(u),qr(n,l,o),Xr(t,e,n,o),s+=T,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return Er(o),T=a,s}function $r(e,t){let n=D.get(e);if(n===void 0&&S(60),t!==null){let r=jr.get(e);if(r!==void 0){let i=Nr.get(e);if(i!==void 0){let a=Wd(r)?r.__slotHost:null,o=Wd(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),ai(e,t.element)}}}let r=Ir.$createDOM(n,w);if(function(e,t,n){let r=n._keyToDOMMap;go(t,n,e),r.set(e,t)}(e,r,w),N(n)?r.setAttribute(`data-lexical-text`,`true`):A(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),Ws(r,{captureSelection:!0})),k(n)){let e=T,t=n.__indent,i=n.__size;Gr(r,n),t!==0&&Ur(r,t);let a=Yr(n),o=a.size>0?Jr(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,T+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(ei(Ec(n,D),n,0,t,Ns(n,r,w)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,T=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(gr(n)){let t=n.getTextContent();r.__lexicalTextContent=t,T=e+t}let s=n.__format;s!==0&&Wr(r,s),n.isInline()||(ri(0,n,r),ni(n,r))}else{let t=n.getTextContent();if(A(n)){let t=n.decorate(w,xr);t!==null&&oi(e,t),r.contentEditable=`false`;let i=Yr(n);i.size>0&&Jr(n,r,i)}T+=t}return t!==null&&t.insertChild(r),Ir.$decorateDOM(n,null,r,w),yr(n),Ro(Fr,Sr,Or,n,`created`),r}function ei(e,t,n,r,i){let a=T,o=Tr();T=``,E=null,Cr=null,wr=null;let s=n;for(;s<=r;++s){let t=Tr();$r(e[s],i);let n=D.get(e[s]);n!==null&&N(n)?E===null&&(E=n.getFormat(),Cr=n.getStyle(),wr=n.__key):k(n)&&s<r&&!n.isInline()&&(T+=je),Er(t)}let c=w._keyToDOMMap.get(t.__key);c===void 0&&S(349,t.__key),c.__lexicalTextContent=T,c.__lexicalFirstTextKey=wr,T=a+T,Er(o)}function ti(e){return A(e)&&!e.isInline()}function ni(e,t,n=Ns(e,t,w)){n.setDecoratorBoundaryAnchor(`leading`,ti(e.getFirstChild())),n.setDecoratorBoundaryAnchor(`trailing`,ti(e.getLastChild()))}function ri(e,t,n){let r=Ns(t,n,w),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return U(e)?`line-break`:A(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,D);r.setManagedLineBreak(i)}function ii(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=D.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=D.get(r);if(N(e))return E=e.getFormat(),void(Cr=e.getStyle())}}t.__lexicalFirstTextKey=wr}function ai(e,t){let n=jr.get(e),r=D.get(e);n!==void 0&&r!==void 0||S(61);let i=Lr||Ar.has(e)||kr.has(e),a=Uo(w,e);if(n===r&&!i){let e;if(k(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&S(355,n.getType()),e=t,Dr(a)}else e=n.getTextContent();return T+=e,a}if(n!==r&&i&&Ro(Fr,Sr,Or,r,`updated`),Ir.$updateDOM(r,n,a,w)){let n=$r(e,null);return t===null&&S(62),t.replaceChild(n,a),zr(e,null),n}if(k(n)){k(r)||S(334,e);let t=r.__indent;(Lr||t!==n.__indent)&&Ur(a,t);let o=r.__format;(Lr||o!==n.__format)&&Wr(a,o);let s=i&&(Yr(r).size>0||Yr(n).size>0)?Qr(n,r,a):``;if(i){let e=T;if(function(e,t,n){var r;E=null,Cr=null,wr=null,function(e,t,n){let r=T,i=e.__size,a=t.__size;T=``;let o=n.element,s=w._keyToDOMMap.get(t.__key);s===void 0&&S(351,t.__key);let c=a-i;if(!Lr&&Math.abs(c)<=1&&i>=br&&e.__first===t.__first&&(c!==0||!w._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Pr.get(e.__key);if(!Lr&&!gr(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=D.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=vr(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=D.get(n);if(e===void 0)break;let t=Tr();ai(n,o),N(e)&&E===null&&(E=e.getFormat(),Cr=e.getStyle(),wr=e.__key),Er(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=D.get(n);if(e===void 0)break;let t;if(k(e)){let r=w._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&S(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&k(e)&&!e.isInline()&&(d+=je),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,T=r+m,ii(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=jr.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=D.get(a),d=jr.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=D.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=jr.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=vr(l,c);for(let e of _){let t=Tr();if(e.kind===`reconcile`)ai(e.key,n.element);else if(e.kind===`destroy`)zr(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=w._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}$r(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=D.get(e.key);t&&N(t)&&E===null&&(E=t.getFormat(),Cr=t.getStyle(),wr=t.__key)}Er(t)}let x=``;for(let e=0;e<o;e++){let t=D.get(f[e]);if(t===void 0)return!1;let n;if(k(t)){let r=w._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&S(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&k(t)&&!t.isInline()&&(x+=je)}let ee=r.__lexicalSlotTextLength||0,te=ee>0?i.slice(ee):i;return r.__lexicalTextContent=te.slice(0,te.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&S(353),T=r+e,ii(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=D.get(t);if(e===void 0)break;let r=Lr||Ar.has(t)||kr.has(t),i=Tr();if(r)ai(t,o);else{let n,r;if(k(e)){r=Nr.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&S(354,e.getType()),n=i}else n=e.getTextContent();T+=n,r!==void 0&&Dr(r)}N(e)?E===null&&(E=e.getFormat(),Cr=e.getStyle(),wr=e.__key):k(e)&&n<a-1&&!e.isInline()&&(T+=je),Er(i),t=e.__next,n++}s.__lexicalTextContent=T,s.__lexicalFirstTextKey=wr,T=r+T;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)ai(r,o);else{let e=ui(r),t=$r(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}zr(r,null)}let a=D.get(i);N(a)&&E===null&&(E=a.getFormat(),Cr=a.getStyle(),wr=a.__key)}else{let r=Ec(e,jr),s=Ec(t,D);if(r.length!==i&&S(227),s.length!==a&&S(228),i===0)a!==0&&ei(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&Yr(t).size===0&&n.element.__lexicalLineBreak==null;Br(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=Tr();if(e===r)u=si(ai(r,a.element)),d++,f++;else{if(l===void 0&&(l=ci(n,f)),c===void 0)c=ci(t,d);else if(!c.has(e)){d++,Er(i);continue}if(!l.has(e)){let t=ui(e);t.parentNode===a.element&&(u=si(t)),zr(e,a.element),d++,c.delete(e),Er(i);continue}if(c.has(r)){let e=Uo(w,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=si(ai(r,a.element)),d++,f++}else $r(r,a.withBefore(u??a.before)),f++}let o=D.get(r);o!==null&&N(o)?E===null&&(E=o.getFormat(),Cr=o.getStyle(),wr=o.__key):k(o)&&f<=s&&!o.isInline()&&(T+=je),Er(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:w.getElementByKey(t);ei(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&Br(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=T,s.__lexicalFirstTextKey=wr,T=r+T}(e,t,Ns(t,n,w)),z(t)||(r=t,E==null||E===r.__textFormat||Rr||r.setTextFormat(E),function(e){Cr==null||Cr===e.__textStyle||Rr||e.setTextStyle(Cr)}(t))}(n,r,a),r.isInline()||(j(r)||ri(0,r,a),ni(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,T=e+s+t,a.__lexicalSlotTextLength=s.length}else(Yr(r).size>0||Yr(n).size>0)&&(a.__lexicalSlotTextLength=0);if(gr(r)){let t=r.getTextContent();a.__lexicalTextContent=t,T=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&S(356,n.getType()),T+=e,Dr(a)}if((Lr||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Gr(a,r),j(r)&&!Lr))for(let e of r.getChildren())k(e)&&Gr(Uo(w,e.getKey()),e)}else{let t=r.getTextContent();if(A(r)){let t=r.decorate(w,xr);t!==null&&oi(e,t),i&&(Yr(r).size>0||Yr(n).size>0)&&Qr(n,r,a)}T+=t}if(!Rr&&j(r)){let e=r.getLatest();if(e.__cachedText!==T){let t=e.getWritable();t.__cachedText=T,r=t}}return Ir.$decorateDOM(r,n,a,w),yr(r),a}function oi(e,t){let n=w._pendingDecorators,r=w._decorators;if(n===null){if(r[e]===t)return;n=yo(w)}n[e]=t}function si(e){let t=e.nextSibling;return t!==null&&t===w._blockCursorElement&&(t=t.nextSibling),t}function ci(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function li(e,t,n,r,i,a){T=``,E=null,Cr=null,wr=null,Lr=r===2,w=n,xr=n._config,Ir=n._config.dom||Xc,Sr=n._nodes,Or=w._listeners.mutation,kr=i,Ar=a,jr=e._nodeMap,Mr=e,D=t._nodeMap,Rr=t._readOnly,Nr=Zt(n._keyToDOMMap),Pr=function(){let e=new Map,t=t=>{for(let n of t){let t=D.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(kr.keys()),t(Ar),e}();let o=new Map;return Fr=o,ai(`root`,null),w=void 0,Sr=void 0,kr=void 0,Ar=void 0,jr=void 0,Mr=void 0,D=void 0,xr=void 0,Nr=void 0,Pr=void 0,Fr=void 0,Ir=Xc,o}function ui(e){let t=Nr.get(e);return t===void 0&&S(75,e),t}function di(e,t,n){fl();let r=e.__key,i=e.getParent();if(i===null)return void(Gd(e)!==null&&S(367,r,String(Gd(e))));let a=function(e){let t=J();if(!K(t)||!k(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Xo(i,e)&&n.set(e.__key,0,`element`),Xo(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(K(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(bd(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(bd(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else q(a)&&t&&e.isSelected()&&e.selectPrevious();Rd(e.getWritable(),t&&!o&&K(a)?a:null),n||z(i)||i.canBeEmpty()||!i.isEmpty()||di(i,t),t&&a&&j(i)&&i.isEmpty()&&i.selectEnd()}function fi(e){return e}var pi=Symbol.for(`ephemeral`);function mi(e){return e[pi]||!1}var hi={configurable:!0,enumerable:!1,value:void 0,writable:!0},gi=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=hc(this);return e===void 0&&S(64,this.name),e}static clone(e){S(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Dc(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",hi),Object.defineProperty(this,_r,hi),co(this,e)}getType(){return this.__type}isInline(){S(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=F(e);if(t===null)break;e=t.__parent===null?Gd(t):t.__parent}return!1}isSelected(e){let t=e||J();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(N(this))return n;if(K(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(A(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:F(e)}getParentOrThrow(){let e=this.getParent();return e===null&&S(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(z(t)||Gd(e)!==null)return k(e)||e===this&&A(e)||S(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&S(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:F(e)}getPreviousSiblings(){return Vd(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:F(e)}getNextSiblings(){return Vd(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Wf(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?Vf(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&S(279),!1)))}isParentOf(e){return Xo(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&k(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=G()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(mi(this))return this;let e=F(this.__key);return e===null&&S(442,this.__key,this.__type),e}getWritable(){if(mi(this))return this;fl();let e=ml(),t=G(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return uo(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&S(442,n,this.__type);let c=zs(s);return r.set(n,c),o.set(n,c),uo(c),c}getTextContent(){return of(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){S(70)}updateDOM(e,t,n){S(71)}getDOMSlot(e){return new ln(e)}exportDOM(e){return{element:Ms(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=Zs(Xs(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return k(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=uc(e)[a.field];o=a.getterTable===void 0?t:Bn(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!dc(a,o)&&a.when.call(e)||(o=void 0)),r&&dc(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){S(18,this.name)}updateFromJSON(e){return mc(ur(this,e),e)}static transform(){return null}remove(e){di(this,!0,e)}replace(e,t){fl();let n=J();n!==null&&(n=n.clone()),is(this,e);let r=this.getLatest(),i=this.__key,a=Kd(r);a!==null&&S(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent();Rd(s,K(n)?n:null);let d=r.getPreviousSibling(),f=r.getNextSibling();di(r,!1,!0),Id(c,s,d&&d.getWritable(),f&&f.getWritable()),c.__size=u!==null&&u.is(c)?l-1:l;let p=0;if(t&&(k(this)&&k(s)||S(139),p=s.getChildrenSize(),s.splice(p,0,this.getChildren())),K(n)){L(n);for(let e of[n.anchor,n.focus])e.key===i&&(t&&e.type===`element`?e.set(s.__key,p+e.offset,`element`):Fu(e,s))}return po()===i&&fo(o),s}insertAfter(e,t=!0){return zd(this,`next`,e,t)}insertBefore(e,t=!0){return zd(this,`previous`,e,t)}isParentRequired(){return!1}createParentElementNode(){return P()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){return Bd(Y(this,`previous`),e,t)}selectNext(e,t){return Bd(Y(this,`next`),e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function _i(e){return e instanceof gi}function vi(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&pr(n,e,t)||t&&pr(n,t,e)||e&&mr(n,e,t)||t&&mr(n,t,e))}(c,l))}function yi(e,t){let n=e.mergeWithSibling(t),r=G()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function bi(e){let t,n,r=e;if(!mo(r)){if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&N(t)&&t.isSimpleText()&&!t.isUnmergeable()&&!mo(t);){if(t.__text!==``){if(vi(t,r)){r=yi(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&N(n)&&n.isSimpleText()&&!n.isUnmergeable()&&!mo(n);){if(n.__text!==``){if(vi(r,n)){r=yi(r,n);break}break}n.remove()}}else r.remove()}}function xi(e){return Si(e.anchor),Si(e.focus),e}function Si(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),N(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!k(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var Ci=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function wi(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Ci.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Ti(e,t,n,r,i){let a=wi(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var Ei=e=>{let t=En(e,`format`),n=Dn(e,`format`),r=kn(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ti(t.indent,0,0,1/0),e.__textFormat=wi(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Di(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var Oi=e=>{let t=En(e,`mode`),n=On(e,`detail`,0),r=On(e,`format`,0),i=Dn(e,`mode`),a=kn(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:wi(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:wi(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Di}},ki=e=>{let t=En(e,`format`),n=Dn(e,`format`),r=kn(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ti(t.indent,0,0,1/0),e.__textFormat=wi(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Ai=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),ji=e=>{let t=En(e,`mode`),n=On(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:wi(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}},Mi=new WeakMap;function Ni(e,t){for(let n=e;n!==null&&n!==t;n=Object.getPrototypeOf(n)){let t=n.prototype;if(t!==void 0&&Object.prototype.hasOwnProperty.call(t,`isInline`)&&typeof t.isInline==`function`&&!vc(t.isInline))try{let t=e.prototype.isInline.call(Object.create(e.prototype));return typeof t==`boolean`?t:null}catch{return null}}}function Pi(e){for(let{ownNodeConfig:t}of Cc(e))if(t&&t.children!==void 0)return t.children}function Fi(e){let t=Mi.get(e);if(t===void 0){let n={},r={},i=!1;for(let{klass:t,ownNodeConfig:a}of Cc(e))a&&(r.inline===void 0&&a.inline!==void 0&&(n.inline=a.inline,r.inline=t),r.children===void 0&&a.children!==void 0&&(n.children=a.children,r.children=t),i||a.mergeAdjacent===void 0||(i=!0,!1!==a.mergeAdjacent&&(n.mergeAdjacent=a.mergeAdjacent,r.mergeAdjacent=t)));let a=function(e){let t=new Set,n=oc(e);for(let e of Object.keys(n))!0===n[e].derived&&t.add(e);for(let{ownNodeConfig:n}of Cc(e)){let e=n&&n.stateConfigs;if(e)for(let n of e){let e=n instanceof tr?n:n.stateConfig;e.derived&&t.add(e.key)}}return t}(e);r.inline!==void 0&&r.inline!==e&&Ni(e,r.inline)!==void 0&&Ni(e,r.inline)!==n.inline&&(delete n.inline,delete r.inline),r.mergeAdjacent===void 0||r.mergeAdjacent===e||function(e,t,n){let r=oc(e);for(let e of t.by)if(typeof e==`string`){if(!(e in r))return{entry:e,reason:`unknown`};if(n.has(e))return{entry:e,reason:`derived`}}else if(e.derived)return{entry:String(e.key),reason:`derived-state`};return null}(e,n.mergeAdjacent,a)===null&&function(e,t){if(!Array.isArray(t)||t.includes(`inline`))return null;for(let n of t){if(n===`inline`)continue;let t=Pi(n);if(!(t===`inline`||Array.isArray(t)&&t.includes(`inline`)&&t.every(t=>t===`inline`||t===e||e.prototype instanceof t)))return n}return null}(e,n.children)===null||(delete n.mergeAdjacent,delete r.mergeAdjacent),t=Object.freeze({...n,declaredBy:Object.freeze(r),derived:a,derivedNames:a}),Mi.set(e,t)}return t}function Ii(e){let{derivedNames:t,...n}=Fi(e);return Object.freeze({...n,derived:new Set(t)})}function Li(e){return!1}function Ri(){return{...Le,0:``}}function zi(){return{...Fe,"":0}}var Bi=Ri(),Vi=zi(),Hi=Jn()({direction:Zn(Gn([null,`ltr`,`rtl`]),{field:`__dir`}),format:Zn(Gn([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:Bi,setter:`setFormat`,setterTable:Vi}),indent:Zn(Un(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:Qn(Un(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:Qn(Vn(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function Ui(e){if(z(e)&&!Li(G())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var O=class extends gi{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:Ui,extends:gi,generated:Ei,json:Hi})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&S(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return Le[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return Vd(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Zd(this).length===0}isDirty(){let e=G()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of Zd(this)){let n=Qd(this,t);if(k(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(N(t)&&e.push(t),k(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;k(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;k(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return k(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:F(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&S(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:F(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&S(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=of(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),k(i)&&r!==n-1&&!i.isInline()&&(e+=je)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of Xd(e).values()){let e=F(n);e!==null&&(t+=e.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),k(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=Fe[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Ne[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return so(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){fl();let n=J(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(N(e)||k(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(N(e)||k(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return K(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):ud(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&Fe[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){mi(this)&&S(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||S(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e<n;e++){a===null&&S(100);let e=a.getNextSibling();i.push(a.getWritable()),a=e}return Pd(e,r&&r.getWritable(),a&&a.getWritable()),e.__size-=i.length,i.map(e=>(Fd(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,Ld(t);let n=e.__key;Id(i,t,d,c&&c.getWritable()),e.__key===a&&S(76),o.push(n),d=t}if(i.__size=u,s.length){let e=J();if(K(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])Wi(r,t,n)&&bd(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||z(this)||this.remove()}}return i}getDOMSlot(e){return new dn(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(z(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(N(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=Ns(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=_o(s,t))&&Gs(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}ni(this,e,n)})}};function k(e){return e instanceof O}function Wi(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Gi=class extends gi{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&S(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function A(e){return e instanceof Gi}function Ki(e){let t=e.getLatest().__cachedText;return t===null||!dl()&&G()._dirtyType!==0?null:t}var qi=class extends O{__cachedText;$config(){return this.config(`root`,{extends:O})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){S(51)}getTextContent(){let e=Ki(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=Ki(this);return e===null?super.getTextContentSize():e.length}remove(){S(52)}replace(e){S(53)}insertBefore(e){S(54)}insertAfter(e){S(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)k(e)||A(e)||S(282);return super.splice(e,t,n)}static importJSON(e){return I().updateFromJSON(e)}collapseAtStart(){return!0}};function j(e){return e instanceof qi}function Ji(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function Yi(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function Xi(e,t,n=``){if(t===n)return;let r=Ji(n),i=Ji(t);for(let t in i)delete r[t],Yi(e,t,i[t]);for(let t in r)e.removeProperty(t)}var Zi=Jn()({detail:Zn(Yn(Un(),Pe),{field:`__detail`}),format:Zn(Yn(Un(),Ne),{field:`__format`}),mode:Zn(Gn([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:ze,setterTable:Re}),style:Zn(Vn(),{field:`__style`}),text:Zn(Vn(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function Qi(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function $i(e,t){return 1&t?`strong`:2&t?`em`:`span`}function ea(e,t,n,r,i){let a=r.classList,o=Lo(i,`base`);o!==void 0&&a.add(...o),o=Lo(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Ne){let r=Ne[e];if(o=Lo(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}Io(r,`class`)}function ta(e,t,n){let r=n.isComposing(),i=e+(r?Ae:``),a=H(),o=Ms(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(B().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||ve||Te){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);c.replaceData(e,t,n)}else c.nodeValue=i}}function na(e,t,n,r,i,a){ta(i,e,t);let o=a.theme.text;o!==void 0&&ea(0,0,r,e,o)}function ra(e,t){let n=B().createElement(t);return n.appendChild(e),n}function ia(e){return e!=null&&!0===e.__isInlineFormattable}var aa=class extends gi{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:gi,generated:Oi,importDOM:{"#text":()=>({conversion:ua,priority:0}),b:()=>({conversion:sa,priority:0}),code:()=>({conversion:pa,priority:0}),em:()=>({conversion:pa,priority:0}),i:()=>({conversion:pa,priority:0}),mark:()=>({conversion:pa,priority:0}),s:()=>({conversion:pa,priority:0}),span:()=>({conversion:oa,priority:0}),strong:()=>({conversion:pa,priority:0}),sub:()=>({conversion:pa,priority:0}),sup:()=>({conversion:pa,priority:0}),u:()=>({conversion:pa,priority:0})},json:Zi})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return ze[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===po()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Ne[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return so(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Qi(0,n),i=$i(0,n),a=r===null?i:r,o=B().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=B().createElement(i),o.appendChild(s)),na(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&Xi(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Qi(0,i),s=Qi(0,a),c=$i(0,i),l=$i(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??S(48);let i=B().createElement(l);return na(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??S(49)),ta(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&ea(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(Xi(t.style,p,f),Io(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return V(t)||S(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=ra(t,`b`)),this.hasFormat(`italic`)&&(t=ra(t,`i`)),this.hasFormat(`strikethrough`)&&(t=ra(t,`s`)),this.hasFormat(`underline`)&&(t=ra(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Ne[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Pe[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=so(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Re[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){fl();let n=e,r=t,i=J(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!K(i))return ud(o,n,o,r,`text`,`text`);{let e=po();e!==i.anchor.key&&e!==i.focus.key||fo(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=J();if(r&&K(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){fl();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=po(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=J();if(K(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=M(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=hr(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=M(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=hr(t,n);let a=n.__key;i===r&&fo(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,ee=0;for(let e of y){if(!g&&!_)break;let t=ee+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=ee&&(g.set(e.getKey(),b-ee,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=ee){_.set(e.getKey(),x-ee,`text`);break}ee=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&uo(t),n!==null&&uo(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),K(v)&&yd(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||S(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;po()===r&&fo(n);let o=J();if(K(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&xd(i,t,n,e,a),s!==null&&s.key===r&&xd(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function oa(e){return{forChild:ma(e.style),node:null}}function sa(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:ma(t.style,n?void 0:`bold`),node:null}}var ca=new WeakMap;function la(e){if(!V(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function ua(e){let t=e;e.parentElement===null&&S(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=ca.get(n))===void 0&&!la(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)ca.set(r[e],i);return i}(t)!==null)return{node:Dd(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=da(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=da(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:M(n)}}function da(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,V(n)){let e=n.style.display;if(e===``&&!Os(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(io(n))return n;if(n.nodeName===`BR`)return null}}var fa={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function pa(e){let t=fa[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:ma(e.style,t),node:null}}function M(e=``){return rs(new aa(e))}function N(e){return e instanceof aa}function ma(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((N(e)||ia(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function ha(e,t){let{type:n,key:r,offset:i}=e,a=as(e.key);return n===`text`?(N(a)||S(266,a.getType(),r),wf(a,t,i)):(k(a)||S(267,a.getType(),r),Oa(a,e.offset,t))}function ga(e,t){let{origin:n,direction:r}=t,i=r===`next`;vf(t)?e.set(n.getKey(),t.offset,`text`):yf(t)?N(n)?e.set(n.getKey(),Tf(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(bf(t)&&k(n)||S(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function _a(e){let t=J(),n=K(t)?t:dd();return va(n,e),L(n),n}function va(e,t){ga(e.anchor,t.anchor),ga(e.focus,t.focus)}function ya(e){let{anchor:t,focus:n}=e,r=ha(t,`next`),i=ha(n,`next`),a=Rf(r,i)<=0?`next`:`previous`;return If(Nf(r,a),Nf(i,a))}function ba(e){let{direction:t,origin:n}=e,r=Y(n,mf(t)).getNodeAtCaret();return r?Y(r,t):Df(n.getParentOrThrow(),t)}function xa(e,t=`root`){let n=[e];for(let r=bf(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(ba(r));return n}function Sa(e){return!!e&&e.origin.isAttached()}function Ca(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Da(e,r),o=a.anchor.origin;for(;o!==null&&!z(o);)o=o.getParent();let s=k(o)?o.getFirstChild():null,c=xa(a.anchor,n),l=xa(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(bf(e))u.add(e.origin.getKey());else if(yf(e)){let{origin:t}=e;k(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),lo(e)}for(let e of f)!e.canBeEmpty()&&!z(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=ba(Y(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=M(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=wf(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=wa(c),m=wa(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&Wf(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(z(i))return;t&&!n.has(i.__key)||!js(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&Zd(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;Df(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(bf(e)){let t=e.origin;if(js(t))return t}else{let t=e.getParentAtCaret();if(t&&js(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(ts);if(e&&t&&!j(t)&&e.isEmpty()&&u.has(e.getKey())&&Zd(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!j(n)&&n.isEmpty();){let e=n.getParent();if(e&&j(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}So(o,s)!==null||o===null||o.isAttached()||So(I(),null);let g=wa([p,m,...c,...l]);if(g)return Ff(Nf(g,e.direction));S(269,JSON.stringify(c.map(e=>e.origin.__key)))}function wa(e){let t=e.find(Sa);return t&&Ta(t)}function Ta(e){let t=function(e){let t=e;for(;bf(t);){let e=kf(t);if(!bf(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(N(t.origin))return vf(t)?t:wf(t.origin,n,n);let r=t.getAdjacentCaret();return yf(r)&&N(r.origin)?wf(r.origin,n,mf(n)):t}function Ea(e){return vf(e)&&e.offset!==Tf(e.origin,e.direction)}function Da(e,t){return e.direction===t?e:If(Nf(e.focus,t),Nf(e.anchor,t))}function Oa(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?Df(e,n):Y(a,n)}function ka(e){let{origin:t,offset:n,direction:r}=e;if(n===Tf(t,r))return e.getSiblingCaret();if(n===Tf(t,mf(r)))return ba(e.getSiblingCaret());let[i]=t.splitText(n);return N(i)||S(281),Nf(Y(i,`next`),r)}function Aa(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function ja(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&vd(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==J()&&yd(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function Ma(e,t){return!0}function Na(e,{$copyElementNode:t=ns,$splitTextPointCaretNext:n=ka,rootMode:r=`shadowRoot`,$shouldSplit:i=Ma,removeEmptyDestination:a=!1}={}){if(vf(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(bf(e)){let e=ba(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=Vd((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function Pa(e,t,n){let r=Nf(t,`next`);vf(r)&&(r.offset===0?r=Y(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=Y(r.origin,`next`))),r.origin.is(e)&&(yf(r)||S(342,e.getKey(),e.getType()),r=ba(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Na(e,n))r=e;return vf(r)&&S(283),r.insert(e.isInline()?P().append(e):e),Nf(Y(e.getLatest(),`next`),t.direction)}function Fa(e,t){let n=Da(K(t)?ya(t):t,`next`),r=Jd(n.anchor.origin),i=Jd(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Ta(Df(e,`next`)),o=Nf(Ta(Df(e,`previous`)),`next`);return Rf(n.anchor,a)<=0&&Rf(n.focus,o)>=0}var Ia=class extends O{$config(){return this.config(`paragraph`,{children:`inline`,extends:O,generated:ki,importDOM:{p:()=>({conversion:La,priority:0})}})}createDOM(e){let t=B().createElement(`p`),n=Lo(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){this.isEmpty()&&t.append(B().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(N),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!K(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(Fa(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=P();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>N(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function La(e){let t=P();if(Us(t,e),Vs(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in Fe&&t.setFormat(n)}return Hs(t,e),{node:t}}function P(){return rs(new Ia)}function Ra(e){return e instanceof Ia}var za=Jn()({detail:Qn(Un(2),{getter:{field:`__detail`},setter:null}),mode:Qn(Gn([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:Qn(Vn(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),Ba=class extends aa{$config(){return this.config(`tab`,{extends:aa,generated:ji,json:za})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=Lo(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||S(286),this}setDetail(e){return e!==2&&S(127),this}setMode(e){return e!==`normal`&&S(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Va(){return rs(new Ba)}function Ha(e){return e instanceof Ba}var Ua=null;function Wa(e){Ua=e}var Ga=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),Ka=1;function qa(e,t){let n=Ja(e,t);return n===void 0&&S(30,t),n}function Ja(e,t){return e._nodes.get(t)}var Ya=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function Xa(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return ao(t)||us(t)?Ss(t):null})():t;if(!V(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=vo(n),i=n.nodeName;return _i(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&to(n)==null)}function Za(e){let t=e===null?null:Cs(e);return Ts(t)&&Xa(t)}function Qa(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return eo(t)===e&&e.read(`latest`,()=>!Xa(t))}function $a(e){return e instanceof el}function eo(e){let t=e;for(;t!=null;){let e=to(t);if($a(e))return e;t=Wo(t)}return null}function to(e){return e?e.__lexicalEditor:null}function no(e){return Ha(e)||e.isToken()}function ro(e){return no(e)||e.isSegmented()}function io(e){return Ts(e)&&e.nodeType===3}function ao(e){return Ts(e)&&e.nodeType===9}function oo(e){let t=e;for(;t!=null;){if(io(t))return t;t=t.firstChild}return null}function so(e,t,n){let r=Ne[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Ne.superscript:t===`superscript`?i&=~Ne.subscript:t===`lowercase`?(i&=~Ne.uppercase,i&=~Ne.capitalize):t===`uppercase`?(i&=~Ne.lowercase,i&=~Ne.capitalize):t===`capitalize`&&(i&=~Ne.lowercase,i&=~Ne.uppercase),i}function co(e,t){let n=function(){let e=Ua;return Ua=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);fl(),pl();let r=G(),i=ml(),a=``+Ka++;i._nodeMap.set(a,e),k(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function lo(e){Ld(e.getParent()===null?e:e.getWritable())}function uo(e){pl(),mi(e)&&S(323,e.__key,e.__type);let t=e.__parent===null?Wd(e)?e.__slotHost:null:e.__parent,n=ml(),r=G(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Wd(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),k(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function fo(e){fl();let t=G(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=F(n);e!==null&&e.getWritable()}if(e!==null){let t=F(e);t!==null&&t.getWritable()}}}function po(){return dl()?null:G()._compositionKey}function mo(e){return!Se&&(we||De)&&e.__text===``&&e.__key===G()._compositionKey}function F(e,t){let n=(t||ml())._nodeMap.get(e);return n===void 0?null:n}function ho(e,t){let n=_o(e,G());return n===void 0?null:F(n,t)}function go(e,t,n){e[`__lexicalKey_${t._key}`]=n}function _o(e,t){return e[`__lexicalKey_${t._key}`]}function vo(e,t){let n=e;for(;n!=null;){let e=ho(n,t);if(e!==null)return e;n=Wo(n)}return null}function yo(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function bo(e){return e.read(()=>I().getTextContent())}function xo(e,t){let n=Rs(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=F(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function I(){return ml()._nodeMap.get(`root`)}function So(e,t){if(!(z(e)&&e.isAttached()&&(j(e)?e.getChildrenSize()===0:e.isEmpty())&&(j(e)||t!==null&&js(t))))return null;let n=P();return e.append(n),n}function L(e){fl();let t=ml();e!==null&&(e.dirty=!0,e.setCachedNodes(null),K(e)&&G()._slotsUsed&&od(e)),t._selection=e}function Co(e){fl(),xn(G(),e)}function wo(e){let t=function(e,t){let n=e;for(;n!=null;){let e=_o(n,t);if(e!==void 0)return e;n=Wo(n)}return null}(e,G());return t===null?null:F(t)}function To(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Eo(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Do=0;function Oo(){return fe?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Do).toString(36)}`}function ko(e){return io(e)?e.nodeValue:null}function Ao(e,t,n){let r=cs(Qo(t));if(r===null)return;let i=_s(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=ko(a),r=vo(a);if(t!==null&&N(r)){if((t===Ae||t===Me)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&jo(r,t,o,s,e)}}}function jo(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!Se&&(we||De);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(Ae)||s&&t===a.getTextContent()||(c=t.slice(0,-Ae.length)),i&&!s)){let e=Me,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=J();if(c===``){if(o&&!i&&s)return void Mo(a,``,t);if(fo(null),we||Se||De)a.remove();else{let e=G();Mo(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=_d(),d=a.getTextContentSize(),f=po(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||K(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!K(t)||n===null||r===null)return void Mo(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=M(a.getTextContent());a.replace(e),a=e}Mo(a,c,t)}}}function Mo(e,t,n){if(e.setTextContent(t),K(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=Tf(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function No(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(j(e))return t;t=e}return null}function Po(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(xi(e),!j(t))return e;let u=No(n.getNode());return k(u)&&u.isShadowRoot()&&u.is(No(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function Fo(e){let t=I();if(K(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(j(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),Po(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(k(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),Po(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),Po(e,a),e)}{let e=t.select(0,t.getChildrenSize());return L(Po(e,t)),e}}function Io(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function Lo(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=Kf(i);return n[t]=e,e}return i}function Ro(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&S(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function zo(e){let t=e.getType(),n=ml();if(n._readOnly){let e=Rs(n).get(t);return e?Array.from(e.values()):[]}let r=n._nodeMap,i=[];for(let[,n]of r)n instanceof e&&n.__type===t&&n.isAttached()&&i.push(n);return i}function Bo(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function Vo(e,t){let n=e.offset;if(e.type===`element`)return Bo(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?Bo(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function Ho(e){let t=Qo(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function R(e,t,...n){return Ol(e,t,n[0],e)}function Uo(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&S(75,t),n}function Wo(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return us(n)?n.host:null}function Go(e){return ao(e)?e:V(e)?e.ownerDocument:null}function Ko(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function qo(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+Ko(o.scrollPaddingLeft,i)*l,p=d+(i-Ko(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function Jo(e){fl(),G()._updateTags.add(e)}function Yo(e){fl(),G()._deferred.push(e)}function Xo(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Zo(e){let t=Go(e);return t?t.defaultView:null}function Qo(e){let t=e._window;return t===null&&S(78),t}function $o(e){return k(e)&&e.isInline()||A(e)&&e.isInline()}function es(e){let t=e.getLatest();for(;t!==null;){if(Gd(t)!==null&&k(t))return t;let e=t.getParentOrThrow();if(z(e))return e;t=e}return t}function ts(e){return k(e)&&e.isShadowRoot()}function z(e){return j(e)||ts(e)}function ns(e,t=!1){let n=e.constructor.clone(e,Ga);return co(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function rs(e){let t=G(),n=e.getType(),r=Ja(t,n);r===void 0&&S(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||S(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||S(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&S(203,e.constructor.name,n,r.name,r.getType()),t}return e}function is(e,t){!j(e.getParent())||k(t)||A(t)||S(99)}function as(e){let t=F(e);return t===null&&S(63,e),t}function os(e){if(!e||e.isInline())return!1;if(A(e))return!0;if(k(e)){if(e.isShadowRoot()){let t=e.getParent();return!(k(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function ss(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function cs(e){return fe?(e||window).getSelection():null}function ls(e){let t=Zo(e);return t?t.getSelection():null}function us(e){return Es(e)&&`host`in e}var ds=[];function fs(e){let t=e.getRootNode();if(t===e||!us(t))return ds;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!us(e))break;n.push(e),r=e.host}return n}function*ps(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(ao(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function ms(e){return e===null?document:e.ownerDocument}function B(){let e=vl();return ms(e===null?null:e._rootElement)}function hs(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=fs(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function gs(e,t){let n=hs(e,t);if(n!==null){let e=vs(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function _s(e,t){let n=hs(e,t);return n===null?e:ys(n,bs(e))}function vs(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function ys(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function bs(e){return e.direction}function xs(e){let t=e.getRootNode();return ao(t)||us(t)?t.activeElement:null}function Ss(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Cs(e){let t=e.target;if(t!==null&&V(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function ws(e){return V(e)&&e.tagName===`A`}function V(e){return Ts(e)&&e.nodeType===1}function Ts(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Es(e){return Ts(e)&&e.nodeType===11}var Ds=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function Os(e){return!(!V(e)||!e.style.display.startsWith(`inline`))||Ds.test(e.nodeName)}var ks=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function As(e){return(!V(e)||!e.style.display.startsWith(`inline`))&&ks.test(e.nodeName)}function js(e){if(A(e)&&!e.isInline())return!0;if(!k(e)||z(e))return!1;let t=e.getFirstChild(),n=t===null||U(t)||N(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function H(){return G()}function Ms(e=H()){return e._config.dom||Xc}function Ns(e,t,n=H()){let r=Ms(n).$getDOMSlot(e,t,n);return k(e)&&(Ps(r)||S(344,e.getKey(),e.getType())),r}function Ps(e){return e instanceof dn}function Fs(e,t,n=H()){return oo(Ns(e,t,n).element)}var Is=new WeakMap,Ls=new Map;function Rs(e){if(!e._readOnly&&e.isEmpty())return Ls;e._readOnly||S(192);let t=Is.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Is.set(e,t)),t}function zs(e){let t=e.constructor.clone(e,Ga);return t.afterCloneFrom(e),t}function Bs(e){return(t=zs(e))[pi]=!0,t;var t}function Vs(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function Hs(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function Us(e,t){let n=t.style.textAlign;return n&&n in Fe?e.setFormat(n):e}function Ws(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function Gs(e){return!0===e.__lexicalUnmanaged}function Ks(e,t=H()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function qs(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(V(n)&&n.hasAttribute(`data-lexical-slot`)||_o(n,t)!==void 0)return!1;n=Wo(n)}return!1}function Js(e,t){return Bn(e,t)&&e[t]!==gi[t]}var Ys=new WeakMap;function Xs(e){let t=Ys.get(e);return t===void 0?function(e){let t=e.prototype!=null&&Ve in e.prototype?e.prototype[Ve]():void 0,n=function(e){if(!(e===gi||e.prototype instanceof gi)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{el.version&&(n=JSON.parse(el.version))}catch{}S(290,e.name,t,n)}return e===Gi||e===O||e===gi}(e),r=!n&&Js(e,`getType`)?e.getType:void 0,i=r&&!(Qs in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:Bn(e.prototype,Ve),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};Ys.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=ac(e);for(let[i,a]of r){let r=lc(e,i,a);if(r===null)continue;if(Tn(r)){let t=r.field;if(t===`__proto__`&&S(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])Bn(t,String(r))||S(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&S(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?$s:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of ac(e).fieldsDerivedFirst){let a=cc(e,r,i);if(a===null)continue;if(Tn(a)){let o=a.field;o===`__proto__`&&S(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&S(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&S(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?sc:[...n.values()]}(e),i=ac(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of Cc(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,Zs(Xs(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:fc(r),setters:t},function(e,t,n,r){if(!t&&n){if(!Js(e,`getType`)){let t=e,r=function(){return this===t?n:gi.getType.call(this)};r[Qs]=!0,e.getType=r}if(Js(e,`clone`)||(e.clone=(t,n)=>{Wa(t);let r=new e;return n!==Ga&&r.afterCloneFrom(t),r}),Js(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=wc(e);return n.updateFromJSON===gi.prototype.updateFromJSON?function(e,t){return mc(e.__state||t.$!==void 0?ur(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!Js(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;Bn(t,`getTextContent`)&&!Bn(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=gi.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of Cc(e)){let e=t.prototype;if(Bn(e,`afterCloneFrom`))continue;let r=Sc(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?Zs(Xs(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[bc]=!0}}(e),function(e,t){t&&t.inline!==void 0&&Bn(e.prototype,Ve)&&!Object.prototype.hasOwnProperty.call(e.prototype,`isInline`)&&Object.defineProperty(e.prototype,"isInline",{configurable:!0,value:t.inline?gc:_c,writable:!0})}(e,a)}catch(t){throw Ys.delete(e),t}return s}(e):t}function Zs(e){let{compiled:t}=e;return t===void 0&&S(422,e.config.klass.name),t}var Qs=Symbol(`lexical.synthesizedGetType`),$s=[];function ec(e,t,n,r){let i=n.method===void 0?r:n.method,a=ac(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return tc(o,s,i)&&tc(o,s,r)?n:i}function tc(e,t,n){return e[n]===t[n]}function nc(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function rc(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var ic={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function ac(e){let t=Xs(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of Cc(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=new Map,o=new Map,s=new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?ic:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}function oc(e){let{fieldsDerivedFirst:t,flatStates:n}=ac(e),r={};for(let e of n)e.schema&&(r[e.key]=e.schema);for(let[e,n]of t)r[e]=n;return r}var sc=[];function cc(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?rc(t):r;return Tn(i)?ec(e,t,i,rc(t)):i}function lc(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?nc(t):r;return Tn(i)?ec(e,t,i,nc(t)):i}function uc(e){return e}function dc(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function fc(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&dc(i,r)}}function pc(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function mc(e,t){let{flatStates:n,generated:r,setters:i}=Zs(Xs(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=ir(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?uc(e)[i.field]=i.setterTable===void 0?a:Bn(i.setterTable,a)?i.setterTable[a]:pc(i):i.setter.call(e,a)}return e}(a,t,i)}function hc(e){return Xs(e).config}function gc(){return!0}function _c(){return!1}function vc(e){return e===gc||e===_c}function yc(e){let t=[];for(let n of[e.getter,e.setter])Tn(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var bc=`__lexicalSynthesizedAfterCloneFrom`;function xc(e){let{declaredBy:t,fieldsBaseFirst:n}=ac(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of yc(a))r.includes(e)||r.push(e);return r}function Sc(e){let t=xc(e);if(t.length===0)return t;let n=new Set;for(let{klass:t}of Cc(e))if(t!==e)for(let e of xc(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*Cc(e){for(let t=e;t&&(t===gi||_i(t.prototype));){let e=hc(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||Dc(t)}}function wc(e){let t=H();fl();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:rs(r)}var Tc=(e,t)=>{let n=e;for(;n!=null&&!j(n);){if(t(n))return n;n=n.getParent()}return null};function Ec(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?F(r):t.get(r);e??S(174),n.push(r),r=e.__next}return n}function Dc(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function Oc(e){return new Mc(Zt(e._nodeMap),null,e._slotsUsed)}function kc(){return new Mc(new Map([[`root`,new qi]]),null,!1)}function Ac(e){let t=e.constructor,n=nn(e);if(k(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(Ac(r[e]))}let r=Zd(e);if(r.length>0){let i={};for(let n of r){let r=Qd(e,n);r===null&&S(366,t.name,n),i[n]=Ac(r)}n.$slots=i}return n}function jc(e){return e instanceof Mc}var Mc=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return wl(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return en(typeof e==`boolean`&&e,()=>wl(null,this,()=>({root:Ac(I())})))}},Nc=`historic`,Pc=`history-push`,Fc=`history-merge`,Ic=`paste`,Lc=`skip-selection-focus`,Rc=`composition-start`,zc=`composition-end`,Bc=class extends O{$config(){return this.config(`artificial`,{extends:O})}createDOM(e){return B().createElement(`div`)}},Vc=class extends gi{$config(){return this.config(`linebreak`,{extends:gi,generated:Ai,importDOM:{br:e=>Wc(e)||Gc(e)?null:{conversion:Hc,priority:0}}})}getTextContent(){return`
|
|
5
5
|
`}createDOM(){return B().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function Hc(e){return{node:Uc()}}function Uc(){return rs(new Vc)}function U(e){return e instanceof Vc}function Wc(e){let t=e.parentElement;if(t!==null&&As(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Kc(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&Kc(n))return!0}}return!1}function Gc(e){let t=e.parentElement;if(t!==null&&As(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Kc(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&Kc(r))return!0}return!1}function Kc(e){return io(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function qc(e){console.warn(e)}function Jc(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=kc(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&Ql(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),go(n,e,`root`))}function Yc(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of Cc(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var Xc={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=Ja(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>k(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>k(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function Zc(e){let t=e||{},n=vl(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=kc(),s=t.namespace||(i===null?Oo():i._config.namespace),c=t.editorState,l=[qi,aa,Vc,Ba,Ia,Bc,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===gi||n.prototype instanceof gi)){let r=`<unknown>`;try{r=JSON.parse(Jt)}catch{}S(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}hc(n);let a=n.getType(),o=Yc(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:or(l[e]),transforms:o})}}let h=new el(o,i,m,{disableEvents:a,dom:{...Xc,...e&&e.dom},namespace:s,theme:r},u||console.error,d||qc,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(Ke,cu,0),e.registerCommand(qe,uu,0),e.registerCommand(Je,fu,0),e.registerCommand(Ye,pu,0),e.registerCommand(ct,wu,0)}(h),h}function Qc(e,t){let n=e.get(t);e.delete(t),n&&n()}function $c(e,t,n){return e.set(t,n),Qc.bind(null,e,t)}var el=class{static version=Jt;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Qt,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Oo(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return $c(this._listeners.update,e)}registerEditableListener(e){return $c(this._listeners.editable,e)}registerDecoratorListener(e){return $c(this._listeners.decorator,e)}registerTextContentListener(e){return $c(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Pl($c(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&S(35);let r=this._commands;r.has(e)||r.set(e,[new Yt,new Yt,new Yt,new Yt,new Yt]);let i=r.get(e);i===void 0&&S(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&S(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Rs(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return xo(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return R(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=Lo(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Jc(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=Rl.get(e);if(t===void 0)return void ju();let n=zl.get(t);if(n===void 0)return void ju();Rl.delete(e);let r=to(e);$a(r)?(function(e){if(e._parentEditor!==null){let t=Eo(e),n=t[t.length-1]._key;Du.get(n)===e&&Du.delete(n)}else Du.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&S(198);let i=Tu(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=Zo(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Sn(this),this._updateTags.add(Fc),Tl(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;Rl.set(e,n);let r=zl.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},zl.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Tu(e);i.push(Bl.register(n));let a={blur:Lt,click:ql,compositionend:gu,compositionstart:du,copy:kt,cut:At,dragend:Ot,dragover:Dt,dragstart:Et,drop:wt,focus:It,input:lu,keydown:_u,paste:et,pointerdown:$l,...be&&{beforeinput:su},...Se&&{keyup:vu,mousedown:Xl}};for(let[n,r]of Object.entries(a))i.push(Fl(e,n,i=>{Au(i)||(ku(i),n===`blur`&&(Ql(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):R(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,Nl(t,()=>{let o=cs(Qo(t));if(a.type!==`mousedown`){let r=c&&o&&K(J())&&hd(_d(),o,t,new Event(`selectionchange`));return r&&L(r),tu(t,n,c&&o?_s(o,e).focusNode:null)}let l=pd(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){Eu(t,o,new Event(`selectionchange`),r),tu(t,a,_s(o,e).focusNode);let n=J();K(n)&&n.isCollapsed()&&!n.is(_d())&&Kl(t,n)}})};i.push(Il(n,{pointercancel:c,pointermove:c,pointerup:c},!0),Fl(Qo(t),`blur`,s),t.registerEditableListener(s),Il(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||qs(Cs(e),t)?null:e}}),Fl(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),Se&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return Pl(Fl(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),Fl(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=Jl&&Math.abs(r.clientY-n.y)<=Jl&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(Zl(e,t,n)||(Ss(n.ownerDocument)===n&&n.blur(),Ql(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Fc),Tl(this);El(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=Oc(e),r._selection=e._selection?e._selection.clone():null),xn(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),Tl(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Nl(this,()=>{if(a&&this._updateTags.add(a),n&&(ue(38),I().append(P())),e._parsed)for(let[e,t]of r._nodeMap.entries())k(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=kc(),i=nl,a=rl,o=W,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,nl=r,rl=!1,W=t,Wa(null);try{let i=t._nodes;Cl(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,nl=i,rl=a,W=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(cl.has(this)||Tl(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Ml(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Nl(this,()=>{let r=J(),i=I();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||L(r.clone()),Jo(`focus`),Yo(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=cs(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,El(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>gl()))}toJSON(){return{editorState:this._editorState.toJSON(tn())}}};function tl(e,t,n,r,i,a){if(k(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=k(e);e.__parent!==t||s&&a.has(o)||((s||Ud(e)&&e.__slots!==null)&&tl(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of Ud(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Wd(e)&&e.__slotHost===t&&((k(e)||Ud(e)&&e.__slots!==null)&&tl(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var nl=null,W=null,rl=!1,il=!1,al=!1,ol=new Set,sl=new Set,cl=new Set,ll=0,ul={characterData:!0,childList:!0,subtree:!0};function dl(){return rl||nl!==null&&nl._readOnly}function fl(){rl&&S(13)}function pl(){ll>99&&S(14)}function ml(){return nl===null&&S(195,_l()),nl}function hl(e){ml()!==null&&W===null&&(W=e),W!==e&&ue(378)}function G(){return W===null&&S(337,_l()),W}function gl(){G()._dirtyType=2}function _l(){let e=0,t=new Set,n=el.version;if(typeof window<`u`)for(let r of ps(document)){let i=to(r);if($a(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function vl(){return W}function yl(e,t,n){let r=t.__type,i=qa(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function bl(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function xl(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Sl(e){return Cl(e,G()._nodes)}function Cl(e,t){let n=e.type,r=t.get(n);r===void 0&&S(17,n);let i=r.klass;e.type!==i.getType()&&S(18,i.name);let a=i.importJSON(e),o=e.children;if(k(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Cl(o[e],t);a.append(n)}let s=e.$slots;if(s){Ud(a)||S(379,i.name);for(let e in s)cf(a,e,Cl(s[e],t))}return a}function wl(e,t,n){let r=nl,i=rl,a=W;nl=t,rl=!0,W=e;try{return n()}finally{nl=r,rl=i,W=a}}function Tl(e,t){e._pendingEditorState!==null&&W!==e&&xn(e,!1,!0);let n=al;al=!0;try{let n=function(e){if(sl.has(e))return!1;sl.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!Dl(e,n))return!1;let i=(n===null||K(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;Ml(e,()=>e.dispatchCommand(Ue),void 0,!0)}return!1}finally{sl.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&kl(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=nl,u=rl,d=W,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){W=e,nl=n,rl=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=li(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),il)throw t;Jc(e,null,r,n),Sn(e),e._dirtyType=2,il=!0,Tl(e,a),il=!1;return}finally{p.observe(r,ul),e._updating=f,nl=l,rl=u,W=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=yo(e)),delete r[a])}(e,n);let b=i?null:cs(Qo(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){W=e,nl=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&ss(t,e,r),wd(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(K(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(xs(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())os(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&os(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=Ns(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=B().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=Kf(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&ss(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,ul),W=d,nl=l}}let x=cl.has(e);cl.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let r=e._pendingDecorators;r!==null&&(e._decorators=r,e._pendingDecorators=null,El(`decorator`,e,!0,r)),function(e,t,n){let r=bo(t),i=bo(n);r!==i&&El(`textcontent`,e,!0,i)}(e,t||a,n),El(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v})}finally{x||cl.delete(e)}f||kl(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){ol.has(e)||(ol.add(e),setTimeout(()=>{ol.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(le(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;Ml(e,t,r)}}(e)})(e,t),n&&e._onWarn(le(436))}finally{al=n}}function El(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function Dl(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Ol(e,t,n,r){let i=Eo(e),a;if(!al)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===Ue){if(W!==e||rl){let i=!1;return Nl(e,()=>{i=Ol(e,t,n,r)}),i}let i=ml()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(Nl(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Ol(a,t,n,r)}),!1}function kl(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Al(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&S(191),a._flushSync=!0),o&&e._deferred.push(o),xl(e,i.tag)),a==null?Ml(e,n,i):n()}}return r}function jl(){let e=ml();fl(),e._flushSync=!0}function Ml(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,xl(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=Oc(l||c),u=!0),l._flushSync=s;let d=nl,f=rl,p=W,m=e._updating,h=e._lastNotifiedSelection;nl=l,rl=!1,e._updating=!0,W=e;let g=e._headless||e.getRootElement()===null;Wa(null);try{u&&(g?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=cs(Qo(e));return K(n)||n==null?hd(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=Al(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(K(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);N(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&bi(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=po(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);N(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&bi(r),r!==void 0&&bl(r,a)&&yl(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){ll++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&bl(c,a)&&yl(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,ll++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Al(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(k(t)&&tl(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Ud(t)&&t.__slots!==null&&tl(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=G(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(K(i)){e._slotsUsed&&od(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||S(19)}else q(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Tl(e);return}finally{nl=d,rl=f,W=p,e._updating=m,ll=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,Tl(e)):u&&Ya(()=>{Tl(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function Nl(e,t,n){W===e&&n===void 0?dl()?Ml(e,t,n):t():Ml(e,t,n)}function Pl(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Fl(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function Il(e,t,n){return Pl(...Object.entries(t).map(([t,r])=>Fl(e,t,r,n)))}var Ll=30,Rl=new WeakMap,zl=new WeakMap,Bl=Kt(e=>(e.addEventListener(`selectionchange`,Ou),()=>e.removeEventListener(`selectionchange`,Ou)));function Vl(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=G(),u;if(a!==void 0)u=a;else{let e=cs(Qo(l));u=e===null?null:_s(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!N(c)||(!i&&(!be||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||To(n))&&o.offset!==s.offset&&!c.isComposing()||ro(c)||c.isDirty()&&m>1||(i||!be)&&p!==null&&!c.isComposing()&&d!==Fs(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=no(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(N(t)||k(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function Hl(e,t){return io(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Ul(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=_s(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,Hl(r,i)&&Hl(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}Nl(t,()=>{if(!n)return void L(null);if(!Qa(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||tu(t,c,a);let l=eu.has(c),u=J();if(s.postDeleteSelectionToRestore&&K(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),L(u))}if(s.postDeleteSelectionToRestore=null,K(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),Kl(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=ke,v=!1;for(let e=0;e<s;e++){let t=a[e],n=t.getTextContentSize();if(N(t)&&n!==0&&!(e===0&&t.__key===h&&p===n||e===s-1&&t.__key===g&&m===0)&&(v=!0,_&=t.getFormat(),_===0))break}u.format=v?_:0}}(function(e,t,n=!1){(n||Dl(e,t))&&e.dispatchCommand(Ue)})(t,u,u!==null&&(u.dirty&&!l||!K(u)))})}function Wl(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Gl(e,t){Wl(e,t.getFormat(),t.getStyle())}function Kl(e,t){let n=t.anchor,r=n.getNode(),i=Qo(e).event,a=i?i.timeStamp:performance.now(),{format:o,style:s,offset:c,key:l,timeStamp:u}=e._inputState.collapsedSelectionFormat;a<u+200&&n.offset===c&&n.key===l?Wl(t,o,s):n.type===`text`?(N(r)||S(141),Gl(t,r)):(e.isComposing()||I().getTextContent()!==``)&&(k(r)||S(259),r.isEmpty()?gd(t,``):Wl(t,t.format,``))}function ql(e,t){Nl(t,()=>{let n=J(),r=cs(Qo(t)),i=_d();if(r){if(K(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!j(t)&&I().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||Se&&t._inputState.lastPointerType!==`mouse`){let n=_s(r,t._rootElement).anchorNode;(V(n)||io(n))&&L(hd(i,r,t,e))}}if(ve&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(V(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=hd(i,r,t,e);s===null?r.removeAllRanges():L(s)}}R(t,Ge,e)})}var Jl=10,Yl=`input:not(:disabled),textarea:not(:disabled),select:not(:disabled),button:not(:disabled),a[href],area[href],label,summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])`;function Xl(e,t){let n=t.getRootElement();n!==null&&(Zl(e,t,n)?(e.preventDefault(),Ss(n.ownerDocument)!==n&&(t._inputState.savedInputMode===void 0&&(t._inputState.savedInputMode=n.getAttribute(`inputmode`)),n.setAttribute(`inputmode`,`none`),n.focus({preventScroll:!0}))):Ql(t,n))}function Zl(e,t,n){if(t._inputState.lastPointerType===`mouse`)return!1;let r=Cs(e);if(!Ts(r))return!1;let i=!1;for(let e=r;e!==null;e=Wo(e)){if(e===n)return i;if(e.nodeType===1){let t=e;if(t.matches(Yl))return!1;t.getAttribute(`data-lexical-decorator`)===`true`&&(i=!0)}}return!1}function Ql(e,t){let n=e._inputState.savedInputMode;n!==void 0&&(e._inputState.savedInputMode=void 0,n===null?t.removeAttribute(`inputmode`):t.setAttribute(`inputmode`,n))}function $l(e,t){let n=Cs(e),r=e.pointerType;Ts(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Nl(t,()=>{qs(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var eu=new WeakSet;function tu(e,t,n=null){let r=J(),i=r&&r.clone();(function(e,t,n){let r=_d(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&vo(n);A(o)&&(i?a&&o.isInline()&&o.selectPrevious():K(r)&&L(r.clone()));let s=J(),c=s||(a?dd():K(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!K(c)||a&&!c.isCollapsed()||!ao(u)&&!us(u))return;let{anchor:d,focus:f}=c;if(!i&&K(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&vo(h),_=(e,t)=>k(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=k(g)&&!g.isInline()&&(j(g)?Tc(f.getNode(),ld):g);for(let e of y?Df(y,`next`):[])v.push(Y(e.origin,`previous`),e);let b=Qo(e),x=b.document.createRange(),ee=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!A(n)||!n.isInline()||n===ee)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(m<v||m>l)){ee=n;continue}let y=b.getComputedStyle(Wo(r)||r).direction===`rtl`,te=2*p>u+h!==y,ne=te?`next`:`previous`,re=t&&t.getNodeAtCaret(),ie=re&&e.getElementByKey(re.getKey()),ae=ie?ie.getClientRects():[],oe=ae[te?0:ae.length-1];if(!t||t.direction===ne&&b.getComputedStyle(r).cssFloat===`none`&&(!re||U(re)||oe&&(te===y?2*oe.right>u+h:2*oe.left<u+h))){if(!n.is(_(Vo(f,te),ne))){let e=Y(n,ne);ga(f,e),a&&ga(d,e)}s||L(c);return}}if(A(o)&&!i){let t=b.document,n=t.caretPositionFromPoint&&t.caretPositionFromPoint(p,m,{shadowRoots:us(u)?[u]:[]}),r=n&&td(n.offsetNode,n.offset,null,e);if(r){let[{key:e,offset:t,type:n}]=r;f.set(e,t,n)}}})(e,t,n);let a=J(),o=e._inputState.mouseDrag;o&&a&&!a.is(i)&&eu.add(o),t.type===`mousedown`&&K(a)&&gd(a,K(i)?i.anchor.key:``)}function nu(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function ru(e){let{lastKeyCode:t}=G()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
|
|
@@ -21,5 +21,5 @@ import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{t}from"./react-BWPDF9m
|
|
|
21
21
|
`),s=o.length;(function(e){let n=Y_,c=X_;Y_=[],X_=e;try{return(()=>{for(let e=0;e<s;e++){let n=o[e],[s,c]=Ov(o,e,i.multilineElement,t);s?e=c:kv(n,t,i.element,a,i.textMatch,r)}})()}finally{Y_=n,X_=c}})(!r);let c=t.getChildren();for(let e of c)if(!r&&y_(e)&&t.getChildrenSize()>1)e.remove();else if(k(e))for(let t of e.getAllTextNodes())Av(t)}function Ov(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d<f;){let n=l?e[d].match(l):null;if(!n&&(!u||u&&d<f-1)||n&&t===d&&n.index===c.index){d++;continue}let i=[];if(n&&t===d)i.push(e[t].slice(c[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){let t=e[r].slice(c[0].length);i.push(t)}else if(r===d&&n){let t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==s(r,null,c,n,i,!0))return[!0,d];break}}return[!1,t]}function kv(e,t,n,r,i,a){let o=M(e),s=P();s.append(o),t.append(s);for(let{regExp:t,replace:r}of n){let n=e.match(t);if(n&&(o.setTextContent(e.slice(n[0].length)),!1!==r(s,[o],n,!0)))break}if(Ev(o,r,i),s.getParent()!==null&&e.length>0){let e=s.getPreviousSibling();if(!a&&(Ra(e)||Ug(e)||Q(e))){let t=e;if(Q(e)){let n=e.getLastDescendant();t=n==null?null:Tc(n,eg)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[U_(t),...s.getChildren()]),s.remove())}}}function Av(e){if(Ha(e))return;let t=e.getTextContent();if(!t.includes(` `))return;let n=e.getFormat(),r=e.getStyle(),i=[],a=0;for(let e=t.indexOf(` `);e!==-1;e=t.indexOf(` `,e+1))e>a&&i.push(M(t.slice(a,e)).setFormat(n).setStyle(r)),i.push(Va()),a=e+1;a<t.length&&i.push(M(t.slice(a)).setFormat(n).setStyle(r)),e.getParentOrThrow().splice(e.getIndexWithinParent(),1,i)}function jv(e,t=Sv,n,r=!1,i=!1){let a=r?e:Cv(e,i),o=n||I();o.clear(),Dv(a,o,t,r),J()!==null&&o.selectStart()}var Mv=/^(\d+(?:\.\d+)?)px$/,Nv=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Pv(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Nv.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Fv(e,t,n,r,i){let a=Pv(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Iv(e,t){e.__colWidths=t.__colWidths,e.__frozenColumnCount=t.__frozenColumnCount,e.__frozenRowCount=t.__frozenRowCount,e.__rowStriping=t.__rowStriping}var Lv=e=>{let t=En(e,`format`),n=Dn(e,`format`),r=kn(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],colWidths:e.__colWidths,frozenColumnCount:e.getSerializedFrozenColumnCount(),frozenRowCount:e.getSerializedFrozenRowCount(),rowStriping:e.getSerializedRowStriping(),direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__colWidths;o!==void 0&&(a.colWidths=o);let s=e.getSerializedFrozenColumnCount();s!==void 0&&s!==0&&(a.frozenColumnCount=s);let c=e.getSerializedFrozenRowCount();c!==void 0&&c!==0&&(a.frozenRowCount=c);let l=e.getSerializedRowStriping();l!==void 0&&!1!==l&&(a.rowStriping=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Fv(t.indent,0,0,1/0),e.__textFormat=Pv(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.colWidths;e.setColWidths(s===void 0?void 0:Array.isArray(s)?Array.from(s,e=>Pv(e,0)):[]),e.__frozenColumnCount=Pv(t.frozenColumnCount,0),e.__frozenRowCount=Pv(t.frozenRowCount,0);let c=t.rowStriping;return e.__rowStriping=typeof c==`boolean`&&c,e},afterCloneFrom:Iv}};function Rv(e,t){e.__height=t.__height}var zv=e=>{let t=En(e,`format`),n=Dn(e,`format`),r=kn(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],height:e.__height,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__height;o!==void 0&&(a.height=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Fv(t.indent,0,0,1/0),e.__textFormat=Pv(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.height;return e.__height=s===void 0?void 0:Pv(s,0),e},afterCloneFrom:Rv}};function Bv(e,t){e.__backgroundColor=t.__backgroundColor,e.__colSpan=t.__colSpan,e.__headerState=t.__headerState,e.__rowSpan=t.__rowSpan,e.__verticalAlign=t.__verticalAlign,e.__width=t.__width}var Vv=e=>{let t=En(e,`format`),n=Dn(e,`format`),r=kn(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],backgroundColor:e.__backgroundColor,colSpan:e.__colSpan,headerState:e.__headerState,rowSpan:e.__rowSpan,verticalAlign:e.getSerializedVerticalAlign(),width:e.__width,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__backgroundColor;o!=null&&(a.backgroundColor=o);let s=e.__colSpan;s!==void 0&&s!==1&&(a.colSpan=s);let c=e.__headerState;c!==void 0&&c!==0&&(a.headerState=c);let l=e.__rowSpan;l!==void 0&&l!==1&&(a.rowSpan=l);let u=e.getSerializedVerticalAlign();u!==void 0&&(a.verticalAlign=u);let d=e.__width;d!==void 0&&(a.width=d);let f=e.__dir;f!=null&&(a.direction=f);let p=t[e.__format];p!==void 0&&p!==``&&(a.format=p);let m=e.__indent;return m!==void 0&&m!==0&&(a.indent=m),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Fv(t.indent,0,0,1/0),e.__textFormat=Pv(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.backgroundColor;e.__backgroundColor=typeof s==`string`&&s!==``?s:null,e.__colSpan=Fv(t.colSpan,1,1,1/0),e.setHeaderStyles(Pv(t.headerState,0)),e.__rowSpan=Fv(t.rowSpan,1,1,1/0);let c=t.verticalAlign;e.__verticalAlign=c===`middle`||c===`bottom`?c:void 0;let l=t.width;return e.__width=l===void 0||Pv(l,0)===0?void 0:Pv(l,0),e},afterCloneFrom:Bv}},Hv={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},Uv=Jn()({backgroundColor:Zn(Kn(Vn(),{defaultAsNull:!0}),{field:`__backgroundColor`}),colSpan:Zn(Un(1,{integer:!0,min:1}),{field:`__colSpan`}),headerState:Qn(Un(0),{getter:{field:`__headerState`,method:`getHeaderStyles`},setter:`setHeaderStyles`}),rowSpan:Zn(Un(1,{integer:!0,min:1}),{field:`__rowSpan`}),verticalAlign:Qn(Gn([void 0,`middle`,`bottom`]),{getter:`getSerializedVerticalAlign`,setter:{field:`__verticalAlign`}}),width:Zn(qn(Un(),{omitDefault:!0}),{field:`__width`})}),Wv=class extends O{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config(`tablecell`,{children:`block`,extends:O,generated:Vv,importDOM:{td:()=>({conversion:Kv,priority:0}),th:()=>({conversion:Kv,priority:0})},json:Uv})}constructor(e=Hv.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=B().createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),Gv(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),qf(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(V(t.element)){let e=t.element;e.setAttribute(`data-temporary-table-cell-lexical-key`,this.getKey()),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()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||`top`,e.style.textAlign=`start`,this.__backgroundColor===null&&this.hasHeader()&&(e.style.backgroundColor=`#f2f3f5`)}return t}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?`th`:`td`}setHeaderStyles(e,t=Hv.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getSerializedVerticalAlign(){let e=this.getLatest().__verticalAlign;return Gv(e)?e:void 0}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState&=~e:t.__headerState|=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==Hv.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function Gv(e){return e===`middle`||e===`bottom`}function Kv(e){let t=e,n=e.nodeName.toLowerCase(),r;Mv.test(t.style.width)&&(r=parseFloat(t.style.width));let i=Hv.NO_STATUS;if(n===`th`){let e=t.getAttribute(`scope`);if(e===`col`)i=Hv.COLUMN;else if(e===`row`)i=Hv.ROW;else{let e=t.parentElement,n=V(e)&&e.nodeName.toLowerCase()===`tr`&&V(e.parentElement)&&(e.parentElement.nodeName.toLowerCase()===`thead`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=Hv.ROW),r&&(i|=Hv.COLUMN),i===Hv.NO_STATUS&&(i=Hv.ROW)}}let a=qv(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;Gv(s)&&(a.__verticalAlign=s),Hs(a,t);let c=t.style,l=(c&&c.textDecoration||``).split(` `),u=c.fontWeight===`700`||c.fontWeight===`bold`,d=l.includes(`line-through`),f=c.fontStyle===`italic`,p=l.includes(`underline`),m=c.color;return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();U(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)if($o(i)||N(i)||U(i)){if(N(i)&&(u&&i.toggleFormat(`bold`),d&&i.toggleFormat(`strikethrough`),f&&i.toggleFormat(`italic`),p&&i.toggleFormat(`underline`),m)){let e=i.getStyle();e.includes(`color:`)||i.setStyle(e+`color: ${m};`)}n?n.append(i):(n=P().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),t.length===0&&t.push(P()),t},node:a}}function qv(e=Hv.NO_STATUS,t=1,n){return rs(new Wv(e,t,n))}function Jv(e){return e instanceof Wv}function Yv(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Xv=Jn()({height:Zn(qn(Un()),{field:`__height`})}),Zv=class extends O{__height;$config(){return this.config(`tablerow`,{extends:O,generated:zv,importDOM:{tr:()=>({conversion:Qv,priority:0})},json:Xv})}constructor(e=void 0,t){super(t),this.__height=e}createDOM(e){let t=B().createElement(`tr`);return this.__height&&(t.style.height=`${this.__height}px`),qf(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n===`html`}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function Qv(e){let t=e,n;return Mv.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>pp(e,Jv),node:Hs($v(n),t)}}function $v(e){return rs(new Zv(e))}function ey(e){return e instanceof Zv}function ty(e,t,n){let r=[],i=null,a=null;function o(e){let t=r[e];return t===void 0&&(r[e]=t=[]),t}let s=e.getChildren();for(let e=0;e<s.length;e++){let r=s[e];ey(r)||Yv(209);let c=o(e);for(let l=r.getFirstChild(),u=0;l!=null;l=l.getNextSibling()){for(Jv(l)||Yv(147);c[u]!==void 0;)u++;let r={cell:l,startColumn:u,startRow:e},{__rowSpan:d,__colSpan:f}=l;for(let t=0;t<d&&!(e+t>=s.length);t++){let n=o(e+t);for(let e=0;e<f;e++)n[u+e]=r}t!==null&&i===null&&t.is(l)&&(i=r),n!==null&&a===null&&n.is(l)&&(a=r)}}return[r,i,a]}function ny(e){return V(e)&&e.nodeName===`TABLE`}function ry(e,t){if(!t)return t;let n=ny(t)?t:t.querySelector(`table`);return ny(n)||Yv(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function iy(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;Jv(n)&&(r=n)}return null}function ay(e,t,n){return iy(e,vo(t,n))}function oy(e){return V(e)&&e.nodeName===`DIV`}var sy=Jn()({colWidths:Qn(qn(Xn(Un())),{getter:{field:`__colWidths`}}),frozenColumnCount:Qn(Un(),{getter:`getSerializedFrozenColumnCount`,setter:{field:`__frozenColumnCount`,method:`setFrozenColumns`}}),frozenRowCount:Qn(Un(),{getter:`getSerializedFrozenRowCount`,setter:{field:`__frozenRowCount`,method:`setFrozenRows`}}),rowStriping:Qn(Wn(),{getter:`getSerializedRowStriping`,setter:{field:`__rowStriping`}})});function cy(e,t,n){let r=e.querySelector(`:scope > colgroup`);if(!n)return void(r&&r.remove());r||(r=B().createElement(`colgroup`),Ws(r),e.insertBefore(r,e.firstChild));let i=[];for(let e=0;e<t;e++){let t=B().createElement(`col`),r=n[e];r&&(t.style.width=`${r}px`),i.push(t)}r.replaceChildren(...i)}function ly(e,t,n){if(!t.theme.tableAlignment)return;let r=[],i=[];for(let e of[`center`,`right`]){let a=t.theme.tableAlignment[e];a&&(e===n?i:r).push(a)}Jf(e,...r),qf(e,...i)}var uy=new WeakSet;function dy(e=H()){return uy.has(e)}function fy(e=H()){let t=Ip(e,`@lexical/table/Table`);return!!t&&t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek()}var py=class extends O{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config(`table`,{extends:O,generated:Lv,importDOM:{table:()=>({conversion:my,priority:1})},json:sy})}getSerializedFrozenColumnCount(){return this.getLatest().__frozenColumnCount||void 0}getSerializedFrozenRowCount(){return this.getLatest().__frozenRowCount||void 0}getSerializedRowStriping(){return this.getLatest().__rowStriping||void 0}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}extractWithChild(e,t,n){return n===`html`}getDOMSlot(e){let t=ny(e)?e:e.querySelector(`table`);return ny(t)||Yv(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(`:scope > colgroup`))}createDOM(e,t){let n=B().createElement(`table`);if(this.__style&&Xi(n.style,this.__style),this.getColWidths()){let e=B().createElement(`colgroup`);n.appendChild(e),Ws(e)}if(qf(n,e.theme.table),this.updateTableElement(null,n,e),dy(t)){let r=fy(t),i=function(e,t,n){let r=B().createElement(`div`),i=t.theme.tableScrollableWrapper;return i?qf(r,i):r.style.overflowX=`auto`,n&&(r.style.scrollbarWidth=`none`),r.appendChild(e),r}(n,e,r);if(this.updateTableWrapper(null,i,n,e),r){let t=function(e){let t=B(),n=t.createElement(`div`),r=e.theme.tableStickyScrollbar;r?qf(n,r):(n.style.position=`sticky`,n.style.bottom=`0`,n.style.overflowX=`scroll`,n.style.overflowY=`hidden`),n.style.display=`none`,n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1;let i=t.createElement(`div`);return i.style.height=`1px`,i.style.width=`0px`,n.appendChild(i),n}(e),n=B().createElement(`div`);return n.setAttribute(`data-lexical-sticky-scrollbar`,`true`),n.appendChild(i),n.appendChild(t),Ws(t),n}return i}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(qf(e,n.theme.tableFrozenColumn),t.setAttribute(`data-lexical-frozen-column`,`true`)):(Jf(e,n.theme.tableFrozenColumn),t.removeAttribute(`data-lexical-frozen-column`))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(qf(e,n.theme.tableFrozenRow),t.setAttribute(`data-lexical-frozen-row`,`true`)):(Jf(e,n.theme.tableFrozenRow),t.removeAttribute(`data-lexical-frozen-row`))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:``)&&Xi(t.style,this.__style,e?e.__style:``),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(qf(e,t.theme.tableRowStriping),e.setAttribute(`data-lexical-row-striping`,`true`)):(Jf(e,t.theme.tableRowStriping),e.removeAttribute(`data-lexical-row-striping`))}(t,n,this.__rowStriping);let r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||cy(t,this.getColumnCount(),this.getColWidths()),ly(t,n,this.getFormatType())}updateDOM(e,t,n){let r=ry(this,t);if(t===r===dy())return!0;if(oy(t)){if(t.hasAttribute(`data-lexical-sticky-scrollbar`)!==fy())return!0;let i=r.parentElement;oy(i)&&this.updateTableWrapper(e,i,r,n)}return this.updateTableElement(e,r,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();n&&cy(ry(this,e),this.getColumnCount(),n.map(e=>e*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t,r=!ny(n)&&V(n)?n.querySelector(`table`):n;if(V(n)&&ny(r)&&r!==n){n.dir&&(r.dir=n.dir);let{paddingInlineStart:e}=n.style;e&&(r.style.paddingInlineStart=e);let t=n.getAttribute(`data-lexical-indent`);t!==null&&r.setAttribute(`data-lexical-indent`,t)}return{after:n=>{if(t.after&&(n=t.after(n)),!ny(n)&&V(n)&&(n=n.querySelector(`table`)),!ny(n))return null;ly(n,e._config,this.getFormatType());let[r]=ty(this,null,null),i=new Map;for(let e of r)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let a=new Set;for(let e of n.querySelectorAll(`:scope > tr > [data-temporary-table-cell-lexical-key]`)){let t=e.getAttribute(`data-temporary-table-cell-lexical-key`);if(t){let n=i.get(t);if(e.removeAttribute(`data-temporary-table-cell-lexical-key`),n){i.delete(t);for(let e=0;e<n.colSpan;e++)a.add(e+n.startColumn)}}}let o=n.querySelector(`:scope > colgroup`);if(o){let e=Array.from(n.querySelectorAll(`:scope > colgroup > col`)).filter((e,t)=>a.has(t));o.replaceChildren(...e)}let s=n.querySelectorAll(`:scope > tr`);if(s.length>0){let e=B().createElement(`tbody`);for(let t of s)e.appendChild(t);n.append(e)}return n},element:r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t<n;t++){let n=r[t];if(n!=null)for(let r=0;r<n.length;r++){let i=n[r];if(i==null)continue;let{elem:a}=i,o=ay(this,a);if(o!==null&&e.is(o))return{x:r,y:t}}}throw Error(`Cell not found in table.`)}getDOMCellFromCords(e,t,n){let{domRows:r}=n,i=r[t];return i==null?null:i[e<i.length?e:i.length-1]??null}getDOMCellFromCordsOrThrow(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(!r)throw Error(`Cell not found at cords.`);return r}getCellNodeFromCords(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(r==null)return null;let i=vo(r.elem);return Jv(i)?i:null}getCellNodeFromCordsOrThrow(e,t,n){let r=this.getCellNodeFromCords(e,t,n);if(!r)throw Error(`Node at cords not TableCellNode.`);return r}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!ey(e))return 0;let t=0;return e.getChildren().forEach(e=>{Jv(e)&&(t+=e.getColSpan())}),t}};function my(e){let t=hy();e.hasAttribute(`data-lexical-row-striping`)&&t.setRowStriping(!0),e.hasAttribute(`data-lexical-frozen-column`)&&t.setFrozenColumns(1),e.hasAttribute(`data-lexical-frozen-row`)&&t.setFrozenRows(1);let n=e.querySelector(`:scope > colgroup`);if(n){let e=[];for(let t of n.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!Mv.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return Hs(t,e),{after:e=>pp(e,ey),node:t}}function hy(){return rs(new py)}function gy(e){return e instanceof py}function _y(e){let t=e.trim(),n=t.startsWith(`|`)?t.slice(1):t;return(n.endsWith(`|`)?n.slice(0,-1):n).split(`|`).map(e=>e.trim())}function vy(e){let t=_y(e);return t.length>0&&t.every(e=>/^:?-+:?$/.test(e.trim())&&e.trim().length>=1)}var yy=[{type:`multiline-element`,dependencies:[py,Zv,Wv],regExpStart:/^\|?[^|]*\|.*$/,regExpEnd:{optional:!0,regExp:/^\x00$/},handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){let r=e[n];if(r===void 0)return null;let i=e[n+1];if(i===void 0||!vy(i))return null;let a=_y(r),o=a.length,s=[],c=n+1;for(let t=n+2;t<e.length;t++){let n=e[t];if(n===void 0||!n.trim().includes(`|`)&&n.trim()!==``||n.trim()===``)break;s.push(_y(n)),c=t}let l=hy(),u=$v();for(let e=0;e<o;e++){let t=qv(Hv.ROW),n=P(),r=a[e]??``;n.append(M(r)),t.append(n),u.append(t)}l.append(u);for(let e of s){let t=$v();for(let n=0;n<o;n++){let r=qv(Hv.NO_STATUS),i=P(),a=e[n]??``;i.append(M(a)),r.append(i),t.append(r)}l.append(t)}return t.append(l),[!0,c]},replace(e,t,n,r,i,a){return!1},export(e,t){if(!gy(e))return null;let n=e.getChildren();if(n.length===0)return null;let r=[];return n.forEach((e,n)=>{if(!ey(e))return;let i=e.getChildren(),a=i.map(e=>Jv(e)?t(e).trim():``);r.push(`| ${a.join(` | `)} |`),n===0&&r.push(`| ${i.map(()=>`---`).join(` | `)} |`)}),r.join(`
|
|
22
22
|
`)}},iv,...Sv],by=/^[ \t]*`{3,}[ \t]*$/;function xy(e){return RegExp(`^[ \\t]*\`{${String(e)},}[ \\t]*$`)}function Sy(e,t,n){let r=xy(n.length),i=[],a=t;for(let n=t+1;n<e.length;n++){let t=e[n];if(t===void 0)break;if(a=n,r.test(t))return{source:i.join(`
|
|
23
23
|
`),lastLineIndex:a,closed:!0};i.push(t)}return{source:i.join(`
|
|
24
|
-
`),lastLineIndex:a,closed:!1}}var $=e(n(),1),Cy=(0,ce.lazy)(()=>p(()=>import(`./GenUIBlock-
|
|
24
|
+
`),lastLineIndex:a,closed:!1}}var $=e(n(),1),Cy=(0,ce.lazy)(()=>p(()=>import(`./GenUIBlock-DAGKgmn9.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])));function wy({label:e}){return(0,$.jsxs)(`div`,{className:`not-prose my-3 flex min-h-24 items-center justify-center gap-2 rounded-lg border border-dashed border-border text-sm text-muted-foreground`,role:`status`,children:[(0,$.jsx)(ie,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,$.jsx)(c,{}),e]})}function Ty({source:e,closed:t}){return t?(0,$.jsx)(ce.Suspense,{fallback:(0,$.jsx)(wy,{label:`Loading view…`}),children:(0,$.jsx)(Cy,{source:e})}):(0,$.jsx)(wy,{label:`Building view…`})}function Ey({source:e}){let{label:t,context:n}=(0,ce.useMemo)(()=>b(e),[e]);return(0,$.jsxs)(`details`,{className:`not-prose my-1 w-fit max-w-full rounded-md border border-border px-2 py-1 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`summary`,{className:`flex cursor-pointer select-none items-center gap-1.5`,children:[(0,$.jsx)(ie,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),t]}),n?(0,$.jsx)(`pre`,{className:`mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono`,children:JSON.stringify(n,null,2)}):null]})}var Dy=class e extends Gi{__source;__closed;__intent;__dom;constructor(e,t,n,r,i=ee){super(r),this.__source=e,this.__closed=t,this.__intent=n,this.__dom=i}static getType(){return _}static clone(t){return new e(t.__source,t.__closed,t.__intent,t.__key,t.__dom)}static importJSON(e){return Oy(e.source,e.closed,e.intent)}exportJSON(){return{type:e.getType(),version:1,source:this.__source,closed:this.__closed,intent:this.__intent}}createDOM(e,t){return this.__dom.createElement(`div`)}updateDOM(){return!1}isInline(){return!1}getTextContent(){return this.__source}isIntent(){return this.__intent}isClosed(){return this.__closed}decorate(e,t){return this.__intent?(0,$.jsx)(Ey,{source:this.__source}):(0,$.jsx)(Ty,{source:this.__source,closed:this.__closed})}};function Oy(e,t,n){return rs(new Dy(e,t,n))}function ky(e,t){return{type:`multiline-element`,dependencies:[Dy],regExpStart:e,regExpEnd:{optional:!0,regExp:by},handleImportAfterStartMatch({lines:e,rootNode:n,startLineIndex:r,startMatch:i}){let{source:a,lastLineIndex:o,closed:s}=Sy(e,r,i[1]??"```");return n.append(Oy(a,s,t)),[!0,o]},replace(){return!1},export(e){return!(e instanceof Dy)||e.isIntent()!==t?null:v(t?h:_,e.getTextContent())}}}var Ay=ky(m,!1),jy=ky(g,!0),My=`font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0`,Ny={h1:`text-20 ${My}`,h2:`text-18 ${My}`,h3:`text-16 ${My}`,h4:`text-16 ${My}`,h5:`text-16 ${My}`,h6:`text-16 ${My}`},Py={paragraph:`break-words mt-5 mb-3 first:mt-0 last:mb-0`,quote:`my-2 mt-5 mb-3 first:mt-0 last:mb-0 border-l-2 border-border/80 pl-2 text-muted-foreground`,ul:`list-disc ml-5 my-2`,ol:`list-decimal ml-5 my-2`,listitem:`my-0.5`,bold:`font-semibold`,italic:`italic`,strikethrough:`line-through`,inlineCode:`break-all px-1 bg-border/60 py-0.5 rounded text-sm`},Fy={paragraph:Py.paragraph,quote:Py.quote,heading:Ny,list:{ul:Py.ul,ol:Py.ol,listitem:Py.listitem,nested:{listitem:`list-none`}},link:`text-primary underline underline-offset-2`,text:{bold:Py.bold,italic:Py.italic,strikethrough:Py.strikethrough,code:Py.inlineCode},code:`block text-xs whitespace-pre`};function Iy(e){throw e}function Ly(e){return{namespace:e.namespace,theme:Fy,nodes:[...e.nodes],editable:e.editable??!0,onError:Iy}}var Ry=f(`ShikiHtml`,()=>e=>({highlighted:null,setHighlighted:t=>e({highlighted:t})})),zy=204800,By={ts:`typescript`,typescript:`typescript`,tsx:`tsx`,js:`javascript`,javascript:`javascript`,jsx:`jsx`,py:`python`,python:`python`,go:`go`,golang:`go`,rs:`rust`,rust:`rust`,java:`java`,rb:`ruby`,ruby:`ruby`,sh:`bash`,bash:`bash`,zsh:`bash`,shell:`bash`,yml:`yaml`,yaml:`yaml`,css:`css`,scss:`scss`,html:`html`,xml:`xml`,json:`json`,json5:`json5`,md:`markdown`,markdown:`markdown`,sql:`sql`,cpp:`cpp`,"c++":`cpp`,c:`c`,h:`c`,swift:`swift`,kt:`kotlin`,kotlin:`kotlin`,php:`php`,toml:`toml`,dockerfile:`dockerfile`,diff:`diff`,patch:`diff`,vue:`vue`,svelte:`svelte`};function Vy(e){return By[e.toLowerCase()]??null}function Hy(e){let t=e.lastIndexOf(`.`);return Vy(t<0?e:e.slice(t+1))}var Uy=/^<pre[^>]*>/,Wy=/<\/pre>\s*$/,Gy=/^<code[^>]*>/,Ky=/<\/code>\s*$/;function qy(e){return e.replace(Uy,``).replace(Wy,``).replace(Gy,``).replace(Ky,``)}function Jy(e,t){let n=y()===`dark`?`github-dark`:`github-light`,r=t!==null&&e.length<=zy,i=Ry.useScopedStore(e=>e.highlighted),a=Ry.useScopedStore(e=>e.setHighlighted);return(0,ce.useEffect)(()=>{if(!r||t===null)return;let i=!1;return p(()=>import(`./dist-Bk41vfIT.js`).then(async r=>{if(i)return;let o=await r.codeToHtml(e,{lang:t,theme:n});i||a({source:e,theme:n,lang:t,html:o})}),__vite__mapDeps([51,42,52,53,1,54,55,56])).catch(()=>{u.warn(`[transcript] Shiki unavailable; falling back to plain code`)}),()=>{i=!0}},[r,e,t,n,a]),i!==null&&i.source===e&&i.theme===n&&i.lang===t?i.html:null}function Yy({source:e,lang:t}){let n=Vy(t),r=Jy(e,n),i=n??t.toLowerCase();return r===null?(0,$.jsx)(`code`,{className:`block text-xs whitespace-pre language-${i}`,children:e}):(0,$.jsx)(`code`,{className:`block text-xs whitespace-pre language-${i} shiki-highlighted`,dangerouslySetInnerHTML:{__html:qy(r)}})}var Xy=d(Ry,Yy);function Zy({source:e,lang:t,ports:n}){let{copied:r,copy:c}=s(n),u=(0,ce.useCallback)(()=>{x(`copy code block`,c(e))},[c,e]);return(0,$.jsxs)(`div`,{className:`relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre`,children:[(0,$.jsx)(`pre`,{className:`min-w-0 rounded-xl py-2.5 px-3.5`,children:t?(0,$.jsx)(Xy,{source:e,lang:t}):(0,$.jsx)(`code`,{className:`block text-xs whitespace-pre`,children:e})}),(0,$.jsx)(l,{variant:`ghost`,size:`icon`,"aria-label":r?`Copied`:`Copy code`,className:i(`absolute top-[35px] -translate-y-[50%] -translate-x-[1px] rounded-md right-1.5 h-11 w-11 md:h-8 md:w-8 text-muted-foreground opacity-100 md:opacity-0 md:group-hover/pre:opacity-100 transition-opacity [@media(hover:none)]:!opacity-100`,!r&&`hover:text-foreground`,r&&`hover:!bg-transparent hover:!border-transparent`),onClick:u,children:r?(0,$.jsx)(o,{className:`h-4 w-4 text-success-text`}):(0,$.jsx)(a,{className:`h-4 w-4`})})]})}var Qy=`transition-colors underline decoration-2 text-logo decoration-logo/50 hover:text-logo/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40`,$y=[Gg,Vg,Wh,Yh,Km,rh,gh,xh,py,Zv,Wv],eb={namespace:`kanna-md-renderer`,nodes:[...$y,Dy],transformers:[jy,Ay,...yy]};function tb(e,t,n){switch(e){case`h1`:return(0,$.jsx)(`h1`,{className:Ny.h1,children:n},t);case`h2`:return(0,$.jsx)(`h2`,{className:Ny.h2,children:n},t);case`h3`:return(0,$.jsx)(`h3`,{className:Ny.h3,children:n},t);case`h4`:return(0,$.jsx)(`h4`,{className:Ny.h4,children:n},t);case`h5`:return(0,$.jsx)(`h5`,{className:Ny.h5,children:n},t);case`h6`:return(0,$.jsx)(`h6`,{className:Ny.h6,children:n},t);default:return(0,$.jsx)(`h6`,{className:Ny.h1,children:n},t)}}function nb(e){return e.getChildren().map(e=>N(e)||oh(e)?e.getTextContent():U(e)?`
|
|
25
25
|
`:``).join(``)}function rb(e){return e!==void 0&&ey(e)&&e.getChildren().every(e=>Jv(e)&&(e.getHeaderStyles()&Hv.ROW)!==0)}function ib(e,t){let n=e.getChildren(),r=n[0],i=rb(r)?r:void 0,a=i===void 0?n:n.slice(1);return(0,$.jsx)(`div`,{className:`border border-border rounded-xl overflow-x-auto`,children:(0,$.jsxs)(`table`,{className:`table-auto min-w-full divide-y divide-border bg-background`,children:[i!==void 0&&(0,$.jsx)(`thead`,{children:(0,$.jsx)(`tr`,{children:i.getChildren().map(e=>Jv(e)?(0,$.jsx)(`th`,{className:`text-left text-xs text-muted-foreground tracking-wider p-2 pl-0 first:pl-3 bg-muted dark:bg-card [&_*]:font-semibold`,children:ub(e,t)},t.nextKey()):null)})}),(0,$.jsx)(`tbody`,{className:`divide-y divide-border`,children:a.map(e=>ey(e)?(0,$.jsx)(`tr`,{children:e.getChildren().map(e=>Jv(e)?(0,$.jsx)(`td`,{className:`text-left p-2 pl-0 first:pl-3 [&_*]:font-normal`,children:ub(e,t)},t.nextKey()):null)},t.nextKey()):null)})]})},t.nextKey())}function ab(e,t){let n=e.getChecked(),r=ub(e,t),i=t.nextKey();return n===void 0?(0,$.jsx)(`li`,{className:Py.listitem,children:r},i):(0,$.jsxs)(`li`,{className:`my-0.5 list-none flex items-start gap-1.5`,children:[(0,$.jsx)(`input`,{type:`checkbox`,readOnly:!0,checked:n,className:`mt-[3px] shrink-0`}),(0,$.jsx)(`span`,{className:`min-w-0 break-words`,children:r})]},i)}function ob(e){return A(e)}function sb(e,t){if(ob(e)){let n=t.renderDecorator?.(e)??null;return n===null?(0,$.jsx)(`span`,{children:e.decorate(t.editor,t.config)},t.nextKey()):(0,$.jsx)(`span`,{children:n},t.nextKey())}if(Xg(e)){let n=ub(e,t);return tb(e.getTag(),t.nextKey(),n)}if(Ug(e))return(0,$.jsx)(`blockquote`,{className:Py.quote,children:ub(e,t)},t.nextKey());if(Ra(e))return(0,$.jsx)(`p`,{className:Py.paragraph,children:ub(e,t)},t.nextKey());if(Jm(e))return(0,$.jsx)(Zy,{source:nb(e),lang:e.getLanguage()??``},t.nextKey());if(Q(e)){let n=ub(e,t),r=t.nextKey();return e.getListType()===`number`?(0,$.jsx)(`ol`,{className:Py.ol,children:n},r):(0,$.jsx)(`ul`,{className:Py.ul,children:n},r)}if(eg(e))return ab(e,t);if(yh(e)||Sh(e))return(0,$.jsx)(`a`,{href:e.getURL(),className:Qy,target:`_blank`,rel:`noopener noreferrer`,children:ub(e,t)},t.nextKey());if(gy(e))return ib(e,t);if(U(e))return(0,$.jsx)(`br`,{},t.nextKey());if(N(e))return lb(e,t);if(oh(e))return(0,$.jsx)(`code`,{className:Py.inlineCode,children:e.getTextContent()},t.nextKey());let n=e.getTextContent();return n?(0,$.jsx)(`span`,{children:n},t.nextKey()):null}function cb(e,t,n){let r=n.caret;if(r===null||r.key!==e.getKey())return t;let i=Math.min(r.ghostLength,t.length),a=t.length-i;return(0,$.jsxs)(ce.Fragment,{children:[t.slice(0,a),r.renderTail(t.slice(a))]},n.nextKey())}function lb(e,t){let n=e.getFormat(),r=cb(e,e.getTextContent(),t);return n&16?(0,$.jsx)(`code`,{className:Py.inlineCode,children:r},t.nextKey()):(n&4&&(r=(0,$.jsx)(`del`,{className:Py.strikethrough,children:r},t.nextKey())),n&2&&(r=(0,$.jsx)(`em`,{className:Py.italic,children:r},t.nextKey())),n&1&&(r=(0,$.jsx)(`strong`,{className:Py.bold,children:r},t.nextKey())),r)}function ub(e,t){return e.getChildren().map(e=>sb(e,t))}function db(e){if(e===void 0)return null;let t=I().getLastDescendant();return!N(t)||oh(t)?null:{...e,key:t.getKey()}}function fb(e,t,n){let r=Ly({namespace:t.namespace,nodes:t.nodes,editable:!1}),i=Yf(r);return i.update(()=>{jv(e,t.transformers,void 0,!0)},{discrete:!0}),i.getEditorState().read(()=>{let e=0,a={nextKey:()=>String(e++),editor:i,config:r,caret:db(n),renderDecorator:t.renderDecorator};return ub(I(),a)})}function pb(e){return(0,$.jsx)($.Fragment,{children:fb(e,eb)})}var mb=[`B`,`KB`,`MB`,`GB`,`TB`];function hb(e){let t=e,n=0;for(;t>=1024&&n<mb.length-1;)t/=1024,n+=1;let r=n===0||t>=100?0:1;return`${t.toFixed(r).replace(/\.0$/,``)} ${mb[n]}`}var gb=RegExp(`^[a-z0-9][a-z0-9_-]{0,39}$`),_b=`beacon/`,vb=`(^|[\\s\\n\\t])@${_b}([A-Za-z0-9][A-Za-z0-9_-]*)`;function yb(){return new RegExp(vb,`g`)}function bb(e){return e.length===0?`Short name is required`:e.length>40?`Short name must be at most 40 characters`:gb.test(e)?null:`Use lowercase letters, digits, - and _, starting with a letter or digit`}function xb(e){return e.alias??e.label}var Sb=/[^a-z0-9_-]+/g,Cb=/^[-_]+|[-_]+$/g;function wb(e){let t=e.toLowerCase().replace(Sb,`-`).replace(Cb,``).slice(0,40).replace(Cb,``);return t.length>0?t:`beacon`}function Tb(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}-${n}`);)n+=1;return`${e}-${n}`}function Eb(e){let t=[...e].sort((e,t)=>e.id.localeCompare(t.id)),n=new Map,r=new Map;for(let e of t)e.alias!==void 0&&e.alias!==null&&(r.has(e.alias)||(n.set(e.id,e.alias),r.set(e.alias,e.id)));for(let e of t){if(n.has(e.id))continue;let t=Tb(wb(e.label),r);n.set(e.id,t),r.set(t,e.id)}return{handleByBeaconId:n,beaconIdByHandle:r}}function Db(e){let t=[];for(let n of e.matchAll(yb())){let e=n[2];e!==void 0&&t.push(e.toLowerCase())}return t}function Ob(e,t){let n=Db(e);if(n.length===0)return{beacons:[],unresolvedHandles:[]};let{beaconIdByHandle:r}=Eb(t),i=new Map(t.map(e=>[e.id,e])),a=[],o=[],s=new Set;for(let e of n){let t=r.get(e),n=t===void 0?void 0:i.get(t);n===void 0?o.includes(e)||o.push(e):s.has(n.id)||(s.add(n.id),a.push(n))}return{beacons:a,unresolvedHandles:o}}export{Nc as $,Wo as A,M as B,Yp as C,se as Ct,U as D,Fl as E,rs as F,mt as G,_s as H,N as I,us as J,Fc as K,wt as L,zc as M,Dt as N,Td as O,I as P,C as Q,Ic as R,im as S,bt as St,cp as T,ne as Tt,Nt as U,Rc as V,$a as W,Pt as X,fs as Y,K as Z,Dy as _,Ss as _t,bb as a,cs as at,yy as b,V as bt,fb as c,Pc as ct,Jy as d,xs as dt,to as et,Ry as f,P as ft,jy as g,fe as gt,Ay as h,ms as ht,Ob as i,A as it,ht as j,Mt as k,pb as l,et as lt,Ly as m,zo as mt,xb as n,st as nt,hb as o,Ft as ot,Py as p,Zc as pt,vt as q,Eb as r,ot as rt,$y as s,Pl as st,_b as t,j as tt,Hy as u,k as ut,by as v,Gi as vt,Fp as w,ie as wt,p_ as x,pt as xt,Sy as y,Ra as yt,J as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{t}from"./react-BWPDF9mI.js";import{i as n}from"./utils-gw0dpHSZ.js";import{n as r}from"./errors-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{t}from"./react-BWPDF9mI.js";import{i as n}from"./utils-gw0dpHSZ.js";import{n as r}from"./errors-ewkwYZz5.js";var i={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};i.node;var a=n(i),o={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};o.node;var s=n(o);function c(e){if(e==null)return null;switch(typeof e){case`string`:case`boolean`:return e;case`number`:return Number.isFinite(e)?e:null}if(Array.isArray(e))return e.map(e=>c(e));if(r(e)){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=c(r));return t}return null}var l=e(t(),1),u=e=>Symbol.iterator in e,d=e=>`entries`in e,f=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},p=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function m(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:u(e)&&u(t)?d(e)&&d(t)?f(e,t):p(e,t):f({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function h(e){let t=l.useRef(void 0);return n=>{let r=e(n);return m(t.current,r)?t.current:t.current=r}}function g(e,t,n){let r=typeof e.maxTokens==`number`&&Number.isFinite(e.maxTokens)?e.maxTokens:null,i=r&&r>0?Math.min(100,e.usedTokens/r*100):null,a=r===null?null:Math.max(0,Math.round(r-e.usedTokens)),o=i===null?null:Math.max(0,100-i);return{...e,compactsAutomatically:e.compactsAutomatically||n,maxTokens:r??void 0,remainingTokens:a,usedPercentage:i,remainingPercentage:o,updatedAt:t}}function _(e){let t=e.some(e=>e.kind===`compact_boundary`||e.kind===`compact_summary`||e.kind===`context_cleared`);for(let n=e.length-1;n>=0;--n){let r=e[n];if(r){if(r.kind===`context_cleared`)return null;if(!(r.kind!==`context_window_updated`||r.usage.usedTokens<=0))return g(r.usage,new Date(r.createdAt).toISOString(),t)}}return null}function v(e,t){return!e||t===null||!Number.isFinite(t)||t<=0?e:g({...e,maxTokens:t},e.updatedAt,e.compactsAutomatically)}function y(e){return e===void 0||!Number.isFinite(e)||e<0?0:e}function b(e,t){let n=0,r=0,i=0,a=0;for(let t of e){if(t.kind!==`result`)continue;let e=t.usage;e&&(n+=y(e.inputTokens),r+=y(e.outputTokens),i+=y(e.cachedInputTokens)),a+=y(t.costUsd??e?.costUsd)}for(let e of t){let t=e.usage;t&&(n+=y(t.inputTokens),r+=y(t.outputTokens),i+=y(t.cachedInputTokens),a+=y(t.costUsd))}if(n===0&&r===0&&i===0&&a===0)return null;let o=n>0?i/n*100:null;return{inputTokens:n,outputTokens:r,cachedTokens:i,costUsd:a,cacheHitPercentage:o}}function x(e){return!Number.isFinite(e)||e<=0?`$0.00`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function S(e){return e==null||!Number.isFinite(e)?`0`:e<1e3?`${Math.round(e)}`:e<1e4?`${(e/1e3).toFixed(1).replace(/\.0$/,``)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,``)}m`}function C(e){return e<10?`${e.toFixed(1).replace(/\.0$/,``)}%`:`${Math.round(e)}%`}export{C as a,c,x as i,s as l,_ as n,v as o,S as r,h as s,b as t,a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{t}from"./react-BWPDF9mI.js";import{i as n}from"./utils-gw0dpHSZ.js";import{s as r}from"./pendingActionsStore-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{t}from"./react-BWPDF9mI.js";import{i as n}from"./utils-gw0dpHSZ.js";import{s as r}from"./pendingActionsStore-Bw87-8u6.js";import{t as i}from"./timer.adapter-t-ql2eaa.js";import{n as a}from"./log-8K5PdGJC.js";var o={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};o.node;var s=n(o),c={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};c.node;var l=n(c),u=e(t(),1),d={writeText(e){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.writeText(e)},readText(){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.readText()}},f=2e3,p={},m=a()((e,t)=>({copiedTokens:p,nextToken:1,markCopied:n=>{let r=t().nextToken;return e(e=>({nextToken:r+1,copiedTokens:{...e.copiedTokens,[n]:r}})),r},clearCopied:(n,i)=>{let{copiedTokens:a}=t();a[n]===i&&e({copiedTokens:r(a,n,p)})}}));async function h(e,t,n=i){await t();let r=m.getState().markCopied(e);n.setTimeout(()=>m.getState().clearCopied(e,r),f)}function g(e){return m(t=>t.copiedTokens[e]!==void 0)}var _=0;function v(){return _+=1,`copy:${_}`}function y(e={}){let t=(0,u.useMemo)(v,[]),n=g(t),r=e.clipboard??d,a=e.timer??i;return{copied:n,copy:(0,u.useCallback)(e=>h(t,()=>r.writeText(e),a),[r,t,a])}}export{l as a,d as i,g as n,s as o,y as r,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={name:`@cuongtran001/kanna`,type:`module`,version:`1.112.
|
|
1
|
+
var e={name:`@cuongtran001/kanna`,type:`module`,version:`1.112.3`,description:`A beautiful web UI for Claude Code`,license:`MIT`,keywords:[`claude`,`claude-code`,`ai`,`chat`,`ui`,`agent`,`anthropic`,`bun`,`react`],repository:{type:`git`,url:`git+https://github.com/cuongtranba/kanna.git`},bin:{kanna:`./bin/kanna`},packageManager:`bun@1.3.11`,files:[`bin/`,`src/server/`,`src/shared/`,`dist/client/`],engines:{bun:`>=1.3.11`},scripts:{build:`bun run build:client`,"build:client":`vp build`,"build:beacon-desktop":`bun run ./scripts/build-beacon-desktop.ts`,"icons:beacon-desktop":`bun run ./scripts/beacon-desktop-icons.ts`,typecheck:`vp check --no-lint`,check:`vp check --deny-warnings && bun run lint:comments && bun run lint:flex-overflow && bun run build:client && bun run check:bundle`,"check:bundle":`bun run ./scripts/check-client-bundle.ts`,lint:`vp lint --deny-warnings`,"lint:usestate":`ast-grep scan --report-style short`,"check:arch":`bun --bun vp test run src/ops/architecture/`,"lint:limits":`bun run ./scripts/check-complexity-limits.ts`,"lint:comments":`bun run ./scripts/check-no-comments.ts`,"lint:flex-overflow":`bun run ./scripts/check-flex-overflow.ts`,"strip:comments":`bun run ./scripts/strip-comments.ts`,dev:`bun run ./scripts/dev.ts`,"dev:client":`vp dev --host 0.0.0.0 --port 5174`,"dev:server":`bun run ./scripts/dev-server.ts --no-open --port 5175`,"install:dev":`bun install && bun run build && bun install -g .`,start:`bun run ./src/server/cli.ts`,test:`bun --bun vp test run`,"test:e2e":`bun run build && playwright test -c e2e/playwright.config.ts`,"test:smoke":`playwright test -c e2e/playwright.config.ts e2e/smoke.pw.ts`,"verify:client-arch":`bunx ast-grep scan && bun run lint && bun run typecheck && bun run test`,"scan:secrets":`gitleaks dir --no-banner --redact`,"check:commits":`bun run ./scripts/check-commit-messages.ts`,"setup:hooks":`git config core.hooksPath .githooks`,prepublishOnly:`bun run build`},dependencies:{"@anthropic-ai/claude-agent-sdk":`0.3.317`,"@atlaskit/pragmatic-drag-and-drop":`3.1.0`,"@atlaskit/pragmatic-drag-and-drop-auto-scroll":`3.2.1`,"@atlaskit/pragmatic-drag-and-drop-hitbox":`3.0.0`,"@better-auth/mcp":`1.7.15`,"@better-auth/oauth-provider":`1.7.15`,"@bufbuild/cel":`^0.6.1`,"@bufbuild/protobuf":`^2.6.2`,"@json-render/core":`0.21.4`,"@json-render/react":`0.21.4`,"@legendapp/list":`3.7.1`,"@lexical/clipboard":`^0.53.0`,"@lexical/code":`^0.53.0`,"@lexical/headless":`^0.53.0`,"@lexical/link":`^0.53.0`,"@lexical/list":`^0.53.0`,"@lexical/markdown":`^0.53.0`,"@lexical/plain-text":`^0.53.0`,"@lexical/react":`^0.53.0`,"@lexical/rich-text":`^0.53.0`,"@lexical/selection":`^0.53.0`,"@lexical/table":`^0.53.0`,"@lexical/text":`^0.53.0`,"@lexical/utils":`^0.53.0`,"@modelcontextprotocol/client":`^2.3.1`,"@modelcontextprotocol/sdk":`^1.29.0`,"@modelcontextprotocol/server":`^2.3.1`,"@nats-io/jetstream":`3.4.0`,"@nats-io/transport-node":`3.4.0`,"@opentelemetry/api":`^1.9.1`,"@opentelemetry/exporter-metrics-otlp-http":`^0.300.0`,"@opentelemetry/exporter-trace-otlp-http":`^0.300.0`,"@opentelemetry/resources":`^3.0.0`,"@opentelemetry/sdk-metrics":`^3.1.0`,"@opentelemetry/sdk-trace-node":`^2.10.0`,"@pierre/diffs":`^1.1.12`,"@radix-ui/react-context-menu":`^2.2.16`,"@radix-ui/react-select":`^2.2.6`,"@tanstack/react-query":`^5.101.2`,"@tus/file-store":`^2.1.1`,"@tus/server":`^2.4.5`,"@visactor/vchart":`2.2.1`,"@xterm/addon-fit":`^0.11.0`,"@xterm/addon-serialize":`^0.14.0`,"@xterm/addon-web-links":`^0.12.0`,"@xterm/headless":`^6.0.0`,"@xterm/xterm":`^6.0.0`,"@xyflow/react":`12.12.1`,animejs:`^4.5.0`,"better-auth":`1.7.15`,cloudflared:`^0.7.1`,cron:`^4.4.0`,"default-shell":`^2.2.0`,elkjs:`0.12.1`,"file-type":`^22.0.0`,"fractional-indexing":`4.0.0`,lexical:`^0.53.0`,"mdast-util-from-markdown":`^2.0.3`,"mdast-util-gfm":`^3.1.0`,"mdast-util-to-markdown":`^2.1.2`,mermaid:`^12.0.0`,"micromark-extension-gfm":`^3.0.0`,minimatch:`^11.0.3`,motion:`^14.0.0`,openai:`^7.8.0`,"react-resizable-panels":`^4.7.3`,"shell-quote":`^1.8.3`,sonner:`^2.0.7`,uqr:`^0.1.3`,"web-push":`^3.6.7`,yaml:`^2.9.1`,zod:`^4.5.4`},devDependencies:{"@ast-grep/cli":`0.51.1`,"@axe-core/playwright":`4.14.0`,"@conventional-commits/parser":`^0.4.1`,"@dnd-kit/core":`^6.3.1`,"@dnd-kit/sortable":`^10.0.0`,"@dnd-kit/utilities":`^3.2.2`,"@fontsource-variable/bricolage-grotesque":`^5.2.10`,"@happy-dom/global-registrator":`^21.0.3`,"@playwright/test":`^1.62.1`,"@radix-ui/react-dialog":`^1.1.15`,"@radix-ui/react-popover":`^1.1.15`,"@radix-ui/react-tooltip":`^1.2.8`,"@tailwindcss/postcss":`^4.1.18`,"@tailwindcss/typography":`^0.5.19`,"@types/bun":`latest`,"@types/mdast":`^4.0.4`,"@types/node":`^26.4.0`,"@types/react":`19.3.0`,"@types/react-dom":`19.3.0`,"@types/shell-quote":`^1.7.5`,"@types/web-push":`^3.6.4`,"@vitejs/plugin-react":`6.2.1`,autoprefixer:`^10.4.23`,"class-variance-authority":`^0.7.1`,clsx:`^2.1.1`,"happy-dom":`^21.0.1`,"lucide-react":`^1.37.0`,"oxlint-plugin-eslint":`1.91.0`,react:`19.3.1`,"react-dom":`19.3.1`,"react-router-dom":`^7.12.0`,"tailwind-merge":`^3.4.0`,tailwindcss:`^4.1.18`,"tus-js-client":`^4.3.1`,typescript:`6.0.3`,vite:`npm:@voidzero-dev/vite-plus-core@1.4.0`,"vite-plus":`1.4.0`,zustand:`^5.0.10`},overrides:{vite:`npm:@voidzero-dev/vite-plus-core@1.4.0`}},t=`Kanna`,n=`kanna`,r=`.kanna`,i=`.kanna-dev`,a=e.version;`${e.version}`;var o=`[kanna]`,s=`~/${t}`;function c(){return Reflect.get(globalThis,`process`)?.env}function l(e=c()){return e?.KANNA_RUNTIME_PROFILE?.trim().toLowerCase()===`dev`?`dev`:`prod`}function u(e=c()){return l(e)===`dev`?i:r}function d(e=c()){return`~/${u(e)}`}function f(e=c()){return`${d(e)}/keybindings.json`}function p(e){return e?`${n} ${e}`:n}function m(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);try{return Error(JSON.stringify(e))}catch{return Error(String(e))}}function h(e){return m(e).message}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _(e){return t=>{e(m(t))}}export{t as a,o as c,m as i,p as l,g as n,a as o,_ as r,s,h as t,f as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./core-types-BWpRMPSe.js";import{ut as t}from"./tool-call-types-CoEzmgyY.js";import{M as n}from"./types-tbL38EdO.js";import{K as r}from"./keybindings-
|
|
1
|
+
import{f as e}from"./core-types-BWpRMPSe.js";import{ut as t}from"./tool-call-types-CoEzmgyY.js";import{M as n}from"./types-tbL38EdO.js";import{K as r}from"./keybindings-CqgNeQvJ.js";var i=[`off`,`suggest`,`approve`,`auto`],a=e(i),o={level:`suggest`,threshold:.8,perThreadPerHour:3,perSourcePerDay:20,quietHours:null,allowlist:[],allowUrls:!1,maxChars:1e3,sendDelaySeconds:30,sendFromNotification:!1},s={perThreadPerHour:{min:0,max:100},perSourcePerDay:{min:0,max:1e3},maxChars:{min:1,max:r},sendDelaySeconds:{min:10,max:300},allowlistEntries:500,allowlistEntryChars:200},c=/^([01]\d|2[0-3]):([0-5]\d)$/;function l(e){let t=c.exec(e);return t===null?null:Number(t[1])*60+Number(t[2])}function u(e){return l(e)!==null}function d(e){return i.indexOf(e)>i.indexOf(`suggest`)}function f(e){return e===void 0||n(e)}function p(e){return e===void 0||!Number.isFinite(e)?o.threshold:Math.min(1,Math.max(0,e))}function m(e){let t=new Set;for(let n of e??[]){let e=n.trim().slice(0,s.allowlistEntryChars);e.length>0&&t.add(e)}return[...t].slice(0,s.allowlistEntries)}function h(e){let n=o,r=s,i=e?.quietHours;return{level:e?.level??n.level,threshold:p(e?.threshold),perThreadPerHour:t(e?.perThreadPerHour,r.perThreadPerHour,n.perThreadPerHour),perSourcePerDay:t(e?.perSourcePerDay,r.perSourcePerDay,n.perSourcePerDay),quietHours:i?{start:i.start.trim(),end:i.end.trim()}:null,allowlist:m(e?.allowlist),allowUrls:e?.allowUrls??n.allowUrls,maxChars:t(e?.maxChars,r.maxChars,n.maxChars),sendDelaySeconds:t(e?.sendDelaySeconds,r.sendDelaySeconds,n.sendDelaySeconds),sendFromNotification:e?.sendFromNotification??n.sendFromNotification}}function g(e,t){if(e===void 0)return[];let n=h(e),r=[];d(n.level)&&!t&&r.push(`Approve and Auto autonomy need a reply target`);let i=n.quietHours;return i===null||u(i.start)&&u(i.end)||r.push(`Quiet hours must be HH:MM times`),r}var _={off:`Off`,suggest:`Suggest`,approve:`Approve`,auto:`Auto`},v=`default`,y=`Approve and Auto need a reply target on the source`,b=`Auto needs a Claude handler: Codex and Antigravity cannot be stopped from sending on their own`;function x(e,t){return d(e)&&t.reply===null?y:e===`auto`&&!f(t.handler.provider)?b:null}function S(e,t){if(e.sourceKind!==`mcp`)return null;let n=t.find(t=>t.id===e.sourceId);if(n===void 0)return null;let r=n.autonomy.level,a=e.autonomy??r,o=i.map(e=>({level:e,reason:x(e,n)}));return{sourceId:n.id,sourceLevel:r,effective:a,blockedReason:o.find(e=>e.reason!==null)?.reason??null,offerAllowContact:a===`auto`&&!n.autonomy.allowlist.includes(e.threadKey),allowlist:n.autonomy.allowlist,options:[{value:v,label:`Source default (${_[r]})`,disabled:!1},...o.map(({level:e,reason:t})=>({value:e,label:_[e],disabled:t!==null}))]}}function C(e,t){return e.agentPausedUntil!==void 0&&e.agentPausedUntil>t}function w(e){let t=Math.max(0,Math.ceil(e/1e3)),n=Math.floor(t/60),r=String(t%60).padStart(2,`0`);return`${String(n)}:${r}`}function T(e){return`${String(Math.round(e*100))}%`}var E={you:`You`,approved:`You · approved`,agent:`Agent · auto`};function D(e){return E[e.by]}function O(e){let{proposal:t}=e;return t===void 0?null:`Confidence ${T(t.confidence)} · ${t.reason}`}export{S as a,O as c,a as d,g as f,w as i,i as l,v as n,C as o,T as r,D as s,_ as t,o as u};
|