@llmops/app 0.1.8 → 0.1.9-beta.1

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.
Files changed (115) hide show
  1. package/dist/.vite/manifest.json +285 -366
  2. package/dist/assets/Form-DHA5ZPmK.js +1 -0
  3. package/dist/assets/_environment-Bj632BW3.js +1 -0
  4. package/dist/assets/_observability-Bsw31e8i.js +1 -0
  5. package/dist/assets/_settings-MuCcKpRb.js +1 -0
  6. package/dist/assets/{_tabs-DaucGqpx.js → _tabs-DR5WY23M.js} +1 -1
  7. package/dist/assets/{_tabs-D9USU0yw.js → _tabs-Osf37WI9.js} +1 -1
  8. package/dist/assets/_variant-DGrwitKk.js +30 -0
  9. package/dist/assets/{_variants-Bjp8ZEvO.js → _variants-C7fc4T8_.js} +1 -1
  10. package/dist/assets/{area.css-CSjofvHM.js → area.css-ByjMFuMe.js} +1 -1
  11. package/dist/assets/auth-BkNQi67-.css +1 -0
  12. package/dist/assets/auth.css-CbKu-iME.js +1 -0
  13. package/dist/assets/button-J5fxAIyE.js +1 -0
  14. package/dist/assets/check-BdOT-uCr.js +1 -0
  15. package/dist/assets/{chevron-right-fMWRsRLZ.js → chevron-right-CcvZen9O.js} +1 -1
  16. package/dist/assets/combobox-BKEpKROu.js +1 -0
  17. package/dist/assets/configs-BEKTOPIS.js +1 -0
  18. package/dist/assets/{copy-DADLeZ69.js → copy-Btrg1ewH.js} +1 -1
  19. package/dist/assets/{costs-Fh0OPnEw.js → costs-C0sD1amq.js} +1 -1
  20. package/dist/assets/environments-CZ6PX9PA.js +1 -0
  21. package/dist/assets/index-C1Qc7Z7W.js +27 -0
  22. package/dist/assets/index-C8Gwa2Ui.js +1 -0
  23. package/dist/assets/{index-DeuSY0Yv.js → index-CAScpK2G.js} +1 -1
  24. package/dist/assets/{index-DW-cTzEh.js → index-CPQ3xdGh.js} +1 -1
  25. package/dist/assets/index-CPokRl9v.js +1 -0
  26. package/dist/assets/index-CQALuvff.js +1 -0
  27. package/dist/assets/{index-BFe2NM3q.css → index-CgbnU9Zg.css} +1 -1
  28. package/dist/assets/{index-Cns5MLjo.js → index-ChLdrp-m.js} +1 -1
  29. package/dist/assets/{index.esm-oCSEvUVx.js → index.esm-BVbruXk6.js} +1 -1
  30. package/dist/assets/info-box.css-BzqwxgQm.js +1 -0
  31. package/dist/assets/logo-D4ybjOzp.css +1 -0
  32. package/dist/assets/logo.css-BHDDnlVa.js +1 -0
  33. package/dist/assets/new-config-state-B8sMe-TC.css +1 -0
  34. package/dist/assets/new-config-state.css-DccH1TI0.js +1 -0
  35. package/dist/assets/{observability.css-wgjHtY3p.js → observability.css-D5kKsJ4z.js} +1 -1
  36. package/dist/assets/{overview-D1QIYPBL.js → overview-Czui5UTZ.js} +5 -5
  37. package/dist/assets/plus-DqiZvCBU.js +1 -0
  38. package/dist/assets/popover-BndR7yWD.js +1 -0
  39. package/dist/assets/requests-DrSJLtrE.js +1 -0
  40. package/dist/assets/{route-Df57lqxl.js → route-22shZRiS.js} +1 -1
  41. package/dist/assets/route-7Tn2yELm.js +1 -0
  42. package/dist/assets/{route-CjAw8hSU.js → route-CqIm0KnA.js} +1 -1
  43. package/dist/assets/{route-timDYxX2.js → route-D_QnUz7-.js} +1 -1
  44. package/dist/assets/{route-DmWZbVk6.js → route-DwYQMwtZ.js} +1 -1
  45. package/dist/assets/secrets-DnWQ2F0V.js +1 -0
  46. package/dist/assets/settings-c6c9IYPa.js +1 -0
  47. package/dist/assets/settings-sisslKb5.js +1 -0
  48. package/dist/assets/setup-G_oS-RU-.js +1 -0
  49. package/dist/assets/signin-B-qadLup.js +1 -0
  50. package/dist/assets/table-jMzD3FNy.js +1 -0
  51. package/dist/assets/{tabs.css-CG5ugi0p.js → tabs.css-CkcP1Ksc.js} +1 -1
  52. package/dist/assets/targeting-CaE84Lx8.js +1 -0
  53. package/dist/assets/tooltip-BiUUXiGj.js +1 -0
  54. package/dist/assets/{update-or-create-name-B-M46wHl.js → update-or-create-name-DGt2MGEI.js} +1 -1
  55. package/dist/assets/useAnalytics-CHDelHQa.js +1 -0
  56. package/dist/assets/useConfigList-Bx9xKceA.js +1 -0
  57. package/dist/assets/{useConfigVariants-CLc_hPw1.js → useConfigVariants-CB0S5gfJ.js} +1 -1
  58. package/dist/assets/useEnvironments-DILRhv_b.js +1 -0
  59. package/dist/assets/{useMutation-D4JglXWk.js → useMutation-CNzYa4ST.js} +1 -1
  60. package/dist/assets/usePopupAutoResize-CaO9EPHk.js +1 -0
  61. package/dist/assets/{useSetTargeting-bk0Ixhqq.js → useSetTargeting-DY3jI95T.js} +1 -1
  62. package/dist/assets/useTargetingRules-D10mXxut.js +1 -0
  63. package/dist/assets/useValueChanged-8LsiEynk.js +1 -0
  64. package/dist/assets/{user-profile-BB3dPOc5.js → user-profile-8xq1f7_D.js} +1 -1
  65. package/dist/assets/variants-rQQlpgeF.js +1 -0
  66. package/dist/assets/variants.css-Dzb38Nu1.js +1 -0
  67. package/dist/assets/{workspace-general-DYXfOF9H.js → workspace-general-dH65Sm8D.js} +1 -1
  68. package/dist/index.cjs +136 -59
  69. package/dist/index.d.cts +8 -5
  70. package/dist/index.d.mts +8 -5
  71. package/dist/index.mjs +138 -61
  72. package/package.json +4 -3
  73. package/dist/assets/Form-Bh6BPtQ_.js +0 -1
  74. package/dist/assets/InternalBackdrop-Za9lpJi7.js +0 -12
  75. package/dist/assets/_environment-COxSWJ9w.js +0 -1
  76. package/dist/assets/_observability-C8wSXZk2.js +0 -1
  77. package/dist/assets/_settings-DOmj1R7I.js +0 -1
  78. package/dist/assets/_variant-DxME2BL0.js +0 -30
  79. package/dist/assets/button-CMZqhyXB.js +0 -1
  80. package/dist/assets/check-D9E8RKB4.js +0 -1
  81. package/dist/assets/chevron-down-BJFxhYkh.js +0 -1
  82. package/dist/assets/combobox-iSbUYz0A.js +0 -1
  83. package/dist/assets/configs-BflhBVlY.js +0 -1
  84. package/dist/assets/environments-ChldQPyq.js +0 -1
  85. package/dist/assets/getDisabledMountTransitionStyles-TZFYxPIU.js +0 -1
  86. package/dist/assets/index-BDsrc1Q7.js +0 -1
  87. package/dist/assets/index-BWU02PnY.js +0 -1
  88. package/dist/assets/index-DYoud8po.js +0 -1
  89. package/dist/assets/index-FrTQ7TcS.js +0 -16
  90. package/dist/assets/info-box.css-DuVI9M9-.js +0 -1
  91. package/dist/assets/llmops-B3IIte87.css +0 -1
  92. package/dist/assets/llmops-CdOQq40D.js +0 -1
  93. package/dist/assets/plus-JQ0TORpd.js +0 -1
  94. package/dist/assets/popover-DXj4s-ni.js +0 -1
  95. package/dist/assets/popupStateMapping-DolkyTT3.js +0 -1
  96. package/dist/assets/requests-CzvYwfwV.js +0 -1
  97. package/dist/assets/reselect-DVmmTZGf.js +0 -1
  98. package/dist/assets/secrets-BxFGEuKj.js +0 -1
  99. package/dist/assets/settings-DpSRw7LL.js +0 -1
  100. package/dist/assets/settings-pgWZnVf6.js +0 -1
  101. package/dist/assets/table-DggTSlPh.js +0 -1
  102. package/dist/assets/targeting-CkqRTjnZ.js +0 -1
  103. package/dist/assets/tooltip-BuSsMQ8P.js +0 -1
  104. package/dist/assets/useAnalytics-DTf81POS.js +0 -1
  105. package/dist/assets/useButton-CsZ8hBM8.js +0 -1
  106. package/dist/assets/useConfigList-CAf01_dV.js +0 -1
  107. package/dist/assets/useEnvironments-Bu_0SIUj.js +0 -1
  108. package/dist/assets/useFocus-9TCY0h5x.js +0 -1
  109. package/dist/assets/usePopupAutoResize-D6RSlB-m.js +0 -1
  110. package/dist/assets/useRole-CiSaVva3.js +0 -1
  111. package/dist/assets/useSyncedFloatingRootContext-BKbVh8Gq.js +0 -1
  112. package/dist/assets/useTargetingRules-BrgaEdxR.js +0 -1
  113. package/dist/assets/useValueChanged-CTjBqaGs.js +0 -1
  114. package/dist/assets/variants-BH682hHM.js +0 -1
  115. package/dist/assets/variants.css-rCWHZycz.js +0 -1
@@ -1,30 +0,0 @@
1
- import{a0 as hg,r as w,j as k,x as wr,l as pg,a as qe,e as mg,I as Gu,a1 as Ia,t as yg,i as Fo,g as Yu,a2 as _g,d as vg,a3 as xg}from"./index-FrTQ7TcS.js";import{u as Bs,a as Zu,b as bg,c as Sg,g as Cg,d as Xu,e as Eg,f as Tg,h as wg,i as kg,j as Mo}from"./combobox-iSbUYz0A.js";import{e as Qu,i as Zt,u as Ng}from"./index.esm-oCSEvUVx.js";import{S as Ag,v as Ra,a as Pg,b as Ig,m as Rg,c as Og,d as Fg,g as Mg,u as $g,e as Lg,f as Dg,h as Bg,i as jg}from"./useSetTargeting-bk0Ixhqq.js";import{u as zg,a as ec,b as tc,P as nc}from"./popover-DXj4s-ni.js";import{f as In,d as rc,m as ys,e as $o,c as bt,b as Ug,E as js,u as tr,a as Fe,h as ji,i as sc,j as Kg,k as Wg,l as Vg,n as fi}from"./useButton-CsZ8hBM8.js";import{z as ic,o as nr,s as Hg,A as qg,c as ct,r as oc,v as Jg,F as Gg,D as Yg,q as Zg,t as br,B as Xg,E as mr,R as Qg,P as eh,d as Le,G as ac,H as lc,I as uc,J as th,u as _s,e as Oa,f as nh,K as zi,L as rh,h as sh,m as ih,k as oh,l as Lo,M as cc,N as ah,O as lh,Q as Qt,S as uh,a as ls,U as ch,V as dh,W as fh,X as gh,Y as hh,Z as Fa,_ as Ma,$ as ph,p as mh,a0 as dc,n as yh,y as fc,a1 as gc,a2 as _h,a3 as vh,a4 as xh,a5 as $a,a6 as hc,a7 as La}from"./popupStateMapping-DolkyTT3.js";import{g as bh,u as Sh,b as Do}from"./getDisabledMountTransitionStyles-TZFYxPIU.js";import{C as pc,u as Ch,H as mc,E as yc,A as _c,a as vc,b as xc,c as bc}from"./useRole-CiSaVva3.js";import{a as Eh,u as Th}from"./useValueChanged-CTjBqaGs.js";import{C as wh}from"./chevron-right-fMWRsRLZ.js";import{C as Sc}from"./check-D9E8RKB4.js";import{C as Cc}from"./chevron-down-BJFxhYkh.js";import{F as kh,I as Nh,i as Ah,u as Ph,a as Ih,b as Ec}from"./InternalBackdrop-Za9lpJi7.js";import{p as Rh,c as Oh,a as Fh,b as Mh,u as $h,d as Lh,e as Dh}from"./useSyncedFloatingRootContext-BKbVh8Gq.js";import{b as Bh,u as Tc,s as wc}from"./usePopupAutoResize-D6RSlB-m.js";import{u as jh}from"./useFocus-9TCY0h5x.js";import{u as kc}from"./useMutation-D4JglXWk.js";import{g as zh,u as Uh}from"./useConfigVariants-CLc_hPw1.js";import{u as Kh}from"./useTargetingRules-BrgaEdxR.js";import{B as gi}from"./button-CMZqhyXB.js";import{u as Wh}from"./useEnvironments-Bu_0SIUj.js";/* empty css *//* empty css */import"./reselect-DVmmTZGf.js";function Vh(n,e){if(n===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in n)return n;if(typeof n=="function")return{shouldBlockFn:async()=>await n(),enableBeforeUnload:!0,withResolver:!1};const t=!!(n.condition??!0),r=n.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function Hh(n,e){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=Vh(n),o=hg(),{history:a}=o,[l,c]=w.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return w.useEffect(()=>{const u=async f=>{function d(p){const _=o.parseLocation(p),C=o.getMatchedRoutes(_.pathname);return C.foundRoute===void 0?{routeId:"__notFound__",fullPath:_.pathname,pathname:_.pathname,params:C.routeParams,search:o.options.parseSearch(p.search)}:{routeId:C.foundRoute.id,fullPath:C.foundRoute.fullPath,pathname:_.pathname,params:C.routeParams,search:o.options.parseSearch(p.search)}}const h=d(f.currentLocation),g=d(f.nextLocation);if(h.routeId==="__notFound__"&&g.routeId!=="__notFound__")return!1;const m=await t({action:f.action,current:h,next:g});if(!i)return m;if(!m)return!1;const x=await new Promise(p=>{c({status:"blocked",current:h,next:g,action:f.action,proceed:()=>p(!1),reset:()=>p(!0)})});return c({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),x};return s?void 0:a.block({blockerFn:u,enableBeforeUnload:r})},[t,r,s,i,a,o]),l}function Nc(n,e,t=(r,s)=>r===s){return n.length===e.length&&n.every((r,s)=>t(r,e[s]))}const qh=w.createContext(void 0);function zs(n=!0){const e=w.useContext(qh);if(e===void 0&&!n)throw new Error(In(25));return e}const Ac=w.createContext(void 0);function Bo(n){const e=w.useContext(Ac);if(e===void 0&&!n)throw new Error(In(33));return e}const Pc=w.createContext(void 0);function Gt(n){const e=w.useContext(Pc);if(e===void 0&&!n)throw new Error(In(36));return e}const Jh={type:"regular-item"};function Ic(n){const{closeOnClick:e,disabled:t=!1,highlighted:r,id:s,store:i,nativeButton:o,itemMetadata:a,nodeId:l}=n,c=w.useRef(null),u=zs(!0),f=u!==void 0,{events:d}=i.useState("floatingTreeRoot"),{getButtonProps:h,buttonRef:g}=rc({disabled:t,focusableWhenDisabled:!0,native:o}),m=w.useCallback(x=>ys({id:s,role:"menuitem",tabIndex:r?0:-1,onMouseMove(p){l&&d.emit("itemhover",{nodeId:l,target:p.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(p){p.key===" "&&i.context.typingRef.current&&p.preventBaseUIHandler()},onClick(p){e&&d.emit("close",{domEvent:p,reason:ic})},onMouseUp(p){if(u){const _=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,f&&_&&Math.abs(p.clientX-_.x)<=1&&Math.abs(p.clientY-_.y)<=1)return}c.current&&i.context.allowMouseUpTriggerRef.current&&(!f||p.button===2)&&a.type==="regular-item"&&c.current.click()}},x,h),[s,r,h,e,d,i,f,u,a,l]),y=$o(c,g);return w.useMemo(()=>({getItemProps:m,itemRef:y}),[m,y])}const Gh=w.forwardRef(function(e,t){const{render:r,className:s,id:i,label:o,nativeButton:a=!1,disabled:l=!1,closeOnClick:c=!0,...u}=e,f=Bs({label:o}),d=Bo(!0),h=nr(i),{store:g}=Gt(),m=g.useState("isActive",f.index),y=g.useState("itemProps"),{getItemProps:x,itemRef:p}=Ic({closeOnClick:c,disabled:l,highlighted:m,id:h,store:g,nativeButton:a,nodeId:d?.nodeId,itemMetadata:Jh}),_=w.useMemo(()=>({disabled:l,highlighted:m}),[l,m]);return bt("div",e,{state:_,props:[y,u,x],ref:[p,t,f.ref]})}),Yh={...oc,...Jg},Da=w.forwardRef(function(e,t){const{render:r,className:s,finalFocus:i,...o}=e,{store:a}=Gt(),{side:l,align:c}=Bo(),u=zg()!=null,f=a.useState("open"),d=a.useState("transitionStatus"),h=a.useState("popupProps"),g=a.useState("mounted"),m=a.useState("instantType"),y=a.useState("activeTriggerElement"),x=a.useState("parent"),p=a.useState("lastOpenChangeReason"),_=a.useState("rootId"),C=a.useState("floatingRootContext"),v=a.useState("floatingTreeRoot"),b=a.useState("closeDelay"),S=a.useState("activeTriggerElement");Hg({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),w.useEffect(()=>{function R(I){a.setOpen(!1,ct(I.reason,I.domEvent))}return v.events.on("close",R),()=>{v.events.off("close",R)}},[v.events,a]);const T=a.useState("hoverEnabled"),E=a.useState("disabled");Bh(C,{enabled:T&&!E&&x.type!=="context-menu"&&x.type!=="menubar",closeDelay:b});const N=w.useMemo(()=>({transitionStatus:d,side:l,align:c,open:f,nested:x.type==="menu",instant:m}),[d,l,c,f,x.type,m]),P=bt("div",e,{state:N,ref:[t,a.context.popupRef],stateAttributesMapping:Yh,props:[h,{onKeyDown(R){u&&pc.has(R.key)&&R.stopPropagation()}},bh(d),o,{"data-rootownerid":_}]});let $=x.type===void 0||x.type==="context-menu";return(y||x.type==="menubar"&&p!==qg)&&($=!0),k.jsx(kh,{context:C,modal:!1,disabled:!g,returnFocus:i===void 0?$:i,initialFocus:x.type!=="menu",restoreFocus:!0,externalTree:x.type!=="menubar"?v:void 0,previousFocusableElement:S,nextFocusableElement:x.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:x.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:P})}),Rc=w.createContext(void 0);function Zh(){const n=w.useContext(Rc);if(n===void 0)throw new Error(In(32));return n}const Ba=w.forwardRef(function(e,t){const{keepMounted:r=!1,...s}=e,{store:i}=Gt();return i.useState("mounted")||r?k.jsx(Rc.Provider,{value:r,children:k.jsx(Gg,{ref:t,...s})}):null}),ja=w.forwardRef(function(e,t){const{anchor:r,positionMethod:s="absolute",className:i,render:o,side:a,align:l,sideOffset:c=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:y=Yg,...x}=e,{store:p}=Gt(),_=Zh(),C=zs(!0),v=p.useState("parent"),b=p.useState("floatingRootContext"),S=p.useState("floatingTreeRoot"),T=p.useState("mounted"),E=p.useState("open"),N=p.useState("modal"),P=p.useState("activeTriggerElement"),$=p.useState("lastOpenChangeReason"),R=p.useState("floatingNodeId"),I=p.useState("floatingParentNodeId");let j=r,B=c,M=u,U=l,z=y;v.type==="context-menu"&&(j=r??v.context?.anchor,U=U??"start",!a&&U!=="center"&&(M=e.alignOffset??2,B=e.sideOffset??-5));let Z=a,ne=U;v.type==="menu"?(Z=Z??"inline-end",ne=ne??"start",z=e.collisionAvoidance??Zg):v.type==="menubar"&&(Z=Z??"bottom",ne=ne??"start");const J=v.type==="context-menu",q=Sh({anchor:j,floatingRootContext:b,positionMethod:C?"fixed":s,mounted:T,side:Z,sideOffset:B,align:ne,alignOffset:M,arrowPadding:J?0:h,collisionBoundary:f,collisionPadding:d,sticky:g,nodeId:R,keepMounted:_,disableAnchorTracking:m,collisionAvoidance:z,shiftCrossAxis:J,externalTree:S}),H=w.useMemo(()=>{const ie={};return E||(ie.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...q.positionerStyles,...ie}}},[E,T,q.positionerStyles]);w.useEffect(()=>{function ie(V){V.open?(V.parentNodeId===R&&p.set("hoverEnabled",!1),V.nodeId!==R&&V.parentNodeId===p.select("floatingParentNodeId")&&p.setOpen(!1,ct(mr))):V.parentNodeId===R&&V.reason!==mr&&p.set("hoverEnabled",!0)}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[p,S.events,R]),w.useEffect(()=>{if(p.select("floatingParentNodeId")==null)return;function ie(V){if(V.open||V.nodeId!==p.select("floatingParentNodeId"))return;const ce=V.reason??mr;p.setOpen(!1,ct(ce))}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[S.events,p]),w.useEffect(()=>{function ie(V){!E||V.nodeId!==p.select("floatingParentNodeId")||V.target&&P&&P!==V.target&&p.setOpen(!1,ct(mr))}return S.events.on("itemhover",ie),()=>{S.events.off("itemhover",ie)}},[S.events,E,P,p]),w.useEffect(()=>{const ie={open:E,nodeId:R,parentNodeId:I,reason:p.select("lastOpenChangeReason")};S.events.emit("menuopenchange",ie)},[S.events,E,p,R,I]);const ae=w.useMemo(()=>({open:E,side:q.side,align:q.align,anchorHidden:q.anchorHidden,nested:v.type==="menu"}),[E,q.side,q.align,q.anchorHidden,v.type]),re=w.useMemo(()=>({side:q.side,align:q.align,arrowRef:q.arrowRef,arrowUncentered:q.arrowUncentered,arrowStyles:q.arrowStyles,nodeId:q.context.nodeId}),[q.side,q.align,q.arrowRef,q.arrowUncentered,q.arrowStyles,q.context.nodeId]),le=bt("div",e,{state:ae,stateAttributesMapping:oc,ref:[t,p.useStateSetter("positionerElement")],props:[H,x]}),Q=T&&v.type!=="menu"&&(v.type!=="menubar"&&N&&$!==br||v.type==="menubar"&&v.context.modal);let te=null;return v.type==="menubar"?te=v.context.contentElement:v.type===void 0&&(te=P),k.jsxs(Ac.Provider,{value:re,children:[Q&&k.jsx(Nh,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Ah(!E),cutout:te}),k.jsx(Xg,{id:R,children:k.jsx(Zu,{elementsRef:p.context.itemDomElements,labelsRef:p.context.itemLabels,children:le})})]})}),Xh=w.createContext(null);function Oc(n){return w.useContext(Xh)}const Qh={...Rh,disabled:Le(n=>n.parent.type==="menubar"&&n.parent.context.disabled||n.disabled),modal:Le(n=>(n.parent.type===void 0||n.parent.type==="context-menu")&&(n.modal??!0)),allowMouseEnter:Le(n=>n.parent.type==="menu"?n.parent.store.select("allowMouseEnter"):n.allowMouseEnter),stickIfOpen:Le(n=>n.stickIfOpen),parent:Le(n=>n.parent),rootId:Le(n=>n.parent.type==="menu"?n.parent.store.select("rootId"):n.parent.type!==void 0?n.parent.context.rootId:n.rootId),activeIndex:Le(n=>n.activeIndex),isActive:Le((n,e)=>n.activeIndex===e),hoverEnabled:Le(n=>n.hoverEnabled),instantType:Le(n=>n.instantType),lastOpenChangeReason:Le(n=>n.openChangeReason),floatingTreeRoot:Le(n=>n.parent.type==="menu"?n.parent.store.select("floatingTreeRoot"):n.floatingTreeRoot),floatingNodeId:Le(n=>n.floatingNodeId),floatingParentNodeId:Le(n=>n.floatingParentNodeId),itemProps:Le(n=>n.itemProps),closeDelay:Le(n=>n.closeDelay),keyboardEventRelay:Le(n=>{if(n.keyboardEventRelay)return n.keyboardEventRelay;if(n.parent.type==="menu")return n.parent.store.select("keyboardEventRelay")})};class jo extends Qg{constructor(e){super({...ep(),...e},{positionerRef:w.createRef(),popupRef:w.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),onOpenChangeComplete:void 0,triggerElements:new eh},Qh),this.observe(Le(t=>t.allowMouseEnter),(t,r)=>{this.state.parent.type==="menu"&&t!==r&&this.state.parent.store.set("allowMouseEnter",t)}),this.unsubscribeParentListener=this.observe("parent",t=>{if(this.unsubscribeParentListener?.(),t.type==="menu"){this.unsubscribeParentListener=t.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=t.store.context.allowMouseUpTriggerRef;return}t.type!==void 0&&(this.context.allowMouseUpTriggerRef=t.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){return Ug(()=>e??new jo(t)).current}unsubscribeParentListener=null}function ep(){return{...Oh(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ac,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:js,keyboardEventRelay:void 0,closeDelay:0}}const Fc=w.createContext(void 0);function Mc(){return w.useContext(Fc)}function $c(n){const{children:e,open:t,onOpenChange:r,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:o=!1,modal:a,loopFocus:l=!0,orientation:c="vertical",actionsRef:u,closeParentOnEsc:f=!1,handle:d,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:m=!0}=n,y=zs(!0),x=Gt(!0),p=Oc(),_=Mc(),C=w.useMemo(()=>_&&x?{type:"menu",store:x.store}:p?{type:"menubar",context:p}:y&&!x?{type:"context-menu",context:y}:{type:void 0},[y,x,p,_]),v=jo.useStore(d?.store,{parent:C}),b=v.useState("floatingTreeRoot"),S=lc(b),T=uc();tr(()=>{y&&!x?v.update({parent:{type:"context-menu",context:y},floatingNodeId:S,floatingParentNodeId:T}):x&&v.update({floatingNodeId:S,floatingParentNodeId:T})},[y,x,S,T,v]),v.useControlledProp("open",t,i),v.useControlledProp("activeTriggerId",h,g),v.useContextCallback("onOpenChangeComplete",s);const E=v.useState("open"),N=v.useState("activeTriggerElement"),P=v.useState("positionerElement"),$=v.useState("hoverEnabled"),R=v.useState("modal"),I=v.useState("disabled"),j=v.useState("lastOpenChangeReason"),B=v.useState("parent"),M=v.useState("activeIndex"),U=v.useState("payload"),z=v.useState("floatingParentNodeId"),Z=w.useRef(null),ne=z!=null;let J;v.useSyncedValues({disabled:o,modal:B.type===void 0?a:void 0,rootId:th()});const{openMethod:q,triggerProps:H,reset:ae}=Ph(E);Fh(v);const{forceUnmount:re}=Mh(E,v,()=>{v.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),le=w.useRef(B.type!=="context-menu"),Q=_s();w.useEffect(()=>{if(E||(Z.current=null),B.type==="context-menu"){if(!E){Q.clear(),le.current=!1;return}Q.start(500,()=>{le.current=!0})}},[Q,E,B.type]),Ih(E&&R&&j!==br&&q!=="touch",P),tr(()=>{!E&&!$&&v.set("hoverEnabled",!0)},[E,$,v]);const te=w.useRef(!0),ie=_s(),V=Fe((de,Y)=>{const Se=Y.reason;if(E===de&&Y.trigger===N||(Y.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},!de&&Y.trigger==null&&(Y.trigger=N??void 0),r?.(de,Y),Y.isCanceled))return;const rt={open:de,nativeEvent:Y.event,reason:Y.reason,nested:ne};J?.emit("openchange",rt);const st=Y.event;if(de===!1&&st?.type==="click"&&st.pointerType==="touch"&&!te.current)return;if(!de&&M!==null){const be=v.context.itemDomElements.current[M];queueMicrotask(()=>{be?.setAttribute("tabindex","-1")})}de&&Se===Oa?(te.current=!1,ie.start(300,()=>{te.current=!0})):(te.current=!0,ie.clear());const cn=(Se===nh||Se===ic)&&st.detail===0&&st?.isTrusted,Hr=!de&&(Se===sh||Se==null);function Ce(){const be={open:de,openChangeReason:Se};Z.current=Y.event??null;const Pe=Y.trigger?.id??null;(Pe||de)&&(be.activeTriggerId=Pe,be.activeTriggerElement=Y.trigger??null),v.update(be)}Se===br?wr.flushSync(Ce):Ce(),B.type==="menubar"&&(Se===Oa||Se===zi||Se===br||Se===rh||Se===mr)?v.set("instantType","group"):cn||Hr?v.set("instantType",cn?"click":"dismiss"):v.set("instantType",void 0)}),ce=w.useCallback(de=>{const Y=ct(de);return Y.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},Y},[v]),he=w.useCallback(()=>{v.setOpen(!1,ce(ih))},[v,ce]);w.useImperativeHandle(u,()=>({unmount:re,close:he}),[re,he]);let Ne;B.type==="context-menu"&&(Ne=B.context),w.useImperativeHandle(Ne?.positionerRef,()=>P,[P]),w.useImperativeHandle(Ne?.actionsRef,()=>({setOpen:V}),[V]);const W=$h({popupStore:v,onOpenChange:V});J=W.context.events,w.useEffect(()=>{const de=({open:Y,eventDetails:Se})=>V(Y,Se);return J.on("setOpen",de),()=>{J?.off("setOpen",de)}},[J,V]);const ue=oh(W,{enabled:!I,bubbles:f&&B.type==="menu",outsidePress(){return B.type!=="context-menu"||Z.current?.type==="contextmenu"?!0:le.current},externalTree:ne?b:void 0}),G=Ch(W,{role:"menu"}),oe=Do(),ee=w.useCallback(de=>{v.select("activeIndex")!==de&&v.set("activeIndex",de)},[v]),Ae=bg(W,{enabled:!I,listRef:v.context.itemDomElements,activeIndex:M,nested:B.type!==void 0,loopFocus:l,orientation:c,parentOrientation:B.type==="menubar"?B.context.orientation:void 0,rtl:oe==="rtl",disabledIndices:ji,onNavigate:ee,openOnArrowKeyDown:B.type!=="context-menu",externalTree:ne?b:void 0,focusItemOnHover:m}),lt=w.useCallback(de=>{v.context.typingRef.current=de},[v]),Ge=Sg(W,{listRef:v.context.itemLabels,activeIndex:M,resetMs:lh,onMatch:de=>{E&&de!==M&&v.set("activeIndex",de)},onTypingChange:lt}),{getReferenceProps:ut,getFloatingProps:Dt,getItemProps:Et,getTriggerProps:me}=Lo([ue,G,Ae,Ge]),Bt=w.useMemo(()=>{const de=ys(ut(),{onMouseEnter(){v.set("hoverEnabled",!0)},onMouseMove(){v.set("allowMouseEnter",!0)}},H);return delete de.role,de},[ut,v,H]),Ye=w.useMemo(()=>{const de=me();if(!de)return de;const Y=ys(de,H);return delete Y.role,delete Y["aria-controls"],Y},[me,H]),Ke=cc(),We=w.useMemo(()=>Dt({onMouseEnter(){B.type==="menu"&&Ke.request(()=>v.set("hoverEnabled",!1))},onMouseMove(){v.set("allowMouseEnter",!0)},onClick(){v.select("hoverEnabled")&&v.set("hoverEnabled",!1)},onKeyDown(de){const Y=v.select("keyboardEventRelay");Y&&!de.isPropagationStopped()&&Y(de)}}),[Dt,B.type,Ke,v]),jt=w.useMemo(()=>Et(),[Et]);v.useSyncedValues({floatingRootContext:W,activeTriggerProps:Bt,inactiveTriggerProps:Ye,popupProps:We,itemProps:jt});const et=w.useMemo(()=>({store:v,parent:C}),[v,C]),Dn=k.jsx(Pc.Provider,{value:et,children:typeof e=="function"?e({payload:U}):e});return B.type===void 0||B.type==="context-menu"?k.jsx(ah,{externalTree:b,children:Dn}):Dn}function tp(n){const e=Gt().store,t=w.useMemo(()=>({parentMenu:e}),[e]);return k.jsx(Fc.Provider,{value:t,children:k.jsx($c,{...n})})}function np(n={}){const{highlightItemOnHover:e,highlightedIndex:t,onHighlightedIndexChange:r}=sc(),{ref:s,index:i}=Bs(n),o=t===i,a=w.useRef(null),l=$o(s,a);return{compositeProps:w.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(i)},onMouseMove(){const u=a.current;if(!e||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!o&&!f&&u.focus()}}),[o,r,i,e]),compositeRef:l,index:i}}function rp(n){const{render:e,className:t,state:r=js,props:s=ji,refs:i=ji,metadata:o,stateAttributesMapping:a,tag:l="div",...c}=n,{compositeProps:u,compositeRef:f}=np({metadata:o});return bt(l,n,{state:r,ref:[...i,f],props:[u,...s,c],stateAttributesMapping:a})}function Lc(n){if(Kg(n)&&n.hasAttribute("data-rootownerid"))return n.getAttribute("data-rootownerid")??void 0;if(!Wg(n))return Lc(Vg(n))}function sp(n){const{enabled:e=!0,mouseDownAction:t,open:r}=n,s=w.useRef(!1);return w.useMemo(()=>e?{onMouseDown:i=>{(t==="open"&&!r||t==="close"&&r)&&(s.current=!0,Qt(i.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:i=>{s.current&&(s.current=!1,i.preventBaseUIHandler())}}:js,[e,t,r])}const Gr=2,ip=w.forwardRef(function(e,t){const{render:r,className:s,disabled:i=!1,nativeButton:o=!0,id:a,openOnHover:l,delay:c=100,closeDelay:u=0,handle:f,payload:d,...h}=e,g=Gt(!0),m=f?.store??g?.store;if(!m)throw new Error(In(85));const y=nr(a),x=m.useState("isTriggerActive",y),p=m.useState("floatingRootContext"),_=m.useState("isOpenedByTrigger",y),C=w.useRef(null),v=ap(),b=sc(!0),S=uh(),T=w.useMemo(()=>S??new ac,[S]),E=lc(T),N=uc(),{registerTrigger:P,isMountedByThisTrigger:$}=Lh(y,C,m,{payload:d,closeDelay:u,parent:v,floatingTreeRoot:T,floatingNodeId:E,floatingParentNodeId:N,keyboardEventRelay:b?.relayKeyboardEvent}),R=m.useState("disabled"),I=i||R||v.type==="menubar"&&v.context.disabled,{getButtonProps:j,buttonRef:B}=rc({disabled:I,native:o});w.useEffect(()=>{!_&&v.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,_,v.type]);const M=w.useRef(null),U=_s(),z=Fe(G=>{if(!M.current)return;U.clear(),m.context.allowMouseUpTriggerRef.current=!1;const oe=G.target;if(ls(M.current,oe)||ls(m.select("positionerElement"),oe)||oe===M.current||oe!=null&&Lc(oe)===m.select("rootId"))return;const ee=Cg(M.current);G.clientX>=ee.left-Gr&&G.clientX<=ee.right+Gr&&G.clientY>=ee.top-Gr&&G.clientY<=ee.bottom+Gr||T.events.emit("close",{domEvent:G,reason:ch})});w.useEffect(()=>{_&&m.select("lastOpenChangeReason")===br&&Qt(M.current).addEventListener("mouseup",z,{once:!0})},[_,z,m]);const Z=v.type==="menubar"&&v.context.hasSubmenuOpen,J=Tc(p,{enabled:(l??Z??!1)&&!I&&v.type!=="context-menu"&&(v.type!=="menubar"||Z&&!$),handleClose:wc({blockPointerEvents:v.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:v.type===void 0?c:void 0,delay:{close:u},triggerElementRef:C,externalTree:T,isActiveTrigger:x}),q=op(_,m.select("lastOpenChangeReason")),H=Ec(p,{enabled:!I&&v.type!=="context-menu",event:_&&v.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?q:!1}),ae=jh(p,{enabled:!I&&(v.type!=="menubar"&&_||Z)}),re=sp({open:_,enabled:v.type==="menubar",mouseDownAction:"open"}),le=Lo([H,ae]),Q=v.type==="menubar",te=w.useMemo(()=>({disabled:I,open:_}),[I,_]),ie=m.useState("triggerProps",$),V=[M,t,B,P,C],ce=[le.getReferenceProps(),J??js,ie,{"aria-haspopup":"menu",id:y,onMouseDown:G=>{if(m.select("open"))return;U.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),Qt(G.currentTarget).addEventListener("mouseup",z,{once:!0})}},Q?{role:"menuitem"}:{},re,h,j],he=w.useRef(null),Ne=Fe(G=>{wr.flushSync(()=>{m.setOpen(!1,ct(zi,G.nativeEvent,G.currentTarget))}),dh(he.current)?.focus()}),W=Fe(G=>{const oe=m.select("positionerElement");if(oe&&fh(G,oe))m.context.beforeContentFocusGuardRef.current?.focus();else{wr.flushSync(()=>{m.setOpen(!1,ct(zi,G.nativeEvent,G.currentTarget))});let ee=gh(C.current);for(;ee!==null&&ls(oe,ee)||ee?.hasAttribute("aria-hidden");){const Ae=ee;if(ee=hh(ee),ee===Ae)break}ee?.focus()}}),ue=bt("button",e,{enabled:!Q,stateAttributesMapping:Fa,state:te,ref:V,props:ce});return Q?k.jsx(rp,{tag:"button",render:r,className:s,state:te,refs:V,props:ce,stateAttributesMapping:Fa}):_?k.jsxs(w.Fragment,{children:[k.jsx(Ma,{ref:he,onFocus:Ne},`${y}-pre-focus-guard`),k.jsx(w.Fragment,{children:ue},y),k.jsx(Ma,{ref:m.context.triggerFocusTargetRef,onFocus:W},`${y}-post-focus-guard`)]}):k.jsx(w.Fragment,{children:ue},y)});function op(n,e){const t=_s(),[r,s]=w.useState(!1);return tr(()=>{n&&e==="trigger-hover"?(s(!0),t.start(ph,()=>{s(!1)})):n||(t.clear(),s(!1))},[n,e,t]),r}function ap(){const n=zs(!0),e=Gt(!0),t=Oc();return w.useMemo(()=>t?{type:"menubar",context:t}:n&&!e?{type:"context-menu",context:n}:{type:void 0},[n,e,t])}const lp=w.forwardRef(function(e,t){const{render:r,className:s,label:i,id:o,nativeButton:a=!1,openOnHover:l=!0,delay:c=100,closeDelay:u=0,disabled:f=!1,...d}=e,h=Bs(),g=Bo(),{store:m}=Gt(),y=nr(o),x=m.useState("open"),p=m.useState("floatingRootContext"),_=m.useState("floatingTreeRoot"),C=Dh(y,m),v=w.useCallback(ae=>{const re=C(ae);return ae!==null&&m.select("open")&&m.select("activeTriggerId")==null&&m.update({activeTriggerId:y,activeTriggerElement:ae,closeDelay:u}),re},[C,u,m,y]),b=w.useRef(null),S=w.useCallback(ae=>{b.current=ae,m.set("activeTriggerElement",ae)},[m]),T=Mc();if(!T?.parentMenu)throw new Error(In(37));m.useSyncedValue("closeDelay",u);const E=T.parentMenu,N=E.useState("itemProps"),P=E.useState("isActive",h.index),$=w.useMemo(()=>({type:"submenu-trigger",setActive:()=>E.set("activeIndex",h.index)}),[E,h.index]),R=m.useState("disabled"),I=f||R,{getItemProps:j,itemRef:B}=Ic({closeOnClick:!1,disabled:I,highlighted:P,id:y,store:m,nativeButton:a,itemMetadata:$,nodeId:g?.nodeId}),M=m.useState("hoverEnabled"),U=m.useState("allowMouseEnter"),z=Tc(p,{enabled:M&&l&&!I&&U,handleClose:wc({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:{open:c,close:u},triggerElementRef:b,externalTree:_}),Z=Ec(p,{enabled:!I,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}),ne=Lo([Z]),J=m.useState("triggerProps",!0);delete J.id;const q=w.useMemo(()=>({disabled:I,highlighted:P,open:x}),[I,P,x]);return bt("div",e,{state:q,stateAttributesMapping:mh,props:[ne.getReferenceProps(),z,J,N,{tabIndex:x||P?0:-1,onBlur(){P&&E.set("activeIndex",null)}},d,j],ref:[t,h.ref,B,v,S]})}),za=new Map;function up(n,e){const t=JSON.stringify({locale:n,options:e}),r=za.get(t);if(r)return r;const s=new Intl.NumberFormat(n,e);return za.set(t,s),s}function us(n,e,t){return n==null?"":up(e,t).format(n)}function Ui(n,e,t){return(n-e)*100/(t-e)}function yt(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}function Dc(n,e){return n-e}function cp(n,e,t){const r=n.slice();return r[e]=t,r.sort(Dc)}function Bc(n,e,t,r,s,i){let o=n;return o=yt(o,t,r),s&&(o=cp(i,e,yt(o,i[e-1]||-1/0,i[e+1]||1/0))),o}function jc(n,e,t){if(!Array.isArray(n))return!0;const r=n.reduce((s,i,o,a)=>(o===a.length-1||s.push(Math.abs(i-a[o+1])),s),[]);return Math.min(...r)>=e*t}const Fr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},zc=w.createContext(void 0);function Us(){const n=w.useContext(zc);if(n===void 0)throw new Error(In(62));return n}function dp(n){return"key"in n?_h:vh}function fp(n,e){return typeof n=="number"&&typeof e=="number"?n===e:Array.isArray(n)&&Array.isArray(e)?Nc(n,e):!1}const gp=w.forwardRef(function(e,t){const{"aria-labelledby":r,className:s,defaultValue:i,disabled:o=!1,id:a,format:l,largeStep:c=10,locale:u,render:f,max:d=100,min:h=0,minStepsBetweenValues:g=0,name:m,onValueChange:y,onValueCommitted:x,orientation:p="horizontal",step:_=1,thumbCollisionBehavior:C="push",thumbAlignment:v="center",value:b,...S}=e,T=nr(a),E=Fe(y),N=Fe(x),{clearErrors:P}=Eh(),{state:$,disabled:R,name:I,setTouched:j,setDirty:B,validityData:M,shouldValidateOnChange:U,validation:z}=Xu(),{labelId:Z}=Eg(),ne=r??Z,J=R||o,q=I??m,[H,ae]=Tg({controlled:b,default:i??h,name:"Slider"}),re=w.useRef(null),le=w.useRef(null),Q=w.useRef([]),te=w.useRef(null),ie=w.useRef(null),V=w.useRef(-1),ce=w.useRef(null),he=w.useRef(null),Ne=w.useRef("none"),W=dc(l),[ue,G]=w.useState(-1),[oe,ee]=w.useState(-1),[Ae,lt]=w.useState(!1),[Ge,ut]=w.useState(()=>new Map),[Dt,Et]=w.useState([void 0,void 0]),me=Fe(Y=>{G(Y),Y!==-1&&ee(Y)});wg({id:T,commit:z.commit,value:H,controlRef:le,name:q,getValue:()=>H}),Th(H,()=>{P(q),U()?z.commit(H):z.commit(H,!0);const Y=M.initialValue;let Se;Array.isArray(H)&&Array.isArray(Y)?Se=!Nc(H,Y):Se=H!==Y,B(Se)});const Bt=Fe(Y=>{Y&&(le.current=Y)}),Ye=Array.isArray(H),Ke=w.useMemo(()=>Ye?H.slice().sort(Dc):[yt(H,h,d)],[d,h,Ye,H]),We=Fe((Y,Se)=>{if(Number.isNaN(Y)||fp(Y,H))return;const rt=Se??ct(yh,void 0,void 0,{activeThumbIndex:-1});Ne.current=rt.reason;const st=new event.constructor(event.type,event);Object.defineProperty(st,"target",{writable:!0,value:{value:Y,name:q}}),rt.event=st,he.current=Y,E(Y,rt),!rt.isCanceled&&ae(Y)}),jt=Fe((Y,Se,rt)=>{const st=Bc(Y,Se,h,d,Ye,Ke);if(jc(st,_,g)){const cn=dp(rt);We(st,ct(cn,rt.nativeEvent,void 0,{activeThumbIndex:Se})),j(!0);const Hr=he.current??st;N(Hr,fc(cn,rt.nativeEvent))}});tr(()=>{const Y=gc(Qt(re.current));J&&Y&&re.current?.contains(Y)&&Y.blur()},[J]),J&&ue!==-1&&me(-1);const et=w.useMemo(()=>({...$,activeThumbIndex:ue,disabled:J,dragging:Ae,orientation:p,max:d,min:h,minStepsBetweenValues:g,step:_,values:Ke}),[$,ue,J,Ae,d,h,g,p,_,Ke]),Dn=w.useMemo(()=>({active:ue,controlRef:le,disabled:J,dragging:Ae,validation:z,formatOptionsRef:W,handleInputChange:jt,indicatorPosition:Dt,inset:v!=="center",labelId:ne,largeStep:c,lastUsedThumbIndex:oe,lastChangedValueRef:he,lastChangeReasonRef:Ne,locale:u,max:d,min:h,minStepsBetweenValues:g,name:q,onValueCommitted:N,orientation:p,pressedInputRef:te,pressedThumbCenterOffsetRef:ie,pressedThumbIndexRef:V,pressedValuesRef:ce,registerFieldControlRef:Bt,renderBeforeHydration:v==="edge",setActive:me,setDragging:lt,setIndicatorPosition:Et,setValue:We,state:et,step:_,thumbCollisionBehavior:C,thumbMap:Ge,thumbRefs:Q,values:Ke}),[ue,le,ne,J,Ae,z,W,jt,Dt,c,oe,he,Ne,u,d,h,g,q,N,p,te,ie,V,ce,Bt,me,lt,Et,We,et,_,C,v,Ge,Q,Ke]),de=bt("div",e,{state:et,ref:[t,re],props:[{"aria-labelledby":ne,id:T,role:"group"},z.getValidationProps,S],stateAttributesMapping:Fr});return k.jsx(zc.Provider,{value:Dn,children:k.jsx(Zu,{elementsRef:Q,onMapChange:ut,children:de})})});function Uc(n){const e=n.getBoundingClientRect();return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function hp(n){if(Math.abs(n)<1){const t=n.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}const e=n.toString().split(".")[1];return e?e.length:0}function Kc(n,e,t){const r=Math.round((n-t)/e)*e+t;return Number(r.toFixed(hp(e)))}function Ua({values:n,index:e,nextValue:t,min:r,max:s,step:i,minStepsBetweenValues:o,initialValues:a}){if(n.length===0)return[];const l=n.slice(),c=i*o,u=l.length-1,f=a??n,d=r+e*c,h=s-(u-e)*c;l[e]=yt(t,d,h);for(let g=e+1;g<=u;g+=1){const m=l[g-1]+c,y=s-(u-g)*c,x=f[g]??l[g];let p=Math.max(l[g],m);x<p&&(p=Math.max(x,m)),l[g]=yt(p,m,y)}for(let g=e-1;g>=0;g-=1){const m=l[g+1]-c,y=r+g*c,x=f[g]??l[g];let p=Math.min(l[g],m);x>p&&(p=Math.min(x,m)),l[g]=yt(p,y,m)}for(let g=0;g<=u;g+=1)l[g]=Number(l[g].toFixed(12));return l}function pp({behavior:n,values:e,currentValues:t,initialValues:r,pressedIndex:s,nextValue:i,min:o,max:a,step:l,minStepsBetweenValues:c}){const u=t??e,f=r??e;if(!(u.length>1))return{value:i,thumbIndex:0,didSwap:!1};const h=l*c;switch(n){case"swap":{const g=u[s],m=1e-7,y=u.slice(),x=y[s-1],p=y[s+1],_=x!=null?x+h:o,C=p!=null?p-h:a,v=yt(i,_,C),b=Number(v.toFixed(12));y[s]=b;const S=i>g,T=i<g,E=S&&p!=null&&i>=p-m,N=T&&x!=null&&i<=x+m;if(!E&&!N)return{value:y,thumbIndex:s,didSwap:!1};const P=E?s+1:s-1,$=y.map((B,M)=>{if(M===s)return b;const U=f[M];return U??u[M]});let R=i;E?R=Math.max(i,y[P]):R=Math.min(i,y[P]);const I=Ua({values:y,index:P,nextValue:R,min:o,max:a,step:l,minStepsBetweenValues:c,initialValues:$}),j=E?P-1:P+1;if(j>=0&&j<I.length){const B=I[j-1],M=I[j+1];let U=B!=null?B+h:o;U=Math.max(U,o+j*h);let z=M!=null?M-h:a;z=Math.min(z,a-(I.length-1-j)*h);const Z=yt(b,U,z);I[j]=Number(Z.toFixed(12))}return{value:I,thumbIndex:P,didSwap:!0}}case"push":return{value:Ua({values:u,index:s,nextValue:i,min:o,max:a,step:l,minStepsBetweenValues:c}),thumbIndex:s,didSwap:!1};case"none":default:{const g=u.slice(),m=g[s-1],y=g[s+1],x=m!=null?m+h:o,p=y!=null?y-h:a,_=yt(i,x,p);return g[s]=Number(_.toFixed(12)),{value:g,thumbIndex:s,didSwap:!1}}}}const mp=2;function yp(n,e){if(!n)return{start:0,end:0};function t(i){const o=i!=null?parseFloat(i):0;return Number.isNaN(o)?0:o}const r=e?"Top":"InlineStart",s=e?"Bottom":"InlineEnd";return{start:t(n[`border${r}Width`])+t(n[`padding${r}`]),end:t(n[`border${s}Width`])+t(n[`padding${s}`])}}function Yr(n,e){if(e.current!=null&&n.changedTouches){const t=n;for(let r=0;r<t.changedTouches.length;r+=1){const s=t.changedTouches[r];if(s.identifier===e.current)return{x:s.clientX,y:s.clientY}}return null}return{x:n.clientX,y:n.clientY}}const _p=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{disabled:o,dragging:a,validation:l,inset:c,lastChangedValueRef:u,lastChangeReasonRef:f,max:d,min:h,minStepsBetweenValues:g,onValueCommitted:m,orientation:y,pressedInputRef:x,pressedThumbCenterOffsetRef:p,pressedThumbIndexRef:_,pressedValuesRef:C,registerFieldControlRef:v,renderBeforeHydration:b,setActive:S,setDragging:T,setValue:E,state:N,step:P,thumbCollisionBehavior:$,thumbRefs:R,values:I}=Us(),j=Do(),B=I.length>1,M=y==="vertical",U=w.useRef(null),z=w.useRef(null),Z=Fe(W=>{W&&z.current==null&&z.current==null&&(z.current=getComputedStyle(W))}),ne=w.useRef(null),J=w.useRef(0),q=w.useRef(0),H=dc(I),ae=Fe(W=>{_.current!==W&&(_.current=W);const ue=R.current[W];if(!ue){p.current=null,x.current=null;return}x.current=ue.querySelector('input[type="range"]')}),re=Fe(W=>{const ue=U.current;if(!ue)return null;const{width:G,height:oe,bottom:ee,left:Ae,right:lt}=ue.getBoundingClientRect(),Ge=yp(z.current,M),ut=q.current,Dt=(M?oe:G)-Ge.start-Ge.end-ut*2,Et=p.current??0,me=W.x-Et,Bt=W.y-Et,Ye=M?ee-Bt-Ge.end:(j==="rtl"?lt-me:me-Ae)-Ge.start,Ke=yt((Ye-ut)/Dt,0,1);let We=(d-h)*Ke+h;if(We=Kc(We,P,h),We=yt(We,h,d),!B)return{value:We,thumbIndex:0,didSwap:!1};const jt=_.current;if(jt<0)return null;const et=pp({behavior:$,values:I,currentValues:H.current??I,initialValues:C.current,pressedIndex:jt,nextValue:We,min:h,max:d,step:P,minStepsBetweenValues:g});return $==="swap"&&et.didSwap?ae(et.thumbIndex):_.current=et.thumbIndex,et}),le=Fe(W=>{C.current=B?I.slice():null,H.current=I;const ue=_.current;let G=ue;if(ue>-1&&ue<I.length){if(I[ue]===d){let oe=ue;for(;oe>0&&I[oe-1]===d;)oe-=1;G=oe}}else{const oe=M?"y":"x";let ee;G=-1;for(let Ae=0;Ae<R.current.length;Ae+=1){const lt=R.current[Ae];if(fi(lt)){const Ge=Uc(lt),ut=Math.abs(W[oe]-Ge[oe]);(ee===void 0||ut<=ee)&&(G=Ae,ee=ut)}}}if(G>-1&&G!==ue&&ae(G),c){const oe=R.current[G];if(fi(oe)){const ee=oe.getBoundingClientRect(),Ae=M?"height":"width";q.current=ee[Ae]/2}}}),Q=Fe(W=>{R.current?.[W]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),te=Fe(W=>{const ue=Yr(W,ne);if(ue==null)return;if(J.current+=1,W.type==="pointermove"&&W.buttons===0){ie(W);return}const G=re(ue);G!=null&&jc(G.value,P,g)&&(!a&&J.current>mp&&T(!0),E(G.value,ct(xh,W,void 0,{activeThumbIndex:G.thumbIndex})),H.current=Array.isArray(G.value)?G.value:[G.value],G.didSwap&&Q(G.thumbIndex))});function ie(W){S(-1),T(!1),x.current=null,p.current=null,_.current=-1;const ue=Yr(W,ne),G=ue!=null?re(ue):null;if(G!=null){const oe=f.current;l.commit(u.current??G.value),m(u.current??G.value,fc(oe,W))}"pointerType"in W&&U.current?.hasPointerCapture(W.pointerId)&&U.current?.releasePointerCapture(W.pointerId),ne.current=null,C.current=null,ce()}const V=Fe(W=>{if(o)return;const ue=W.changedTouches[0];ue!=null&&(ne.current=ue.identifier);const G=Yr(W,ne);if(G!=null){le(G);const ee=re(G);if(ee==null)return;Q(ee.thumbIndex),E(ee.value,ct($a,W,void 0,{activeThumbIndex:ee.thumbIndex})),H.current=Array.isArray(ee.value)?ee.value:[ee.value],ee.didSwap&&Q(ee.thumbIndex)}J.current=0;const oe=Qt(U.current);oe.addEventListener("touchmove",te,{passive:!0}),oe.addEventListener("touchend",ie,{passive:!0})}),ce=Fe(()=>{const W=Qt(U.current);W.removeEventListener("pointermove",te),W.removeEventListener("pointerup",ie),W.removeEventListener("touchmove",te),W.removeEventListener("touchend",ie),C.current=null}),he=cc();return w.useEffect(()=>{const W=U.current;return W?(W.addEventListener("touchstart",V,{passive:!0}),()=>{W.removeEventListener("touchstart",V),he.cancel(),ce()}):()=>ce()},[ce,V,U,he]),w.useEffect(()=>{o&&ce()},[o,ce]),bt("div",e,{state:N,ref:[t,v,U,Z],props:[{"data-base-ui-slider-control":b?"":void 0,onPointerDown(W){const ue=U.current;if(!ue||o||W.defaultPrevented||!fi(W.target)||W.button!==0)return;const G=Yr(W,ne);if(G!=null){le(G);const ee=re(G);if(ee==null)return;ls(R.current[ee.thumbIndex],gc(Qt(ue)))?W.preventDefault():he.request(()=>{Q(ee.thumbIndex)}),T(!0),p.current!=null||(E(ee.value,ct($a,W.nativeEvent,void 0,{activeThumbIndex:ee.thumbIndex})),H.current=Array.isArray(ee.value)?ee.value:[ee.value],ee.didSwap&&Q(ee.thumbIndex))}W.nativeEvent.pointerId&&ue.setPointerCapture(W.nativeEvent.pointerId),J.current=0;const oe=Qt(U.current);oe.addEventListener("pointermove",te,{passive:!0}),oe.addEventListener("pointerup",ie,{once:!0})},tabIndex:-1},i],stateAttributesMapping:Fr})}),vp=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{state:o}=Us();return bt("div",e,{state:o,ref:t,props:[{style:{position:"relative"}},i],stateAttributesMapping:Fr})});let xp=(function(n){return n.index="data-index",n.dragging="data-dragging",n.orientation="data-orientation",n.disabled="data-disabled",n.readonly="data-readonly",n.required="data-required",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.focused="data-focused",n})({});const bp='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();',Wc="PageUp",Vc="PageDown",Sp=new Set([bc,vc,_c,xc,mc,yc,Wc,Vc]);function Cp(n,e,t,r){if(!(e<0))return n.length===2?e===0?`${us(n[e],r,t)} start range`:`${us(n[e],r,t)} end range`:t?us(n[e],r,t):void 0}function Bn(n,e,t,r,s){return t===1?Math.min(n+e,s):Math.max(n-e,r)}const Ep=w.forwardRef(function(e,t){const{render:r,children:s,className:i,"aria-describedby":o,"aria-label":a,"aria-labelledby":l,disabled:c=!1,getAriaLabel:u,getAriaValueText:f,id:d,index:h,inputRef:g,onBlur:m,onFocus:y,onKeyDown:x,tabIndex:p,..._}=e,C=nr(d),{active:v,lastUsedThumbIndex:b,controlRef:S,disabled:T,validation:E,formatOptionsRef:N,handleInputChange:P,inset:$,labelId:R,largeStep:I,locale:j,max:B,min:M,minStepsBetweenValues:U,name:z,orientation:Z,pressedInputRef:ne,pressedThumbCenterOffsetRef:J,pressedThumbIndexRef:q,renderBeforeHydration:H,setActive:ae,setIndicatorPosition:re,state:le,step:Q,values:te}=Us(),ie=Do(),V=c||T,ce=te.length>1,he=Z==="vertical",Ne=ie==="rtl",{setTouched:W,setFocused:ue,validationMode:G}=Xu(),oe=w.useRef(null),ee=w.useRef(null),Ae=nr(),lt=kg(),Ge=ce?Ae:lt,ut=w.useMemo(()=>({inputId:Ge}),[Ge]),{ref:Dt,index:Et}=Bs({metadata:ut}),me=ce?h??Et:0,Bt=me===te.length-1,Ye=te[me],Ke=Ui(Ye,M,B),[We,jt]=w.useState(!1),[et,Dn]=w.useState();hc(()=>jt(!0));const de=b>=0&&b<te.length?b:-1,Y=Fe(()=>{const Ce=S.current,be=oe.current;if(!Ce||!be)return;const Pe=be.getBoundingClientRect(),qr=Ce.getBoundingClientRect(),Jr=he?"height":"width",gg=qr[Jr]-Pe[Jr],ci=(Pe[Jr]/2+gg*Ke/100)/qr[Jr]*100;Dn(ci),me===0?re(di=>[ci,di[1]]):Bt&&re(di=>[di[0],ci])});tr(()=>{$&&queueMicrotask(Y)},[Y,$]),tr(()=>{$&&Y()},[Y,$,Ke]);const Se=w.useCallback(()=>{const Ce=he?"bottom":"insetInlineStart",be=he?"left":"top";let Pe;return ce?v===me?Pe=2:de===me&&(Pe=1):v===me&&(Pe=1),$?{"--position":`${et}%`,visibility:H&&!We||et===void 0?"hidden":void 0,position:"absolute",[Ce]:"var(--position)",[be]:"50%",translate:`${(he||!Ne?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Pe}:Number.isFinite(Ke)?{position:"absolute",[Ce]:`${Ke}%`,[be]:"50%",translate:`${(he||!Ne?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Pe}:La},[v,me,$,We,et,ce,H,Ne,de,Ke,he]);let rt;Z==="vertical"&&(rt=Ne?"vertical-rl":"vertical-lr");const st=ys({"aria-label":typeof u=="function"?u(me):a,"aria-labelledby":l??R,"aria-describedby":o,"aria-orientation":Z,"aria-valuenow":Ye,"aria-valuetext":typeof f=="function"?f(us(Ye,j,N.current??void 0),Ye,me):Cp(te,me,N.current??void 0,j),disabled:V,id:Ge,max:B,min:M,name:z,onChange(Ce){P(Ce.target.valueAsNumber,me,Ce)},onFocus(){ae(me),ue(!0)},onBlur(){oe.current&&(ae(-1),W(!0),ue(!1),G==="onBlur"&&E.commit(Bc(Ye,me,M,B,ce,te)))},onKeyDown(Ce){if(!Sp.has(Ce.key))return;pc.has(Ce.key)&&Ce.stopPropagation();let be=null;const Pe=Kc(Ye,Q,M);switch(Ce.key){case bc:be=Bn(Pe,Ce.shiftKey?I:Q,1,M,B);break;case xc:be=Bn(Pe,Ce.shiftKey?I:Q,Ne?-1:1,M,B);break;case vc:be=Bn(Pe,Ce.shiftKey?I:Q,-1,M,B);break;case _c:be=Bn(Pe,Ce.shiftKey?I:Q,Ne?1:-1,M,B);break;case Wc:be=Bn(Pe,I,1,M,B);break;case Vc:be=Bn(Pe,I,-1,M,B);break;case yc:be=B,ce&&(be=Number.isFinite(te[me+1])?te[me+1]-Q*U:B);break;case mc:be=M,ce&&(be=Number.isFinite(te[me-1])?te[me-1]+Q*U:M);break}be!==null&&(P(be,me,Ce),Ce.preventDefault())},step:Q,style:{...La,width:"100%",height:"100%",writingMode:rt},tabIndex:p??void 0,type:"range",value:Ye??""},E.getInputValidationProps),cn=$o(ee,E.inputRef,g);return bt("div",e,{state:le,ref:[t,Dt,oe],props:[{[xp.index]:me,children:k.jsxs(w.Fragment,{children:[s,k.jsx("input",{ref:cn,...st}),$&&!We&&H&&Bt&&k.jsx("script",{dangerouslySetInnerHTML:{__html:bp},suppressHydrationWarning:!0})]}),id:C,onBlur:m,onFocus:y,onPointerDown(Ce){if(q.current=me,oe.current!=null){const be=Z==="horizontal"?"x":"y",Pe=Uc(oe.current),qr=(Z==="horizontal"?Ce.clientX:Ce.clientY)-Pe[be];J.current=qr}ee.current!=null&&ne.current!==ee.current&&(ne.current=ee.current)},style:Se(),suppressHydrationWarning:H||void 0,tabIndex:-1},_],stateAttributesMapping:Fr})});function Tp(n,e,t,r,s,i){const o=t===void 0||e&&r===void 0?"hidden":void 0,a=n?"bottom":"insetInlineStart",l=n?"height":"width",u={visibility:s&&!i?"hidden":o,position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};return u["--start-position"]=`${t??0}%`,e?(u["--relative-size"]=`${(r??0)-(t??0)}%`,u[a]="var(--start-position)",u[l]="var(--relative-size)",u):(u[a]=0,u[l]="var(--start-position)",u)}function wp(n,e,t,r){const s=n?"bottom":"insetInlineStart",i=n?"height":"width",a={position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};if(!e)return a[s]=0,a[i]=`${t}%`,a;const l=r-t;return a[s]=`${t}%`,a[i]=`${l}%`,a}const kp=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{indicatorPosition:o,inset:a,max:l,min:c,orientation:u,renderBeforeHydration:f,state:d,values:h}=Us(),[g,m]=w.useState(!1);hc(()=>m(!0));const y=u==="vertical",x=h.length>1,p=a?Tp(y,x,o[0],o[1],f,g):wp(y,x,Ui(h[0],c,l),Ui(h[h.length-1],c,l));return bt("div",e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":f?"":void 0,style:p,suppressHydrationWarning:f||void 0},i],stateAttributesMapping:Fr})});const Np=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Ap=pg("brain-circuit",Np);var Pp="vpj4en0",Ip="vpj4en1",Rp="vpj4en2",Op="vpj4en3",Fp="vpj4en4",Mp="vpj4en5",$p="vpj4en6";function Zr(n){const e=qe.c(25),{label:t,value:r,defaultValue:s,min:i,max:o,step:a,onValueChange:l,onValueCommitted:c,disabled:u,className:f,showValue:d,formatValue:h}=n,g=i===void 0?0:i,m=o===void 0?100:o,y=a===void 0?1:a,x=u===void 0?!1:u,p=d===void 0?!0:d;let _;e[0]!==l?(_=I=>{typeof I=="number"?l?.(I):Array.isArray(I)&&l?.(I[0])},e[0]=l,e[1]=_):_=e[1];const C=_;let v;e[2]!==c?(v=I=>{typeof I=="number"?c?.(I):Array.isArray(I)&&c?.(I[0])},e[2]=c,e[3]=v):v=e[3];const b=v,S=r??s??g;let T;e[4]!==S||e[5]!==h?(T=h?h(S):String(S),e[4]=S,e[5]=h,e[6]=T):T=e[6];const E=T;let N;e[7]!==f?(N=mg(Pp,f),e[7]=f,e[8]=N):N=e[8];let P;e[9]!==E||e[10]!==t||e[11]!==p?(P=(t||p)&&k.jsxs("div",{className:Ip,children:[t&&k.jsx("span",{children:t}),p&&k.jsx("span",{className:Rp,children:E})]}),e[9]=E,e[10]=t,e[11]=p,e[12]=P):P=e[12];let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($=k.jsx(_p,{className:Op,children:k.jsxs(vp,{className:Fp,children:[k.jsx(kp,{className:Mp}),k.jsx(Ep,{className:$p})]})}),e[13]=$):$=e[13];let R;return e[14]!==s||e[15]!==x||e[16]!==C||e[17]!==b||e[18]!==m||e[19]!==g||e[20]!==y||e[21]!==P||e[22]!==N||e[23]!==r?(R=k.jsxs(gp,{value:r,defaultValue:s,min:g,max:m,step:y,onValueChange:C,onValueCommitted:b,disabled:x,className:N,children:[P,$]}),e[14]=s,e[15]=x,e[16]=C,e[17]=b,e[18]=m,e[19]=g,e[20]=y,e[21]=P,e[22]=N,e[23]=r,e[24]=R):R=e[24],R}var Lp="_7ucatj0",Dp="_7ucatj1",Bp="_7ucatj2",Ka="_7ucatj3",Wa="_7ucatj4",Va="_7ucatj5",Ha="_7ucatj6",qa="_7ucatj7",Ja="_7ucatj8",Ga="_7ucatj9",Ya="_7ucatja",jp="_7ucatjb",zp="_7ucatjc",Up="_7ucatjd",Kp="_7ucatje",Wp="_7ucatjf",Vp="_7ucatjg",Hp="_7ucatjh",qp="_7ucatji";function Jp(n){const e=qe.c(69),{isNewVariant:t,onSave:r,isSaving:s}=n,i=s===void 0?!1:s,[o,a]=w.useState(!1),[l,c]=w.useState(t?"new_variant":"new_version"),[u,f]=w.useState(!1),[d,h]=w.useState(null),{data:g}=Wh();let m;e[0]!==g?(m=g===void 0?[]:g,e[0]=g,e[1]=m):m=e[1];const y=m;let x;e[2]!==u||e[3]!==l||e[4]!==r||e[5]!==d?.id?(x=()=>{r({mode:l,deployToEnvironment:u,environmentId:u?d?.id??null:null}),a(!1)},e[2]=u,e[3]=l,e[4]=r,e[5]=d?.id,e[6]=x):x=e[6];const p=x;let _;e[7]!==t?(_=W=>{a(W),W&&(c(t?"new_variant":"new_version"),f(!1),h(null))},e[7]=t,e[8]=_):_=e[8];const C=_;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=k.jsx(Gu,{icon:Ag,size:"xs"}),e[9]=v):v=e[9];const b=i?"Saving...":"Save";let S;e[10]!==i||e[11]!==b?(S=k.jsx(ec,{asChild:!0,children:k.jsxs(gi,{variant:"primary",size:"default",type:"button",disabled:i,children:[v,b]})}),e[10]=i,e[11]=b,e[12]=S):S=e[12];let T;e[13]===Symbol.for("react.memo_cache_sentinel")?(T=k.jsx("div",{className:Dp,children:"Save Options"}),e[13]=T):T=e[13];const E=`${Ka} ${l==="new_variant"?Wa:""}`;let N,P;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=()=>c("new_variant"),P=W=>W.key==="Enter"&&c("new_variant"),e[14]=N,e[15]=P):(N=e[14],P=e[15]);const $=l==="new_variant",R=`${Va} ${l==="new_variant"?Ha:""}`;let I;e[16]!==l?(I=l==="new_variant"&&k.jsx("div",{className:qa}),e[16]=l,e[17]=I):I=e[17];let j;e[18]!==R||e[19]!==I?(j=k.jsx("div",{className:R,children:I}),e[18]=R,e[19]=I,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=k.jsxs("div",{className:Ja,children:[k.jsx("span",{className:Ga,children:"Save as new variant"}),k.jsx("span",{className:Ya,children:"Creates a new variant with version 1"})]}),e[21]=B):B=e[21];let M;e[22]!==E||e[23]!==$||e[24]!==j?(M=k.jsxs("div",{className:E,onClick:N,onKeyDown:P,role:"radio","aria-checked":$,tabIndex:0,children:[j,B]}),e[22]=E,e[23]=$,e[24]=j,e[25]=M):M=e[25];let U;e[26]!==t||e[27]!==l?(U=!t&&k.jsxs("div",{className:`${Ka} ${l==="new_version"?Wa:""}`,onClick:()=>c("new_version"),onKeyDown:W=>W.key==="Enter"&&c("new_version"),role:"radio","aria-checked":l==="new_version",tabIndex:0,children:[k.jsx("div",{className:`${Va} ${l==="new_version"?Ha:""}`,children:l==="new_version"&&k.jsx("div",{className:qa})}),k.jsxs("div",{className:Ja,children:[k.jsx("span",{className:Ga,children:"Update as new version"}),k.jsx("span",{className:Ya,children:"Creates a new version of this variant"})]})]}),e[26]=t,e[27]=l,e[28]=U):U=e[28];let z;e[29]!==M||e[30]!==U?(z=k.jsxs("div",{className:Bp,children:[M,U]}),e[29]=M,e[30]=U,e[31]=z):z=e[31];const Z=`${Up} ${u?Kp:""}`;let ne,J;e[32]!==u?(ne=()=>f(!u),J=W=>W.key==="Enter"&&f(!u),e[32]=u,e[33]=ne,e[34]=J):(ne=e[33],J=e[34]);let q;e[35]!==u?(q=u&&k.jsx(Sc,{className:Wp}),e[35]=u,e[36]=q):q=e[36];let H;e[37]!==u||e[38]!==Z||e[39]!==ne||e[40]!==J||e[41]!==q?(H=k.jsx("div",{className:Z,onClick:ne,onKeyDown:J,role:"checkbox","aria-checked":u,tabIndex:0,children:q}),e[37]=u,e[38]=Z,e[39]=ne,e[40]=J,e[41]=q,e[42]=H):H=e[42];let ae;e[43]!==u?(ae=k.jsx("span",{className:Vp,onClick:()=>f(!u),children:"Deploy to environment"}),e[43]=u,e[44]=ae):ae=e[44];let re;e[45]!==H||e[46]!==ae?(re=k.jsxs("div",{className:zp,children:[H,ae]}),e[45]=H,e[46]=ae,e[47]=re):re=e[47];let le;e[48]!==u||e[49]!==y||e[50]!==d?(le=u&&k.jsx("div",{className:Hp,children:k.jsx(Mo,{items:y,value:d,onValueChange:h,itemToString:Gp,placeholder:"Select environment"})}),e[48]=u,e[49]=y,e[50]=d,e[51]=le):le=e[51];let Q;e[52]!==re||e[53]!==le?(Q=k.jsxs("div",{className:jp,children:[re,le]}),e[52]=re,e[53]=le,e[54]=Q):Q=e[54];let te;e[55]===Symbol.for("react.memo_cache_sentinel")?(te=k.jsx(gi,{variant:"ghost",scheme:"gray",size:"sm",type:"button",onClick:()=>a(!1),children:"Cancel"}),e[55]=te):te=e[55];const ie=i||u&&!d,V=i?"Saving...":"Confirm";let ce;e[56]!==p||e[57]!==ie||e[58]!==V?(ce=k.jsxs("div",{className:qp,children:[te,k.jsx(gi,{variant:"primary",size:"sm",type:"button",onClick:p,disabled:ie,children:V})]}),e[56]=p,e[57]=ie,e[58]=V,e[59]=ce):ce=e[59];let he;e[60]!==z||e[61]!==Q||e[62]!==ce?(he=k.jsx(tc,{side:"bottom",align:"end",sideOffset:4,children:k.jsxs("div",{className:Lp,children:[T,z,Q,ce]})}),e[60]=z,e[61]=Q,e[62]=ce,e[63]=he):he=e[63];let Ne;return e[64]!==C||e[65]!==o||e[66]!==he||e[67]!==S?(Ne=k.jsxs(nc,{open:o,onOpenChange:C,children:[S,he]}),e[64]=C,e[65]=o,e[66]=he,e[67]=S,e[68]=Ne):Ne=e[68],Ne}function Gp(n){return n?.name||""}const Hc=w.createContext(null);function Yp(n,e){return{getTheme:function(){return e??null}}}function Je(){const n=w.useContext(Hc);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const i of t)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qc(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const St=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Zp=St&&"documentMode"in document?document.documentMode:null,mt=St&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),xn=St&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),vs=!(!St||!("InputEvent"in window)||Zp)&&"getTargetRanges"in new window.InputEvent("input"),Mr=St&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),or=St&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Xp=St&&/Android/.test(navigator.userAgent),Jc=St&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Za=St&&Xp&&Jc,$r=St&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mt&&!Jc;function Gc(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Qp=0,em=1,tm=2,Yc=128,nm=1,rm=2,sm=3,im=4,om=5,am=6,Ks=Mr||or||$r?" ":"​",sn=`
2
-
3
- `,lm=xn?" ":Ks,bn={bold:1,capitalize:1024,code:16,highlight:Yc,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},um={directionless:1,unmergeable:2},Xa={center:2,end:6,justify:4,left:1,right:3,start:5},cm={[rm]:"center",[am]:"end",[im]:"justify",[nm]:"left",[sm]:"right",[om]:"start"},dm={normal:0,segmented:2,token:1},fm={[Qp]:"normal",[tm]:"segmented",[em]:"token"},Qa="$config";function Zc(n,e,t,r,s,i){let o=n.getFirstChild();for(;o!==null;){const a=o.__key;o.__parent===e&&(A(o)&&Zc(o,a,t,r,s,i),t.has(a)||i.delete(a),s.push(a)),o=o.getNextSibling()}}let Ki=!1,zo=0;function gm(n){zo=n.timeStamp}function hi(n,e,t){const r=n.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(n===s||r&&n.previousSibling===s)||r&&Qs(n,t)!==void 0}function hm(n,e,t){const r=Ct(ht(t));let s=null,i=null;r!==null&&r.anchorNode===n&&(s=r.anchorOffset,i=r.focusOffset);const o=n.nodeValue;o!==null&&ua(e,o,s,i,!1)}function pm(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return Yt(e)&&t.isAttached()}function mm(n,e,t,r){for(let s=n;s&&!_y(s);s=zr(s)){const i=Qs(s,e);if(i!==void 0){const o=Ie(i,t);if(o)return pe(o)||!ke(s)?void 0:[s,o]}else if(s===r)return[r,tf(t)]}}function Xc(n,e,t){Ki=!0;const r=performance.now()-zo>100;try{It(n,()=>{const s=D()||(function(d){return d.getEditorState().read(()=>{const h=D();return h!==null?h.clone():null})})(n),i=new Map,o=n.getRootElement(),a=n._editorState,l=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,m=h.target,y=mm(m,n,a,o);if(!y)continue;const[x,p]=y;if(g==="characterData")r&&L(p)&&Yt(m)&&pm(s,m,p)&&hm(m,p,n);else if(g==="childList"){c=!0;const _=h.addedNodes;for(let b=0;b<_.length;b++){const S=_[b],T=Qd(S),E=S.parentNode;if(E!=null&&S!==l&&T===null&&!hi(S,E,n)){if(xn){const N=(ke(S)?S.innerText:null)||S.nodeValue;N&&(u+=N)}E.removeChild(S)}}const C=h.removedNodes,v=C.length;if(v>0){let b=0;for(let S=0;S<v;S++){const T=C[S];(hi(T,m,n)||l===T)&&(m.appendChild(T),b++)}v!==b&&i.set(x,p)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,n);const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,m=h.target;for(let y=0;y<g.length;y++){const x=g[y],p=x.parentNode;p==null||x.nodeName!=="BR"||hi(x,m,n)||p.removeChild(x)}}t.takeRecords()}s!==null&&(c&&Ue(s),xn&&of(n)&&s.insertRawText(u))})}finally{Ki=!1}}function Qc(n){const e=n._observer;e!==null&&Xc(n,e.takeRecords(),e)}function ed(n){(function(e){zo===0&&ht(e).addEventListener("textInput",gm,!0)})(n),n._observer=new MutationObserver((e,t)=>{Xc(n,e,t)})}let ym=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||bm).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function _m(n,e){return new ym(n,e)}function td(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function pi(n,e,t){let r;if(De(),typeof t=="function"){const i=n.getLatest(),o=td(i,e);if(r=t(o),e.isEqual(o,r))return i}else r=t;const s=n.getWritable();return rd(s).updateFromKnown(e,r),s}function vm(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:s}=ni(r);if(s&&s.stateConfigs)for(const i of s.stateConfigs){let o;"stateConfig"in i?(o=i.stateConfig,i.flat&&t.add(o.key)):o=i,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let xm=class nd{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,s=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=s;const{sharedConfigMap:o}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(o,r,s);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const s=this.unknownState[e.key];s!==void 0&&(r=e.parse(s)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,s]of this.knownState)r.isEqual(s,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(s);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return el(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,s=new Map(this.knownState);return new nd(e,t,(function(i,o,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?o.has(f)||o.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(t.sharedConfigMap,s,r),s,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:s,unknownState:i}=this;s.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=el(i)),this.size++),s.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,s]of Object.entries(e))this.updateFromUnknown(r,s)}};function rd(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new xm(e,sd(e));return e.__state=t,t}function sd(n){return n.__state?n.__state.sharedNodeState:Jd(ti(),n.getType()).sharedNodeState}function el(n){if(n)for(const e in n)return n}function bm(n){return n}function tl(n,e,t){for(const[r,s]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const i=t?t.getValue(r):r.defaultValue;if(i!==s&&!r.isEqual(i,s))return!0}return!1}function nl(n,e,t){const{unknownState:r}=e,s=t?t.unknownState:void 0;if(r){for(const[i,o]of Object.entries(r))if(!n.has(i)&&(n.add(i),o!==(s?s[i]:void 0)))return!0}return!1}function rl(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function sl(n,e){const t=n.__mode,r=n.__format,s=n.__style,i=e.__mode,o=e.__format,a=e.__style,l=n.__state,c=e.__state;return(t===null||t===i)&&(r===null||r===o)&&(s===null||s===a)&&(n.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&tl(d,u,f)||f&&tl(d,f,u)||u&&nl(d,u,f)||f&&nl(d,f,u))})(l,c))}function il(n,e){const t=n.mergeWithSibling(e),r=ve()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function ol(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&L(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(sl(e,r)){r=il(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&L(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(sl(r,t)){r=il(r,t);break}break}t.remove()}}else r.remove()}function Sn(n){return al(n.anchor),al(n.focus),n}function al(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,s;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),s=!0):(r=e.getChildAtIndex(t),s=!1),L(r)){n.set(r.__key,s?r.getTextContentSize():0,"text",!0);break}if(!A(r))break;n.set(r.__key,s?r.getChildrenSize():0,"element",!0)}}let Cn,Ve,kr,Ws,Wi,Vi,En,_t,Hi,Nr,Me="",Tt=null,fn=null,Vt="",Wn=!1,xs=!1;function bs(n,e){const t=En.get(n);if(e!==null){const r=Yi(n);r.parentNode===e&&e.removeChild(r)}if(_t.has(n)||Ve._keyToDOMMap.delete(n),A(t)){const r=Cs(t,En);qi(r,0,r.length-1,null)}t!==void 0&&ca(Nr,kr,Ws,t,"destroyed")}function qi(n,e,t,r){let s=e;for(;s<=t;++s){const i=n[s];i!==void 0&&bs(i,r)}}function dn(n,e){n.setProperty("text-align",e)}const Sm="40px";function id(n,e){const t=Cn.theme.indent;if(typeof t=="string"){const s=n.classList.contains(t);e>0&&!s?n.classList.add(t):e<1&&s&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Sm;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function od(n,e){const t=n.style;e===0?dn(t,""):e===1?dn(t,"left"):e===2?dn(t,"center"):e===3?dn(t,"right"):e===4?dn(t,"justify"):e===5?dn(t,"start"):e===6&&dn(t,"end")}function Ji(n,e){const t=(function(r){const s=r.__dir;if(s!==null)return s;if($e(r))return null;const i=r.getParentOrThrow();return $e(i)&&i.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function Ss(n,e){const t=_t.get(n);t===void 0&&F(60);const r=t.createDOM(Cn,Ve);if((function(s,i,o){const a=o._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,o,s),a.set(s,i)})(n,r,Ve),L(t)?r.setAttribute("data-lexical-text","true"):pe(t)&&r.setAttribute("data-lexical-decorator","true"),A(t)){const s=t.__indent,i=t.__size;if(Ji(r,t),s!==0&&id(r,s),i!==0){const a=i-1;Gi(Cs(t,_t),t,0,a,t.getDOMSlot(r))}const o=t.__format;o!==0&&od(r,o),t.isInline()||ad(null,t,r),ei(t)&&(Me+=sn,Vt+=sn)}else{const s=t.getTextContent();if(pe(t)){const i=t.decorate(Ve,Cn);i!==null&&ld(n,i),r.contentEditable="false"}Me+=s,Vt+=s}return e!==null&&e.insertChild(r),ca(Nr,kr,Ws,t,"created"),r}function Gi(n,e,t,r,s){const i=Me;Me="";let o=t;for(;o<=r;++o){Ss(n[o],s);const a=_t.get(n[o]);a!==null&&L(a)&&Tt===null&&(Tt=a.getFormat(),fn=a.getStyle())}ei(e)&&(Me+=sn),s.element.__lexicalTextContent=Me,Me=i+Me}function ll(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Pt(r)?"line-break":pe(r)&&r.isInline()?"decorator":null}return"empty"}return null}function ad(n,e,t){const r=ll(n,En),s=ll(e,_t);r!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Cm(n,e,t){var r;Tt=null,fn=null,(function(s,i,o){const a=Me,l=s.__size,c=i.__size;Me="";const u=o.element;if(l===1&&c===1){const f=s.__first,d=i.__first;if(f===d)yr(f,u);else{const g=Yi(f),m=Ss(d,null);try{u.replaceChild(m,g)}catch(y){if(typeof y=="object"&&y!=null){const x=`${y.toString()} Parent: ${u.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(x)}throw y}bs(f,null)}const h=_t.get(d);L(h)&&Tt===null&&(Tt=h.getFormat(),fn=h.getStyle())}else{const f=Cs(s,En),d=Cs(i,_t);if(f.length!==l&&F(227),d.length!==c&&F(228),l===0)c!==0&&Gi(d,i,0,c-1,o);else if(c===0){if(l!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;qi(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,m,y,x,p){const _=y-1,C=x-1;let v,b,S=p.getFirstChild(),T=0,E=0;for(;T<=_&&E<=C;){const $=g[T],R=m[E];if($===R)S=mi(yr(R,p.element)),T++,E++;else{v===void 0&&(v=new Set(g)),b===void 0&&(b=new Set(m));const j=b.has($),B=v.has(R);if(j)if(B){const M=Tn(Ve,R);M===S?S=mi(yr(R,p.element)):(p.withBefore(S).insertChild(M),yr(R,p.element)),T++,E++}else Ss(R,p.withBefore(S)),E++;else S=mi(Yi($)),bs($,p.element),T++}const I=_t.get(R);I!==null&&L(I)&&Tt===null&&(Tt=I.getFormat(),fn=I.getStyle())}const N=T>_,P=E>C;if(N&&!P){const $=m[C+1],R=$===void 0?null:Ve.getElementByKey($);Gi(m,h,E,C,p.withBefore(R))}else P&&!N&&qi(g,T,_,p.element)})(i,f,d,l,c,o)}ei(i)&&(Me+=sn),u.__lexicalTextContent=Me,Me=a+Me})(n,e,e.getDOMSlot(t)),r=e,Tt==null||Tt===r.__textFormat||xs||r.setTextFormat(Tt),(function(s){fn==null||fn===s.__textStyle||xs||s.setTextStyle(fn)})(e)}function Cs(n,e){const t=[];let r=n.__first;for(;r!==null;){const s=e.get(r);s===void 0&&F(101),t.push(r),r=s.__next}return t}function yr(n,e){const t=En.get(n);let r=_t.get(n);t!==void 0&&r!==void 0||F(61);const s=Wn||Vi.has(n)||Wi.has(n),i=Tn(Ve,n);if(t===r&&!s){if(A(t)){const o=i.__lexicalTextContent;o!==void 0&&(Me+=o,Vt+=o)}else{const o=t.getTextContent();Vt+=o,Me+=o}return i}if(t!==r&&s&&ca(Nr,kr,Ws,r,"updated"),r.updateDOM(t,i,Cn)){const o=Ss(n,null);return e===null&&F(62),e.replaceChild(o,i),bs(n,null),o}if(A(t)&&A(r)){const o=r.__indent;(Wn||o!==t.__indent)&&id(i,o);const a=r.__format;if((Wn||a!==t.__format)&&od(i,a),s&&(Cm(t,r,i),$e(r)||r.isInline()||ad(t,r,i)),ei(r)&&(Me+=sn,Vt+=sn),(Wn||r.__dir!==t.__dir)&&(Ji(i,r),$e(r)&&!Wn))for(const l of r.getChildren())A(l)&&Ji(Tn(Ve,l.getKey()),l)}else{const o=r.getTextContent();if(pe(r)){const a=r.decorate(Ve,Cn);a!==null&&ld(n,a)}Me+=o,Vt+=o}if(!xs&&$e(r)&&r.__cachedText!==Vt){const o=r.getWritable();o.__cachedText=Vt,r=o}return i}function ld(n,e){let t=Ve._pendingDecorators;const r=Ve._decorators;if(t===null){if(r[n]===e)return;t=ef(Ve)}t[n]=e}function mi(n){let e=n.nextSibling;return e!==null&&e===Ve._blockCursorElement&&(e=e.nextSibling),e}function Em(n,e,t,r,s,i){Me="",Vt="",Wn=r===2,Ve=t,Cn=t._config,kr=t._nodes,Ws=Ve._listeners.mutation,Wi=s,Vi=i,En=n._nodeMap,_t=e._nodeMap,xs=e._readOnly,Hi=new Map(t._keyToDOMMap);const o=new Map;return Nr=o,yr("root",null),Ve=void 0,kr=void 0,Wi=void 0,Vi=void 0,En=void 0,_t=void 0,Cn=void 0,Hi=void 0,Nr=void 0,o}function Yi(n){const e=Hi.get(n);return e===void 0&&F(75,n),e}function X(n){return{type:n}}const ud=X("SELECTION_CHANGE_COMMAND"),Tm=X("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Uo=X("CLICK_COMMAND"),cd=X("BEFORE_INPUT_COMMAND"),dd=X("INPUT_COMMAND"),fd=X("COMPOSITION_START_COMMAND"),gd=X("COMPOSITION_END_COMMAND"),mn=X("DELETE_CHARACTER_COMMAND"),Gn=X("INSERT_LINE_BREAK_COMMAND"),Ar=X("INSERT_PARAGRAPH_COMMAND"),Yn=X("CONTROLLED_TEXT_INSERTION_COMMAND"),Vs=X("PASTE_COMMAND"),Zi=X("REMOVE_TEXT_COMMAND"),Pr=X("DELETE_WORD_COMMAND"),Ir=X("DELETE_LINE_COMMAND"),en=X("FORMAT_TEXT_COMMAND"),hd=X("UNDO_COMMAND"),pd=X("REDO_COMMAND"),md=X("KEYDOWN_COMMAND"),yd=X("KEY_ARROW_RIGHT_COMMAND"),wm=X("MOVE_TO_END"),Ko=X("KEY_ARROW_LEFT_COMMAND"),km=X("MOVE_TO_START"),Wo=X("KEY_ARROW_UP_COMMAND"),Vo=X("KEY_ARROW_DOWN_COMMAND"),Es=X("KEY_ENTER_COMMAND"),Ho=X("KEY_SPACE_COMMAND"),_d=X("KEY_BACKSPACE_COMMAND"),qo=X("KEY_ESCAPE_COMMAND"),vd=X("KEY_DELETE_COMMAND"),Jo=X("KEY_TAB_COMMAND"),xd=X("INSERT_TAB_COMMAND"),Xi=X("INDENT_CONTENT_COMMAND"),Qi=X("OUTDENT_CONTENT_COMMAND"),bd=X("DROP_COMMAND"),Nm=X("FORMAT_ELEMENT_COMMAND"),Sd=X("DRAGSTART_COMMAND"),Cd=X("DRAGOVER_COMMAND"),Am=X("DRAGEND_COMMAND"),Hs=X("COPY_COMMAND"),Go=X("CUT_COMMAND"),eo=X("SELECT_ALL_COMMAND"),Pm=X("FOCUS_COMMAND"),Im=X("BLUR_COMMAND"),Rm=X("KEY_MODIFIER_COMMAND"),zt=Object.freeze({}),to=[["keydown",function(n,e){Rr=n.timeStamp,Ed=n.key,!e.isComposing()&&K(e,md,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;Fn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&It(e,()=>{Gd(t)||(so=!0)})}],["compositionstart",function(n,e){K(e,fd,n)}],["compositionend",function(n,e){xn?_r=!0:or||!Mr&&!$r?K(e,gd,n):(io=!0,oo=n.data)}],["input",function(n,e){n.stopPropagation(),It(e,()=>{e.dispatchCommand(dd,n)},{event:n}),Vn=null}],["click",function(n,e){It(e,()=>{const t=D(),r=Ct(ht(e)),s=On();if(r){if(O(t)){const i=t.anchor,o=i.getNode();if(i.type==="element"&&i.offset===0&&t.isCollapsed()&&!$e(o)&&we().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const a=Qe(o,l=>A(l)&&!l.isInline());A(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const i=r.anchorNode;(ke(i)||Yt(i))&&Ue(Xo(s,r,e,n))}}K(e,Uo,n)})}],["cut",zt],["copy",zt],["dragstart",zt],["dragover",zt],["dragend",zt],["paste",zt],["focus",zt],["blur",zt],["drop",zt]];vs&&to.push(["beforeinput",(n,e)=>(function(t,r){const s=t.inputType;s==="deleteCompositionText"||xn&&of(r)||s!=="insertCompositionText"&&K(r,cd,t)})(n,e)]);let Rr=0,Ed=null,Td=0,Vn=null;const no=new WeakMap,Ts=new WeakMap;let ro=!1,so=!1,Sr=!1,_r=!1,io=!1,oo="",pn=null,wd=[0,"",0,"root",0];function kd(n,e,t,r,s){const i=n.anchor,o=n.focus,a=i.getNode(),l=ve(),c=Ct(ht(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=t.length;return f!==o.key||!L(a)||(!s&&(!vs||Td<r+50)||a.isDirty()&&h<2||nf(t))&&i.offset!==o.offset&&!a.isComposing()||Wt(a)||a.isDirty()&&h>1||(s||!vs)&&d!==null&&!a.isComposing()&&u!==sr(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||a.getFormat()!==n.format||a.getStyle()!==n.style||(function(g,m){if(m.isSegmented())return!0;if(!g.isCollapsed())return!1;const y=g.anchor.offset,x=m.getParentOrThrow(),p=yn(m);return y===0?!m.canInsertTextBefore()||!x.canInsertTextBefore()&&!m.isComposing()||p||(function(_){const C=_.getPreviousSibling();return(L(C)||A(C)&&C.isInline())&&!C.canInsertTextAfter()})(m):y===m.getTextContentSize()&&(!m.canInsertTextAfter()||!x.canInsertTextAfter()&&!m.isComposing()||p)})(n,a)}function ul(n,e){return Yt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function cl(n,e,t){const{anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:o}=n;ro&&(ro=!1,ul(r,s)&&ul(i,o)&&!pn)||It(e,()=>{if(!t)return void Ue(null);if(!jr(e,r,i))return;let a=D();if(pn&&O(a)&&a.isCollapsed()){const l=a.anchor,c=pn.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=pn.clone(),Ue(a))}if(pn=null,O(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);const u=ht(e).event,f=u?u.timeStamp:performance.now(),[d,h,g,m,y]=wd,x=we(),p=e.isComposing()===!1&&x.getTextContent()==="";if(f<y+200&&l.offset===g&&l.key===m)cs(a,d,h);else if(l.type==="text")L(c)||F(141),Nd(a,c);else if(l.type==="element"&&!p){A(c)||F(259);const _=l.getNode();_.isEmpty()?(function(C,v){const b=v.getTextFormat(),S=v.getTextStyle();cs(C,b,S)})(a,_):cs(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),m=g?o:s,y=g?s:o,x=g?f:u,p=g?u:f;let _=2047,C=!1;for(let v=0;v<h;v++){const b=d[v],S=b.getTextContentSize();if(L(b)&&S!==0&&!(v===0&&b.__key===x&&m===S||v===h-1&&b.__key===p&&y===0)&&(C=!0,_&=b.getFormat(),_===0))break}a.format=C?_:0}}K(e,ud,void 0)})}function cs(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Nd(n,e){cs(n,e.getFormat(),e.getStyle())}function Ad(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Om(n){const e=n.inputType,t=Ad(n),r=ve(),s=D();if(e==="deleteContentBackward"){if(s===null){const f=On();if(!O(f))return!0;Ue(f.clone())}if(O(s)){const f=s.anchor.key===s.focus.key;if(i=n.timeStamp,Ed==="MediaLast"&&i<Rr+30&&r.isComposing()&&f){if(ze(null),Rr=0,setTimeout(()=>{It(r,()=>{ze(null)})},30),O(s)){const d=s.anchor.getNode();d.markDirty(),L(d)||F(142),Nd(s,d)}}else{ze(null),n.preventDefault();const d=s.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),m=s.anchor.offset===0&&s.focus.offset===h.length;let y=Za&&f&&!m&&g;if(y&&s.isCollapsed()&&(y=!pe(co(s.anchor,!0))),!y){K(r,mn,!0);const x=D();Za&&O(x)&&x.isCollapsed()&&(pn=x,setTimeout(()=>pn=null))}}return!0}}var i;if(!O(s))return!0;const o=n.data;Vn!==null&&la(!1,r,Vn),s.dirty&&Vn===null||!s.isCollapsed()||$e(s.anchor.getNode())||t===null||s.applyDOMRange(t),Vn=null;const a=s.anchor,l=s.focus,c=a.getNode(),u=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
4
- `)n.preventDefault(),K(r,Gn,!1);else if(o===sn)n.preventDefault(),K(r,Ar,void 0);else if(o==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),s.insertRawText(f)}else o!=null&&kd(s,t,o,n.timeStamp,!0)?(n.preventDefault(),K(r,Yn,o)):Vn=o;return Td=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":K(r,Yn,n);break;case"insertFromComposition":ze(null),K(r,Yn,n);break;case"insertLineBreak":ze(null),K(r,Gn,!1);break;case"insertParagraph":ze(null),Sr&&!or?(Sr=!1,K(r,Gn,!1)):K(r,Ar,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":K(r,Vs,n);break;case"deleteByComposition":(function(f,d){return f!==d||A(f)||A(d)||!yn(f)||!yn(d)})(c,u)&&K(r,Zi,n);break;case"deleteByDrag":case"deleteByCut":K(r,Zi,n);break;case"deleteContent":K(r,mn,!1);break;case"deleteWordBackward":K(r,Pr,!0);break;case"deleteWordForward":K(r,Pr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":K(r,Ir,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":K(r,Ir,!1);break;case"formatStrikeThrough":K(r,en,"strikethrough");break;case"formatBold":K(r,en,"bold");break;case"formatItalic":K(r,en,"italic");break;case"formatUnderline":K(r,en,"underline");break;case"historyUndo":K(r,hd,void 0);break;case"historyRedo":K(r,pd,void 0)}return!0}function Fm(n){if(ke(n.target)&&Gd(n.target))return!0;const e=ve(),t=D(),r=n.data,s=Ad(n);if(r!=null&&O(t)&&kd(t,s,r,n.timeStamp,!1)){_r&&(ws(e,r),_r=!1);const i=t.anchor.getNode(),o=Ct(ht(e));if(o===null)return!0;const a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;vs&&!t.isCollapsed()&&L(i)&&o.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===sf(o.anchorNode)||K(e,Yn,r);const u=r.length;xn&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),Mr||or||$r||!e.isComposing()||(Rr=0,ze(null))}else la(!1,e,r!==null?r:void 0),_r&&(ws(e,r||void 0),_r=!1);return(function(){De();const i=ve();Qc(i)})(),!0}function Mm(n){const e=ve(),t=D();if(O(t)&&!e.isComposing()){const r=t.anchor,s=t.anchor.getNode();ze(r.key),(n.timeStamp<Rr+30||r.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||L(s)&&s.getStyle()!==t.style)&&K(e,Yn,lm)}return!0}function $m(n){return ws(ve(),n.data),!0}function ws(n,e){const t=n._compositionKey;if(ze(null),t!==null&&e!=null){if(e===""){const r=Ie(t),s=sr(n.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&L(r)&&ua(r,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
5
- `){const r=D();if(O(r)){const s=r.focus;return r.anchor.set(s.key,s.offset,s.type),void K(n,Es,null)}}}la(!0,n,e)}function Lm(n){const e=ve();if(n.key==null)return!0;if(io&&Ml(n))return It(e,()=>{ws(e,oo)}),io=!1,oo="",!0;if((function(t){return _e(t,"ArrowRight",{shiftKey:"any"})})(n))K(e,yd,n);else if((function(t){return _e(t,"ArrowRight",Kt)})(n))K(e,wm,n);else if((function(t){return _e(t,"ArrowLeft",{shiftKey:"any"})})(n))K(e,Ko,n);else if((function(t){return _e(t,"ArrowLeft",Kt)})(n))K(e,km,n);else if((function(t){return _e(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))K(e,Wo,n);else if((function(t){return _e(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))K(e,Vo,n);else if((function(t){return _e(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Sr=!0,K(e,Es,n);else if((function(t){return t.key===" "})(n))K(e,Ho,n);else if((function(t){return mt&&_e(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Sr=!0,K(e,Gn,!0);else if((function(t){return _e(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Sr=!1,K(e,Es,n);else if((function(t){return _e(t,"Backspace",{shiftKey:"any"})||mt&&_e(t,"h",{ctrlKey:!0})})(n))Ml(n)?K(e,_d,n):(n.preventDefault(),K(e,mn,!0));else if((function(t){return t.key==="Escape"})(n))K(e,qo,n);else if((function(t){return _e(t,"Delete",{})||mt&&_e(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?K(e,vd,n):(n.preventDefault(),K(e,mn,!1));else if((function(t){return _e(t,"Backspace",Fl)})(n))n.preventDefault(),K(e,Pr,!0);else if((function(t){return _e(t,"Delete",Fl)})(n))n.preventDefault(),K(e,Pr,!1);else if((function(t){return mt&&_e(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),K(e,Ir,!0);else if((function(t){return mt&&(_e(t,"Delete",{metaKey:!0})||_e(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),K(e,Ir,!1);else if((function(t){return _e(t,"b",Kt)})(n))n.preventDefault(),K(e,en,"bold");else if((function(t){return _e(t,"u",Kt)})(n))n.preventDefault(),K(e,en,"underline");else if((function(t){return _e(t,"i",Kt)})(n))n.preventDefault(),K(e,en,"italic");else if((function(t){return _e(t,"Tab",{shiftKey:"any"})})(n))K(e,Jo,n);else if((function(t){return _e(t,"z",Kt)})(n))n.preventDefault(),K(e,hd,void 0);else if((function(t){return mt?_e(t,"z",{metaKey:!0,shiftKey:!0}):_e(t,"y",{ctrlKey:!0})||_e(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),K(e,pd,void 0);else{const t=e._editorState._selection;t===null||O(t)?$l(n)&&(n.preventDefault(),K(e,eo,n)):(function(r){return _e(r,"c",Kt)})(n)?(n.preventDefault(),K(e,Hs,n)):(function(r){return _e(r,"x",Kt)})(n)?(n.preventDefault(),K(e,Go,n)):$l(n)&&(n.preventDefault(),K(e,eo,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(Rm,n),!0}function Pd(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Zn=new Map;function Id(n){const e=py(n.target);if(e===null)return;const t=Zs(e.anchorNode);if(t===null)return;so&&(so=!1,It(t,()=>{const l=On(),c=e.anchorNode;(ke(c)||Yt(c))&&Ue(Xo(l,e,t,n))}));const r=aa(t),s=r[r.length-1],i=s._key,o=Zn.get(i),a=o||s;a!==t&&cl(e,a,!1),cl(e,t,!0),t!==s?Zn.set(i,t):o&&Zn.delete(i)}function dl(n){n._lexicalHandled=!0}function fl(n){return n._lexicalHandled===!0}function Dm(n){const e=no.get(n);if(e===void 0)return;const t=Ts.get(e);if(t===void 0)return;const r=t-1;r>=0||F(164),no.delete(n),Ts.set(e,r),r===0&&e.removeEventListener("selectionchange",Id);const s=Xs(n);oa(s)?((function(o){if(o._parentEditor!==null){const a=aa(o),l=a[a.length-1]._key;Zn.get(l)===o&&Zn.delete(l)}else Zn.delete(o._key)})(s),n.__lexicalEditor=null):s&&F(198);const i=Pd(n);for(let o=0;o<i.length;o++)i[o]();n.__lexicalEventHandles=[]}function ao(n,e,t){De();const r=n.__key,s=n.getParent();if(s===null)return;const i=(function(a){const l=D();if(!O(l)||!A(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return fo(f,a)&&c.set(a.__key,0,"element"),fo(d,a)&&u.set(a.__key,0,"element"),l})(n);let o=!1;if(O(i)&&e){const a=i.anchor,l=i.focus;a.key===r&&(Ps(a,n,s,n.getPreviousSibling(),n.getNextSibling()),o=!0),l.key===r&&(Ps(l,n,s,n.getPreviousSibling(),n.getNextSibling()),o=!0)}else Oe(i)&&e&&n.isSelected()&&n.selectPrevious();if(O(i)&&e&&!o){const a=n.getIndexWithinParent();_n(n),As(i,s,a,-1)}else _n(n);t||He(s)||s.canBeEmpty()||!s.isEmpty()||ao(s,e),e&&i&&$e(s)&&s.isEmpty()&&s.selectEnd()}const Rd=Symbol.for("ephemeral");function ks(n){return n[Rd]||!1}class At{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=ni(this);return e===void 0&&F(64,this.name),e}static clone(e){F(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,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))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Xd(this,e)}getType(){return this.__type}isInline(){F(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Ie(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||D();if(t==null)return!1;const r=t.getNodes().some(s=>s.__key===this.__key);if(L(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const s=this.getParent();if(pe(this)&&this.isInline()&&s){const i=t.isBackward()?t.focus:t.anchor;if(s.is(i.getNode())&&i.offset===s.getChildrenSize()&&this.is(s.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Ie(e)}getParentOrThrow(){const e=this.getParent();return e===null&&F(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(He(t))return A(e)||e===this&&pe(e)||F(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&F(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Ie(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Ie(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=A(this)?this:this.getParent(),r=A(e)?e:e.getParent(),s=t&&r?fs(t,r):null;return s?s.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=fs(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?gf(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&F(279),!1)))}isParentOf(e){const t=fs(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],s=new Set;let i=this;for(;i!==null;){const o=i.__key;if(s.has(o)||(s.add(o),r.push(i)),i===e)break;const a=A(i)?t?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=t?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(s.has(c.__key)||r.push(c),c===e)break;let u=null,f=c;do{if(f===null&&F(68),u=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||s.has(f.__key)||r.push(f)}while(u===null);i=u}return t||r.reverse(),r}isDirty(){const e=ve()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(ks(this))return this;const e=Ie(this.__key);return e===null&&F(113),e}getWritable(){if(ks(this))return this;De();const e=an(),t=ve(),r=e._nodeMap,s=this.__key,i=this.getLatest(),o=t._cloneNotNeeded,a=D();if(a!==null&&a.setCachedNodes(null),o.has(s))return Rs(i),i;const l=lf(i);return o.add(s),Rs(l),r.set(s,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){F(70)}updateDOM(e,t,r){F(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){F(18,this.name)}updateFromJSON(e){return(function(t,r){const s=t.getWritable(),i=r.$;let o=i;for(const a of sd(s).flatKeys)a in r&&(o!==void 0&&o!==i||(o={...i}),o[a]=r[a]);return(s.__state||o)&&rd(t).updateFromJSON(o),s})(this,e)}static transform(){return null}remove(e){ao(this,!0,e)}replace(e,t){De();let r=D();r!==null&&(r=r.clone()),Si(this,e);const s=this.getLatest(),i=this.__key,o=e.__key,a=e.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;_n(a);const u=s.getPreviousSibling(),f=s.getNextSibling(),d=s.__prev,h=s.__next,g=s.__parent;if(ao(s,!1,!0),u===null?l.__first=o:u.getWritable().__next=o,a.__prev=d,f===null?l.__last=o:f.getWritable().__prev=o,a.__next=h,a.__parent=g,l.__size=c,t&&(A(this)&&A(a)||F(139),this.getChildren().forEach(m=>{a.append(m)})),O(r)){Ue(r);const m=r.anchor,y=r.focus;m.key===i&&ml(m,a),y.key===i&&ml(y,a)}return tn()===i&&ze(o),a}insertAfter(e,t=!0){De(),Si(this,e);const r=this.getWritable(),s=e.getWritable(),i=s.getParent(),o=D();let a=!1,l=!1;if(i!==null){const h=e.getIndexWithinParent();if(_n(s),O(o)){const g=i.__key,m=o.anchor,y=o.focus;a=m.type==="element"&&m.key===g&&m.offset===h+1,l=y.type==="element"&&y.key===g&&y.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=s.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,s.__next=d,s.__prev=r.__key,s.__parent=r.__parent,t&&O(o)){const h=this.getIndexWithinParent();As(o,u,h+1);const g=u.__key;a&&o.anchor.set(g,h+2,"element"),l&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){De(),Si(this,e);const r=this.getWritable(),s=e.getWritable(),i=s.__key;_n(s);const o=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();o===null?a.__first=i:o.getWritable().__next=i,a.__size++,r.__prev=i,s.__prev=l,s.__next=r.__key,s.__parent=r.__parent;const u=D();return t&&O(u)&&As(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Ee()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){De();const r=this.getPreviousSibling(),s=this.getParentOrThrow();if(r===null)return s.select(0,0);if(A(r))return r.select();if(!L(r)){const i=r.getIndexWithinParent()+1;return s.select(i,i)}return r.select(e,t)}selectNext(e,t){De();const r=this.getNextSibling(),s=this.getParentOrThrow();if(r===null)return s.select();if(A(r))return r.select(0,0);if(!L(r)){const i=r.getIndexWithinParent();return s.select(i,i)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const Bm="historic",Xn="history-merge",jm="paste",Od="collaboration",zm="skip-scroll-into-view",Um="skip-dom-selection",Km="skip-selection-focus";class ar extends At{static getType(){return"linebreak"}static clone(e){return new ar(e.__key)}constructor(e){super(e)}getTextContent(){return`
6
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&Os(r)){const s=r.firstChild;if(s===t||s.nextSibling===t&&Xr(s)){const i=r.lastChild;if(i===t||i.previousSibling===t&&Xr(i))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&Os(r)){const s=r.firstChild;if(s===t||s.nextSibling===t&&Xr(s))return!1;const i=r.lastChild;if(i===t||i.previousSibling===t&&Xr(i))return!0}return!1})(e)?null:{conversion:Wm,priority:0}}}static importJSON(e){return vt().updateFromJSON(e)}}function Wm(n){return{node:vt()}}function vt(){return pt(new ar)}function Pt(n){return n instanceof ar}function Xr(n){return Yt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function yi(n,e){return 16&e?"code":e&Yc?"mark":32&e?"sub":64&e?"sup":null}function _i(n,e){return 1&e?"strong":2&e?"em":"span"}function Fd(n,e,t,r,s){const i=r.classList;let o=Qn(s,"base");o!==void 0&&i.add(...o),o=Qn(s,"underlineStrikethrough");let a=!1;const l=8&e&&4&e;o!==void 0&&(8&t&&4&t?(a=!0,l||i.add(...o)):l&&i.remove(...o));for(const c in bn){const u=bn[c];if(o=Qn(s,c),o!==void 0)if(t&u){if(a&&(c==="underline"||c==="strikethrough")){e&u&&i.remove(...o);continue}((e&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...o)}else e&u&&i.remove(...o)}}function Md(n,e,t){const r=e.firstChild,s=t.isComposing(),i=n+(s?Ks:"");if(r==null)e.textContent=i;else{const o=r.nodeValue;if(o!==i)if(s||xn){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,m=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;m+g<d&&m+g<h&&u[d-m-1]===f[h-m-1];)m++;return[g,d-g-m,f.slice(g,h-m)]})(o,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function gl(n,e,t,r,s,i){Md(s,n,e);const o=i.theme.text;o!==void 0&&Fd(0,0,r,n,o)}function Qr(n,e){const t=document.createElement(e);return t.appendChild(n),t}class Lt extends At{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Lt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}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(){const e=this.getLatest();return fm[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===tn()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=bn[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Is(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,s=yi(0,r),i=_i(0,r),o=s===null?i:s,a=document.createElement(o);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),s!==null&&(l=document.createElement(i),a.appendChild(l)),gl(l,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(e,t,r){const s=this.__text,i=e.__format,o=this.__format,a=yi(0,i),l=yi(0,o),c=_i(0,i),u=_i(0,o);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const m=t.firstChild;m==null&&F(48);const y=document.createElement(u);return gl(y,this,0,o,s,r),t.replaceChild(y,m),!1}let f=t;l!==null&&a!==null&&(f=t.firstChild,f==null&&F(49)),Md(s,f,this);const d=r.theme.text;d!==void 0&&i!==o&&Fd(0,i,o,f,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Jm,priority:0}),b:()=>({conversion:Hm,priority:0}),code:()=>({conversion:Ut,priority:0}),em:()=>({conversion:Ut,priority:0}),i:()=>({conversion:Ut,priority:0}),mark:()=>({conversion:Ut,priority:0}),s:()=>({conversion:Ut,priority:0}),span:()=>({conversion:Vm,priority:0}),strong:()=>({conversion:Ut,priority:0}),sub:()=>({conversion:Ut,priority:0}),sup:()=>({conversion:Ut,priority:0}),u:()=>({conversion:Ut,priority:0})}}static importJSON(e){return Te().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return ke(t)||F(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=Qr(t,"b")),this.hasFormat("italic")&&(t=Qr(t,"i")),this.hasFormat("strikethrough")&&(t=Qr(t,"s")),this.hasFormat("underline")&&(t=Qr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?bn[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?um[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Is(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=dm[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){De();let r=e,s=t;const i=D(),o=this.getTextContent(),a=this.__key;if(typeof o=="string"){const l=o.length;r===void 0&&(r=l),s===void 0&&(s=l)}else r=0,s=0;if(!O(i))return Dd(a,r,a,s,"text","text");{const l=tn();l!==i.anchor.key&&l!==i.focus.key||ze(a),i.setTextNodeRange(this,r,this,s)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,s){const i=this.getWritable(),o=i.__text,a=r.length;let l=e;l<0&&(l=a+l,l<0&&(l=0));const c=D();if(s&&O(c)){const f=e+a;c.setTextNodeRange(i,f,i,f)}const u=o.slice(0,l)+r+o.slice(l+t);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){De();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const s=t.__key,i=tn(),o=r.length;e.sort((T,E)=>T-E),e.push(o);const a=[],l=e.length;for(let T=0,E=0;T<o&&E<=l;E++){const N=e[E];N>T&&(a.push(r.slice(T,N)),T=N)}const c=a.length;if(c===1)return[t];const u=a[0],f=t.getParent();let d;const h=t.getFormat(),g=t.getStyle(),m=t.__detail;let y=!1,x=null,p=null;const _=D();if(O(_)){const[T,E]=_.isBackward()?[_.focus,_.anchor]:[_.anchor,_.focus];T.type==="text"&&T.key===s&&(x=T),E.type==="text"&&E.key===s&&(p=E)}t.isSegmented()?(d=Te(u),d.__format=h,d.__style=g,d.__detail=m,d.__state=rl(t,d),y=!0):d=t.setTextContent(u);const C=[d];for(let T=1;T<c;T++){const E=Te(a[T]);E.__format=h,E.__style=g,E.__detail=m,E.__state=rl(t,E);const N=E.__key;i===s&&ze(N),C.push(E)}const v=x?x.offset:null,b=p?p.offset:null;let S=0;for(const T of C){if(!x&&!p)break;const E=S+T.getTextContentSize();if(x!==null&&v!==null&&v<=E&&v>=S&&(x.set(T.getKey(),v-S,"text"),v<E&&(x=null)),p!==null&&b!==null&&b<=E&&b>=S){p.set(T.getKey(),b-S,"text");break}S=E}if(f!==null){(function(N){const P=N.getPreviousSibling(),$=N.getNextSibling();P!==null&&Rs(P),$!==null&&Rs($)})(this);const T=f.getWritable(),E=this.getIndexWithinParent();y?(T.splice(E,0,C),this.remove()):T.splice(E,1,C),O(_)&&As(_,f,E,c-1)}return C}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||F(50);const r=this.__key,s=e.__key,i=this.__text,o=i.length;tn()===s&&ze(r);const a=D();if(O(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===s&&Cl(f,t,r,e,o),d!==null&&d.key===s&&Cl(d,t,r,e,o)}const l=e.__text,c=t?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Vm(n){return{forChild:Yo(n.style),node:null}}function Hm(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Yo(e.style,t?void 0:"bold"),node:null}}const hl=new WeakMap;function qm(n){if(!ke(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function Jm(n){const e=n;n.parentElement===null&&F(129);let t=e.textContent||"";if((function(r){let s,i=r.parentNode;const o=[r];for(;i!==null&&(s=hl.get(i))===void 0&&!qm(i);)o.push(i),i=i.parentNode;const a=s===void 0?i:s;for(let l=0;l<o.length;l++)hl.set(o[l],a);return a})(e)!==null){const r=t.split(/(\r?\n|\t)/),s=[],i=r.length;for(let o=0;o<i;o++){const a=r[o];a===`
7
- `||a===`\r
8
- `?s.push(vt()):a===" "?s.push(ur()):a!==""&&s.push(Te(a))}return{node:s}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,s=!0;for(;r!==null&&(r=pl(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(t=t.slice(1)),s=!1;break}}s&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,s=!0;for(;r!==null&&(r=pl(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:Te(t)}}function pl(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const i=t.parentElement;if(i===null)return null;t=i}if(t=r,ke(t)){const i=t.style.display;if(i===""&&!po(t)||i!==""&&!i.startsWith("inline"))return null}let s=t;for(;(s=e?t.firstChild:t.lastChild)!==null;)t=s;if(Yt(t))return t;if(t.nodeName==="BR")return null}}const Gm={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ut(n){const e=Gm[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Yo(n.style,e),node:null}}function Te(n=""){return pt(new Lt(n))}function L(n){return n instanceof Lt}function Yo(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),s=t==="700"||t==="bold",i=r.includes("line-through"),o=n.fontStyle==="italic",a=r.includes("underline"),l=n.verticalAlign;return c=>(L(c)&&(s&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),o&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class lr extends Lt{static getType(){return"tab"}static clone(e){return new lr(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=Qn(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return ur().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&qc(126),super.setTextContent(" ")}spliceText(e,t,r,s){return r===""&&t===0||r===" "&&t===1||F(286),this}setDetail(e){return e!==2&&F(127),this}setMode(e){return e!=="normal"&&F(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function ur(){return pt(new lr)}function qs(n){return n instanceof lr}class Ym{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:ff(it($t(this,"next")),it($t(e,"next")))<0}getNode(){const e=Ie(this.key);return e===null&&F(20),e}set(e,t,r,s){const i=this._selection,o=this.key;s&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,Lr()||(tn()===o&&ze(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function Ft(n,e,t){return new Ym(n,e,t)}function vi(n,e){let t=e.__key,r=n.offset,s="element";if(L(e)){s="text";const i=e.getTextContentSize();r>i&&(r=i)}else if(!A(e)){const i=e.getNextSibling();if(L(i))t=i.__key,r=0,s="text";else{const o=e.getParent();o&&(t=o.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,s)}function ml(n,e){if(A(e)){const t=e.getLastDescendant();A(t)||L(t)?vi(n,t):vi(n,e)}else vi(n,e)}class Js{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Oe(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(s=>r.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Js(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,s=t[r-1];let i;if(L(s))i=s.select();else{const o=s.getIndexWithinParent()+1;i=s.getParentOrThrow().select(o,o)}i.insertNodes(e);for(let o=0;o<r;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const s of t){const i=Ie(s);i!==null&&r.push(i)}return Lr()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((D()||On())===this&&e[0]){const t=Re(e[0],"next");hf(on(t,t))}for(const t of e)t.remove()}}function O(n){return n instanceof Rn}class Rn{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,s){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!O(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=(function(r){const s=[],[i,o]=r.getTextSlices();i&&s.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(dt(c)){const{origin:u}=c;s.length===0?a.add(u):(l.add(u),s.push(u))}else{const{origin:u}=c;A(u)&&l.has(u)||s.push(u)}if(o&&s.push(o.caret.origin),ir(r.focus)&&A(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=ft(r.focus.origin,"previous");dt(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(s[s.length-1]);c=ri(c))a.delete(c.origin),s.pop();for(;s.length>1;){const c=s[s.length-1];if(!A(c)||l.has(c)||c.isEmpty()||a.has(c))break;s.pop()}if(s.length===0&&r.isCollapsed()){const c=it(r.anchor),u=it(r.anchor.getFlipped()),f=h=>Rt(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);s.push(d)}return s})(mf(Ul(this),"next"));return Lr()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,s){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,s,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],s=this.anchor,i=this.focus,o=s.isBefore(i),[a,l]=lo(this);let c="",u=!0;for(let f=0;f<e.length;f++){const d=e[f];if(A(d)&&!d.isInline())u||(c+=`
9
- `),u=!d.isEmpty();else if(u=!1,L(d)){let h=d.getTextContent();d===t?d===r?s.type==="element"&&i.type==="element"&&i.offset!==s.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=o?h.slice(a):h.slice(l):d===r&&(h=o?h.slice(0,l):h.slice(0,a)),c+=h}else!pe(d)&&!Pt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=ve(),r=t.getEditorState()._selection,s=Ld(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(s===null)return;const[i,o]=s;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(o.key,o.offset,o.type,!0),Sn(this)}clone(){const e=this.anchor,t=this.focus;return new Rn(Ft(e.key,e.offset,e.type),Ft(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Is(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=bn[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],s=t.length;for(let i=0;i<s;i++){const o=t[i];o===`
10
- `||o===`\r
11
- `?r.push(vt()):o===" "?r.push(ur()):r.push(Te(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,s=this.format,i=this.style;let o=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,a=t),o.type==="element"&&(function(y,x,p,_){const C=y.getNode(),v=C.getChildAtIndex(y.offset),b=Te();if(b.setFormat(p),b.setStyle(_),Br(v))v.splice(0,0,[b]);else{const S=$e(C)?Ee().append(b):b;v===null?C.append(S):v.insertBefore(S)}y.is(x)&&x.set(b.__key,0,"text"),y.set(b.__key,0,"text")})(o,a,s,i),a.type==="element"&&An(a,it($t(a,"next")));const l=o.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];L(d)||F(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let m=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(o.key,c,"text")),this.isCollapsed()&&l===h&&(Wt(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let y=d.getNextSibling();if(L(y)&&y.canInsertTextBefore()&&!Wt(y)||(y=Te(),y.setFormat(s),y.setStyle(i),g.canInsertTextAfter()?d.insertAfter(y):g.insertAfter(y)),y.select(0,0),d=y,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&(Wt(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let y=d.getPreviousSibling();if(L(y)&&!Wt(y)||(y=Te(),y.setFormat(s),g.canInsertTextBefore()?d.insertBefore(y):g.insertBefore(y)),y.select(),d=y,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const y=Te(d.getTextContent());y.setFormat(s),d.replace(y),d=y}else if(!this.isCollapsed()&&e!==""){const y=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||A(y)&&(!y.canInsertTextBefore()||!y.canInsertTextAfter()))return this.insertText(""),$d(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(yn(d)){const _=Te(e);return _.select(),void d.replace(_)}const y=d.getFormat(),x=d.getStyle();if(l!==c||y===s&&x===i){if(qs(d)){const _=Te(e);return _.setFormat(s),_.setStyle(i),_.select(),void d.replace(_)}}else{if(d.getTextContent()!==""){const _=Te(e);if(_.setFormat(s),_.setStyle(i),_.select(),l===0)d.insertBefore(_,!1);else{const[C]=d.splitText(l);C.insertAfter(_,!1)}return void(_.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(s),d.setStyle(i)}const p=c-l;d=d.spliceText(l,p,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=y,this.style=x))}else{const y=new Set([...d.getParentKeys(),...m.getParentKeys()]),x=A(d)?d:d.getParentOrThrow();let p=A(m)?m:m.getParentOrThrow(),_=m;if(!x.is(p)&&p.isInline())do _=p,p=p.getParentOrThrow();while(p.isInline());if(a.type==="text"&&(c!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<c)if(L(m)&&!yn(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){const T=Te(m.getTextContent());m.replace(T),m=T}$e(a.getNode())||a.type!=="text"||(m=m.spliceText(0,c,"")),y.add(m.__key)}else{const T=m.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?m.remove():T.remove()}else y.add(m.__key);const C=p.getChildren(),v=new Set(u),b=x.is(p),S=x.isInline()&&d.getNextSibling()===null?x:d;for(let T=C.length-1;T>=0;T--){const E=C[T];if(E.is(d)||A(E)&&E.isParentOf(d))break;E.isAttached()&&(!v.has(E)||E.is(_)?b||S.insertAfter(E,!1):E.remove())}if(!b){let T=p,E=null;for(;T!==null;){const N=T.getChildren(),P=N.length;(P===0||N[P-1].is(E))&&(y.delete(T.__key),E=T),T=T.getParent()}}if(yn(d))if(l===h)d.select();else{const T=Te(e);T.select(),d.replace(T)}else d=d.spliceText(l,h-l,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let T=1;T<f;T++){const E=u[T],N=E.__key;y.has(N)||E.remove()}}}removeText(){const e=D()===this;gs(this,wy(Ul(this))),e&&D()!==this&&Ue(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void ze(null);const r=this.getNodes(),s=[];for(const C of r)L(C)&&s.push(C);const i=C=>{r.forEach(v=>{if(A(v)){const b=v.getFormatFlags(e,C);v.setTextFormat(b)}})},o=s.length;if(o===0)return this.toggleFormat(e),ze(null),void i(t);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=s[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=s[1],g=0),h==null)return;const m=h.getFormatFlags(e,t);i(m);const y=o-1;let x=s[y];const p=f.type==="text"?f.offset:x.getTextContentSize();if(h.is(x)){if(g===p)return;if(Wt(h)||g===0&&p===h.getTextContentSize())h.setFormat(m);else{const C=h.splitText(g,p),v=g===0?C[0]:C[1];v.setFormat(m),u.type==="text"&&u.set(v.__key,0,"text"),f.type==="text"&&f.set(v.__key,p-g,"text")}return void(this.format=m)}g===0||Wt(h)||([,h]=h.splitText(g),g=0),h.setFormat(m);const _=x.getFormatFlags(e,m);p>0&&(p===x.getTextContentSize()||Wt(x)||([x]=x.splitText(p)),x.setFormat(_));for(let C=d+1;C<y;C++){const v=s[C],b=v.getFormatFlags(e,_);v.setFormat(b)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(x.__key,p,"text"),this.format=m|_}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=D();return O(g)||F(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=Qe(t,Xt),s=e[e.length-1];if(A(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=xi(this);r.splice(g,0,e),s.selectEnd()}return}if(!e.some(g=>(A(g)||pe(g))&&!g.isInline())){A(r)||F(211,t.constructor.name,t.getType());const g=xi(this);return r.splice(g,0,e),void s.selectEnd()}const i=(function(g){const m=Ee();let y=null;for(let x=0;x<g.length;x++){const p=g[x],_=Pt(p);if(_||pe(p)&&p.isInline()||A(p)&&p.isInline()||L(p)||p.isParentRequired()){if(y===null&&(y=p.createParentElementNode(),m.append(y),_))continue;y!==null&&y.append(p)}else m.append(p),y=null}return m})(e),o=i.getLastDescendant(),a=i.getChildren(),l=!A(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;A(f=u)&&Xt(f)&&!f.isEmpty()&&A(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(A(r)||F(211,t.constructor.name,t.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&F(212,t.constructor.name,t.getType()),(function(g,m){const y=m.getParentOrThrow().getLastChild();let x=m;const p=[m];for(;x!==y;)x.getNextSibling()||F(140),x=x.getNextSibling(),p.push(x);let _=g;for(const C of p)_=_.insertAfter(C)})(r,u));const d=Qe(o,Xt);l&&A(d)&&(l.canMergeWhenEmpty()||Xt(c))&&(d.append(...l.getChildren()),l.remove()),A(r)&&r.isEmpty()&&r.remove(),o.selectEnd();const h=A(r)?r.getLastChild():null;Pt(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=Ee();return we().splice(this.anchor.offset,0,[o]),o.select(),o}const e=xi(this),t=Qe(this.anchor.getNode(),Xt);A(t)||F(213);const r=t.getChildAtIndex(e),s=r?[r,...r.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...s),i.selectStart(),i):null}insertLineBreak(e){const t=vt();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),s=t.getIndexWithinParent();r.select(s,s)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],s=e[t-1];const[i,o]=lo(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[o,i]:[i,o];if(t===0)return[];if(t===1){if(L(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(L(r)&&(u===r.getTextContentSize()?e.shift():u!==0&&([,r]=r.splitText(u),e[0]=r,l.set(r.getKey(),0,"text"))),L(s)){const d=s.getTextContent().length;f===0?e.pop():f!==d&&([s]=s.splitText(f),e[e.length-1]=s,c.set(s.getKey(),s.getTextContentSize(),"text"))}return e}modify(e,t,r){if(El(this,e,t,r))return;const s=e==="move",i=ve(),o=Ct(ht(i));if(!o)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!A(c)||c.isInline()||c.canBeEmpty()||go(a,i,l),this.dirty){let u=Tn(i,this.anchor.key),f=Tn(i,this.focus.key);this.anchor.type==="text"&&(u=sr(u)),this.focus.type==="text"&&(f=sr(f)),u&&f&&Bd(o,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(o,e,t?"backward":"forward",r),o.rangeCount>0){const u=o.getRangeAt(0),f=this.anchor.getNode(),d=$e(f)?f:fy(f);if(this.applyDOMRange(u),this.dirty=!0,!s){const h=this.getNodes(),g=[];let m=!1;for(let y=0;y<h.length;y++){const x=h[y];fo(x,d)?g.push(x):m=!0}if(m&&g.length>0)if(t){const y=g[0];A(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=g[g.length-1];A(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}o.anchorNode===u.startContainer&&o.anchorOffset===u.startOffset||(function(y){const x=y.focus,p=y.anchor,_=p.key,C=p.offset,v=p.type;p.set(x.key,x.offset,x.type,!0),x.set(_,C,v,!0)})(this)}}r==="lineboundary"&&El(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&A(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const s=t.getParent(),i=t.getNextSibling()||(s===null?null:s.getNextSibling());if(A(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let s=r.getNode();if(this.forwardDeletion(r,s,e))return;const i=ya($t(r,e?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(dt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(A(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=it(l);gs(this,on(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(ir(l)){if(A(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(pe(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&A(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=Zo();c.add(l.origin.getKey()),Ue(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return gs(this,on(!l.origin.isEmpty()&&c.isEmpty()?Ur(Re(c,l.direction)):i.anchor,l)),this.removeText()}}const o=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&_l(this,r.getNode()))return}else{const a=o.type==="text"?o.getNode():null;if(s=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=o.offset,c=a.getTextContentSize();if(a.is(s)||e&&l!==c||!e&&l!==0)return void vl(a,e,l)}else if(s!==null&&s.isSegmented()){const l=r.offset,c=s.getTextContentSize();if(s.is(a)||e&&l!==0||!e&&l!==c)return void vl(s,e,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,m=f.offset,y=g<m,x=y?g:m,p=y?m:g,_=p-1;x!==_&&(function(C){return!(nf(C)||Zm(C))})(d.getTextContent().slice(x,p))&&(c?f.set(f.key,_,f.type):u.set(u.key,_,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&$e(r.getParent())&&r.getPreviousSibling()===null&&_l(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Oe(n){return n instanceof Js}function yl(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function lo(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[yl(t),yl(r)]}function _l(n,e){for(let t=e;t;t=t.getParent()){if(A(t)){if(t.collapseAtStart(n))return!0;if(He(t))break}if(t.getPreviousSibling())break}return!1}const Zm=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function vl(n,e,t){const r=n,s=r.getTextContent().split(/(?=\s)/g),i=s.length;let o=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=o,o+=s[c].length,e&&o===t||o>t||u){s.splice(c,1),u&&(a=void 0);break}}const l=s.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function xl(n,e,t,r){let s,i=e;if(ke(n)){let o=!1;const a=n.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(o=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&i--}if(s=qn(u),L(s))i=Ot(s,o?"next":"previous");else{let d=qn(n);if(d===null)return null;if(A(d)){const h=r.getElementByKey(d.getKey());h===null&&F(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,n,e),A(d)||F(215),o&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let m=d.getChildAtIndex(i);if(A(m)&&(function(y,x,p){const _=y.getParent();return p===null||_===null||!_.canBeEmpty()||_!==p.getNode()})(m,0,t)){const y=o?m.getLastDescendant():m.getFirstDescendant();y===null?d=m:(m=y,d=A(m)?m:m.getParentOrThrow()),i=0}L(m)?(s=m,d=null,i=Ot(m,o?"next":"previous")):m!==d&&o&&!f&&(A(d)||F(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=e===0&&pe(d)&&qn(n)===d?h:h+1,d=d.getParentOrThrow()}if(A(d))return Ft(d.__key,i,"element")}}else s=qn(n);return L(s)?Ft(s.__key,Ot(s,i,"clamp"),"text"):null}function bl(n,e,t){const r=n.offset,s=n.getNode();if(r===0){const i=s.getPreviousSibling(),o=s.getParent();if(e){if((t||!e)&&i===null&&A(o)&&o.isInline()){const a=o.getPreviousSibling();L(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else A(i)&&!t&&i.isInline()?n.set(i.__key,i.getChildrenSize(),"element"):L(i)&&n.set(i.__key,i.getTextContent().length,"text")}else if(r===s.getTextContent().length){const i=s.getNextSibling(),o=s.getParent();if(e&&A(i)&&i.isInline())n.set(i.__key,0,"element");else if((t||e)&&i===null&&A(o)&&o.isInline()&&!o.canInsertTextAfter()){const a=o.getNextSibling();L(a)&&n.set(a.__key,0,"text")}}}function $d(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),s=n.is(e);bl(n,r,s),bl(e,!r,s),s&&e.set(n.key,n.offset,n.type);const i=ve();if(i.isComposing()&&i._compositionKey!==n.key&&O(t)){const o=t.anchor,a=t.focus;n.set(o.key,o.offset,o.type,!0),e.set(a.key,a.offset,a.type,!0)}}}function Ld(n,e,t,r,s,i){if(n===null||t===null||!jr(s,n,t))return null;const o=xl(n,e,O(i)?i.anchor:null,s);if(o===null)return null;const a=xl(t,r,O(i)?i.focus:null,s);if(a===null)return null;if(o.type==="element"&&a.type==="element"){const l=qn(n),c=qn(t);if(pe(l)&&pe(c))return null}return $d(o,a,i),[o,a]}function Ns(n){return A(n)&&!n.isInline()}function Dd(n,e,t,r,s,i){const o=an(),a=new Rn(Ft(n,e,s),Ft(t,r,i),0,"");return a.dirty=!0,o._selection=a,a}function Gs(){const n=Ft("root",0,"element"),e=Ft("root",0,"element");return new Rn(n,e,0,"")}function Zo(){return new Js(new Set)}function Xo(n,e,t,r){const s=t._window;if(s===null)return null;const i=r||s.event,o=i?i.type:void 0,a=o==="selectionchange",l=!Ki&&(a||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&i&&i.detail===3||o==="drop"||o===void 0);let c,u,f,d;if(O(n)&&!l)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,(a||o===void 0)&&O(n)&&!jr(t,c,u))return n.clone();const h=Ld(c,f,u,d,t,n);if(h===null)return null;const[g,m]=h;return new Rn(g,m,O(n)?n.format:0,O(n)?n.style:"")}function D(){return an()._selection}function On(){return ve()._editorState._selection}function As(n,e,t,r=1){const s=n.anchor,i=n.focus,o=s.getNode(),a=i.getNode();if(!e.is(o)&&!e.is(a))return;const l=e.__key;if(n.isCollapsed()){const c=s.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);s.set(l,u,"element"),i.set(l,u,"element"),Sl(n)}}else{const c=n.isBackward(),u=c?i:s,f=u.getNode(),d=c?s:i,h=d.getNode();if(e.is(f)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(e.is(h)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Sl(n)}function Sl(n){const e=n.anchor,t=e.offset,r=n.focus,s=r.offset,i=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!A(i))return;const a=i.getChildrenSize(),l=t>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(t);if(L(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(A(i)){const a=i.getChildrenSize(),l=t>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(t);if(L(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(A(o)){const a=o.getChildrenSize(),l=s>=a,c=l?o.getChildAtIndex(a-1):o.getChildAtIndex(s);if(L(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Ps(n,e,t,r,s){let i=null,o=0,a=null;r!==null?(i=r.__key,L(r)?(o=r.getTextContentSize(),a="text"):A(r)&&(o=r.getChildrenSize(),a="element")):s!==null&&(i=s.__key,L(s)?a="text":A(s)&&(a="element")),i!==null&&a!==null?n.set(i,o,a):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function Cl(n,e,t,r,s){n.type==="text"?n.set(t,n.offset+(e?0:s),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function Bd(n,e,t,r,s){try{n.setBaseAndExtent(e,t,r,s)}catch{}}function Xm(n,e,t,r,s,i,o){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(s.has(Od)&&f!==i||f!==null&&ia(f))return;if(!O(e))return void(n!==null&&jr(t,a,l)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,m=h.key,y=Tn(t,g),x=Tn(t,m),p=d.offset,_=h.offset,C=e.format,v=e.style,b=e.isCollapsed();let S=y,T=x,E=!1;if(d.type==="text"){S=sr(y);const j=d.getNode();E=j.getFormat()!==C||j.getStyle()!==v}else O(n)&&n.anchor.type==="text"&&(E=!0);var N,P,$,R,I;if(h.type==="text"&&(T=sr(x)),S!==null&&T!==null&&(b&&(n===null||E||O(n)&&(n.format!==C||n.style!==v))&&(N=C,P=v,$=p,R=g,I=performance.now(),wd=[N,P,$,R,I]),c!==p||u!==_||a!==S||l!==T||r.type==="Range"&&b||(f!==null&&i.contains(f)||s.has(Km)||i.focus({preventScroll:!0}),d.type==="element"))){if(Bd(r,S,p,T,_),!s.has(zm)&&e.isCollapsed()&&i!==null&&i===document.activeElement){const j=O(e)&&e.anchor.type==="element"?S.childNodes[p]||null:r.rangeCount>0?r.getRangeAt(0):null;if(j!==null){let B;if(j instanceof Text){const M=document.createRange();M.selectNode(j),B=M.getBoundingClientRect()}else B=j.getBoundingClientRect();(function(M,U,z){const Z=af(z),ne=da(Z);if(Z===null||ne===null)return;let{top:J,bottom:q}=U,H=0,ae=0,re=z;for(;re!==null;){const le=re===Z.body;if(le)H=0,ae=ht(M).innerHeight;else{const te=re.getBoundingClientRect();H=te.top,ae=te.bottom}let Q=0;if(J<H?Q=-(H-J):q>ae&&(Q=q-ae),Q!==0)if(le)ne.scrollBy(0,Q);else{const te=re.scrollTop;re.scrollTop+=Q;const ie=re.scrollTop-te;J-=ie,q-=ie}if(le)break;re=zr(re)}})(t,B,i)}}ro=!0}}function Qm(n){let e=D()||On();e===null&&(e=we().selectEnd()),e.insertNodes(n)}function xi(n){let e=n;n.isCollapsed()||e.removeText();const t=D();O(t)&&(e=t),O(e)||F(161);const r=e.anchor;let s=r.getNode(),i=r.offset;for(;!Xt(s);){const o=s;if([s,i]=ey(s,i),o.is(s))break}return i}function ey(n,e){const t=n.getParent();if(!t){const s=Ee();return we().append(s),s.select(),[we(),0]}if(L(n)){const s=n.splitText(e);if(s.length===0)return[t,n.getIndexWithinParent()];const i=e===0?0:1;return[t,s[0].getIndexWithinParent()+i]}if(!A(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const s=new Rn(Ft(n.__key,e,"element"),Ft(n.__key,e,"element"),0,""),i=n.insertNewAfter(s);i&&i.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function El(n,e,t,r,s="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[u,f]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return f.set(u.key,u.offset,u.type),!0}const i=$t(n.focus,t?"previous":"next"),o=r==="lineboundary",a=e==="move";let l=i,c=s==="decorators-and-blocks";if(!pf(l)){for(const u of l){c=!1;const{origin:f}=u;if(!pe(f)||f.isIsolated()||(l=u,!o||!f.isInline()))break}if(c)for(const u of ya(i).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(dt(u))u.origin.isInline()||(l=u);else{if(A(u.origin))continue;pe(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!o&&pe(l.origin)&&l.origin.isKeyboardSelectable()){const u=Zo();return u.add(l.origin.getKey()),Ue(u),!0}return l=it(l),a&&An(n.anchor,l),An(n.focus,l),c||!o}let Be=null,je=null,tt=!1,bi=!1,ds=0;const Tl={characterData:!0,childList:!0,subtree:!0};function Lr(){return tt||Be!==null&&Be._readOnly}function De(){tt&&F(13)}function jd(){ds>99&&F(14)}function an(){return Be===null&&F(195,zd()),Be}function ve(){return je===null&&F(196,zd()),je}function zd(){let n=0;const e=new Set,t=rr.version;if(typeof window<"u")for(const s of document.querySelectorAll("[contenteditable]")){const i=Xs(s);if(oa(i))n++;else if(i){let o=String(i.constructor.version||"<0.17.1");o===t&&(o+=" (separately built, likely a bundler configuration issue)"),e.add(o)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ty(){return je}function wl(n,e,t){const r=e.__type,s=Jd(n,r);let i=t.get(r);i===void 0&&(i=Array.from(s.transforms),t.set(r,i));const o=i.length;for(let a=0;a<o&&(i[a](e),e.isAttached());a++);}function kl(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Ud(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const s of r)t.add(s)}function ny(n){return Qo(n,ve()._nodes)}function Qo(n,e){const t=n.type,r=e.get(t);r===void 0&&F(17,t);const s=r.klass;n.type!==s.getType()&&F(18,s.name);const i=s.importJSON(n),o=n.children;if(A(i)&&Array.isArray(o))for(let a=0;a<o.length;a++){const l=Qo(o[a],e);i.append(l)}return i}function Nl(n,e,t){const r=Be,s=tt,i=je;Be=e,tt=!0,je=n;try{return t()}finally{Be=r,tt=s,je=i}}function Ht(n,e){const t=n._pendingEditorState,r=n._rootElement,s=n._headless||r===null;if(t===null)return;const i=n._editorState,o=i._selection,a=t._selection,l=n._dirtyType!==0,c=Be,u=tt,f=je,d=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!s&&l&&h!==null){je=n,Be=t,tt=!1,n._updating=!0;try{const b=n._dirtyType,S=n._dirtyElements,T=n._dirtyLeaves;h.disconnect(),g=Em(i,t,n,b,S,T)}catch(b){if(b instanceof Error&&n._onError(b),bi)throw b;return Hd(n,null,r,t),ed(n),n._dirtyType=2,bi=!0,Ht(n,i),void(bi=!1)}finally{h.observe(r,Tl),n._updating=d,Be=c,tt=u,je=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,y=n._dirtyElements,x=n._normalizedNodes,p=n._updateTags,_=n._deferred;l&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(b,S){const T=b._decorators;let E=b._pendingDecorators||T;const N=S._nodeMap;let P;for(P in E)N.has(P)||(E===T&&(E=ef(b)),delete E[P])})(n,t);const C=s?null:Ct(ht(n));if(n._editable&&C!==null&&(l||a===null||a.dirty||!a.is(o))&&r!==null&&!p.has(Um)){je=n,Be=t;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const b=n._blockCursorElement;b!==null&&go(b,n,r),Xm(o,a,n,C,p,r)}(function(b,S,T){let E=b._blockCursorElement;if(O(T)&&T.isCollapsed()&&T.anchor.type==="element"&&S.contains(document.activeElement)){const N=T.anchor,P=N.getNode(),$=N.offset;let R=!1,I=null;if($===P.getChildrenSize())Ci(P.getChildAtIndex($-1))&&(R=!0);else{const j=P.getChildAtIndex($);if(j!==null&&Ci(j)){const B=j.getPreviousSibling();(B===null||Ci(B))&&(R=!0,I=b.getElementByKey(j.__key))}}if(R){const j=b.getElementByKey(P.__key);return E===null&&(b._blockCursorElement=E=(function(B){const M=B.theme,U=document.createElement("div");U.contentEditable="false",U.setAttribute("data-lexical-cursor","true");let z=M.blockCursor;if(z!==void 0){if(typeof z=="string"){const Z=Gc(z);z=M.blockCursor=Z}z!==void 0&&U.classList.add(...z)}return U})(b._config)),S.style.caretColor="transparent",void(I===null?j.appendChild(E):j.insertBefore(E,I))}}E!==null&&go(E,b,S)})(n,r,a)}finally{h!==null&&h.observe(r,Tl),je=f,Be=c}}g!==null&&(function(b,S,T,E,N){const P=Array.from(b._listeners.mutation),$=P.length;for(let R=0;R<$;R++){const[I,j]=P[R];for(const B of j){const M=S.get(B);M!==void 0&&I(M,{dirtyLeaves:E,prevEditorState:N,updateTags:T})}}})(n,g,p,m,i),O(a)||a===null||o!==null&&o.is(a)||n.dispatchCommand(ud,void 0);const v=n._pendingDecorators;v!==null&&(n._decorators=v,n._pendingDecorators=null,Cr("decorator",n,!0,v)),(function(b,S,T){const E=Rl(S),N=Rl(T);E!==N&&Cr("textcontent",b,!0,N)})(n,e||i,t),Cr("update",n,!0,{dirtyElements:y,dirtyLeaves:m,editorState:t,mutatedNodes:g,normalizedNodes:x,prevEditorState:e||i,tags:p}),(function(b,S){if(b._deferred=[],S.length!==0){const T=b._updating;b._updating=!0;try{for(let E=0;E<S.length;E++)S[E]()}finally{b._updating=T}}})(n,_),(function(b){const S=b._updates;if(S.length!==0){const T=S.shift();if(T){const[E,N]=T;Ys(b,E,N)}}})(n)}function Cr(n,e,t,...r){const s=e._updating;e._updating=t;try{const i=Array.from(e._listeners[n]);for(let o=0;o<i.length;o++)i[o].apply(null,r)}finally{e._updating=s}}function Al(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const s=t.shift();if(s){const[i,o]=s,a=n._pendingEditorState;let l;o!==void 0&&(l=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(a===null&&F(191),a._flushSync=!0),l&&n._deferred.push(l),Ud(n,o.tag)),a==null?Ys(n,i,o):i()}}return r}function Ys(n,e,t){const r=n._updateTags;let s,i=!1,o=!1;t!==void 0&&(s=t.onUpdate,Ud(n,t.tag),i=t.skipTransforms||!1,o=t.discrete||!1),s&&n._deferred.push(s);const a=n._editorState;let l=n._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=n._pendingEditorState=Kd(l||a),c=!0),l._flushSync=o;const u=Be,f=tt,d=je,h=n._updating;Be=l,tt=!1,n._updating=!0,je=n;const g=n._headless||n.getRootElement()===null;ra(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(p,_){const C=p.getEditorState()._selection,v=Ct(ht(p));return O(C)||C==null?Xo(C,v,p,_):C.clone()})(n,t&&t.event||null));const y=n._compositionKey;e(),i=Al(n,i),(function(p,_){const C=_.getEditorState()._selection,v=p._selection;if(O(v)){const b=v.anchor,S=v.focus;let T;if(b.type==="text"&&(T=b.getNode(),T.selectionTransform(C,v)),S.type==="text"){const E=S.getNode();T!==E&&E.selectionTransform(C,v)}}})(l,n),n._dirtyType!==0&&(i?(function(p,_){const C=_._dirtyLeaves,v=p._nodeMap;for(const b of C){const S=v.get(b);L(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&ol(S)}})(l,n):(function(p,_){const C=_._dirtyLeaves,v=_._dirtyElements,b=p._nodeMap,S=tn(),T=new Map;let E=C,N=E.size,P=v,$=P.size;for(;N>0||$>0;){if(N>0){_._dirtyLeaves=new Set;for(const R of E){const I=b.get(R);L(I)&&I.isAttached()&&I.isSimpleText()&&!I.isUnmergeable()&&ol(I),I!==void 0&&kl(I,S)&&wl(_,I,T),C.add(R)}if(E=_._dirtyLeaves,N=E.size,N>0){ds++;continue}}_._dirtyLeaves=new Set,_._dirtyElements=new Map,P.delete("root")&&P.set("root",!0);for(const R of P){const I=R[0],j=R[1];if(v.set(I,j),!j)continue;const B=b.get(I);B!==void 0&&kl(B,S)&&wl(_,B,T)}E=_._dirtyLeaves,N=E.size,P=_._dirtyElements,$=P.size,ds++}_._dirtyLeaves=C,_._dirtyElements=v})(l,n),Al(n),(function(p,_,C,v){const b=p._nodeMap,S=_._nodeMap,T=[];for(const[E]of v){const N=S.get(E);N!==void 0&&(N.isAttached()||(A(N)&&Zc(N,E,b,S,T,v),b.has(E)||v.delete(E),T.push(E)))}for(const E of T)S.delete(E);for(const E of C){const N=S.get(E);N===void 0||N.isAttached()||(b.has(E)||C.delete(E),S.delete(E))}})(a,l,n._dirtyLeaves,n._dirtyElements)),y!==n._compositionKey&&(l._flushSync=!0);const x=l._selection;if(O(x)){const p=l._nodeMap,_=x.anchor.key,C=x.focus.key;p.get(_)!==void 0&&p.get(C)!==void 0||F(19)}else Oe(x)&&x._nodes.size===0&&(l._selection=null)}catch(y){return y instanceof Error&&n._onError(y),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ht(n)}finally{Be=u,tt=f,je=d,n._updating=h,ds=0}n._dirtyType!==0||n._deferred.length>0||(function(y,x){const p=x.getEditorState()._selection,_=y._selection;if(_!==null){if(_.dirty||!_.is(p))return!0}else if(p!==null)return!0;return!1})(l,n)?l._flushSync?(l._flushSync=!1,Ht(n)):c&&ay(()=>{Ht(n)}):(l._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function It(n,e,t){je===n&&t===void 0?e():Ys(n,e,t)}class Er{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new Er(this.element,e,this.after)}withAfter(e){return new Er(this.element,this.before,e)}withElement(e){return this.element===e?this:new Er(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&F(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&F(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&F(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&($r||or||Mr);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,s=this.before,i=document.createElement("br");if(r.insertBefore(i,s),e){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",r.insertBefore(o,i),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,s){if(r===this.element){const l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,s))]}const i=Pl(t,r);i.push(s);const o=Pl(t,this.element);let a=e.getIndexWithinParent();for(let l=0;l<o.length;l++){const c=i[l],u=o[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[e.getParentOrThrow(),a]}}function Pl(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let s=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)s++;t.push(s)}return r!==n&&F(225),t.reverse()}class ot extends At{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;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=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return cm[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let 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}isDirty(){const e=ve()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(L(t)&&e.push(t),A(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;A(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;A(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const i=t[r-1];return A(i)&&i.getLastDescendant()||i||null}const s=t[e];return A(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Ie(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&F(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Ie(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&F(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,s;if(e<t/2){for(r=this.getFirstChild(),s=0;r!==null&&s<=e;){if(s===e)return r;r=r.getNextSibling(),s++}return null}for(r=this.getLastChild(),s=t-1;r!==null&&s>=e;){if(s===e)return r;r=r.getPreviousSibling(),s--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let s=0;s<r;s++){const i=t[s];e+=i.getTextContent(),A(i)&&s!==r-1&&!i.isInline()&&(e+=sn)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let s=0;s<r;s++){const i=t[s];e+=i.getTextContentSize(),A(i)&&s!==r-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Xa[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=bn[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Is(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){De();const r=D();let s=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const l=this.getFirstChild();if(L(l)||A(l))return l.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const l=this.getLastChild();if(L(l)||A(l))return l.select()}}s===void 0&&(s=o),i===void 0&&(i=o);const a=this.__key;return O(r)?(r.anchor.set(a,s,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):Dd(a,s,a,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Xa[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){ks(this)&&F(324,this.__key,this.__type);const s=this.getChildrenSize(),i=this.getWritable();e+t<=s||F(226,String(e),String(t),String(s));const o=i.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,f=s-t+r.length;if(e!==0)if(e===s)u=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(u=h.getPreviousSibling())}if(t>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<t;g++){h===null&&F(100);const m=h.getNextSibling(),y=h.__key;_n(h.getWritable()),l.push(y),h=m}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===o&&f--,_n(g);const m=h.__key;if(d===null)i.__first=m,g.__prev=null;else{const y=d.getWritable();y.__next=m,g.__prev=y.__key}h.__key===o&&F(76),g.__parent=o,a.push(m),d=h}if(e+t===s)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=D();if(O(h)){const g=new Set(l),m=new Set(a),{anchor:y,focus:x}=h;Il(y,g,m)&&Ps(y,y.getNode(),this,u,c),Il(x,g,m)&&Ps(x,x.getNode(),this,u,c),f!==0||this.canBeEmpty()||He(this)||this.remove()}}return i}getDOMSlot(e){return new Er(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(ke(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const s=this.getDirection();s&&(t.dir=s)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||He(this)||this.getChildren().some(L)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}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,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let s=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const o=t.getElementByKey(i.getKey());o!==null&&(s==null?(r.insertChild(o),s=o):s!==o&&r.replaceChild(o,s),s=s.nextSibling)}}}function A(n){return n instanceof ot}function Il(n,e,t){let r=n.getNode();for(;r;){const s=r.__key;if(e.has(s)&&!t.has(s))return!0;r=r.getParent()}return!1}class ea extends At{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function pe(n){return n instanceof ea}class cr extends ot{__cachedText;static getType(){return"root"}static clone(){return new cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){F(51)}getTextContent(){const e=this.__cachedText;return!Lr()&&ve()._dirtyType!==0||e===null?super.getTextContent():e}remove(){F(52)}replace(e){F(53)}insertBefore(e){F(54)}insertAfter(e){F(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const s of r)A(s)||pe(s)||F(282);return super.splice(e,t,r)}static importJSON(e){return we().updateFromJSON(e)}collapseAtStart(){return!0}}function $e(n){return n instanceof cr}function Kd(n){return new Dr(new Map(n._nodeMap))}function ta(){return new Dr(new Map([["root",new cr]]))}function Wd(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&F(130,t.name),A(n)){const r=e.children;Array.isArray(r)||F(59,t.name);const s=n.getChildren();for(let i=0;i<s.length;i++){const o=Wd(s[i]);r.push(o)}}return e}function ry(n){return n instanceof Dr}class Dr{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Nl(t&&t.editor||null,this,e)}clone(e){const t=new Dr(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Nl(null,this,()=>({root:Wd(we())}))}}class na extends ot{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class dr extends ot{static getType(){return"paragraph"}static clone(e){return new dr(e.__key)}createDOM(e){const t=document.createElement("p"),r=Qn(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:sy,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(ke(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return Ee().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(L);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=Ee();r.setTextFormat(e.format),r.setTextStyle(e.style);const s=this.getDirection();return r.setDirection(s),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||L(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function sy(n){const e=Ee();return n.style&&(e.setFormat(n.style.textAlign),ga(n,e)),{node:e}}function Ee(){return pt(new dr)}function Br(n){return n instanceof dr}const ge=0,Xe=1,Vd=4;function Hd(n,e,t,r){const s=n._keyToDOMMap;s.clear(),n._editorState=ta(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const i=n._observer;i!==null&&(i.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",s.set("root",t))}function iy(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:s}=ni(r),i=r.transform;if(!t.has(i)){t.add(i);const o=r.transform();o&&e.add(o)}if(s){const o=s.$transform;o&&e.add(o),r=s.extends}else{const o=Object.getPrototypeOf(r);r=o.prototype instanceof At&&o!==At?o:void 0}}return e}function qd(n){const e=n||{},t=ty(),r=e.theme||{},s=n===void 0?t:e.parentEditor||null,i=e.disableEvents||!1,o=ta(),a=e.namespace||(s!==null?s._config.namespace:rf()),l=e.editorState,c=[cr,Lt,ar,lr,dr,na,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<c.length;m++){let y=c[m],x=null,p=null;if(typeof y!="function"){const v=y;y=v.replace,x=v.with,p=v.withKlass||null}ni(y);const _=y.getType(),C=iy(y);h.set(_,{exportDOM:f&&f.export?f.export.get(y):void 0,klass:y,replace:x,replaceWithKlass:p,sharedNodeState:vm(c[m]),transforms:C})}}const g=new rr(o,s,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(m,y){const x=new Map,p=new Set,_=C=>{Object.keys(C).forEach(v=>{let b=x.get(v);b===void 0&&(b=[],x.set(v,b)),b.push(C[v])})};return m.forEach(C=>{const v=C.klass.importDOM;if(v==null||p.has(v))return;p.add(v);const b=v.call(C.klass);b!==null&&_(b)}),y&&_(y),x})(h,f?f.import:void 0),d,n);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(m){m.registerCommand(cd,Om,ge),m.registerCommand(dd,Fm,ge),m.registerCommand(fd,Mm,ge),m.registerCommand(gd,$m,ge),m.registerCommand(md,Lm,ge)})(g),g}class rr{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,s,i,o,a,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=s,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=rf(),this._onError=i,this._htmlConversions=o,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&F(35);const s=this._commands;s.has(e)||s.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=s.get(e);i===void 0&&F(36,String(e));const o=i[r];return o.add(t),()=>{o.delete(t),i.every(a=>a.size===0)&&s.delete(e)}}registerMutationListener(e,t,r){const s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let o=i.get(t);o===void 0&&(o=new Set,i.set(t,o)),o.add(s);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,s),()=>{o.delete(s),o.size===0&&i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&F(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,s=Bl(r).get(t.getType());if(!s)return;const i=new Map;for(const o of s.keys())i.set(o,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),s=[r],i=r.replaceWithKlass;if(i!=null){const o=this.registerNodeTransformToKlass(i,t);s.push(o)}return(function(o,a){const l=Bl(o.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&o.update(()=>{for(const u of c)for(const f of u.keys()){const d=Ie(f);d&&d.markDirty()}},o._pendingEditorState===null?{tag:Xn}:void 0)})(this,s.map(o=>o.klass.getType())),()=>{s.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return K(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Qn(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,Hd(this,t,e,s),t!==null&&(this._config.disableEvents||Dm(t),r!=null&&t.classList.remove(...r)),e!==null){const i=da(e),o=e.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,ed(this),this._updateTags.add(Xn),Ht(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;no.set(a,c);const u=Ts.get(c)??0;u<1&&c.addEventListener("selectionchange",Id),Ts.set(c,u+1),a.__lexicalEditor=l;const f=Pd(a);for(let d=0;d<to.length;d++){const[h,g]=to[d],m=typeof g=="function"?y=>{fl(y)||(dl(y),(l.isEditable()||h==="click")&&g(y,l))}:y=>{if(fl(y))return;dl(y);const x=l.isEditable();switch(h){case"cut":return x&&K(l,Go,y);case"copy":return K(l,Hs,y);case"paste":return x&&K(l,Vs,y);case"dragstart":return x&&K(l,Sd,y);case"dragover":return x&&K(l,Cd,y);case"dragend":return x&&K(l,Am,y);case"focus":return x&&K(l,Pm,y);case"blur":return x&&K(l,Im,y);case"drop":return x&&K(l,bd,y)}};a.addEventListener(h,m),f.push(()=>{a.removeEventListener(h,m)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Xn),Ht(this);Cr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&F(38);let r=e;r._readOnly&&(r=Kd(e),r._selection=e._selection?e._selection.clone():null),Qc(this);const s=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;s===null||s.isEmpty()||(o!=null&&i.add(o),Ht(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),this._updating||Ht(this)}parseEditorState(e,t){return(function(r,s,i){const o=ta(),a=Be,l=tt,c=je,u=s._dirtyElements,f=s._dirtyLeaves,d=s._cloneNotNeeded,h=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Be=o,tt=!1,je=s,ra(null);try{const g=s._nodes;Qo(r.root,g),i&&i(),o._readOnly=!0}catch(g){g instanceof Error&&s._onError(g)}finally{s._dirtyElements=u,s._dirtyLeaves=f,s._cloneNotNeeded=d,s._dirtyType=h,Be=a,tt=l,je=c}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ht(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,s,i){r._updating?r._updates.push([s,i]):Ys(r,s,i)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),It(this,()=>{const s=D(),i=we();s!==null?s.dirty||Ue(s.clone()):i.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),cy("focus"),dy(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Ct(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Cr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}rr.version="0.39.0+prod.esm";let uo=null;function ra(n){uo=n}let oy=1;function Jd(n,e){const t=sa(n,e);return t===void 0&&F(30,e),t}function sa(n,e){return n._nodes.get(e)}const ay=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Gd(n){return pe(Mt(n))}function ia(n){const e=document.activeElement;if(!ke(e))return!1;const t=e.nodeName;return pe(Mt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Xs(e)==null)}function jr(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!ia(e)&&Zs(e)===n}catch{return!1}}function oa(n){return n instanceof rr}function Zs(n){let e=n;for(;e!=null;){const t=Xs(e);if(oa(t))return t;e=zr(e)}return null}function Xs(n){return n?n.__lexicalEditor:null}function yn(n){return qs(n)||n.isToken()}function Wt(n){return yn(n)||n.isSegmented()}function Yt(n){return Fn(n)&&n.nodeType===3}function Yd(n){return Fn(n)&&n.nodeType===9}function sr(n){let e=n;for(;e!=null;){if(Yt(e))return e;e=e.firstChild}return null}function Is(n,e,t){const r=bn[e];if(t!==null&&(n&r)===(t&r))return n;let s=n^r;return e==="subscript"?s&=-65:e==="superscript"?s&=-33:e==="lowercase"?(s&=-513,s&=-1025):e==="uppercase"?(s&=-257,s&=-1025):e==="capitalize"&&(s&=-257,s&=-513),s}function Zd(n){return L(n)||Pt(n)||pe(n)}function Xd(n,e){const t=(function(){const o=uo;return uo=null,o})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);De(),jd();const r=ve(),s=an(),i=""+oy++;s._nodeMap.set(i,n),A(n)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,n.__key=i}function _n(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),s=n.getPreviousSibling(),i=n.getNextSibling(),o=i!==null?i.__key:null,a=s!==null?s.__key:null,l=s!==null?s.getWritable():null,c=i!==null?i.getWritable():null;s===null&&(r.__first=o),i===null&&(r.__last=a),l!==null&&(l.__next=o),c!==null&&(c.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function Rs(n){jd(),ks(n)&&F(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=an(),s=ve(),i=r._nodeMap,o=s._dirtyElements;t!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(t,i,o);const a=e.__key;s._dirtyType=1,A(n)?o.set(a,!0):s._dirtyLeaves.add(a)}function ze(n){De();const e=ve(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Ie(t);r!==null&&r.getWritable()}if(n!==null){const r=Ie(n);r!==null&&r.getWritable()}}}function tn(){return Lr()?null:ve()._compositionKey}function Ie(n,e){const t=(e||an())._nodeMap.get(n);return t===void 0?null:t}function Qd(n,e){const t=Qs(n,ve());return t!==void 0?Ie(t,e):null}function Qs(n,e){return n[`__lexicalKey_${e._key}`]}function Mt(n,e){let t=n;for(;t!=null;){const r=Qd(t,e);if(r!==null)return r;t=zr(t)}return null}function ef(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Rl(n){return n.read(()=>we().getTextContent())}function we(){return tf(an())}function tf(n){return n._nodeMap.get("root")}function Ue(n){De();const e=an();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function qn(n){const e=ve(),t=(function(r,s){let i=r;for(;i!=null;){const o=Qs(i,s);if(o!==void 0)return o;i=zr(i)}return null})(n,e);return t===null?n===e.getRootElement()?Ie("root"):null:Ie(t)}function nf(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function aa(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function rf(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function sf(n){return Yt(n)?n.nodeValue:null}function la(n,e,t){const r=Ct(ht(e));if(r===null)return;const s=r.anchorNode;let{anchorOffset:i,focusOffset:o}=r;if(s!==null){let a=sf(s);const l=Mt(s);if(a!==null&&L(l)){if(a===Ks&&t){const c=t.length;a=t,i=c,o=c}a!==null&&ua(l,a,i,o,n)}}}function ua(n,e,t,r,s){let i=n;if(i.isAttached()&&(s||!i.isDirty())){const o=i.isComposing();let a=e;(o||s)&&e[e.length-1]===Ks&&(a=e.slice(0,-1));const l=i.getTextContent();if(s||a!==l){if(a===""){if(ze(null),Mr||or||$r)i.remove();else{const m=ve();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=On(),f=i.getTextContentSize(),d=tn(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!o||O(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!o||u.focus.key===n.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!o))return void i.markDirty();const g=D();if(!O(g)||t===null||r===null)return void Ol(i,a,g);if(g.setTextNodeRange(i,t,i,r),i.isSegmented()){const m=Te(i.getTextContent());i.replace(m),i=m}Ol(i,a,g)}}}function Ol(n,e,t){if(n.setTextContent(e),O(t)){const r=n.getKey();for(const s of["anchor","focus"]){const i=t[s];i.type==="text"&&i.key===r&&(i.offset=Ot(n,i.offset,"clamp"))}}}function es(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function ly(n,e){return es(n,e,"altKey")&&es(n,e,"ctrlKey")&&es(n,e,"shiftKey")&&es(n,e,"metaKey")}function _e(n,e,t){return ly(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const Kt={ctrlKey:!mt,metaKey:mt},Fl={altKey:mt,ctrlKey:!mt};function Ml(n){return n.key==="Backspace"}function $l(n){return _e(n,"a",Kt)}function uy(n){const e=we();if(O(n)){const t=n.anchor,r=n.focus,s=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(s.getKey(),0,"element"),r.set(s.getKey(),s.getChildrenSize(),"element"),Sn(n),n}{const t=e.select(0,e.getChildrenSize());return Ue(Sn(t)),t}}function Qn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const s=n[e];if(typeof s=="string"){const i=Gc(s);return t[e]=i,i}return s}function ca(n,e,t,r,s){if(t.size===0)return;const i=r.__type,o=r.__key,a=e.get(i);a===void 0&&F(33,i);const l=a.klass;let c=n.get(l);c===void 0&&(c=new Map,n.set(l,c));const u=c.get(o),f=u==="destroyed"&&s==="created";(u===void 0||f)&&c.set(o,f?"updated":s)}function Ll(n,e,t){const r=n.getParent();let s=t,i=n;return r!==null&&(e&&t===0?(s=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(s=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?s-1:s)}function co(n,e){const t=n.offset;if(n.type==="element")return Ll(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const s=e?r.getPreviousSibling():r.getNextSibling();return s===null?Ll(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):s}}return null}function of(n){const e=ht(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function K(n,e,t){return(function(r,s,i){const o=aa(r);for(let a=4;a>=0;a--)for(let l=0;l<o.length;l++){const c=o[l],u=c._commands.get(s);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(It(c,()=>{for(let m=0;m<h;m++)if(d[m](i,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function ei(n){return!$e(n)&&!n.isLastChild()&&!n.isInline()}function Tn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&F(75,e),t}function zr(n){const e=n.assignedSlot||n.parentElement;return ho(e)?e.host:e}function af(n){return Yd(n)?n:ke(n)?n.ownerDocument:null}function cy(n){De(),ve()._updateTags.add(n)}function dy(n){De(),ve()._deferred.push(n)}function fo(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function da(n){const e=af(n);return e?e.defaultView:null}function ht(n){const e=n._window;return e===null&&F(78),e}function fy(n){let e=n.getParentOrThrow();for(;e!==null;){if(He(e))return e;e=e.getParentOrThrow()}return e}function He(n){return $e(n)||A(n)&&n.isShadowRoot()}function gy(n){const e=n.constructor.clone(n);return Xd(e,null),e.afterCloneFrom(n),e}function pt(n){const e=ve(),t=n.getType(),r=sa(e,t);r===void 0&&F(200,n.constructor.name,t);const{replace:s,replaceWithKlass:i}=r;if(s!==null){const o=s(n),a=o.constructor;return i!==null?o instanceof i||F(201,i.name,i.getType(),a.name,a.getType(),n.constructor.name,t):o instanceof n.constructor&&a!==n.constructor||F(202,a.name,a.getType(),n.constructor.name,t),o.__key===n.__key&&F(203,n.constructor.name,t,a.name,a.getType()),o}return n}function Si(n,e){!$e(n.getParent())||A(e)||pe(e)||F(99)}function hy(n){const e=Ie(n);return e===null&&F(63,n),e}function Ci(n){return(pe(n)||A(n)&&!n.canBeEmpty())&&!n.isInline()}function go(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Ct(n){return St?(n||window).getSelection():null}function py(n){const e=da(n);return e?e.getSelection():null}function fa(n){return ke(n)&&n.tagName==="A"}function ke(n){return Fn(n)&&n.nodeType===1}function Fn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function ho(n){return Fn(n)&&n.nodeType===11}function po(n){const e=new RegExp(/^(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");return n.nodeName.match(e)!==null}function Os(n){const e=new RegExp(/^(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");return n.nodeName.match(e)!==null}function Xt(n){if(pe(n)&&!n.isInline())return!0;if(!A(n)||He(n))return!1;const e=n.getFirstChild(),t=e===null||Pt(e)||L(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function ti(){return ve()}const Dl=new WeakMap,my=new Map;function Bl(n){if(!n._readOnly&&n.isEmpty())return my;n._readOnly||F(192);let e=Dl.get(n);return e||(e=(function(t){const r=new Map;for(const[s,i]of t._nodeMap){const o=i.__type;let a=r.get(o);a||(a=new Map,r.set(o,a)),a.set(s,i)}return r})(n),Dl.set(n,e)),e}function lf(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function yy(n){return(e=lf(n))[Rd]=!0,e;var e}function ga(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function _y(n){return n.__lexicalUnmanaged===!0}function gr(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==At[e]}function ni(n){const e=Qa in n.prototype?n.prototype[Qa]():void 0,t=(function(o){if(!(o===At||o.prototype instanceof At)){let a="<unknown>",l="<unknown>";try{a=o.getType()}catch{}try{rr.version&&(l=JSON.parse(rr.version))}catch{}F(290,o.name,a,l)}return o===ea||o===ot||o===At})(n),r=!t&&gr(n,"getType")?n.getType():void 0;let s,i=r;if(e)if(r)s=e[r];else for(const[o,a]of Object.entries(e))i=o,s=a;if(!t&&i&&(gr(n,"getType")||(n.getType=()=>i),gr(n,"clone")||(n.clone=o=>(ra(o),new n)),gr(n,"importJSON")||(n.importJSON=s&&s.$importJSON||(o=>new n().updateFromJSON(o))),!gr(n,"importDOM")&&s)){const{importDOM:o}=s;o&&(n.importDOM=()=>o)}return{ownNodeConfig:s,ownNodeType:i}}function uf(n){const e=ti();return De(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const Qe=(n,e)=>{let t=n;for(;t!=null&&!$e(t);){if(e(t))return t;t=t.getParent()}return null},vy={next:"previous",previous:"next"};class ha{origin;constructor(e){this.origin=e}[Symbol.iterator](){return df({hasNext:ir,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Re(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Re(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const s=r===this.direction?t:Array.from(t).reverse();let i=this;const o=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<e;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of s){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(o)&&l.remove(),c.replace(l)}}else c===null&&F(263,Array.from(a).join(" "))}else i.insert(l);i=Re(l,this.direction)}for(const l of a.values())l.remove();return this}}class Or extends ha{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ft(e,this.direction)}getParentCaret(e="root"){return Re(pa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Mn(this.direction);return Re(this.getNodeAtCaret(),e)||ft(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Or&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const xy={root:$e,shadowRoot:He};function Mn(n){return vy[n]}function pa(n,e="root"){return xy[e](n)?null:n}class wn extends ha{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Re(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return A(this.origin)?ft(this.origin,this.direction):null}getParentCaret(e="root"){return Re(pa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Mn(this.direction);return Re(this.getNodeAtCaret(),e)||ft(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof wn&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof wn||e instanceof kn)&&this.direction===e.direction&&this.origin.is(e.origin)}}class kn extends ha{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Nn(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Re(pa(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Nn(this.origin,Mn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof kn&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof wn||e instanceof kn)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Re(this.origin,this.direction)}}function Rt(n){return n instanceof kn}function ir(n){return n instanceof wn}function dt(n){return n instanceof Or}const by={next:class extends kn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends kn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Sy={next:class extends wn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends wn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Cy={next:class extends Or{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends Or{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function Re(n,e){return n?new Sy[e](n):null}function Nn(n,e,t){return n?new by[e](n,Ot(n,t)):null}function Ot(n,e,t="error"){const r=n.getTextContentSize();let s=e==="next"?r:e==="previous"?0:e;return(s<0||s>r)&&(t!=="clamp"&&qc(284,String(e),String(r),n.getKey()),s=s<0?0:r),s}function jl(n,e){return new Ty(n,e)}function ft(n,e){return A(n)?new Cy[e](n):null}function Ey(n){return n&&n.getChildCaret()||n}function ri(n){return n&&Ey(n.getAdjacentCaret())}class ma{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new ma(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=s=>{const i=this[s].getLatest();return Rt(i)?(function(o,a){const{direction:l,origin:c}=o,u=Ot(c,a==="focus"?Mn(l):l);return jl(o,u-o.offset)})(i,s):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:s}=t,{caret:i}=r;if(s.isSameNodeCaret(i))return[jl(s,i.offset-s.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=Rt(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),s=Rt(r),i=o=>o.isSameNodeCaret(r)?null:ri(o)||o.getParentCaret(e);return df({hasNext:o=>o!==null&&!(s&&r.isSameNodeCaret(o)),initial:t.isSameNodeCaret(r)?null:i(t),map:o=>o,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Ty{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,s]=this.getSliceIndices(),i=e.getTextContent();return Nn(e.setTextContent(i.slice(0,r)+i.slice(s)),t,r)}}function ya(n){return on(n,Re(we(),n.direction))}function cf(n){return on(n,n)}function on(n,e){return n.direction!==e.direction&&F(265),new ma(n,e,n.direction)}function df(n){const{initial:e,hasNext:t,step:r,map:s}=n;let i=e;return{[Symbol.iterator](){return this},next(){if(!t(i))return{done:!0,value:void 0};const o={done:!1,value:s(i)};return i=r(i),o}}}function ff(n,e){const t=fs(n.origin,e.origin);switch(t===null&&F(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",s=e.type==="text";return r&&s?(function(i,o){return Math.sign(i-o)})(n.offset,e.offset):n.type===e.type?0:r?-1:s?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return gf(t)}}function gf(n){const{a:e,b:t}=n,r=e.__key,s=t.__key;let i=e,o=t;for(;i&&o;i=i.getNextSibling(),o=o.getNextSibling()){if(i.__key===s)return-1;if(o.__key===r)return 1}return i===null?1:-1}function ts(n,e){return e.is(n)}function zl(n){return A(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function fs(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,s]=zl(n);r;s=r,r=r.getParent())t.set(r,s);for(let[r,s]=zl(e);r;s=r,r=r.getParent()){const i=t.get(r);if(i!==void 0)return i===null?(ts(n,r)||F(276),{commonAncestor:r,type:"ancestor"}):s===null?(ts(e,r)||F(277),{commonAncestor:r,type:"descendant"}):((A(i)||ts(n,i))&&(A(s)||ts(e,s))&&r.is(i.getParent())&&r.is(s.getParent())||F(278),{a:i,b:s,commonAncestor:r,type:"branch"})}return null}function $t(n,e){const{type:t,key:r,offset:s}=n,i=hy(n.key);return t==="text"?(L(i)||F(266,i.getType(),r),Nn(i,e,s)):(A(i)||F(267,i.getType(),r),ky(i,n.offset,e))}function An(n,e){const{origin:t,direction:r}=e,s=r==="next";Rt(e)?n.set(t.getKey(),e.offset,"text"):ir(e)?L(t)?n.set(t.getKey(),Ot(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(s?1:0),"element"):(dt(e)&&A(t)||F(268),n.set(t.getKey(),s?0:t.getChildrenSize(),"element"))}function hf(n){const e=D(),t=O(e)?e:Gs();return gs(t,n),Ue(t),t}function gs(n,e){An(n.anchor,e.anchor),An(n.focus,e.focus)}function Ul(n){const{anchor:e,focus:t}=n,r=$t(e,"next"),s=$t(t,"next"),i=ff(r,s)<=0?"next":"previous";return on(Jt(r,i),Jt(s,i))}function Ur(n){const{direction:e,origin:t}=n,r=Re(t,Mn(e)).getNodeAtCaret();return r?Re(r,e):ft(t.getParentOrThrow(),e)}function Kl(n,e="root"){const t=[n];for(let r=dt(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(Ur(r));return t}function Ei(n){return!!n&&n.origin.isAttached()}function wy(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let s=e;const i=mf(n,r),o=Kl(i.anchor,t),a=Kl(i.focus.getFlipped(),t),l=new Set,c=[];for(const g of i.iterNodeCarets(t))if(dt(g))l.add(g.origin.getKey());else if(ir(g)){const{origin:m}=g;A(m)&&!l.has(m.getKey())||c.push(m)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:m}=g.caret,y=m.getTextContentSize(),x=Ur(Re(m,r)),p=m.getMode();if(Math.abs(g.distance)===y&&s==="removeEmptySlices"||p==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){s="removeEmptySlices";let _=g.removeTextSlice();const C=g.caret.origin;if(p==="segmented"){const v=_.origin,b=Te(v.getTextContent()).setStyle(v.getStyle()).setFormat(v.getFormat());x.replaceOrInsert(b),_=Nn(b,r,_.offset)}C.is(o[0].origin)&&(o[0]=_),C.is(a[0].origin)&&(a[0]=_.getFlipped())}}let u,f;for(const g of o)if(Ei(g)){u=it(g);break}for(const g of a)if(Ei(g)){f=it(g);break}const d=(function(g,m,y){if(!g||!m)return null;const x=g.getParentAtCaret(),p=m.getParentAtCaret();if(!x||!p)return null;const _=x.getParents().reverse();_.push(x);const C=p.getParents().reverse();C.push(p);const v=Math.min(_.length,C.length);let b;for(b=0;b<v&&_[b]===C[b];b++);const S=(N,P)=>{let $;for(let R=b;R<N.length;R++){const I=N[R];if(He(I))return;!$&&P(I)&&($=I)}return $},T=S(_,Xt),E=T&&S(C,N=>y.has(N.getKey())&&Xt(N));return T&&E?[T,E]:null})(u,f,l);if(d){const[g,m]=d;ft(g,"previous").splice(0,m.getChildren()),m.remove()}const h=[u,f,...o,...a].find(Ei);if(h)return cf(Jt(it(h),n.direction));F(269,JSON.stringify(o.map(g=>g.origin.__key)))}function it(n){const e=(function(s){let i=s;for(;dt(i);){const o=ri(i);if(!dt(o))break;i=o}return i})(n.getLatest()),{direction:t}=e;if(L(e.origin))return Rt(e)?e:Nn(e.origin,t,t);const r=e.getAdjacentCaret();return ir(r)&&L(r.origin)?Nn(r.origin,t,Mn(t)):e}function pf(n){return Rt(n)&&n.offset!==Ot(n.origin,n.direction)}function Jt(n,e){return n.direction===e?n:n.getFlipped()}function mf(n,e){return n.direction===e?n:on(Jt(n.focus,e),Jt(n.anchor,e))}function ky(n,e,t){let r=ft(n,"next");for(let s=0;s<e;s++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return Jt(r,t)}function Ny(n){const{origin:e,offset:t,direction:r}=n;if(t===Ot(e,r))return n.getSiblingCaret();if(t===Ot(e,Mn(r)))return Ur(n.getSiblingCaret());const[s]=e.splitText(t);return L(s)||F(281),Jt(Re(s,"next"),r)}function Ay(n,e){return!0}function Py(n,{$copyElementNode:e=gy,$splitTextPointCaretNext:t=Ny,rootMode:r="shadowRoot",$shouldSplit:s=Ay}={}){if(Rt(n))return t(n);const i=n.getParentCaret(r);if(i){const{origin:o}=i;if(dt(n)&&(!o.canBeEmpty()||!s(o,"first")))return Ur(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(n);(a.length>0||o.canBeEmpty()&&s(o,"last"))&&i.insert(e(o).splice(0,0,a))}return i}function Iy(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}const yf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ry=yf?w.useLayoutEffect:w.useEffect,ns={tag:Xn};function Oy({initialConfig:n,children:e}){const t=w.useMemo(()=>{const{theme:r,namespace:s,nodes:i,onError:o,editorState:a,html:l}=n,c=Yp(null,r),u=qd({editable:n.editable,html:l,namespace:s,nodes:i,onError:f=>o(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=we();if(h.isEmpty()){const g=Ee();h.append(g);const m=yf?document.activeElement:null;(D()!==null||m!==null&&m===f.getRootElement())&&g.select()}},ns);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,ns);break}case"object":f.setEditorState(d,ns);break;case"function":f.update(()=>{we().isEmpty()&&d(f)},ns)}}})(u,a),[u,c]},[]);return Ry(()=>{const r=n.editable,[s]=t;s.setEditable(r===void 0||r)},[]),k.jsx(Hc.Provider,{value:t,children:e})}const Fy=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function My(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function $y(){return(function(n){const[e]=Je(),t=w.useMemo(()=>n(e),[e,n]),[r,s]=w.useState(()=>t.initialValueFn()),i=w.useRef(r);return Fy(()=>{const{initialValueFn:o,subscribe:a}=t,l=o();return i.current!==l&&(i.current=l,s(l)),a(c=>{i.current=c,s(c)})},[t,n]),r})(My)}const mo=new Map;function _f(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[s,i]=r.split(/:([^]+)/);s&&i&&(e[s.trim()]=i.trim())}return e}function Wl(n){let e=mo.get(n);return e===void 0&&(e=_f(n),mo.set(n,e)),e}function vf(n){const e=ti().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function xf(n){return vf($e(n)?n:n.getParentOrThrow())}function Vl(n){const e=xf(n);return e!==null&&e.direction==="rtl"}function bf(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!Wt(e)&&r!==null){const[s,i]=r,o=n.isBackward(),a=s.getNode(),l=i.getNode(),c=e.is(a),u=e.is(l);if(c||u){const[f,d]=lo(n),h=a.is(l),g=e.is(o?l:a),m=e.is(o?a:l);let y,x=0;h?(x=f>d?d:f,y=f>d?f:d):g?(x=o?d:f,y=void 0):m&&(x=0,y=o?f:d);const p=e.__text.slice(x,y);p!==e.__text&&(t==="clone"&&(e=yy(e)),e.__text=p)}}return e}function Ly(n){const e=n.getStyle(),t=_f(e);mo.set(e,t)}function Sf(n){const e=Cf(n);return e!==null&&e.writingMode==="vertical-rl"}function Cf(n){const e=n.anchor.getNode();return A(e)?vf(e):xf(e)}function Hl(n,e){let t=Sf(n)?!e:e;Ef(n)&&(t=!t);const r=$t(n.focus,t?"previous":"next");if(pf(r))return!1;for(const s of ya(r)){if(dt(s))return!s.origin.isInline();if(!A(s.origin)){if(pe(s.origin))return!0;break}}return!1}function Dy(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Ef(n){const e=Cf(n);return e!==null&&e.direction==="rtl"}function ql(n,e,t){const r=Ef(n);let s;s=Sf(n)||r?!t:t,Dy(n,e,s,"character")}function Tf(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const si=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,By=si&&"documentMode"in document?document.documentMode:null,jy=si&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!si||!("InputEvent"in window)||By)&&"getTargetRanges"in new window.InputEvent("input");function wf(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function gt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const zy=si,Uy=jy;function xt(n,...e){const t=wf(...e);t.length>0&&n.classList.add(...t)}function ii(n,...e){const t=wf(...e);t.length>0&&n.classList.remove(...t)}function Ky(n){return n?n.getAdjacentCaret():null}function Wy(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function yo(n){const e=Qe(n,t=>A(t)&&!t.isInline());return A(e)||Tf(4,n.__key),e}function Vy(n){const e=D()||On();let t;if(O(e))t=$t(e.focus,"next");else{if(e!=null){const o=e.getNodes(),a=o[o.length-1];a&&(t=Re(a,"next"))}t=t||ft(we(),"previous").getFlipped().insert(Ee())}const r=Hy(n,t),s=ri(r),i=dt(s)?it(s):r;return hf(cf(i)),n.getLatest()}function Hy(n,e,t){let r=Jt(e,"next");for(let s=r;s;s=Py(s,t))r=s;return Rt(r)&&Tf(283),r.insert(n.isInline()?Ee().append(n):n),Jt(Re(n.getLatest(),"next"),e.direction)}function nn(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function qy(n,e){const t=[];for(let r=0;r<n.length;r++){const s=e(n[r]);s!==null&&t.push(s)}return t}let Ti=!(Uy||!zy)&&void 0;function Jy(n){let e=1;if((function(){if(Ti===void 0){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const r=t.getBoundingClientRect();t.style.setProperty("zoom","2"),Ti=t.getBoundingClientRect().width===r.width,document.body.removeChild(t)}return Ti})())for(;n;)e*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return e}const Gy=Symbol.for("preact-signals");function _a(){if(er>1)return void er--;let n,e=!1;for(;Tr!==void 0;){let t=Tr;for(Tr=void 0,_o++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&kf(t))try{t.c()}catch(s){e||(n=s,e=!0)}t=r}}if(_o=0,er--,e)throw n}let ye,Tr;function Jl(n){const e=ye;ye=void 0;try{return n()}finally{ye=e}}let er=0,_o=0,hs=0;function Gl(n){if(ye===void 0)return;let e=n.n;return e===void 0||e.t!==ye?(e={i:0,S:n,p:ye.s,n:void 0,t:ye,e:void 0,x:void 0,r:e},ye.s!==void 0&&(ye.s.n=e),ye.s=e,n.n=e,32&ye.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ye.s,e.n=void 0,ye.s.n=e,ye.s=e),e):void 0}function Ze(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Yy(n,e){return new Ze(n,e)}function kf(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Yl(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Nf(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function jn(n,e){Ze.call(this,void 0),this.x=n,this.s=void 0,this.g=hs-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Af(n){const e=n.u;if(n.u=void 0,typeof e=="function"){er++;const t=ye;ye=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,va(n),r}finally{ye=t,_a()}}}function va(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Af(n)}function Zy(n){if(ye!==this)throw new Error("Out-of-order effect");Nf(this),ye=n,this.f&=-2,8&this.f&&va(this),_a()}function Hn(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function vo(n,e){const t=new Hn(n,e);try{t.c()}catch(s){throw t.d(),s}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function Pf(n,e={}){const t={};for(const r in n){const s=e[r],i=Yy(s===void 0?n[r]:s);t[r]=i}return t}Ze.prototype.brand=Gy,Ze.prototype.h=function(){return!0},Ze.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:Jl(()=>{var t;(t=this.W)==null||t.call(this)}))},Ze.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&Jl(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Ze.prototype.subscribe=function(n){return vo(()=>{const e=this.value,t=ye;ye=void 0;try{n(e)}finally{ye=t}},{name:"sub"})},Ze.prototype.valueOf=function(){return this.value},Ze.prototype.toString=function(){return this.value+""},Ze.prototype.toJSON=function(){return this.value},Ze.prototype.peek=function(){const n=ye;ye=void 0;try{return this.value}finally{ye=n}},Object.defineProperty(Ze.prototype,"value",{get(){const n=Gl(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(_o>100)throw new Error("Cycle detected");this.v=n,this.i++,hs++,er++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{_a()}}}}),jn.prototype=new Ze,jn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===hs))return!0;if(this.g=hs,this.f|=1,this.i>0&&!kf(this))return this.f&=-2,!0;const n=ye;try{Yl(this),ye=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ye=n,Nf(this),this.f&=-2,!0},jn.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Ze.prototype.S.call(this,n)},jn.prototype.U=function(n){if(this.t!==void 0&&(Ze.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},jn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(jn.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=Gl(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Hn.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Hn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Af(this),Yl(this),er++;const n=ye;return ye=this,Zy.bind(this,n)},Hn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Tr,Tr=this)},Hn.prototype.d=function(){this.f|=8,1&this.f||va(this)},Hn.prototype.dispose=function(){this.d()};function Xy(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function xe(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function If(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const s in r)t[s]=If(t[s],r[s]);return n}return e}const xa=0,xo=1,Rf=2,wi=3,rs=4,zn=5,ki=6,hr=7;function Ni(n){return n.id===xa}function Of(n){return n.id===Rf}function Qy(n){return(function(e){return e.id===xo})(n)||xe(305,String(n.id),String(xo)),Object.assign(n,{id:Rf})}const e_=new Set;let t_=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:xa}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Iy;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;Of(t)||xe(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},s={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:wi,registerState:c})})(t,this.mergeConfigs(),r);let o;this.state=i,this.extension.init&&(o=this.extension.init(e,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:rs,initResult:l,registerState:c})})(i,o,s)}build(e){const t=this.state;let r;t.id!==rs&&xe(307,String(t.id),String(zn)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const s={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,o,a){return Object.assign(i,{id:zn,output:o,registerState:a})})(t,r,s)}register(e,t){this._signal=t;const r=this.state;r.id!==zn&&xe(308,String(r.id),String(zn));const s=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:ki})})(r),()=>{const i=this.state;i.id!==hr&&xe(309,String(r.id),String(hr)),this.state=(function(o){return Object.assign(o,{id:zn})})(i),s&&s()}}afterRegistration(e){const t=this.state;let r;return t.id!==ki&&xe(310,String(t.id),String(ki)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(s){return Object.assign(s,{id:hr})})(t),r}getSignal(){return this._signal===void 0&&xe(311),this._signal}getInitResult(){this.extension.init===void 0&&xe(312,this.extension.name);const e=this.state;return(function(t){return t.id>=rs})(e)||xe(313,String(e.id),String(rs)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=wi})(e)||xe(314,String(e.id),String(wi)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&xe(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&xe(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=hr})(e)||xe(316,String(e.id),String(hr)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||e_}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=zn})(e)||xe(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const Zl={tag:Xn};function n_(){const n=we();n.isEmpty()&&n.append(Ee())}const r_={config:{setOptions:Zl,updateOptions:Zl},init:({$initialEditorState:n=n_})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const s=r.getInitResult();if(!s.initialized){s.initialized=!0;const{$initialEditorState:i}=s;if(ry(i))n.setEditorState(i,t);else if(typeof i=="function")n.update(()=>{i(n)},e);else if(i&&(typeof i=="string"||typeof i=="object")){const o=n.parseEditorState(i);n.setEditorState(o,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[cr,Lt,ar,lr,dr]},Xl=Symbol.for("@lexical/extension/LexicalBuilder");function Ql(){}function s_(n){throw n}function ss(n){return Array.isArray(n)?n:[n]}const Ai="0.39.0+prod.esm";let i_=class ps{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Ai,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[ss(r_)];for(const r of e)t.push(ss(r));return new ps(t)}static maybeFromEditor(e){const t=e[Xl];return t&&(t.PACKAGE_VERSION!==Ai&&xe(292,t.PACKAGE_VERSION,Ai),t instanceof ps||xe(293)),t}static fromEditor(e){const t=ps.maybeFromEditor(e);return t===void 0&&xe(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),s=Object.assign(qd({...r,...t?{onError:i=>{t(i,s)}}:{}}),{[Xl]:this});for(const i of this.sortedExtensionReps())i.build(s);return s}buildEditor(){let e=Ql;function t(){try{e()}finally{e=Ql}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=gt(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&xe(295,e.name),t}addEdge(e,t,r){const s=this.outgoingConfigEdges.get(e);s?s.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&xe(296);const t=ss(e),[r]=t;typeof r.name!="string"&&xe(297,typeof r.name);let s=this.extensionNameMap.get(r.name);if(s!==void 0&&s.extension!==r&&xe(298,r.name),!s){s=new t_(this,r),this.extensionNameMap.set(r.name,s);const i=this.conflicts.get(r.name);typeof i=="string"&&xe(299,r.name,i);for(const o of r.conflictsWith||[])this.extensionNameMap.has(o)&&xe(299,r.name,o),this.conflicts.set(o,r.name);for(const o of r.dependencies||[]){const a=ss(o);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[o,a]of r.peerDependencies||[])this.addEdge(r.name,o,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,s)=>{let i=r.state;if(Of(i))return;const o=r.extension.name;var a;Ni(i)||xe(300,o,s||"[unknown]"),Ni(a=i)||xe(304,String(a.id),String(xa)),i=Object.assign(a,{id:xo}),r.state=i;const l=this.outgoingConfigEdges.get(o);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&t(u,o)}i=Qy(i),r.state=i,e.push(r)};for(const r of this.extensionNameMap.values())Ni(r.state)&&t(r);for(const r of e)for(const[s,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const o=this.extensionNameMap.get(s);if(o)for(const a of i)o.configs.add(a)}for(const[r,...s]of this.roots)if(s.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&xe(301,r.name);for(const o of s)i.configs.add(o)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,s=[()=>r.abort()],i=r.signal;for(const o of t){const a=o.register(e,i);a&&s.push(a)}for(const o of t){const a=o.afterRegistration(e);a&&s.push(a)}return gt(...s)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,s=new Map,i={},o={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(e.onError=f.onError),f.disableEvents!==void 0&&(e.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(e.parentEditor=f.parentEditor),f.editable!==void 0&&(e.editable=f.editable),f.namespace!==void 0&&(e.namespace=f.namespace),f.$initialEditorState!==void 0&&(e.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of Xy(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&xe(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}t.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())s.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&If(o,f.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const l=Object.keys(i).length>0,c=s.size>0;(l||c)&&(e.html={},l&&(e.html.import=i),c&&(e.html.export=s));for(const u of a)u.init(e);return e.onError||(e.onError=s_),e}};const o_=X("INSERT_HORIZONTAL_RULE_COMMAND");class Kr extends ea{static getType(){return"horizontalrule"}static clone(e){return new Kr(e.__key)}static importJSON(e){return Ff().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:a_,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return xt(t,e.theme.hr),t}getTextContent(){return`
12
- `}isInline(){return!1}updateDOM(){return!1}}function a_(){return{node:Ff()}}function Ff(){return uf(Kr)}function l_(n){return n instanceof Kr}function u_(n,e){return gt(n.registerCommand(Jo,t=>{const r=D();if(!O(r))return!1;t.preventDefault();const s=(function(i){const o=i.getNodes();if(qy(o,d=>Ns(d)&&d.canIndent()?d:null).length>0)return!0;const a=i.anchor,l=i.focus,c=l.isBefore(a)?l:a,u=c.getNode(),f=yo(u);if(f.canIndent()){const d=f.getKey();let h=Gs();if(h.anchor.set(d,0,"element"),h.focus.set(d,0,"element"),h=Sn(h),h.anchor.is(c))return!0}return!1})(r)?t.shiftKey?Qi:Xi:xd;return n.dispatchCommand(s,void 0)},ge),n.registerCommand(Xi,()=>{const t=typeof e=="number"?e:e?e.peek():null;if(t==null)return!1;const r=D();if(!O(r))return!1;const s=r.getNodes().map(i=>yo(i).getIndent());return Math.max(...s)+1>=t},Vd))}const c_={name:"@lexical/react/ReactProvider"};function d_(){return we().getTextContent()}function f_(n,e=!0){if(n)return!1;let t=d_();return e&&(t=t.trim()),t===""}function g_(n){if(!f_(n,!1))return!1;const e=we().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const s=e[r];if(pe(s))return!1;if(A(s)){if(!Br(s)||s.__indent!==0)return!1;const i=s.getChildren(),o=i.length;for(let a=0;a<o;a++){const l=i[r];if(!L(l))return!1}}}return!0}function Mf(n){return()=>g_(n)}function h_(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const s=n.getRootElement();if(document.activeElement!==s)return;const i=r.data;if(typeof i=="string"){let o;try{o=JSON.parse(i)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const a=o.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;n.update(()=>{const g=D();if(O(g)){const m=g.anchor;let y=m.getNode(),x=0,p=0;if(L(y)&&c>=0&&u>=0&&(x=c,p=c+u,g.setTextNodeRange(y,x,y,p)),x===p&&f===""||(g.insertRawText(f),y=m.getNode()),L(y)){x=d,p=d+h;const _=y.getTextContentSize();x=x>_?_:x,p=p>_?_:p,g.setTextNodeRange(y,x,y,p)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function p_(n,e){const t=Yd(e)?e.body.childNodes:e.childNodes;let r=[];const s=[];for(const i of t)if(!Lf.has(i.nodeName)){const o=Df(i,n,s,!1);o!==null&&(r=r.concat(o))}return(function(i){for(const o of i)o.getNextSibling()instanceof na&&o.insertAfter(vt());for(const o of i){const a=o.getChildren();for(const l of a)o.insertBefore(l);o.remove()}})(s),r}function m_(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=we().getChildren();for(let s=0;s<r.length;s++)$f(n,r[s],t,e);return t.innerHTML}function $f(n,e,t,r=null){let s=r===null||e.isSelected(r);const i=A(e)&&e.excludeFromCopy("html");let o=e;r!==null&&L(e)&&(o=bf(r,e,"clone"));const a=A(o)?o.getChildren():[],l=sa(n,o.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(n,o):o.exportDOM(n);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],m=$f(n,g,d,r);!s&&A(e)&&m&&e.extractWithChild(g,r,"html")&&(s=!0)}if(s&&!i){if((ke(u)||ho(u))&&u.append(d),t.append(u),f){const h=f.call(o,u);h&&(ho(u)?u.replaceChildren(h):u.replaceWith(h))}}else t.append(d);return s}const Lf=new Set(["STYLE","SCRIPT"]);function Df(n,e,t,r,s=new Map,i){let o=[];if(Lf.has(n.nodeName))return o;let a=null;const l=(function(g,m){const{nodeName:y}=g,x=m._htmlConversions.get(y.toLowerCase());let p=null;if(x!==void 0)for(const _ of x){const C=_(g);C!==null&&(p===null||(p.priority||0)<=(C.priority||0))&&(p=C)}return p!==null?p.conversion:null})(n,e),c=l?l(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,m]of s)if(a=m(a,i),!a)break;a&&o.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&s.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const h=(a==null||!He(a))&&(a!=null&&Ns(a)||r);for(let g=0;g<f.length;g++)d.push(...Df(f[g],e,t,h,new Map(s),a));return u!=null&&(d=u(d)),Os(n)&&(d=y_(n,d,h?()=>{const g=new na;return t.push(g),g}:Ee)),a==null?d.length>0?o=o.concat(d):Os(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:po(g.nextSibling)&&po(g.previousSibling)})(n)&&(o=o.concat(vt())):A(a)&&a.append(...d),o}function y_(n,e,t){const r=n.style.textAlign,s=[];let i=[];for(let o=0;o<e.length;o++){const a=e[o];if(Ns(a))r&&!a.getFormat()&&a.setFormat(r),s.push(a);else if(i.push(a),o===e.length-1||o<e.length-1&&Ns(e[o+1])){const l=t();l.setFormat(r),l.append(...i),s.push(l),i=[]}}return s}function Fs(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function __(n,e=D()){return e==null&&Fs(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":m_(n,e)}function v_(n,e=D()){return e==null&&Fs(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(x_(n,e))}function eu(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return tu(t,b_(a.nodes),e)}catch(a){console.error(a)}const s=n.getData("text/html"),i=n.getData("text/plain");if(s&&i!==s)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(s),"text/html");return tu(t,p_(t,a),e)}catch(a){console.error(a)}const o=i||n.getData("text/uri-list");if(o!=null)if(O(e)){const a=o.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=D();if(O(c)){const u=a[l];u===`
13
- `||u===`\r
14
- `?c.insertParagraph():u===" "?c.insertNodes([ur()]):c.insertText(u)}}}else e.insertRawText(o)}function tu(n,e,t){n.dispatchCommand(Tm,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(O(r)&&r.isCollapsed()){const s=r.anchor;let i=null;const o=$t(s,"previous");if(o)if(Rt(o))i=o.origin;else{const a=on(o,ft(we(),"next").getFlipped());for(const l of a){if(L(l.origin)){i=l.origin;break}if(A(l.origin)&&!l.origin.isInline())break}}if(i&&L(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(t))}function Bf(n,e,t,r=[]){let s=e===null||t.isSelected(e);const i=A(t)&&t.excludeFromCopy("html");let o=t;e!==null&&L(o)&&(o=bf(e,o,"clone"));const a=A(o)?o.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Fs(58,f.name),A(c)){const d=u.children;Array.isArray(d)||Fs(59,f.name)}return u})(o);L(o)&&o.getTextContentSize()===0&&(s=!1);for(let c=0;c<a.length;c++){const u=a[c],f=Bf(n,e,u,l.children);!s&&A(t)&&f&&t.extractWithChild(u,e,"clone")&&(s=!0)}if(s&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return s}function x_(n,e){const t=[],r=we().getChildren();for(let s=0;s<r.length;s++)Bf(n,e,r[s],t);return{namespace:n._config.namespace,nodes:t}}function b_(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],s=ny(r);L(s)&&Ly(s),e.push(s)}return e}let Un=null;async function nu(n,e,t){if(Un!==null)return!1;if(e!==null)return new Promise((c,u)=>{n.update(()=>{c(ru(n,e,t))})});const r=n.getRootElement(),s=n._window||window,i=s.document,o=Ct(s);if(r===null||o===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),o.removeAllRanges(),o.addRange(l),new Promise((c,u)=>{const f=n.registerCommand(Hs,d=>(nn(d,ClipboardEvent)&&(f(),Un!==null&&(s.clearTimeout(Un),Un=null),c(ru(n,d,t))),!0),Vd);Un=s.setTimeout(()=>{f(),Un=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function ru(n,e,t){if(t===void 0){const s=Ct(n._window),i=D();if(!i||i.isCollapsed()||!s)return!1;const o=s.anchorNode,a=s.focusNode;if(o!==null&&a!==null&&!jr(n,o,a))return!1;t=S_(i)}e.preventDefault();const r=e.clipboardData;return r!==null&&(C_(r,t),!0)}const jf=[["text/html",__],["application/x-lexical-editor",v_]];function S_(n=D()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=ti();for(const[r,s]of jf){const i=s(t,n);i!==null&&(e[r]=i)}}return e}function C_(n,e){for(const[t]of jf)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function su(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const $n=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,E_=$n&&"documentMode"in document?document.documentMode:null,T_=$n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),w_=!(!$n||!("InputEvent"in window)||E_)&&"getTargetRanges"in new window.InputEvent("input"),k_=$n&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),iu=$n&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,N_=$n&&/^(?=.*Chrome).*/i.test(navigator.userAgent),A_=$n&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&T_&&!N_,ou=X("DRAG_DROP_PASTE_FILE");let oi=class zf extends ot{static getType(){return"quote"}static clone(e){return new zf(e.__key)}createDOM(e){const t=document.createElement("blockquote");return xt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:P_,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(ke(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){return ba().updateFromJSON(e)}insertNewAfter(e,t){const r=Ee(),s=this.getDirection();return r.setDirection(s),this.insertAfter(r,t),r}collapseAtStart(){const e=Ee();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function ba(){return pt(new oi)}function bo(n){return n instanceof oi}let ai=class Uf extends ot{__tag;static getType(){return"heading"}static clone(e){return new Uf(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),s=e.theme.heading;if(s!==void 0){const i=s[t];xt(r,i)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Kn,priority:0}),h2:e=>({conversion:Kn,priority:0}),h3:e=>({conversion:Kn,priority:0}),h4:e=>({conversion:Kn,priority:0}),h5:e=>({conversion:Kn,priority:0}),h6:e=>({conversion:Kn,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&au(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>au(e)?{conversion:t=>({node:Jn("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(ke(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){return Jn(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,s=this.getLastDescendant(),i=!s||e&&e.anchor.key===s.getKey()&&r===s.getTextContentSize()||!e?Ee():Jn(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,t),r===0&&!this.isEmpty()&&e){const a=Ee();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const e=this.isEmpty()?Ee():Jn(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function au(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Kn(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Jn(e),n.style!==null&&(ga(n,t),t.setFormat(n.style.textAlign))),{node:t}}function P_(n){const e=ba();return n.style!==null&&(e.setFormat(n.style.textAlign),ga(n,e)),{node:e}}function Jn(n="h1"){return pt(new ai(n))}function I_(n){return n instanceof ai}function is(n){let e=null;if(nn(n,DragEvent)?e=n.dataTransfer:nn(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),s=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),s]}function lu(n){const e=D();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let s=0;s<r.length;s++){const i=r[s],o=i.getKey();if(t.has(o))continue;const a=Qe(i,c=>A(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!t.has(l)&&(t.add(l),n(a))}return t.size>0}function uu(n){const e=Mt(n);return pe(e)}function Pi(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function R_(n){return gt(n.registerCommand(Uo,e=>{const t=D();return!!Oe(t)&&(t.clear(),!0)},ge),n.registerCommand(mn,e=>{const t=D();return O(t)?(t.deleteCharacter(e),!0):!!Oe(t)&&(t.deleteNodes(),!0)},ge),n.registerCommand(Pr,e=>{const t=D();return!!O(t)&&(t.deleteWord(e),!0)},ge),n.registerCommand(Ir,e=>{const t=D();return!!O(t)&&(t.deleteLine(e),!0)},ge),n.registerCommand(Yn,e=>{const t=D();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)eu(r,t,n);else if(O(t)){const s=e.data;return s&&t.insertText(s),!0}}return!0},ge),n.registerCommand(Zi,()=>{const e=D();return!!O(e)&&(e.removeText(),!0)},ge),n.registerCommand(en,e=>{const t=D();return!!O(t)&&(t.formatText(e),!0)},ge),n.registerCommand(Nm,e=>{const t=D();if(!O(t)&&!Oe(t))return!1;const r=t.getNodes();for(const s of r){const i=Qe(s,o=>A(o)&&!o.isInline());i!==null&&i.setFormat(e)}return!0},ge),n.registerCommand(Gn,e=>{const t=D();return!!O(t)&&(t.insertLineBreak(e),!0)},ge),n.registerCommand(Ar,()=>{const e=D();return!!O(e)&&(e.insertParagraph(),!0)},ge),n.registerCommand(xd,()=>(Qm([ur()]),!0),ge),n.registerCommand(Xi,()=>lu(e=>{const t=e.getIndent();e.setIndent(t+1)}),ge),n.registerCommand(Qi,()=>lu(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),ge),n.registerCommand(Wo,e=>{const t=D();if(Oe(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(O(t)){const r=co(t.focus,!0);if(!e.shiftKey&&pe(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},ge),n.registerCommand(Vo,e=>{const t=D();if(Oe(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(O(t)){if((function(s){const i=s.focus;return i.key==="root"&&i.offset===we().getChildrenSize()})(t))return e.preventDefault(),!0;const r=co(t.focus,!1);if(!e.shiftKey&&pe(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},ge),n.registerCommand(Ko,e=>{const t=D();if(Oe(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),Vl(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!O(t))return!1;if(Hl(t,!0)){const r=e.shiftKey;return e.preventDefault(),ql(t,r,!0),!0}return!1},ge),n.registerCommand(yd,e=>{const t=D();if(Oe(t)){const s=t.getNodes();if(s.length>0)return e.preventDefault(),Vl(s[0])?s[0].selectPrevious():s[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!Hl(t,!1)&&(e.preventDefault(),ql(t,r,!1),!0)},ge),n.registerCommand(_d,e=>{if(uu(e.target))return!1;const t=D();if(O(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:s}=r;if(s.offset!==0)return!1;const i=s.getNode();if($e(i))return!1;const o=yo(i);return o.getIndent()>0&&(o.is(i)||i.is(o.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(Qi,void 0);if(iu&&navigator.language==="ko-KR")return!1}else if(!Oe(t))return!1;return e.preventDefault(),n.dispatchCommand(mn,!0)},ge),n.registerCommand(vd,e=>{if(uu(e.target))return!1;const t=D();return!(!O(t)&&!Oe(t))&&(e.preventDefault(),n.dispatchCommand(mn,!1))},ge),n.registerCommand(Es,e=>{const t=D();if(!O(t))return!1;if(Pi(t),e!==null){if((iu||k_||A_)&&w_)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(Gn,!1)}return n.dispatchCommand(Ar,void 0)},ge),n.registerCommand(qo,()=>{const e=D();return!!O(e)&&(n.blur(),!0)},ge),n.registerCommand(bd,e=>{const[,t]=is(e);if(t.length>0){const s=su(e.clientX,e.clientY);if(s!==null){const{offset:i,node:o}=s,a=Mt(o);if(a!==null){const l=Gs();if(L(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=Sn(l);Ue(c)}n.dispatchCommand(ou,t)}return e.preventDefault(),!0}const r=D();return!!O(r)},ge),n.registerCommand(Sd,e=>{const[t]=is(e),r=D();return!(t&&!O(r))},ge),n.registerCommand(Cd,e=>{const[t]=is(e),r=D();if(t&&!O(r))return!1;const s=su(e.clientX,e.clientY);if(s!==null){const i=Mt(s.node);pe(i)&&e.preventDefault()}return!0},ge),n.registerCommand(eo,()=>(uy(),!0),ge),n.registerCommand(Hs,e=>(nu(n,nn(e,ClipboardEvent)?e:null),!0),ge),n.registerCommand(Go,e=>((async function(t,r){await nu(r,nn(t,ClipboardEvent)?t:null),r.update(()=>{const s=D();O(s)?s.removeText():Oe(s)&&s.getNodes().forEach(i=>i.remove())})})(e,n),!0),ge),n.registerCommand(Vs,e=>{const[,t,r]=is(e);return t.length>0&&!r?(n.dispatchCommand(ou,t),!0):Fn(e.target)&&ia(e.target)?!1:D()!==null&&((function(s,i){s.preventDefault(),i.update(()=>{const o=D(),a=nn(s,InputEvent)||nn(s,KeyboardEvent)?null:s.clipboardData;a!=null&&o!==null&&eu(a,o,i)},{tag:jm})})(e,n),!0)},ge),n.registerCommand(Ho,e=>{const t=D();return O(t)&&Pi(t),!1},ge),n.registerCommand(Jo,e=>{const t=D();return O(t)&&Pi(t),!1},ge))}function O_(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Sa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function F_({editor:n,ErrorBoundary:e}){return(function(t,r){const[s,i]=w.useState(()=>t.getDecorators());return Sa(()=>t.registerDecoratorListener(o=>{wr.flushSync(()=>{i(o)})}),[t]),w.useEffect(()=>{i(t.getDecorators())},[t]),w.useMemo(()=>{const o=[],a=Object.keys(s);for(let l=0;l<a.length;l++){const c=a[l],u=k.jsx(r,{onError:d=>t._onError(d),children:k.jsx(w.Suspense,{fallback:null,children:s[c]})}),f=t.getElementByKey(c);f!==null&&o.push(wr.createPortal(u,f,c))}return o},[r,s,t])})(n,e)}function M_({editor:n,ErrorBoundary:e}){return(function(t){const r=i_.maybeFromEditor(t);if(r&&r.hasExtensionByName(c_.name)){for(const s of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(s)&&O_(320,s);return!0}return!1})(n)?null:k.jsx(F_,{editor:n,ErrorBoundary:e})}function cu(n){return n.getEditorState().read(Mf(n.isComposing()))}function $_({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=Je();return(function(s){Sa(()=>gt(R_(s),h_(s)),[s])})(r),k.jsxs(k.Fragment,{children:[n,k.jsx(L_,{content:e}),k.jsx(M_,{editor:r,ErrorBoundary:t})]})}function L_({content:n}){const[e]=Je(),t=(function(s){const[i,o]=w.useState(()=>cu(s));return Sa(()=>{function a(){const l=cu(s);o(l)}return a(),gt(s.registerUpdateListener(()=>{a()}),s.registerEditableListener(()=>{a()}))},[s]),i})(e),r=$y();return t?typeof n=="function"?n(r):n:null}const Kf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function D_({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:s,ariaErrorMessage:i,ariaExpanded:o,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:m,role:y="textbox",spellCheck:x=!0,style:p,tabIndex:_,"data-testid":C,...v},b){const[S,T]=w.useState(n.isEditable()),E=w.useCallback(P=>{P&&P.ownerDocument&&P.ownerDocument.defaultView?n.setRootElement(P):n.setRootElement(null)},[n]),N=w.useMemo(()=>(function(...P){return $=>{for(const R of P)typeof R=="function"?R($):R!=null&&(R.current=$)}})(b,E),[E,b]);return Kf(()=>(T(n.isEditable()),n.registerEditableListener(P=>{T(P)})),[n]),k.jsx("div",{"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?r:void 0,"aria-describedby":s,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":S&&y==="combobox"?!!o:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":S?f:void 0,"aria-readonly":!S||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:S,"data-testid":C,id:m,ref:N,role:y,spellCheck:x,style:p,tabIndex:_,...v})}const B_=w.forwardRef(D_);function du(n){return n.getEditorState().read(Mf(n.isComposing()))}const j_=w.forwardRef(z_);function z_(n,e){const{placeholder:t,...r}=n,[s]=Je();return k.jsxs(k.Fragment,{children:[k.jsx(B_,{editor:s,...r,ref:e}),t!=null&&k.jsx(U_,{editor:s,content:t})]})}function U_({content:n,editor:e}){const t=(function(o){const[a,l]=w.useState(()=>du(o));return Kf(()=>{function c(){const u=du(o);l(u)}return c(),gt(o.registerUpdateListener(()=>{c()}),o.registerEditableListener(()=>{c()}))},[o]),a})(e),[r,s]=w.useState(e.isEditable());if(w.useLayoutEffect(()=>(s(e.isEditable()),e.registerEditableListener(o=>{s(o)})),[e]),!t)return null;let i=null;return typeof n=="function"?i=n(r):n!==null&&(i=n),i===null?null:k.jsx("div",{"aria-hidden":!0,children:i})}const K_=w.createContext(null),Ii={didCatch:!1,error:null};class W_ extends w.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ii}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:i,reason:"imperative-api"}),this.setState(Ii)}}componentDidCatch(e,t){var r,s;(r=(s=this.props).onError)===null||r===void 0||r.call(s,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:s}=this.props;if(r&&t.error!==null&&V_(e.resetKeys,s)){var i,o;(i=(o=this.props).onReset)===null||i===void 0||i.call(o,{next:s,prev:e.resetKeys,reason:"keys"}),this.setState(Ii)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:s}=this.props,{didCatch:i,error:o}=this.state;let a=e;if(i){const l={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")a=t(l);else if(r)a=w.createElement(r,l);else if(s!==void 0)a=s;else throw o}return w.createElement(K_.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},a)}}function V_(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return n.length!==e.length||n.some((t,r)=>!Object.is(t,e[r]))}function H_({children:n,onError:e}){return k.jsx(W_,{fallback:k.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}function rn(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function So(n){let e=1,t=n.getParent();for(;t!=null;){if(fe(t)){const r=t.getParent();if(se(r)){e++,t=r.getParent();continue}rn(40)}return e}return e}function Co(n){let e=n.getParent();se(e)||rn(40);let t=e;for(;t!==null;)t=t.getParent(),se(t)&&(e=t);return e}function Wf(n){let e=[];const t=n.getChildren().filter(fe);for(let r=0;r<t.length;r++){const s=t[r],i=s.getFirstChild();se(i)?e=e.concat(Wf(i)):e.push(s)}return e}function kt(n){return fe(n)&&se(n.getFirstChild())}function fu(n){return at().append(n)}function Vf(n,e){return fe(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function Eo(n){const e=D();if(e!==null){let t=e.getNodes();if(O(e)){const s=e.getStartEndPoints();s===null&&rn(143);const[i]=s,o=i.getNode(),a=o.getParent();if(He(o)){const l=o.getFirstChild();if(l)t=l.selectStart().getNodes();else{const c=Ee();o.append(c),t=c.select().getNodes()}}else if(Vf(o,t)){const l=nt(n);if(He(a)){o.replace(l);const c=at();A(o)&&(c.setFormat(o.getFormatType()),c.setIndent(o.getIndent())),l.append(c)}else if(fe(o)){const c=o.getParentOrThrow();Pn(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let s=0;s<t.length;s++){const i=t[s];if(A(i)&&i.isEmpty()&&!fe(i)&&!r.has(i.getKey())){gu(i,n);continue}let o=Zd(i)?i.getParent():fe(i)&&i.isEmpty()?i:null;for(;o!=null;){const a=o.getKey();if(se(o)){if(!r.has(a)){const l=nt(n);Pn(l,o.getChildren()),o.replace(l),r.add(a)}break}{const l=o.getParent();if(He(l)&&!r.has(a)){r.add(a),gu(o,n);break}o=l}}}}}function Pn(n,e){n.splice(n.getChildrenSize(),0,e)}function gu(n,e){if(se(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),s=at();let i;if(Pn(s,n.getChildren()),se(t)&&e===t.getListType())t.append(s),se(r)&&e===r.getListType()&&(Pn(t,r.getChildren()),r.remove()),i=t;else if(se(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(s),i=r;else{const o=nt(e);o.append(s),n.replace(o),i=o}return s.setFormat(n.getFormatType()),s.setIndent(n.getIndent()),n.remove(),i}function Ca(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&kt(t)&&kt(r)&&(Ca(t.getFirstChild(),r.getFirstChild()),r.remove());const s=e.getChildren();s.length>0&&n.append(...s),e.remove()}function q_(){const n=D();if(O(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(Vf(r,t))e.add(Co(r));else for(let s=0;s<t.length;s++){const i=t[s];if(Zd(i)){const o=Wy(i,ln);o!=null&&e.add(Co(o))}}for(const s of e){let i=s;const o=Wf(s);for(const a of o){const l=Ee().setTextStyle(n.style).setTextFormat(n.format);Pn(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===n.anchor.key&&An(n.anchor,it(ft(l,"next"))),a.__key===n.focus.key&&An(n.focus,it(ft(l,"next"))),a.remove()}s.remove()}}}function Hf(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())fe(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),se(r.getFirstChild())||t++)}function J_(n){const e=new Set;if(kt(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),s=n.getPreviousSibling();if(kt(r)&&kt(s)){const i=s.getFirstChild();if(se(i)){i.append(n);const o=r.getFirstChild();se(o)&&(Pn(i,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(kt(r)){const i=r.getFirstChild();if(se(i)){const o=i.getFirstChild();o!==null&&o.insertBefore(n)}}else if(kt(s)){const i=s.getFirstChild();se(i)&&i.append(n)}else if(se(t)){const i=at().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=nt(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());i.append(o),o.append(n),s?s.insertAfter(i):r?r.insertBefore(i):t.append(i)}}function G_(n){if(kt(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(se(t?t.getParent():void 0)&&fe(t)&&se(e)){const r=e?e.getFirstChild():void 0,s=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(s))t.insertAfter(n),e.isEmpty()&&t.remove();else{const i=e.getListType(),o=at(),a=nt(i);o.append(a),n.getPreviousSiblings().forEach(u=>a.append(u));const l=at(),c=nt(i);l.append(c),Pn(c,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(l),t.replace(n)}}}function Y_(){const n=D();if(!O(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();if(!fe(e)||e.getChildrenSize()!==0)return!1;const t=Co(e),r=e.getParent();se(r)||rn(40);const s=r.getParent();let i;if(He(s))i=Ee(),t.insertAfter(i);else{if(!fe(s))return!1;i=at(),s.insertAfter(i)}i.setTextStyle(n.style).setTextFormat(n.format).select();const o=e.getNextSiblings();if(o.length>0){const a=nt(r.getListType());if(fe(i)){const l=at();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...o)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!fe(c)&&!se(c))break;l=c}l.remove()})(e),!0}function Ms(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}let ln=class extends ot{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();se(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:ot,importDOM:{li:()=>({conversion:Z_,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(o,a,l){const c=a.getParent();!se(c)||c.getListType()!=="check"||se(a.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||o.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(o,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...Ms(d)),f){const g=l.getParent(),m=se(g)&&g.getListType()==="check",y=l.getChecked();m&&!y||u.push(f.listitemUnchecked),m&&y||u.push(f.listitemChecked),m&&c.push(y?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Ms(h);l.getChildren().some(m=>se(m))?c.push(...g):u.push(...g)}u.length>0&&ii(o,...u),c.length>0&&xt(o,...c)})(t,r.theme,this);const s=e?e.__style:"",i=this.__style;s!==i&&(i===""?t.removeAttribute("style"):t.style.cssText=i),(function(o,a,l){const c=Wl(a.__textStyle);for(const u in c)o.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in Wl(l.__textStyle))u in c||o.style.removeProperty(`--listitem-marker-${u}`)})(t,this,e)}updateDOM(e,t,r){const s=t;return this.updateListItemDOM(e,s,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const s=this.getDirection();return s&&(t.dir=s),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(A(r)&&this.canMergeWith(r)){const s=r.getChildren();this.append(...s),r.remove()}else super.append(r)}return this}replace(e,t){if(fe(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!se(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const s=nt(r.getListType());let i=this.getNextSibling();for(;i;){const o=i;i=i.getNextSibling(),s.append(o)}r.insertAfter(e),e.insertAfter(s)}return t&&(A(e)||rn(139),this.getChildren().forEach(s=>{e.append(s)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(se(r)||rn(39),fe(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(r.insertAfter(e,t),s.length!==0){const i=nt(r.getListType());s.forEach(o=>i.append(o)),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&kt(t)&&kt(r)&&(Ca(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=at().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=Ee();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),s=r.getParentOrThrow(),i=fe(s);if(r.getChildrenSize()===1)if(i)r.remove(),s.select();else{r.insertBefore(t),r.remove();const o=e.anchor,a=e.focus,l=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(l,o.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return se(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;fe(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&rn(117),(e=Math.floor(e))>=0||rn(199);let t=this.getIndent();for(;t!==e;)t<e?(J_(this),t++):(G_(this),t--);return this}canInsertAfter(e){return fe(e)}canReplaceWith(e){return fe(e)}canMergeWith(e){return fe(e)||Br(e)}extractWithChild(e,t){if(!O(t))return!1;const r=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return nt("bullet")}canMergeWhenEmpty(){return!0}};function Z_(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return hu(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return hu(t.children[0])}const e=n.getAttribute("aria-checked");return{node:at(e==="true"||e!=="false"&&void 0)}}function hu(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:at(n.hasAttribute("checked"))}}function at(n){return pt(new ln(void 0,n))}function fe(n){return n instanceof ln}let Ln=class extends ot{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();se(r)&&t.getListType()===r.getListType()&&Ca(t,r)})(e),Hf(e)},extends:ot,importDOM:{ol:()=>({conversion:mu,priority:0}),ul:()=>({conversion:mu,priority:0})}})}constructor(e="number",t=1,r){super(r);const s=Q_[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,s=document.createElement(r);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,pu(s,e.theme,this),s}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(pu(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return ke(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let s=r;for(let i=0;i<r.length;i++){const o=r[i];fe(o)||(s===r&&(s=[...r]),s[i]=at().append(!A(o)||se(o)||o.isInline()?o:Te(o.getTextContent())))}return super.splice(e,t,s)}extractWithChild(e){return fe(e)}};function pu(n,e,t){const r=[],s=[],i=e.list;if(i!==void 0){const o=i[`${t.__tag}Depth`]||[],a=So(t)-1,l=a%o.length,c=o[l],u=i[t.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&t.__listType==="check"&&r.push(h),c!==void 0){r.push(...Ms(c));for(let g=0;g<o.length;g++)g!==l&&s.push(t.__tag+g)}if(f!==void 0){const g=Ms(f);a>1?r.push(...g):s.push(...g)}}s.length>0&&ii(n,...s),r.length>0&&xt(n,...r)}function X_(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(fe(r)){e.push(r);const s=r.getChildren();s.length>1&&s.forEach(i=>{se(i)&&e.push(fu(i))})}else e.push(fu(r))}return e}function mu(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=nt("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const s of r.childNodes)if(ke(s)&&s.hasAttribute("aria-checked"))return!0;return!1})(n)?nt("check"):nt("bullet")),{after:X_,node:t}}const Q_={ol:"number",ul:"bullet"};function nt(n="number",e=1){return pt(new Ln(n,e))}function se(n){return n instanceof Ln}const ev=X("INSERT_CHECK_LIST_COMMAND");function tv(n){return gt(n.registerCommand(ev,()=>(Eo("check"),!0),Xe),n.registerCommand(Vo,e=>vu(e,n,!1),Xe),n.registerCommand(Wo,e=>vu(e,n,!0),Xe),n.registerCommand(qo,()=>{if(To()!=null){const e=n.getRootElement();return e?.focus(),!0}return!1},Xe),n.registerCommand(Ho,e=>{const t=To();return!(t==null||!n.isEditable())&&(n.update(()=>{const r=Mt(t);fe(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},Xe),n.registerCommand(Ko,e=>n.getEditorState().read(()=>{const t=D();if(O(t)&&t.isCollapsed()){const{anchor:r}=t,s=r.type==="element";if(s||r.offset===0){const i=r.getNode(),o=Qe(i,a=>A(a)&&!a.isInline());if(fe(o)){const a=o.getParent();if(se(a)&&a.getListType()==="check"&&(s||o.getFirstDescendant()===i)){const l=n.getElementByKey(o.__key);if(l!=null&&document.activeElement!==l)return l.focus(),e.preventDefault(),!0}}}}return!1}),Xe),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",yu),e.addEventListener("pointerdown",_u)),t!==null&&(t.removeEventListener("click",yu),t.removeEventListener("pointerdown",_u))}))}function qf(n,e){const t=n.target;if(!ke(t))return;const r=t.firstChild;if(ke(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const s=t.parentNode;if(!s||s.__lexicalListType!=="check")return;const i=t.getBoundingClientRect(),o=Jy(t),a=n.clientX/o,l=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},c=parseFloat(l.width),u=n.pointerType==="touch"?32:0;(t.dir==="rtl"?a<i.right+u&&a>i.right-c-u:a>i.left-u&&a<i.left+c+u)&&e()}function yu(n){qf(n,()=>{if(ke(n.target)){const e=n.target,t=Zs(e);t!=null&&t.isEditable()&&t.update(()=>{const r=Mt(e);fe(r)&&(e.focus(),r.toggleChecked())})}})}function _u(n){qf(n,()=>{n.preventDefault()})}function To(){const n=document.activeElement;return ke(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function vu(n,e,t){const r=To();return r!=null&&e.update(()=>{const s=Mt(r);if(!fe(s))return;const i=(function(o,a){let l=a?o.getPreviousSibling():o.getNextSibling(),c=o;for(;l==null&&fe(c);)c=c.getParentOrThrow().getParent(),c!=null&&(l=a?c.getPreviousSibling():c.getNextSibling());for(;fe(l);){const u=a?l.getLastChild():l.getFirstChild();if(!se(u))return l;l=a?u.getLastChild():u.getFirstChild()}return null})(s,t);if(i!=null){i.selectStart();const o=e.getElementByKey(i.__key);o!=null&&(n.preventDefault(),setTimeout(()=>{o.focus()},0))}}),!1}const nv=X("UPDATE_LIST_START_COMMAND"),rv=X("INSERT_UNORDERED_LIST_COMMAND"),sv=X("INSERT_ORDERED_LIST_COMMAND"),iv=X("REMOVE_LIST_COMMAND");function ov(n){return gt(n.registerCommand(sv,()=>(Eo("number"),!0),Xe),n.registerCommand(nv,e=>{const{listNodeKey:t,newStart:r}=e,s=Ie(t);return!!se(s)&&(s.getListType()==="number"&&(s.setStart(r),Hf(s)),!0)},Xe),n.registerCommand(rv,()=>(Eo("bullet"),!0),Xe),n.registerCommand(iv,()=>(q_(),!0),Xe),n.registerCommand(Ar,()=>Y_(),Xe),n.registerNodeTransform(ln,e=>{const t=e.getFirstChild();if(t){if(L(t)){const r=t.getStyle(),s=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==s&&e.setTextFormat(s)}}else{const r=D();O(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Lt,e=>{const t=e.getParent();if(fe(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),s=e.getFormat();r===t.getTextStyle()&&s===t.getTextFormat()||t.setTextStyle(r).setTextFormat(s)}}))}function av(n){const e=t=>{const r=t.getParent();if(se(t.getFirstChild())||!se(r))return;const s=Qe(t,i=>fe(i)&&se(i.getParent())&&fe(i.getPreviousSibling()));if(s===null&&t.getIndent()>0)t.setIndent(0);else if(fe(s)){const i=s.getPreviousSibling();if(fe(i)){const o=(function(l){let c=l,u=c.getFirstChild();for(;se(u);){const f=u.getLastChild();if(!fe(f))break;c=f,u=c.getFirstChild()}return c})(i),a=o.getParent();if(se(a)){const l=So(a);l+1<So(r)&&t.setIndent(l)}}}};return n.registerNodeTransform(Ln,t=>{const r=[t];for(;r.length>0;){const s=r.shift();if(se(s)){for(const i of s.getChildren())if(fe(i)){e(i);const o=i.getFirstChild();se(o)&&r.push(o)}}}})}var Ri={exports:{}},xu;function lv(){return xu||(xu=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function p(_){return _ instanceof l?new l(_.type,p(_.content),_.alias):Array.isArray(_)?_.map(p):_.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++i}),p.__id},clone:function p(_,C){C=C||{};var v,b;switch(a.util.type(_)){case"Object":if(b=a.util.objId(_),C[b])return C[b];v={},C[b]=v;for(var S in _)_.hasOwnProperty(S)&&(v[S]=p(_[S],C));return v;case"Array":return b=a.util.objId(_),C[b]?C[b]:(v=[],C[b]=v,_.forEach(function(T,E){v[E]=p(T,C)}),v);default:return _}},getLanguage:function(p){for(;p;){var _=s.exec(p.className);if(_)return _[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,_){p.className=p.className.replace(RegExp(s,"gi"),""),p.classList.add("language-"+_)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(v){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(v.stack)||[])[1];if(p){var _=document.getElementsByTagName("script");for(var C in _)if(_[C].src==p)return _[C]}return null}},isActive:function(p,_,C){for(var v="no-"+_;p;){var b=p.classList;if(b.contains(_))return!0;if(b.contains(v))return!1;p=p.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(p,_){var C=a.util.clone(a.languages[p]);for(var v in _)C[v]=_[v];return C},insertBefore:function(p,_,C,v){v=v||a.languages;var b=v[p],S={};for(var T in b)if(b.hasOwnProperty(T)){if(T==_)for(var E in C)C.hasOwnProperty(E)&&(S[E]=C[E]);C.hasOwnProperty(T)||(S[T]=b[T])}var N=v[p];return v[p]=S,a.languages.DFS(a.languages,function(P,$){$===N&&P!=p&&(this[P]=S)}),S},DFS:function p(_,C,v,b){b=b||{};var S=a.util.objId;for(var T in _)if(_.hasOwnProperty(T)){C.call(_,T,_[T],v||T);var E=_[T],N=a.util.type(E);N==="Object"&&!b[S(E)]?(b[S(E)]=!0,p(E,C,null,b)):N==="Array"&&!b[S(E)]&&(b[S(E)]=!0,p(E,C,T,b))}}},plugins:{},highlightAll:function(p,_){a.highlightAllUnder(document,p,_)},highlightAllUnder:function(p,_,C){var v={callback:C,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",v),v.elements=Array.prototype.slice.apply(v.container.querySelectorAll(v.selector)),a.hooks.run("before-all-elements-highlight",v);for(var b=0,S;S=v.elements[b++];)a.highlightElement(S,_===!0,v.callback)},highlightElement:function(p,_,C){var v=a.util.getLanguage(p),b=a.languages[v];a.util.setLanguage(p,v);var S=p.parentElement;S&&S.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(S,v);var T=p.textContent,E={element:p,language:v,grammar:b,code:T};function N($){E.highlightedCode=$,a.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,a.hooks.run("after-highlight",E),a.hooks.run("complete",E),C&&C.call(E.element)}if(a.hooks.run("before-sanity-check",E),S=E.element.parentElement,S&&S.nodeName.toLowerCase()==="pre"&&!S.hasAttribute("tabindex")&&S.setAttribute("tabindex","0"),!E.code){a.hooks.run("complete",E),C&&C.call(E.element);return}if(a.hooks.run("before-highlight",E),!E.grammar){N(a.util.encode(E.code));return}if(_&&r.Worker){var P=new Worker(a.filename);P.onmessage=function($){N($.data)},P.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else N(a.highlight(E.code,E.grammar,E.language))},highlight:function(p,_,C){var v={code:p,grammar:_,language:C};if(a.hooks.run("before-tokenize",v),!v.grammar)throw new Error('The language "'+v.language+'" has no grammar.');return v.tokens=a.tokenize(v.code,v.grammar),a.hooks.run("after-tokenize",v),l.stringify(a.util.encode(v.tokens),v.language)},tokenize:function(p,_){var C=_.rest;if(C){for(var v in C)_[v]=C[v];delete _.rest}var b=new f;return d(b,b.head,p),u(p,b,_,b.head,0),g(b)},hooks:{all:{},add:function(p,_){var C=a.hooks.all;C[p]=C[p]||[],C[p].push(_)},run:function(p,_){var C=a.hooks.all[p];if(!(!C||!C.length))for(var v=0,b;b=C[v++];)b(_)}},Token:l};r.Prism=a;function l(p,_,C,v){this.type=p,this.content=_,this.alias=C,this.length=(v||"").length|0}l.stringify=function p(_,C){if(typeof _=="string")return _;if(Array.isArray(_)){var v="";return _.forEach(function(N){v+=p(N,C)}),v}var b={type:_.type,content:p(_.content,C),tag:"span",classes:["token",_.type],attributes:{},language:C},S=_.alias;S&&(Array.isArray(S)?Array.prototype.push.apply(b.classes,S):b.classes.push(S)),a.hooks.run("wrap",b);var T="";for(var E in b.attributes)T+=" "+E+'="'+(b.attributes[E]||"").replace(/"/g,"&quot;")+'"';return"<"+b.tag+' class="'+b.classes.join(" ")+'"'+T+">"+b.content+"</"+b.tag+">"};function c(p,_,C,v){p.lastIndex=_;var b=p.exec(C);if(b&&v&&b[1]){var S=b[1].length;b.index+=S,b[0]=b[0].slice(S)}return b}function u(p,_,C,v,b,S){for(var T in C)if(!(!C.hasOwnProperty(T)||!C[T])){var E=C[T];E=Array.isArray(E)?E:[E];for(var N=0;N<E.length;++N){if(S&&S.cause==T+","+N)return;var P=E[N],$=P.inside,R=!!P.lookbehind,I=!!P.greedy,j=P.alias;if(I&&!P.pattern.global){var B=P.pattern.toString().match(/[imsuy]*$/)[0];P.pattern=RegExp(P.pattern.source,B+"g")}for(var M=P.pattern||P,U=v.next,z=b;U!==_.tail&&!(S&&z>=S.reach);z+=U.value.length,U=U.next){var Z=U.value;if(_.length>p.length)return;if(!(Z instanceof l)){var ne=1,J;if(I){if(J=c(M,z,p,R),!J||J.index>=p.length)break;var re=J.index,q=J.index+J[0].length,H=z;for(H+=U.value.length;re>=H;)U=U.next,H+=U.value.length;if(H-=U.value.length,z=H,U.value instanceof l)continue;for(var ae=U;ae!==_.tail&&(H<q||typeof ae.value=="string");ae=ae.next)ne++,H+=ae.value.length;ne--,Z=p.slice(z,H),J.index-=z}else if(J=c(M,0,Z,R),!J)continue;var re=J.index,le=J[0],Q=Z.slice(0,re),te=Z.slice(re+le.length),ie=z+Z.length;S&&ie>S.reach&&(S.reach=ie);var V=U.prev;Q&&(V=d(_,V,Q),z+=Q.length),h(_,V,ne);var ce=new l(T,$?a.tokenize(le,$):le,j,le);if(U=d(_,V,ce),te&&d(_,U,te),ne>1){var he={cause:T+","+N,reach:ie};u(p,_,C,U.prev,z,he),S&&he.reach>S.reach&&(S.reach=he.reach)}}}}}}function f(){var p={value:null,prev:null,next:null},_={value:null,prev:p,next:null};p.next=_,this.head=p,this.tail=_,this.length=0}function d(p,_,C){var v=_.next,b={value:C,prev:_,next:v};return _.next=b,v.prev=b,p.length++,b}function h(p,_,C){for(var v=_.next,b=0;b<C&&v!==p.tail;b++)v=v.next;_.next=v,v.prev=_,p.length-=b}function g(p){for(var _=[],C=p.head.next;C!==p.tail;)_.push(C.value),C=C.next;return _}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(p){var _=JSON.parse(p.data),C=_.language,v=_.code,b=_.immediateClose;r.postMessage(a.highlight(v,a.languages[C],C)),b&&r.close()},!1)),a;var m=a.util.currentScript();m&&(a.filename=m.src,m.hasAttribute("data-manual")&&(a.manual=!0));function y(){a.manual||a.highlightAll()}if(!a.manual){var x=document.readyState;x==="loading"||x==="interactive"&&m&&m.defer?document.addEventListener("DOMContentLoaded",y):window.requestAnimationFrame?window.requestAnimationFrame(y):window.setTimeout(y,16)}return a})(e);n.exports&&(n.exports=t),typeof Ia<"u"&&(Ia.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,i){var o={};o["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[i]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};a["language-"+i]={pattern:/[\s\S]+/,inside:t.languages[i]};var l={};l[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:a},t.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,(function(r){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,(function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",s=function(m,y){return"✖ Error "+m+" while fetching file: "+y},i="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(m,y,x){var p=new XMLHttpRequest;p.open("GET",m,!0),p.onreadystatechange=function(){p.readyState==4&&(p.status<400&&p.responseText?y(p.responseText):p.status>=400?x(s(p.status,p.statusText)):x(i))},p.send(null)}function h(m){var y=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(y){var x=Number(y[1]),p=y[2],_=y[3];return p?_?[x,Number(_)]:[x,void 0]:[x,x]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+f}),t.hooks.add("before-sanity-check",function(m){var y=m.element;if(y.matches(f)){m.code="",y.setAttribute(a,l);var x=y.appendChild(document.createElement("CODE"));x.textContent=r;var p=y.getAttribute("data-src"),_=m.language;if(_==="none"){var C=(/\.(\w+)$/.exec(p)||[,"none"])[1];_=o[C]||C}t.util.setLanguage(x,_),t.util.setLanguage(y,_);var v=t.plugins.autoloader;v&&v.loadLanguages(_),d(p,function(b){y.setAttribute(a,c);var S=h(y.getAttribute("data-range"));if(S){var T=b.split(/\r\n?|\n/g),E=S[0],N=S[1]==null?T.length:S[1];E<0&&(E+=T.length),E=Math.max(0,Math.min(E-1,T.length)),N<0&&(N+=T.length),N=Math.max(0,Math.min(N,T.length)),b=T.slice(E,N).join(`
15
- `),y.hasAttribute("data-start")||y.setAttribute("data-start",String(E+1))}x.textContent=b,t.highlightElement(x)},function(b){y.setAttribute(a,u),x.textContent=b})}}),t.plugins.fileHighlight={highlight:function(y){for(var x=(y||document).querySelectorAll(f),p=0,_;_=x[p++];)t.highlightElement(_)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Ri)),Ri.exports}lv();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var s={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};s["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:s},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(u){return u=u.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+i+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+i+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(n.languages.markdown[u].inside.content.inside[f]=n.languages.markdown[f])})}),n.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var m=d[h];if(m.type!=="code"){f(m.content);continue}var y=m.content[1],x=m.content[3];if(y&&x&&y.type==="code-language"&&x.type==="code-block"&&typeof y.content=="string"){var p=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase();var _="language-"+p;x.alias?typeof x.alias=="string"?x.alias=[x.alias,_]:x.alias.push(_):x.alias=[_]}}}f(u.tokens)}),n.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],m=/language-(.+)/.exec(g);if(m){f=m[1];break}}var y=n.languages[f];if(y)u.content=n.highlight(c(u.content),y,f);else if(f&&f!=="none"&&n.plugins.autoloader){var x="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=x,n.plugins.autoloader.loadLanguages(f,function(){var p=document.getElementById(x);p&&(p.innerHTML=n.highlight(p.textContent,n.languages[f],f))})}}});var o=RegExp(n.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(o,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var m=a[h];return m||d}}),f}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);var bu={},Su;function uv(){return Su||(Su=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),bu}uv();var Cu={},Eu;function cv(){return Eu||(Eu=1,(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism)),Cu}cv();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});var Tu={},wu;function dv(){return wu||(wu=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),n.languages.ts=n.languages.typescript})(Prism)),Tu}dv();var ku={},Nu;function fv(){return Nu||(Nu=1,(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),ku}fv();var Au={},Pu;function gv(){return Pu||(Pu=1,(function(n){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism)),Au}gv();function Jf(n,e){for(const t of n.childNodes){if(ke(t)&&t.tagName===e)return!0;Jf(t,e)}return!1}const vr="data-language",pr="data-highlight-language",os="data-theme";let li=class Gf extends ot{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new Gf(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");xt(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(vr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(pr,r));const s=this.getTheme();s&&t.setAttribute(os,s);const i=this.getStyle();return i&&t.setAttribute("style",i),t}updateDOM(e,t,r){const s=this.__language,i=e.__language;s?s!==i&&t.setAttribute(vr,s):i&&t.removeAttribute(vr);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?o&&s?s!==i&&t.setAttribute(pr,s):t.removeAttribute(pr):o&&s&&t.setAttribute(pr,s);const a=this.__theme,l=e.__theme;a?a!==l&&t.setAttribute(os,a):l&&t.removeAttribute(os);const c=this.__style,u=e.__style;return c?c!==u&&t.setAttribute("style",c):u&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");xt(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(vr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(pr,r));const s=this.getTheme();s&&t.setAttribute(os,s);const i=this.getStyle();return i&&t.setAttribute("style",i),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||Jf(e,"BR"))?{conversion:Iu,priority:1}:null,div:()=>({conversion:hv,priority:1}),pre:()=>({conversion:Iu,priority:0}),table:e=>Oi(e)?{conversion:pv,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&Oi(r)?{conversion:Ru,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&Oi(t)?{conversion:Ru,priority:3}:null}}}static importJSON(e){return qt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),s=r.length;if(s>=2&&r[s-1].getTextContent()===`
16
- `&&r[s-2].getTextContent()===`
17
- `&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===s){r[s-1].remove(),r[s-2].remove();const l=Ee();return this.insertAfter(l,t),l}const{anchor:i,focus:o}=e,a=(i.isBefore(o)?i:o).getNode();if(L(a)){let l=yv(a);const c=[];for(;;)if(qs(l))c.push(ur()),l=l.getNextSibling();else{if(!Xf(l))break;{let y=0;const x=l.getTextContent(),p=l.getTextContentSize();for(;y<p&&x[y]===" ";)y++;if(y!==0&&c.push(Zf(" ".repeat(y))),y!==p)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[vt(),...c];h.splice(d,0,g);const m=c[c.length-1];m?m.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(Ea(a)){const{offset:l}=e.anchor;a.splice(l,0,[vt()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const e=Ee();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function qt(n,e){return uf(li).setLanguage(n).setTheme(e)}function Ea(n){return n instanceof li}function Iu(n){return{node:qt(n.getAttribute(vr))}}function hv(n){const e=n,t=Ou(e);return t||(function(r){let s=r.parentElement;for(;s!==null;){if(Ou(s))return!0;s=s.parentElement}return!1})(e)?{node:t?qt():null}:{node:null}}function pv(){return{node:qt()}}function Ru(){return{node:null}}function Ou(n){return n.style.fontFamily.match("monospace")!==null}function Oi(n){return n.classList.contains("js-file-line-container")}let Ta=class Yf extends Lt{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new Yf(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=Fi(e.theme,this.__highlightType);return xt(t,r),t}updateDOM(e,t,r){const s=super.updateDOM(e,t,r),i=Fi(r.theme,e.__highlightType),o=Fi(r.theme,this.__highlightType);return i!==o&&(i&&ii(t,i),o&&xt(t,o)),s}static importJSON(e){return Zf().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return qt()}};function Fi(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function Zf(n="",e){return pt(new Ta(n,e))}function Xf(n){return n instanceof Ta}function mv(n,e){let t=n;for(let r=Re(n,e);r&&(Xf(r.origin)||qs(r.origin));r=Ky(r))t=r.origin;return t}function yv(n){return mv(n,"previous")}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],s=[];/^\w+$/.test(t)||s.push(/\w+/.exec(t)[0]),t==="diff"&&s.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
18
- ?|
19
- |(?![\\s\\S])))+`,"m"),alias:s,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);const _v=new Set(["http:","https:","mailto:","sms:","tel:"]);class un extends ot{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new un(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:s=null,rel:i=null,title:o=null}=t;this.__url=e,this.__target=s,this.__rel=i,this.__title=o}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),xt(t,e.theme.link),t}updateLinkDOM(e,t,r){if(fa(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const s of["target","rel","title"]){const i=`__${s}`,o=this[i];e&&e[i]===o||(o?t[s]=o:t.removeAttribute(s))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:vv,priority:1})}}static importJSON(e){return vn().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Mu(e);try{const t=new URL(Mu(e));if(!_v.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=vn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!O(t))return!1;const s=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(s)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function vv(n){let e=null;if(fa(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=vn(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function vn(n="",e){return pt(new un(n,e))}function wt(n){return n instanceof un}class fr extends un{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new fr(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return wo().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(A(r)){const s=wo(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(s),s}return null}}function wo(n="",e){return pt(new fr(n,e))}function Nt(n){return n instanceof fr}const ko=X("TOGGLE_LINK_COMMAND");function Fu(n,e){if(n.type==="element"){const t=n.getNode();return A(t)||(function(r,...s){const i=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of s)o.append("v",a);throw i.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function Mi(n,e={}){let t;if(n&&typeof n=="object"){const{url:u,...f}=n;t=u,e={...f,...e}}else t=n;const{target:r,title:s}=e,i=e.rel===void 0?"noreferrer":e.rel,o=D();if(o===null||!O(o)&&!Oe(o))return;if(Oe(o)){const u=o.getNodes();return u.length===0?void 0:void u.forEach(f=>{if(t===null){const d=Qe(f,h=>!Nt(h)&&wt(h));d&&(d.insertBefore(f),d.getChildren().length===0&&d.remove())}else{const d=Qe(f,h=>!Nt(h)&&wt(h));if(d)d.setURL(t),r!==void 0&&d.setTarget(r),i!==void 0&&d.setRel(i);else{const h=vn(t,{rel:i,target:r});f.insertBefore(h),h.append(f)}}})}const a=o.extract();if(t===null){const u=new Set;return void a.forEach(f=>{const d=f.getParent();if(wt(d)&&!Nt(d)){const h=d.getKey();if(u.has(h))return;(function(g,m){const y=new Set(m.filter(S=>g.isParentOf(S)).map(S=>S.getKey())),x=g.getChildren(),p=x.filter(S=>y.has(S.getKey()));if(p.length===x.length)return x.forEach(S=>g.insertBefore(S)),void g.remove();const _=x.findIndex(S=>y.has(S.getKey())),C=x.findLastIndex(S=>y.has(S.getKey())),v=_===0,b=C===x.length-1;if(v)p.forEach(S=>g.insertBefore(S));else if(b)for(let S=p.length-1;S>=0;S--)g.insertAfter(p[S]);else{for(let T=p.length-1;T>=0;T--)g.insertAfter(p[T]);const S=x.slice(C+1);if(S.length>0){const T=vn(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});p[p.length-1].insertAfter(T),S.forEach(E=>T.append(E))}}})(d,a),u.add(h)}})}const l=new Set,c=u=>{l.has(u.getKey())||(l.add(u.getKey()),u.setURL(t),r!==void 0&&u.setTarget(r),i!==void 0&&u.setRel(i),s!==void 0&&u.setTitle(s))};if(a.length===1){const u=a[0],f=Qe(u,wt);if(f!==null)return c(f)}(function(u){const f=D();if(!O(f))return u();const d=Sn(f),h=d.isBackward(),g=Fu(d.anchor,h?-1:0),m=Fu(d.focus,h?0:-1);if(u(),g||m){const y=D();if(O(y)){const x=y.clone();if(g){const p=g.getParent();p&&x.anchor.set(p.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(m){const p=m.getParent();p&&x.focus.set(p.getKey(),m.getIndexWithinParent()+(h?0:1),"element")}Ue(Sn(x))}}})(()=>{let u=null;for(const f of a){if(!f.isAttached())continue;const d=Qe(f,wt);if(d){c(d);continue}if(A(f)){if(!f.isInline())continue;if(wt(f)){if(!(Nt(f)||u!==null&&u.getParentOrThrow().isParentOf(f))){c(f),u=f;continue}for(const g of f.getChildren())f.insertBefore(g);f.remove();continue}}const h=f.getPreviousSibling();wt(h)&&h.is(u)?h.append(f):(u=vn(t,{rel:i,target:r,title:s}),f.insertAfter(u),u.append(f))}})}const xv=/^\+?[0-9\s()-]{5,}$/;function Mu(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:xv.test(n)?`tel:${n}`:`https://${n}`}function bv(n,e){return gt(vo(()=>n.registerCommand(ko,t=>{const r=e.validateUrl.peek(),s=e.attributes.peek();if(t===null)return Mi(null),!0;if(typeof t=="string")return!(r!==void 0&&!r(t))&&(Mi(t,s),!0);{const{url:i,target:o,rel:a,title:l}=t;return Mi(i,{...s,rel:a,target:o,title:l}),!0}},Xe)),vo(()=>{const t=e.validateUrl.value;if(!t)return;const r=e.attributes.value;return n.registerCommand(Vs,s=>{const i=D();if(!O(i)||i.isCollapsed()||!nn(s,ClipboardEvent)||s.clipboardData===null)return!1;const o=s.clipboardData.getData("text");return!!t(o)&&!i.getNodes().some(a=>A(a))&&(n.dispatchCommand(ko,{...r,url:o}),s.preventDefault(),!0)},Xe)}))}function Sv(n,e,t={}){const r=i=>{const o=i.target;if(!Fn(o))return;const a=Zs(o);if(a===null)return;let l=null,c=null;if(a.update(()=>{const d=Mt(o);if(d!==null){const h=Qe(d,A);if(!e.disabled.peek())if(wt(h))l=h.sanitizeUrl(h.getURL()),c=h.getTarget();else{const g=(function(m,y){let x=m;for(;x!=null;){if(y(x))return x;x=x.parentNode}return null})(o,fa);g!==null&&(l=g.href,c=g.target)}}}),l===null||l==="")return;const u=n.getEditorState().read(D);if(O(u)&&!u.isCollapsed())return void i.preventDefault();const f=i.type==="auxclick"&&i.button===1;window.open(l,e.newTab.peek()||f||i.metaKey||i.ctrlKey||c==="_blank"?"_blank":"_self"),i.preventDefault()},s=i=>{i.button===1&&r(i)};return n.registerRootListener((i,o)=>{o!==null&&(o.removeEventListener("click",r),o.removeEventListener("mouseup",s)),i!==null&&(i.addEventListener("click",r,t),i.addEventListener("mouseup",s,t))})}function $u(n,e=t=>t){return t=>{const r=n.exec(t);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function Qf(n,e){for(let t=0;t<e.length;t++){const r=e[t](n);if(r)return r}return null}const Cv=/[.,;\s]/;function $s(n){return Cv.test(n)}function eg(n){return $s(n[n.length-1])}function No(n){return $s(n[0])}function tg(n){let e=n.getPreviousSibling();return A(e)&&(e=e.getLastDescendant()),e===null||Pt(e)||L(e)&&eg(e.getTextContent())}function ng(n){let e=n.getNextSibling();return A(e)&&(e=e.getFirstDescendant()),e===null||Pt(e)||L(e)&&No(e.getTextContent())}function Ev(n,e,t,r){return(n>0?$s(t[n-1]):tg(r[0]))?e<t.length?$s(t[e]):ng(r[r.length-1]):!1}function Tv(n,e,t){const r=[],s=[],i=[];let o=0,a=0;const l=[...n];for(;l.length>0;){const c=l[0],u=c.getTextContent().length,f=a;a+u<=e?(r.push(c),o+=u):f>=t?i.push(c):s.push(c),a+=u,l.shift()}return[o,r,s,i]}function wv(n,e,t,r){const s=wo(r.url,r.attributes);if(n.length===1){let i,o=n[0];e===0?[i,o]=o.splitText(t):[,i,o]=o.splitText(e,t);const a=Te(r.text);return a.setFormat(i.getFormat()),a.setDetail(i.getDetail()),a.setStyle(i.getStyle()),s.append(a),i.replace(s),o}if(n.length>1){const i=n[0];let o,a=i.getTextContent().length;e===0?o=i:[,o]=i.splitText(e);const l=[];let c;for(let h=1;h<n.length;h++){const g=n[h],m=g.getTextContent().length,y=a;if(y<t)if(a+m<=t)l.push(g);else{const[x,p]=g.splitText(t-y);l.push(x),c=p}a+=m}const u=D(),f=u?u.getNodes().find(L):void 0,d=Te(o.getTextContent());return d.setFormat(o.getFormat()),d.setDetail(o.getDetail()),d.setStyle(o.getStyle()),s.append(d,...l),f&&f===o&&(O(u)?d.select(u.anchor.offset,u.focus.offset):Oe(u)&&d.select(0,d.getTextContent().length)),o.replace(s),c}}function $i(n,e,t){const r=n.getChildren(),s=r.length;for(let l=0;l<s;l++){const c=r[l];if(!L(c)||!c.isSimpleText())return ms(n),void t(null,n.getURL())}const i=n.getTextContent(),o=Qf(i,e);if(o===null||o.text!==i||!tg(n)||!ng(n))return ms(n),void t(null,n.getURL());const a=n.getURL();if(a!==o.url&&(n.setURL(o.url),t(o.url,a)),o.attributes){const l=n.getRel();l!==o.attributes.rel&&(n.setRel(o.attributes.rel||null),t(o.attributes.rel||null,l));const c=n.getTarget();c!==o.attributes.target&&(n.setTarget(o.attributes.target||null),t(o.attributes.target||null,c))}}function ms(n){const e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map(t=>t.getLatest())}const kv={changeHandlers:[],matchers:[]};function Nv(n,e=kv){const{matchers:t,changeHandlers:r}=e,s=(i,o)=>{for(const a of r)a(i,o)};return gt(n.registerNodeTransform(Lt,i=>{const o=i.getParentOrThrow(),a=i.getPreviousSibling();if(Nt(o)&&!o.getIsUnlinked())$i(o,t,s);else if(!wt(o)){if(i.isSimpleText()&&(No(i.getTextContent())||!Nt(a))){const l=(function(c){const u=[c];let f=c.getNextSibling();for(;f!==null&&L(f)&&f.isSimpleText()&&(u.push(f),!/[\s]/.test(f.getTextContent()));)f=f.getNextSibling();return u})(i);(function(c,u,f){let d=[...c];const h=d.map(x=>x.getTextContent()).join("");let g,m=h,y=0;for(;(g=Qf(m,u))&&g!==null;){const x=g.index,p=x+g.length;if(Ev(y+x,y+p,h,d)){const[_,,C,v]=Tv(d,y+x,y+p),b=wv(C,y+x-_,y+p-_,g);d=b?[b,...v]:v,f(g.url,null),y=0}else y+=p;m=m.substring(p)}})(l,t,s)}(function(l,c,u){const f=l.getPreviousSibling(),d=l.getNextSibling(),h=l.getTextContent();var g;!Nt(f)||f.getIsUnlinked()||No(h)&&(g=h,!(f.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(g):/^\.[a-zA-Z0-9]{1,}/.test(g)))||(f.append(l),$i(f,c,u),u(null,f.getURL())),!Nt(d)||d.getIsUnlinked()||eg(h)||(ms(d),$i(d,c,u),u(null,d.getURL()))})(i,t,s)}}),n.registerCommand(ko,i=>{const o=D();return i!==null||!O(o)||o.extract().forEach(a=>{const l=a.getParent();Nt(l)&&(l.setIsUnlinked(!l.getIsUnlinked()),l.markDirty())}),!1},Xe))}function Ao(n,e){const t={};for(const r of n){const s=e(r);s&&(t[s]?t[s].push(r):t[s]=[r])}return t}function wa(n){const e=Ao(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Ls=/[!-/:-@[-`{-~\s]/,Av=/^\s{0,3}$/;function Po(n){if(!Br(n))return!1;const e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&L(e)&&Av.test(e.getTextContent())}function Pv(n,e,t,r){for(const s of e){if(!s.export)continue;const i=s.export(n,o=>Ds(o,t,r));if(i!=null)return i}return A(n)?Ds(n,t,r):pe(n)?n.getTextContent():null}function Ds(n,e,t,r,s){const i=[],o=n.getChildren();r||(r=[]),s||(s=[]);e:for(const a of o){for(const l of t){if(!l.export)continue;const c=l.export(a,u=>Ds(u,e,t,r,[...s,...r]),(u,f)=>Lu(u,f,e,r,s));if(c!=null){i.push(c);continue e}}Pt(a)?i.push(`
20
- `):L(a)?i.push(Lu(a,a.getTextContent(),e,r,s)):A(a)?i.push(Ds(a,e,t,r,s)):pe(a)&&i.push(a.getTextContent())}return i.join("")}function Lu(n,e,t,r,s){let i=n.getFormat()===0?e:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(e);n.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let o="",a="",l="";const c=Du(n,!0),u=Du(n,!1),f=new Set;for(const d of t){const h=d.format[0],g=d.tag;as(n,h)&&!f.has(h)&&(f.add(h),as(c,h)&&r.find(m=>m.tag===g)||(r.push({format:h,tag:g}),o+=g))}for(let d=0;d<r.length;d++){const h=as(n,r[d].format),g=as(u,r[d].format);if(h&&g)continue;const m=[...r];for(;m.length>d;){const y=m.pop();s&&y&&s.find(x=>x.tag===y.tag)||(y&&typeof y.tag=="string"&&(h?g||(l+=y.tag):a+=y.tag),r.pop())}break}return i=o+i+l,a+i}function Du(n,e){let t=e?n.getPreviousSibling():n.getNextSibling();if(!t){const r=n.getParentOrThrow();r.isInline()&&(t=e?r.getPreviousSibling():r.getNextSibling())}for(;t;){if(A(t)){if(!t.isInline())break;const r=e?t.getLastDescendant():t.getFirstDescendant();if(L(r))return r;t=e?t.getPreviousSibling():t.getNextSibling()}if(L(t))return t;if(!A(t))return null}return null}function as(n,e){return L(n)&&n.hasFormat(e)}function Iv(n,e){const t=(function(s,i){const o=s.match(i.openTagsRegExp);if(o==null)return null;for(const a of o){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=s.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=s[d-1],g=s[d+u[0].length];if((!h||Ls.test(h))&&(!g||Ls.test(g)))return u}}return null})(n.getTextContent(),e);if(!t)return null;const r=t.index||0;return{endIndex:r+t[0].length,match:t,startIndex:r,transformer:e.transformersByTag[t[1]]}}function gn(n){return L(n)&&!n.hasFormat("code")}function hn(n,e,t){let r=Iv(n,e),s=(function(o,a){const l=o;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const m=g.index||0,y=h.getEndIndex?h.getEndIndex(l,g):m+g[0].length;y!==!1&&(c===void 0||u===void 0||m<c&&(y>u||y<=c))&&(c=m,u=y,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(n,t);if(r&&s&&(r.startIndex<=s.startIndex&&r.endIndex>=s.endIndex||s.startIndex>r.endIndex?s=null:r=null),r){const o=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,m;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[m,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const y of u.format)h.hasFormat(y)||h.toggleFormat(y);return{nodeAfter:g,nodeBefore:m,transformedNode:h}})(n,r.startIndex,r.endIndex,r.transformer,r.match);gn(o.nodeAfter)&&hn(o.nodeAfter,e,t),gn(o.nodeBefore)&&hn(o.nodeBefore,e,t),gn(o.transformedNode)&&hn(o.transformedNode,e,t)}else if(s){const o=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(n,s.startIndex,s.endIndex,s.transformer,s.match);if(!o)return;gn(o.nodeAfter)&&hn(o.nodeAfter,e,t),gn(o.nodeBefore)&&hn(o.nodeBefore,e,t),gn(o.transformedNode)&&hn(o.transformedNode,e,t)}const i=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(o,a)=>String.fromCodePoint(a));n.setTextContent(i)}function Rv(n,e=!1){const t=wa(n),r=(function(s){const i={},o={},a=[],l="(?<![\\\\])";for(const c of s){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?o[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):o[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:o,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(t.textFormat);return(s,i)=>{const o=s.split(`
21
- `),a=o.length,l=i||we();l.clear();for(let u=0;u<a;u++){const f=o[u],[d,h]=Ov(o,u,t.multilineElement,l);d?u=h:Fv(f,l,t.element,r,t.textMatch,e)}const c=l.getChildren();for(const u of c)!e&&Po(u)&&l.getChildrenSize()>1&&u.remove();D()!==null&&l.selectStart()}}function Ov(n,e,t,r){for(const s of t){const{handleImportAfterStartMatch:i,regExpEnd:o,regExpStart:a,replace:l}=s,c=n[e].match(a);if(!c)continue;if(i){const g=i({lines:n,rootNode:r,startLineIndex:e,startMatch:c,transformer:s});if(g===null)continue;if(g)return g}const u=typeof o=="object"&&"regExp"in o?o.regExp:o,f=o&&typeof o=="object"&&"optional"in o?o.optional:!o;let d=e;const h=n.length;for(;d<h;){const g=u?n[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&e===d&&g.index===c.index){d++;continue}const m=[];if(g&&e===d)m.push(n[e].slice(c[0].length,-g[0].length));else for(let y=e;y<=d;y++)if(y===e){const x=n[y].slice(c[0].length);m.push(x)}else if(y===d&&g){const x=n[y].slice(0,-g[0].length);m.push(x)}else m.push(n[y]);if(l(r,null,c,g,m,!0)!==!1)return[!0,d];break}}return[!1,e]}function Fv(n,e,t,r,s,i){const o=Te(n),a=Ee();a.append(o),e.append(a);for(const{regExp:l,replace:c}of t){const u=n.match(l);if(u&&(o.setTextContent(n.slice(u[0].length)),c(a,[o],u,!0)!==!1))break}if(hn(o,r,s),a.isAttached()&&n.length>0){const l=a.getPreviousSibling();if(!i&&(Br(l)||bo(l)||se(l))){let c=l;if(se(l)){const u=l.getLastDescendant();c=u==null?null:Qe(u,fe)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[vt(),...a.getChildren()]),a.remove())}}}function Mv(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const rg=/^(\s*)(\d{1,})\.\s/,sg=/^(\s*)[-*+]\s/,$v=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Io=/^(#{1,6})\s/,ig=/^>\s/,og=/^[ \t]*```([\w-]+)?/,Ro=/[ \t]*```$/,Lv=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Dv=/^(?:\|)(.+)(?:\|)\s?$/,Bv=/^(\| ?:?-*:? ?)+\|\s?$/,Bu=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,ju=/^<\/[a-z_][\w-]*\s*>/i,zu=n=>new RegExp(`(?:${n.source})$`,n.flags),xr=_m("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),ag=n=>(e,t,r,s)=>{const i=n(r);i.append(...t),e.replace(i),s||i.select(0,0)},lg=n=>(e,t,r,s)=>{const i=e.getPreviousSibling(),o=e.getNextSibling(),a=at(n==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=n!=="bullet"&&n!=="check"||l!==xr.parse(l)?void 0:l;if(se(o)&&o.getListType()===n){c&&pi(o,xr,c);const f=o.getFirstChild();f!==null?f.insertBefore(a):o.append(a),e.remove()}else if(se(i)&&i.getListType()===n)c&&pi(i,xr,c),i.append(a),e.remove();else{const f=nt(n,n==="number"?Number(r[2]):void 0);c&&pi(f,xr,c),f.append(a),e.replace(f)}a.append(...t),s||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},ka=(n,e,t)=>{const r=[],s=n.getChildren();let i=0;for(const o of s)if(fe(o)){if(o.getChildrenSize()===1){const f=o.getFirstChild();if(se(f)){r.push(ka(f,e,t+1));continue}}const a=" ".repeat(4*t),l=n.getListType(),c=td(n,xr),u=l==="number"?`${n.getStart()+i}. `:l==="check"?`${c} [${o.getChecked()?"x":" "}] `:c+" ";r.push(a+u+e(o)),i++}return r.join(`
22
- `)},jv={dependencies:[ai],export:(n,e)=>{if(!I_(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:Io,replace:ag(n=>{const e="h"+n[1].length;return Jn(e)}),type:"element"},zv={dependencies:[oi],export:(n,e)=>{if(!bo(n))return null;const t=e(n).split(`
23
- `),r=[];for(const s of t)r.push("> "+s);return r.join(`
24
- `)},regExp:ig,replace:(n,e,t,r)=>{if(r){const i=n.getPreviousSibling();if(bo(i))return i.splice(i.getChildrenSize(),0,[vt(),...e]),void n.remove()}const s=ba();s.append(...e),n.replace(s),r||s.select(0,0)},type:"element"},Uv={dependencies:[li],export:n=>{if(!Ea(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
25
- `+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:Ro},regExpStart:og,replace:(n,e,t,r,s,i)=>{let o,a;if(!e&&s){if(s.length===1)r?(o=qt(),a=t[1]+s[0]):(o=qt(t[1]),a=s[0].startsWith(" ")?s[0].slice(1):s[0]);else{if(o=qt(t[1]),s[0].trim().length===0)for(;s.length>0&&!s[0].length;)s.shift();else s[0]=s[0].startsWith(" ")?s[0].slice(1):s[0];for(;s.length>0&&!s[s.length-1].length;)s.pop();a=s.join(`
26
- `)}const l=Te(a);o.append(l),n.append(o)}else e&&ag(l=>qt(l?l[1]:void 0))(n,e,t,i)},type:"multiline-element"},Kv={dependencies:[Ln,ln],export:(n,e)=>se(n)?ka(n,e,0):null,regExp:sg,replace:lg("bullet"),type:"element"},Wv={dependencies:[Ln,ln],export:(n,e)=>se(n)?ka(n,e,0):null,regExp:rg,replace:lg("number"),type:"element"},Vv={format:["code"],tag:"`",type:"text-format"},Hv={format:["highlight"],tag:"==",type:"text-format"},qv={format:["bold","italic"],tag:"***",type:"text-format"},Jv={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},Gv={format:["bold"],tag:"**",type:"text-format"},Yv={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Zv={format:["strikethrough"],tag:"~~",type:"text-format"},Xv={format:["italic"],tag:"*",type:"text-format"},Qv={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Na={dependencies:[un],export:(n,e,t)=>{if(!wt(n)||Nt(n))return null;const r=n.getTitle(),s=e(n);return r?`[${s}](${n.getURL()} "${r}")`:`[${s}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,s]=e,i=vn(r,{title:s}),o=t.split("[").length-1,a=t.split("]").length-1;let l=t,c="";if(o<a)return;if(o>a){const f=t.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Te(l);return u.setFormat(n.getFormat()),i.append(u),n.replace(i),c&&i.insertBefore(Te(c)),u},trigger:")",type:"text-match"},ex=[jv,zv,Kv,Wv],tx=[Uv],nx=[Vv,qv,Jv,Gv,Yv,Hv,Xv,Qv,Zv],rx=[Na],Wr=[...ex,...tx,...nx,...rx];function Uu(n,e,t){const r=t.length;for(let s=e;s>=r;s--){const i=s-r;if(ug(n,i,t,0,r)&&n[i+r]!==" ")return i}return-1}function ug(n,e,t,r,s){for(let i=0;i<s;i++)if(n[e+i]!==t[r+i])return!1;return!0}function sx(n,e=Wr){const t=wa(e),r=Ao(t.textFormat,({tag:o})=>o[o.length-1]),s=Ao(t.textMatch,({trigger:o})=>o);for(const o of e){const a=o.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=o.dependencies;for(const c of l)n.hasNode(c)||Mv(173,c.getType())}}const i=(o,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!He(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:m,replace:y}of d){const x=g.match(m);if(x&&x[0].length===(x[0].endsWith(" ")?f:f-1)){const p=u.getNextSiblings(),[_,C]=u.splitText(f);if(y(c,C?[C,...p]:p,x,!1)!==!1)return _.remove(),!0}}return!1})(o,a,l,t.element)||(function(c,u,f,d){const h=c.getParent();if(!He(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:m,replace:y,regExpEnd:x}of d){if(x&&!("optional"in x)||x&&"optional"in x&&!x.optional)continue;const p=g.match(m);if(p&&p[0].length===(p[0].endsWith(" ")?f:f-1)){const _=u.getNextSiblings(),[C,v]=u.splitText(f);if(y(c,v?[v,..._]:_,p,null,null,!1)!==!1)return C.remove(),!0}}return!1})(o,a,l,t.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const m=d.match(g.regExp);if(m===null)continue;const y=m.index||0,x=y+m[0].length;let p;return y===0?[p]=c.splitText(x):[,p]=c.splitText(y,x),p.selectNext(0,0),g.replace(p,m),!0}return!1})(a,l,s)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],m=f[g];if(!m)return!1;for(const y of m){const{tag:x}=y,p=x.length,_=h-p+1;if(p>1&&!ug(d,_,x,0,p)||d[_-1]===" ")continue;const C=d[h+1];if(y.intraword===!1&&C&&!Ls.test(C))continue;const v=c;let b=v,S=Uu(d,_,x),T=b;for(;S<0&&(T=T.getPreviousSibling())&&!Pt(T);)if(L(T)){if(T.hasFormat("code"))continue;const M=T.getTextContent();b=T,S=Uu(M,M.length,x)}if(S<0||b===v&&S+p===_)continue;const E=b.getTextContent();if(S>0&&E[S-1]===g)continue;const N=E[S-1];if(y.intraword===!1&&N&&!Ls.test(N))continue;const P=v.getTextContent(),$=P.slice(0,_)+P.slice(h+1);v.setTextContent($);const R=b===v?$:E;b.setTextContent(R.slice(0,S)+R.slice(S+p));const I=D(),j=Gs();Ue(j);const B=h-p*(b===v?2:1)+1;j.anchor.set(b.__key,S,"text"),j.focus.set(v.__key,B,"text");for(const M of y.format)j.hasFormat(M)||j.formatText(M);j.anchor.set(j.focus.key,j.focus.offset,j.focus.type);for(const M of y.format)j.hasFormat(M)&&j.toggleFormat(M);return O(I)&&(j.format=I.format),!0}})(a,l,r)};return n.registerUpdateListener(({tags:o,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(o.has(Od)||o.has(Bm)||n.isComposing())return;const u=l.read(D),f=c.read(D);if(!O(f)||!O(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!L(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||n.update(()=>{if(!gn(g))return;const m=g.getParent();m===null||Ea(m)||i(m,g,u.anchor.offset)})})}function ix(n,e=Wr,t,r=!1,s=!1){const i=r?n:(function(o,a=!1){const l=o.split(`
27
- `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];Lv.test(d)?u.push(d):og.test(d)||Ro.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||Io.test(h)||Io.test(d)||ig.test(d)||rg.test(d)||sg.test(d)||$v.test(d)||Dv.test(d)||Bv.test(d)||!a||Bu.test(d)||ju.test(d)||zu(ju).test(h)||zu(Bu).test(h)||Ro.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
28
- `)})(n,s);return Rv(e,r)(i,t)}function ox(n=Wr,e,t=!1){return(function(s,i=!1){const o=wa(s),a=[...o.multilineElement,...o.element],l=!i,c=o.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||we()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],m=Pv(g,a,c,o.textMatch);m!=null&&f.push(l&&h>0&&!Po(g)&&!Po(d[h-1])?`
29
- `.concat(m):m)}return f.join(`
30
- `)}})(n,t)(e)}function Ku(n,e){return n.getEditorState().read(()=>{const t=Ie(e);return t!==null&&t.isSelected()})}function ax(n){const[e]=Je(),[t,r]=w.useState(()=>Ku(e,n));return w.useEffect(()=>{let s=!0;const i=e.registerUpdateListener(()=>{s&&r(Ku(e,n))});return()=>{s=!1,i()}},[e,n]),[t,w.useCallback(s=>{e.update(()=>{let i=D();Oe(i)||(i=Zo(),Ue(i)),Oe(i)&&(s?i.add(n):i.delete(n))})},[e,n]),w.useCallback(()=>{e.update(()=>{const s=D();Oe(s)&&s.clear()})},[e])]}function lx({nodeKey:n}){const[e]=Je(),[t,r,s]=ax(n);return w.useEffect(()=>gt(e.registerCommand(Uo,i=>{const o=e.getElementByKey(n);return i.target===o&&(i.shiftKey||s(),r(!t),!0)},Xe)),[s,e,t,n,r]),w.useEffect(()=>{const i=e.getElementByKey(n),o=e._config.theme.hrSelected??"selected";i!==null&&(t?xt(i,o):ii(i,o))},[e,t,n]),null}class Vr extends Kr{static getType(){return"horizontalrule"}static clone(e){return new Vr(e.__key)}static importJSON(e){return ui().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:ux,priority:0})}}decorate(){return k.jsx(lx,{nodeKey:this.__key})}}function ux(){return{node:ui()}}function ui(){return pt(new Vr)}const cx=[{dependencies:[Vr],export:n=>l_(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const s=ui();r||n.getNextSibling()!=null?n.replace(s):n.insertBefore(s),s.selectNext()},type:"element"},...Wr];function dx({transformers:n=cx}){const[e]=Je();return w.useEffect(()=>sx(e,n),[e,n]),null}function fx({hasStrictIndent:n=!1}){const[e]=Je();return w.useEffect(()=>{if(!e.hasNodes([Ln,ln]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),w.useEffect(()=>{if(n)return av(e)},[e,n]),(function(t){w.useEffect(()=>ov(t),[t])})(e),null}var gx="uf0wxx0",hx="uf0wxx1",px="uf0wxx2";function mx(n,e,t){w.useEffect(()=>{n.hasNodes([fr])||(function(r,...s){const i=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of s)o.append("v",a);throw i.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),w.useEffect(()=>Nv(n,{changeHandlers:t?[t]:[],matchers:e}),[n,e,t])}function yx({matchers:n,onChange:e}){const[t]=Je();return mx(t,n,e),null}function _x(){const[n]=Je();return w.useEffect(()=>tv(n),[n]),null}function vx({newTab:n=!0,disabled:e=!1}){const[t]=Je();return w.useEffect(()=>Sv(t,Pf({disabled:e,newTab:n})),[t,n,e]),null}function xx(){const[n]=Je();return w.useEffect(()=>n.registerCommand(o_,e=>{const t=D();if(!O(t))return!1;if(t.focus.getNode()!==null){const r=ui();Vy(r)}return!0},ge),[n]),null}function bx({validateUrl:n,attributes:e}){const[t]=Je();return w.useEffect(()=>{if(!t.hasNodes([un]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),w.useEffect(()=>bv(t,Pf({attributes:e,validateUrl:n})),[t,n,e]),null}function Sx({maxIndent:n}){const[e]=Je();return w.useEffect(()=>u_(e,n),[e,n]),null}const Cx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Ex({ignoreHistoryMergeTagChange:n=!0,ignoreSelectionChange:e=!1,onChange:t}){const[r]=Je();return Cx(()=>{if(t)return r.registerUpdateListener(({editorState:s,dirtyElements:i,dirtyLeaves:o,prevEditorState:a,tags:l})=>{e&&i.size===0&&o.size===0||n&&l.has(Xn)||a.isEmpty()||t(s,r,l)})},[r,n,e,t]),null}const Tx=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function wx(n){return n==="https://"||Tx.test(n)}function kx(n){const e=qe.c(4),{hasLinkAttributes:t}=n,r=t===void 0?!1:t;let s;e[0]!==r?(s=r?{rel:"noopener noreferrer",target:"_blank"}:void 0,e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==s?(i=k.jsx(bx,{validateUrl:wx,attributes:s}),e[2]=s,e[3]=i):i=e[3],i}const Nx=new RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"),Ax=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,Px=[$u(Nx,n=>n.startsWith("http")?n:`https://${n}`),$u(Ax,n=>`mailto:${n}`)];function Ix(){const n=qe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=k.jsx(yx,{matchers:Px}),n[0]=e):e=n[0],e}const Rx={...Na,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/},Aa=Wr.map(n=>n===Na?Rx:n),Ox={paragraph:"editor-paragraph",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",code:"editor-text-code"},list:{ul:"editor-list-ul",ol:"editor-list-ol",listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"}},quote:"editor-quote",code:"editor-code",codeHighlight:{},link:"editor-link",horizontalRule:"editor-hr"},Fx=[ai,oi,Ln,ln,li,Ta,un,fr,Vr];function Mx(n){const e=qe.c(2),{text:t}=n;let r;return e[0]!==t?(r=k.jsx("div",{className:px,children:t}),e[0]=t,e[1]=r):r=e[1],r}function $x(n){const e=qe.c(4),{value:t}=n,[r]=Je();let s;e[0]!==r||e[1]!==t?(s=()=>{t!==void 0&&r.update(()=>{ix(t,Aa)})},e[0]=r,e[1]=t,e[2]=s):s=e[2];let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[3]=i):i=e[3],w.useEffect(s,i),null}function Lx(n){const e=qe.c(4),{onChange:t}=n;let r;e[0]!==t?(r=o=>{t&&o.read(()=>{const a=ox(Aa);t(a)})},e[0]=t,e[1]=r):r=e[1];const s=r;let i;return e[2]!==s?(i=k.jsx(Ex,{onChange:s}),e[2]=s,e[3]=i):i=e[3],i}function Dx(n){const e=qe.c(20),{placeholder:t,value:r,onChange:s}=n,i=t===void 0?"Write your content here...":t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={namespace:"MarkdownEditor",theme:Ox,nodes:Fx,onError:Bx},e[0]=o):o=e[0];const a=o;let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=k.jsx(j_,{className:hx}),e[1]=l):l=e[1];let c;e[2]!==i?(c=k.jsx($_,{contentEditable:l,placeholder:k.jsx(Mx,{text:i}),ErrorBoundary:H_}),e[2]=i,e[3]=c):c=e[3];let u,f,d,h,g,m,y,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=k.jsx(dx,{transformers:Aa}),g=k.jsx(fx,{}),m=k.jsx(_x,{}),y=k.jsx(Sx,{}),x=k.jsx(vx,{}),u=k.jsx(xx,{}),f=k.jsx(kx,{}),d=k.jsx(Ix,{}),e[4]=u,e[5]=f,e[6]=d,e[7]=h,e[8]=g,e[9]=m,e[10]=y,e[11]=x):(u=e[4],f=e[5],d=e[6],h=e[7],g=e[8],m=e[9],y=e[10],x=e[11]);let p;e[12]!==r?(p=k.jsx($x,{value:r}),e[12]=r,e[13]=p):p=e[13];let _;e[14]!==s?(_=k.jsx(Lx,{onChange:s}),e[14]=s,e[15]=_):_=e[15];let C;return e[16]!==p||e[17]!==_||e[18]!==c?(C=k.jsx("div",{className:gx,children:k.jsxs(Oy,{initialConfig:a,children:[c,h,g,m,y,x,u,f,d,p,_]})}),e[16]=p,e[17]=_,e[18]=c,e[19]=C):C=e[19],C}function Bx(n){console.error("Lexical error:",n)}const jx=n=>{const e=qe.c(4);let t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=k.jsx("title",{children:"Markdown"}),r=k.jsx("path",{fill:"currentColor",d:"M22.27 19.385H1.73A1.73 1.73 0 010 17.655V6.345a1.73 1.73 0 011.73-1.73h20.54A1.73 1.73 0 0124 6.345v11.308a1.73 1.73 0 01-1.73 1.731zM5.769 15.923v-4.5l2.308 2.885 2.307-2.885v4.5h2.308V8.078h-2.308l-2.307 2.885-2.308-2.885H3.46v7.847zM21.232 12h-2.309V8.077h-2.307V12h-2.308l3.461 4.039z"}),e[0]=t,e[1]=r):(t=e[0],r=e[1]);let s;return e[2]!==n?(s=k.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n,children:[t,r]}),e[2]=n,e[3]=s):s=e[3],s},zx=n=>{const e=qe.c(7),t=!!(n&&n.length>0);let r,s;e[0]!==n?(r=["provider-models",n],s=async()=>{if(!n)return[];const a=await(await Fo.v1.providers[":providerId"].models.$get({param:{providerId:n}})).json();return"data"in a&&a.data?a.data:[]},e[0]=n,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let i;return e[3]!==t||e[4]!==r||e[5]!==s?(i={queryKey:r,queryFn:s,enabled:t,staleTime:3e5},e[3]=t,e[4]=r,e[5]=s,e[6]=i):i=e[6],yg(i)};var Ux="_1nagll30",cg="_1nagll31",Wu="_1nagll32",Kx="_1nagll33",Wx="_1nagll34",Li="_1nagll35",Di="_1nagll36",Vx="_1nagll37",Hx="_1nagll38",qx="_1nagll39",Jx="_1nagll3d",dg="_1nagll3e",Vu="_1nagll3f",Hu="_1nagll3g",Gx="_1nagll3h",Yx="_1nagll3i",Bi="_1nagll3k",qu="_1nagll3l",Zx="_1nagll3o",Xx="_1nagll3p",Qx="_1nagll3q",Pa="_1nagll3r";const Ju=window.bootstrapData?.llmProviders?.map(n=>({label:n.name,icon:n.imageURI,value:n.key}));function eb(n){const e=qe.c(2),{className:t}=n;let r;return e[0]!==t?(r=k.jsx(Cc,{className:t}),e[0]=t,e[1]=r):r=e[1],r}function tb(n,e){const t=n.split("/");return t.length>1&&t[0].length>0?t[0].charAt(0).toUpperCase()+t[0].slice(1):"Other"}function fg(n){const e=n.split("/");return e.length>1&&e[0].length>0?e[0]:null}function Oo(n){return`https://models.dev/logos/${n}.svg`}function nb(n){const e=qe.c(47),{models:t,isLoading:r,selectedModelName:s,onSelect:i}=n;let o,a,l,c,u,f,d,h,g,m,y,x,p,_;if(e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==s){const T=t?.reduce(rb,{}),E=T?Object.keys(T).sort():[];let N;e[18]!==t||e[19]!==s?(N=t?.find(j=>j.id===s),e[18]=t,e[19]=s,e[20]=N):N=e[20];const $=N?.name||s||"Select a model";c=$c,_=!1;let R;e[21]!==$?(R=k.jsx("span",{className:Bi,children:$}),e[21]=$,e[22]=R):R=e[22];let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx(Cc,{className:qu}),e[23]=I):I=e[23],e[24]!==R?(f=k.jsxs(ip,{className:dg,children:[R,I]}),e[24]=R,e[25]=f):f=e[25],l=Ba,a=ja,h=Vu,g="bottom",m=4,y="start",x="fixed",p=!0,o=Da,u=Hu,d=r?k.jsx("div",{className:Xx,children:"Loading models..."}):E.length===0?k.jsx("div",{className:Zx,children:"No models available"}):E.map(j=>{const B=T?.[j],M=B?.providerId,U=B?.models;return k.jsxs(tp,{children:[k.jsxs(lp,{className:Yx,openOnHover:!0,delay:100,children:[M&&k.jsx("img",{src:Oo(M),alt:"",className:Pa}),k.jsx("span",{className:Bi,children:j}),k.jsx(wh,{className:qu})]}),k.jsx(Ba,{children:k.jsx(ja,{className:Vu,side:"right",sideOffset:4,align:"start",positionMethod:"fixed",sticky:!0,children:k.jsx(Da,{className:Hu,children:U?.map(z=>{const Z=s===z.id;return k.jsxs(Gh,{className:Gx,onClick:()=>i(z.id),children:[k.jsx("span",{className:Bi,children:z.name.split(":")[1]||z.id}),Z&&k.jsx(Sc,{className:Qx})]},z.id)})})})})]},j)}),e[0]=r,e[1]=t,e[2]=i,e[3]=s,e[4]=o,e[5]=a,e[6]=l,e[7]=c,e[8]=u,e[9]=f,e[10]=d,e[11]=h,e[12]=g,e[13]=m,e[14]=y,e[15]=x,e[16]=p,e[17]=_}else o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],g=e[12],m=e[13],y=e[14],x=e[15],p=e[16],_=e[17];let C;e[26]!==o||e[27]!==u||e[28]!==d?(C=k.jsx(o,{className:u,children:d}),e[26]=o,e[27]=u,e[28]=d,e[29]=C):C=e[29];let v;e[30]!==a||e[31]!==C||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==y||e[36]!==x||e[37]!==p?(v=k.jsx(a,{className:h,side:g,sideOffset:m,align:y,positionMethod:x,sticky:p,children:C}),e[30]=a,e[31]=C,e[32]=h,e[33]=g,e[34]=m,e[35]=y,e[36]=x,e[37]=p,e[38]=v):v=e[38];let b;e[39]!==l||e[40]!==v?(b=k.jsx(l,{children:v}),e[39]=l,e[40]=v,e[41]=b):b=e[41];let S;return e[42]!==c||e[43]!==f||e[44]!==b||e[45]!==_?(S=k.jsxs(c,{modal:_,children:[f,b]}),e[42]=c,e[43]=f,e[44]=b,e[45]=_,e[46]=S):S=e[46],S}function rb(n,e){const t=tb(e.id),r=fg(e.id);return n[t]||(n[t]={models:[],providerId:r}),n[t].models.push(e),n}function sb(n){const e=qe.c(76),{value:t,onChange:r}=n,{data:s,isLoading:i}=zx(t.provider);let o;e[0]!==t.provider?(o=Ju?.find(V=>V.value===t.provider)||null,e[0]=t.provider,e[1]=o):o=e[1];const a=o,l=t.modelName?t.modelName:(t.provider,"Select model");let c;e[2]!==r||e[3]!==t?(c=V=>{V&&r({...t,provider:V.value,modelName:""})},e[2]=r,e[3]=t,e[4]=c):c=e[4];const u=c;let f;e[5]!==r||e[6]!==t?(f=V=>{r({...t,modelName:V})},e[5]=r,e[6]=t,e[7]=f):f=e[7];const d=f;let h;e[8]!==r||e[9]!==t?(h=(V,ce)=>{r({...t,[V]:ce})},e[8]=r,e[9]=t,e[10]=h):h=e[10];const g=h;let m;if(e[11]!==t.modelName||e[12]!==t.provider){const V=fg(t.modelName);m=V?Oo(V):t.provider?Oo(t.provider):null,e[11]=t.modelName,e[12]=t.provider,e[13]=m}else m=e[13];const y=m;let x;e[14]!==y?(x=y?k.jsx("img",{src:y,alt:"",className:Pa}):k.jsx("span",{className:cg,children:"?"}),e[14]=y,e[15]=x):x=e[15];const p=t.modelName?Wu:`${Wu} ${Kx}`;let _;e[16]!==l||e[17]!==p?(_=k.jsx("span",{className:p,children:l}),e[16]=l,e[17]=p,e[18]=_):_=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=k.jsx(eb,{className:Jx}),e[19]=C):C=e[19];let v;e[20]!==x||e[21]!==_?(v=k.jsxs(ec,{className:Ux,children:[x,_,C]}),e[20]=x,e[21]=_,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b=k.jsx("span",{className:Di,children:"Provider"}),e[23]=b):b=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=Ju||[],e[24]=S):S=e[24];let T;e[25]!==u||e[26]!==a?(T=k.jsxs("div",{className:Li,children:[b,k.jsx(Mo,{items:S,value:a,onValueChange:u,itemToString:cb,itemToIcon:ub,placeholder:"Select provider"})]}),e[25]=u,e[26]=a,e[27]=T):T=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=k.jsx("span",{className:Di,children:"Model"}),e[28]=E):E=e[28];let N;e[29]!==d||e[30]!==i||e[31]!==s||e[32]!==t.modelName||e[33]!==t.provider?(N=k.jsxs("div",{className:Li,children:[E,t.provider?k.jsx(nb,{models:s,isLoading:i,selectedModelName:t.modelName,onSelect:d}):k.jsx("div",{className:dg,style:{color:"var(--gray9)"},children:"Select a provider first"})]}),e[29]=d,e[30]=i,e[31]=s,e[32]=t.modelName,e[33]=t.provider,e[34]=N):N=e[34];let P;e[35]===Symbol.for("react.memo_cache_sentinel")?(P=k.jsx("span",{className:Di,children:"Parameters"}),e[35]=P):P=e[35];const $=t.temperature??1;let R;e[36]!==g?(R=V=>g("temperature",V),e[36]=g,e[37]=R):R=e[37];let I;e[38]!==$||e[39]!==R?(I=k.jsx(Zr,{label:"Temperature",value:$,min:0,max:2,step:.1,onValueChange:R,formatValue:lb}),e[38]=$,e[39]=R,e[40]=I):I=e[40];let j;e[41]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsx("label",{className:qx,children:"Max Tokens"}),e[41]=j):j=e[41];const B=t.maxTokens??"";let M;e[42]!==r||e[43]!==t?(M=V=>{const ce=V.target.value?parseInt(V.target.value,10):void 0;r({...t,maxTokens:ce})},e[42]=r,e[43]=t,e[44]=M):M=e[44];let U;e[45]!==B||e[46]!==M?(U=k.jsxs("div",{className:Hx,children:[j,k.jsx("input",{type:"number",className:Qu,value:B,placeholder:"Default",min:1,onChange:M})]}),e[45]=B,e[46]=M,e[47]=U):U=e[47];const z=t.topP??1;let Z;e[48]!==g?(Z=V=>g("topP",V),e[48]=g,e[49]=Z):Z=e[49];let ne;e[50]!==z||e[51]!==Z?(ne=k.jsx(Zr,{label:"Top P",value:z,min:0,max:1,step:.05,onValueChange:Z,formatValue:ab}),e[50]=z,e[51]=Z,e[52]=ne):ne=e[52];const J=t.frequencyPenalty??0;let q;e[53]!==g?(q=V=>g("frequencyPenalty",V),e[53]=g,e[54]=q):q=e[54];let H;e[55]!==J||e[56]!==q?(H=k.jsx(Zr,{label:"Frequency Penalty",value:J,min:-2,max:2,step:.1,onValueChange:q,formatValue:ob}),e[55]=J,e[56]=q,e[57]=H):H=e[57];const ae=t.presencePenalty??0;let re;e[58]!==g?(re=V=>g("presencePenalty",V),e[58]=g,e[59]=re):re=e[59];let le;e[60]!==ae||e[61]!==re?(le=k.jsx(Zr,{label:"Presence Penalty",value:ae,min:-2,max:2,step:.1,onValueChange:re,formatValue:ib}),e[60]=ae,e[61]=re,e[62]=le):le=e[62];let Q;e[63]!==I||e[64]!==U||e[65]!==ne||e[66]!==H||e[67]!==le?(Q=k.jsxs("div",{className:Li,children:[P,k.jsxs("div",{className:Vx,children:[I,U,ne,H,le]})]}),e[63]=I,e[64]=U,e[65]=ne,e[66]=H,e[67]=le,e[68]=Q):Q=e[68];let te;e[69]!==T||e[70]!==N||e[71]!==Q?(te=k.jsx(tc,{side:"bottom",align:"start",sideOffset:4,positionMethod:"fixed",children:k.jsxs("div",{className:Wx,children:[T,N,Q]})}),e[69]=T,e[70]=N,e[71]=Q,e[72]=te):te=e[72];let ie;return e[73]!==v||e[74]!==te?(ie=k.jsxs(nc,{children:[v,te]}),e[73]=v,e[74]=te,e[75]=ie):ie=e[75],ie}function ib(n){return n.toFixed(1)}function ob(n){return n.toFixed(1)}function ab(n){return n.toFixed(2)}function lb(n){return n.toFixed(1)}function ub(n){return n?.icon?k.jsx("img",{src:n.icon,alt:"",className:Pa}):k.jsx("span",{className:cg,children:n?.label?.charAt(0).toUpperCase()||"?"})}function cb(n){return n?.label||""}const db=n=>{const e=qe.c(48),{form:t,editorKey:r}=n,{setValue:s,control:i}=t;let o;e[0]!==t.control?(o={control:t.control,name:"provider"},e[0]=t.control,e[1]=o):o=e[1];const a=Zt(o);let l;e[2]!==i?(l={control:i,name:"modelName"},e[2]=i,e[3]=l):l=e[3];const c=Zt(l);let u;e[4]!==i?(u={control:i,name:"system_prompt"},e[4]=i,e[5]=u):u=e[5];const f=Zt(u);let d;e[6]!==i?(d={control:i,name:"temperature"},e[6]=i,e[7]=d):d=e[7];const h=Zt(d);let g;e[8]!==i?(g={control:i,name:"maxTokens"},e[8]=i,e[9]=g):g=e[9];const m=Zt(g);let y;e[10]!==i?(y={control:i,name:"topP"},e[10]=i,e[11]=y):y=e[11];const x=Zt(y);let p;e[12]!==i?(p={control:i,name:"frequencyPenalty"},e[12]=i,e[13]=p):p=e[13];const _=Zt(p);let C;e[14]!==i?(C={control:i,name:"presencePenalty"},e[14]=i,e[15]=C):C=e[15];const v=Zt(C),b=a||"",S=c||"";let T;e[16]!==_||e[17]!==m||e[18]!==v||e[19]!==S||e[20]!==b||e[21]!==h||e[22]!==x?(T={provider:b,modelName:S,temperature:h,maxTokens:m,topP:x,frequencyPenalty:_,presencePenalty:v},e[16]=_,e[17]=m,e[18]=v,e[19]=S,e[20]=b,e[21]=h,e[22]=x,e[23]=T):T=e[23];const E=T;let N;e[24]!==_||e[25]!==m||e[26]!==v||e[27]!==c||e[28]!==a||e[29]!==s||e[30]!==h||e[31]!==x?(N=z=>{z.provider!==a&&s("provider",z.provider,{shouldValidate:!0,shouldDirty:!0}),z.modelName!==c&&s("modelName",z.modelName,{shouldValidate:!0,shouldDirty:!0}),z.temperature!==h&&s("temperature",z.temperature,{shouldValidate:!0,shouldDirty:!0}),z.maxTokens!==m&&s("maxTokens",z.maxTokens,{shouldValidate:!0,shouldDirty:!0}),z.topP!==x&&s("topP",z.topP,{shouldValidate:!0,shouldDirty:!0}),z.frequencyPenalty!==_&&s("frequencyPenalty",z.frequencyPenalty,{shouldValidate:!0,shouldDirty:!0}),z.presencePenalty!==v&&s("presencePenalty",z.presencePenalty,{shouldValidate:!0,shouldDirty:!0})},e[24]=_,e[25]=m,e[26]=v,e[27]=c,e[28]=a,e[29]=s,e[30]=h,e[31]=x,e[32]=N):N=e[32];const P=N;let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=k.jsxs("div",{className:Ra,children:[k.jsx(Gu,{icon:Ap,size:"xs"}),k.jsx("span",{children:"Model"})]}),e[33]=$):$=e[33];let R;e[34]!==P||e[35]!==E?(R=k.jsxs("div",{className:Pg,children:[$,k.jsx("div",{className:Ig,children:k.jsx(sb,{value:E,onChange:P})})]}),e[34]=P,e[35]=E,e[36]=R):R=e[36];let I;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx("span",{children:"System"}),e[37]=I):I=e[37];let j;e[38]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsxs("div",{className:Ra,children:[I,k.jsxs("div",{className:Rg,children:[k.jsx(jx,{width:14,height:14}),k.jsx("span",{children:"Markdown Supported"})]})]}),e[38]=j):j=e[38];let B;e[39]!==s?(B=z=>s("system_prompt",z,{shouldValidate:!0,shouldDirty:!0}),e[39]=s,e[40]=B):B=e[40];let M;e[41]!==r||e[42]!==f||e[43]!==B?(M=k.jsxs("div",{className:Og,children:[j,k.jsx(Dx,{value:f,onChange:B},r)]}),e[41]=r,e[42]=f,e[43]=B,e[44]=M):M=e[44];let U;return e[45]!==R||e[46]!==M?(U=k.jsxs("div",{className:Fg,children:[R,M]}),e[45]=R,e[46]=M,e[47]=U):U=e[47],U},fb=["variants-list"],gb=()=>{const n=qe.c(2),e=Yu();let t;return n[0]!==e?(t={mutationFn:hb,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:fb}),e.invalidateQueries({queryKey:zh(s.configId)})}},n[0]=e,n[1]=t):t=n[1],kc(t)};async function hb(n){const t=await(await Fo.v1.configs[":configId"].variants.$post({param:{configId:n.configId},json:{name:n.name,provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}})).json();if("data"in t&&t.data)return t.data}const pb=()=>{const n=qe.c(2),e=Yu();let t;return n[0]!==e?(t={mutationFn:mb,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:Mg(s.variantId)}),e.invalidateQueries({queryKey:["variant",s.variantId]})}},n[0]=e,n[1]=t):t=n[1],kc(t)};async function mb(n){const e=await Fo.v1.variants[":id"].versions.$post({param:{id:n.variantId},json:{provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}}),t=await e.json();if(!e.ok||!("data"in t))throw new Error("message"in t?t.message:"Failed to create variant version");return t.data}function qb(){const{id:n,variant:e}=_g.useParams(),t=vg(),r=gb(),s=pb(),i=$g(),{data:o}=xg(e==="new"?"":e),{data:a}=Uh(n),{data:l}=Lg(e==="new"?"":e),{data:c}=Kh(n),[u,f]=w.useState("new"),[d,h]=w.useState(null),g=e==="new",m=Ng({defaultValues:{variant_name:"",provider:"",modelName:"",system_prompt:"",temperature:void 0,maxTokens:void 0,topP:void 0,frequencyPenalty:void 0,presencePenalty:void 0}}),y=m.formState.isDirty,x=r.isPending||s.isPending||i.isPending,p=l?[...l].sort((b,S)=>S.version-b.version):[];w.useEffect(()=>{if(l&&l.length>0&&!d){const b=a?.find(T=>T.variantId===e),S=c?.find(T=>b&&T.configVariantId===b.id&&T.variantVersionId);if(S?.variantVersionId)h(S.variantVersionId);else{const T=l.reduce((E,N)=>N.version>E.version?N:E);h(T.id)}}},[l,d,a,c,e]),Hh({shouldBlockFn:()=>x?!1:y?!confirm("You have unsaved changes. Are you sure you want to move away from the form?"):!1}),w.useEffect(()=>{if(o&&d&&l){const b=l.find(T=>T.id===d);if(!b)return;const S=typeof b.jsonData=="string"?JSON.parse(b.jsonData):b.jsonData;m.reset({variant_name:o.name||"",provider:b.provider||"",modelName:S?.model||b.modelName||"",system_prompt:S?.system_prompt||"",temperature:S?.temperature,maxTokens:S?.max_tokens,topP:S?.top_p,frequencyPenalty:S?.frequency_penalty,presencePenalty:S?.presence_penalty},{keepDirty:!1}),f(`${o.id}-${d}`)}},[o,d,l]);const _=b=>{const S={system_prompt:b.system_prompt,model:b.modelName};return b.temperature!==void 0&&(S.temperature=b.temperature),b.maxTokens!==void 0&&(S.max_tokens=b.maxTokens),b.topP!==void 0&&(S.top_p=b.topP),b.frequencyPenalty!==void 0&&(S.frequency_penalty=b.frequencyPenalty),b.presencePenalty!==void 0&&(S.presence_penalty=b.presencePenalty),S},C=b=>{if(!a||a.length===0)return b;const S=new Set(a.map(N=>N.name));if(!S.has(b))return b;let T=2,E=`${b} (${T})`;for(;S.has(E);)T++,E=`${b} (${T})`;return E},v=async b=>{const S=m.getValues();if(!(!S.variant_name.trim()||!S.provider||!S.modelName))try{const T=_(S);if(b.mode==="new_variant"||g){const E=b.mode==="new_variant"&&!g?C(S.variant_name):S.variant_name,N=await r.mutateAsync({configId:n,name:E,provider:S.provider,modelName:S.modelName,jsonData:T});b.deployToEnvironment&&b.environmentId&&N&&await i.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.configVariant.id,variantVersionId:N.version.id})}else{const E=await s.mutateAsync({variantId:e,provider:S.provider,modelName:S.modelName,jsonData:T});if(b.deployToEnvironment&&b.environmentId){const N=a?.find(P=>P.variantId===e);N&&E&&await i.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.id,variantVersionId:E.id})}}m.reset(),t({to:"/configs/$id/variants",params:{id:n}})}catch(T){console.error("Error saving variant:",T)}};return k.jsxs("div",{children:[k.jsxs("div",{className:Dg,children:[k.jsx("input",{title:"Variant Name","data-1p-ignore":!0,autoComplete:"off",placeholder:"Variant Name",className:Qu,...m.register("variant_name")}),k.jsxs("div",{className:Bg,children:[!g&&p.length>0&&k.jsx(Mo,{items:p,value:p.find(b=>b.id===d)??null,onValueChange:b=>{(b&&!y||b&&y&&confirm("You have unsaved changes. Switching versions will discard them. Continue?"))&&h(b.id)},placeholder:"Select version...",itemToString:b=>b?`Version ${b.version}`:""}),k.jsx(Jp,{isNewVariant:g,onSave:v,isSaving:x})]})]}),k.jsx("div",{className:jg,children:k.jsx(db,{form:m,editorKey:u})})]})}export{qb as component};