react-tiptap-base-editor 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,248 @@
1
+ function MM(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();var au=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Np={exports:{}},Pl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var hb;function TM(){if(hb)return Pl;hb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,l){var a=null;if(l!==void 0&&(a=""+l),o.key!==void 0&&(a=""+o.key),"key"in o){l={};for(var u in o)u!=="key"&&(l[u]=o[u])}else l=o;return o=l.ref,{$$typeof:t,type:r,key:a,ref:o!==void 0?o:null,props:l}}return Pl.Fragment=e,Pl.jsx=n,Pl.jsxs=n,Pl}var pb;function AM(){return pb||(pb=1,Np.exports=TM()),Np.exports}var w=AM(),Dp={exports:{}},Ce={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var mb;function kM(){if(mb)return Ce;mb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=b&&N[b]||N["@@iterator"],typeof N=="function"?N:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,M={};function T(N,$,J){this.props=N,this.context=$,this.refs=M,this.updater=J||C}T.prototype.isReactComponent={},T.prototype.setState=function(N,$){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,$,"setState")},T.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function k(){}k.prototype=T.prototype;function R(N,$,J){this.props=N,this.context=$,this.refs=M,this.updater=J||C}var D=R.prototype=new k;D.constructor=R,x(D,T.prototype),D.isPureReactComponent=!0;var _=Array.isArray;function j(){}var L={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function Q(N,$,J){var oe=J.ref;return{$$typeof:t,type:N,key:$,ref:oe!==void 0?oe:null,props:J}}function ne(N,$){return Q(N.type,$,N.props)}function re(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function fe(N){var $={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(J){return $[J]})}var ae=/\/+/g;function W(N,$){return typeof N=="object"&&N!==null&&N.key!=null?fe(""+N.key):$.toString(36)}function ie(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(j,j):(N.status="pending",N.then(function($){N.status==="pending"&&(N.status="fulfilled",N.value=$)},function($){N.status==="pending"&&(N.status="rejected",N.reason=$)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function I(N,$,J,oe,ce){var me=typeof N;(me==="undefined"||me==="boolean")&&(N=null);var pe=!1;if(N===null)pe=!0;else switch(me){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(N.$$typeof){case t:case e:pe=!0;break;case p:return pe=N._init,I(pe(N._payload),$,J,oe,ce)}}if(pe)return ce=ce(N),pe=oe===""?"."+W(N,0):oe,_(ce)?(J="",pe!=null&&(J=pe.replace(ae,"$&/")+"/"),I(ce,$,J,"",function(Ut){return Ut})):ce!=null&&(re(ce)&&(ce=ne(ce,J+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(ae,"$&/")+"/")+pe)),$.push(ce)),1;pe=0;var xe=oe===""?".":oe+":";if(_(N))for(var De=0;De<N.length;De++)oe=N[De],me=xe+W(oe,De),pe+=I(oe,$,J,me,ce);else if(De=v(N),typeof De=="function")for(N=De.call(N),De=0;!(oe=N.next()).done;)oe=oe.value,me=xe+W(oe,De++),pe+=I(oe,$,J,me,ce);else if(me==="object"){if(typeof N.then=="function")return I(ie(N),$,J,oe,ce);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return pe}function q(N,$,J){if(N==null)return N;var oe=[],ce=0;return I(N,oe,"","",function(me){return $.call(J,me,ce++)}),oe}function P(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(J){(N._status===0||N._status===-1)&&(N._status=1,N._result=J)},function(J){(N._status===0||N._status===-1)&&(N._status=2,N._result=J)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var Y=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},se={map:q,forEach:function(N,$,J){q(N,function(){$.apply(this,arguments)},J)},count:function(N){var $=0;return q(N,function(){$++}),$},toArray:function(N){return q(N,function($){return $})||[]},only:function(N){if(!re(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ce.Activity=m,Ce.Children=se,Ce.Component=T,Ce.Fragment=n,Ce.Profiler=o,Ce.PureComponent=R,Ce.StrictMode=r,Ce.Suspense=f,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(N){return L.H.useMemoCache(N)}},Ce.cache=function(N){return function(){return N.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(N,$,J){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var oe=x({},N.props),ce=N.key;if($!=null)for(me in $.key!==void 0&&(ce=""+$.key),$)!B.call($,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&$.ref===void 0||(oe[me]=$[me]);var me=arguments.length-2;if(me===1)oe.children=J;else if(1<me){for(var pe=Array(me),xe=0;xe<me;xe++)pe[xe]=arguments[xe+2];oe.children=pe}return Q(N.type,ce,oe)},Ce.createContext=function(N){return N={$$typeof:a,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Ce.createElement=function(N,$,J){var oe,ce={},me=null;if($!=null)for(oe in $.key!==void 0&&(me=""+$.key),$)B.call($,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ce[oe]=$[oe]);var pe=arguments.length-2;if(pe===1)ce.children=J;else if(1<pe){for(var xe=Array(pe),De=0;De<pe;De++)xe[De]=arguments[De+2];ce.children=xe}if(N&&N.defaultProps)for(oe in pe=N.defaultProps,pe)ce[oe]===void 0&&(ce[oe]=pe[oe]);return Q(N,me,ce)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(N){return{$$typeof:u,render:N}},Ce.isValidElement=re,Ce.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:P}},Ce.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},Ce.startTransition=function(N){var $=L.T,J={};L.T=J;try{var oe=N(),ce=L.S;ce!==null&&ce(J,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(j,Y)}catch(me){Y(me)}finally{$!==null&&J.types!==null&&($.types=J.types),L.T=$}},Ce.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ce.use=function(N){return L.H.use(N)},Ce.useActionState=function(N,$,J){return L.H.useActionState(N,$,J)},Ce.useCallback=function(N,$){return L.H.useCallback(N,$)},Ce.useContext=function(N){return L.H.useContext(N)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(N,$){return L.H.useDeferredValue(N,$)},Ce.useEffect=function(N,$){return L.H.useEffect(N,$)},Ce.useEffectEvent=function(N){return L.H.useEffectEvent(N)},Ce.useId=function(){return L.H.useId()},Ce.useImperativeHandle=function(N,$,J){return L.H.useImperativeHandle(N,$,J)},Ce.useInsertionEffect=function(N,$){return L.H.useInsertionEffect(N,$)},Ce.useLayoutEffect=function(N,$){return L.H.useLayoutEffect(N,$)},Ce.useMemo=function(N,$){return L.H.useMemo(N,$)},Ce.useOptimistic=function(N,$){return L.H.useOptimistic(N,$)},Ce.useReducer=function(N,$,J){return L.H.useReducer(N,$,J)},Ce.useRef=function(N){return L.H.useRef(N)},Ce.useState=function(N){return L.H.useState(N)},Ce.useSyncExternalStore=function(N,$,J){return L.H.useSyncExternalStore(N,$,J)},Ce.useTransition=function(){return L.H.useTransition()},Ce.version="19.2.4",Ce}var gb;function Na(){return gb||(gb=1,Dp.exports=kM()),Dp.exports}var S=Na();const Rt=jf(S),_f=MM({__proto__:null,default:Rt},[S]);var Lp={exports:{}},$l={},zp={exports:{}},jp={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var yb;function RM(){return yb||(yb=1,(function(t){function e(I,q){var P=I.length;I.push(q);e:for(;0<P;){var Y=P-1>>>1,se=I[Y];if(0<o(se,q))I[Y]=q,I[P]=se,P=Y;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var q=I[0],P=I.pop();if(P!==q){I[0]=P;e:for(var Y=0,se=I.length,N=se>>>1;Y<N;){var $=2*(Y+1)-1,J=I[$],oe=$+1,ce=I[oe];if(0>o(J,P))oe<se&&0>o(ce,J)?(I[Y]=ce,I[oe]=P,Y=oe):(I[Y]=J,I[$]=P,Y=$);else if(oe<se&&0>o(ce,P))I[Y]=ce,I[oe]=P,Y=oe;else break e}}return q}function o(I,q){var P=I.sortIndex-q.sortIndex;return P!==0?P:I.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var f=[],h=[],p=1,m=null,b=3,v=!1,C=!1,x=!1,M=!1,T=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var q=n(h);q!==null;){if(q.callback===null)r(h);else if(q.startTime<=I)r(h),q.sortIndex=q.expirationTime,e(f,q);else break;q=n(h)}}function _(I){if(x=!1,D(I),!C)if(n(f)!==null)C=!0,j||(j=!0,fe());else{var q=n(h);q!==null&&ie(_,q.startTime-I)}}var j=!1,L=-1,B=5,Q=-1;function ne(){return M?!0:!(t.unstable_now()-Q<B)}function re(){if(M=!1,j){var I=t.unstable_now();Q=I;var q=!0;try{e:{C=!1,x&&(x=!1,k(L),L=-1),v=!0;var P=b;try{t:{for(D(I),m=n(f);m!==null&&!(m.expirationTime>I&&ne());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,b=m.priorityLevel;var se=Y(m.expirationTime<=I);if(I=t.unstable_now(),typeof se=="function"){m.callback=se,D(I),q=!0;break t}m===n(f)&&r(f),D(I)}else r(f);m=n(f)}if(m!==null)q=!0;else{var N=n(h);N!==null&&ie(_,N.startTime-I),q=!1}}break e}finally{m=null,b=P,v=!1}q=void 0}}finally{q?fe():j=!1}}}var fe;if(typeof R=="function")fe=function(){R(re)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,W=ae.port2;ae.port1.onmessage=re,fe=function(){W.postMessage(null)}}else fe=function(){T(re,0)};function ie(I,q){L=T(function(){I(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(I){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var P=b;b=q;try{return I()}finally{b=P}},t.unstable_requestPaint=function(){M=!0},t.unstable_runWithPriority=function(I,q){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var P=b;b=I;try{return q()}finally{b=P}},t.unstable_scheduleCallback=function(I,q,P){var Y=t.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?Y+P:Y):P=Y,I){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=P+se,I={id:p++,callback:q,priorityLevel:I,startTime:P,expirationTime:se,sortIndex:-1},P>Y?(I.sortIndex=P,e(h,I),n(f)===null&&I===n(h)&&(x?(k(L),L=-1):x=!0,ie(_,P-Y))):(I.sortIndex=se,e(f,I),C||v||(C=!0,j||(j=!0,fe()))),I},t.unstable_shouldYield=ne,t.unstable_wrapCallback=function(I){var q=b;return function(){var P=b;b=q;try{return I.apply(this,arguments)}finally{b=P}}}})(jp)),jp}var vb;function OM(){return vb||(vb=1,zp.exports=RM()),zp.exports}var _p={exports:{}},zt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var bb;function NM(){if(bb)return zt;bb=1;var t=Na();function e(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(f,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:m==null?null:""+m,children:f,containerInfo:h,implementation:p}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,zt.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return l(f,h,null,p)},zt.flushSync=function(f){var h=a.T,p=r.p;try{if(a.T=null,r.p=2,f)return f()}finally{a.T=h,r.p=p,r.d.f()}},zt.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},zt.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},zt.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:v}):p==="script"&&r.d.X(f,{crossOrigin:m,integrity:b,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},zt.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},zt.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},zt.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},zt.requestFormReset=function(f){r.d.r(f)},zt.unstable_batchedUpdates=function(f,h){return f(h)},zt.useFormState=function(f,h,p){return a.H.useFormState(f,h,p)},zt.useFormStatus=function(){return a.H.useHostTransitionStatus()},zt.version="19.2.4",zt}var Cb;function Fx(){if(Cb)return _p.exports;Cb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),_p.exports=NM(),_p.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var xb;function DM(){if(xb)return $l;xb=1;var t=OM(),e=Na(),n=Fx();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,c=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(c=s.return),i=s.return;while(i)}return s.tag===3?c:null}function a(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function u(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(l(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var c=i,d=s;;){var g=c.return;if(g===null)break;var y=g.alternate;if(y===null){if(d=g.return,d!==null){c=d;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===c)return f(g),i;if(y===d)return f(g),s;y=y.sibling}throw Error(r(188))}if(c.return!==d.return)c=g,d=y;else{for(var E=!1,A=g.child;A;){if(A===c){E=!0,c=g,d=y;break}if(A===d){E=!0,d=g,c=y;break}A=A.sibling}if(!E){for(A=y.child;A;){if(A===c){E=!0,c=y,d=g;break}if(A===d){E=!0,d=y,c=g;break}A=A.sibling}if(!E)throw Error(r(189))}}if(c.alternate!==d)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),R=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function fe(i){return i===null||typeof i!="object"?null:(i=re&&i[re]||i["@@iterator"],typeof i=="function"?i:null)}var ae=Symbol.for("react.client.reference");function W(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===ae?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case x:return"Fragment";case T:return"Profiler";case M:return"StrictMode";case _:return"Suspense";case j:return"SuspenseList";case Q:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case C:return"Portal";case R:return i.displayName||"Context";case k:return(i._context.displayName||"Context")+".Consumer";case D:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return s=i.displayName||null,s!==null?s:W(i.type)||"Memo";case B:s=i._payload,i=i._init;try{return W(i(s))}catch{}}return null}var ie=Array.isArray,I=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},Y=[],se=-1;function N(i){return{current:i}}function $(i){0>se||(i.current=Y[se],Y[se]=null,se--)}function J(i,s){se++,Y[se]=i.current,i.current=s}var oe=N(null),ce=N(null),me=N(null),pe=N(null);function xe(i,s){switch(J(me,s),J(ce,i),J(oe,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?_v(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=_v(s),i=Iv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(oe),J(oe,i)}function De(){$(oe),$(ce),$(me)}function Ut(i){i.memoizedState!==null&&J(pe,i);var s=oe.current,c=Iv(s,i.type);s!==c&&(J(ce,i),J(oe,c))}function In(i){ce.current===i&&($(oe),$(ce)),pe.current===i&&($(pe),Hl._currentValue=P)}var $i,sr;function lr(i){if($i===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);$i=s&&s[1]||"",sr=-1<c.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+$i+i+sr}var pd=!1;function md(i,s){if(!i||pd)return"";pd=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(K){var F=K}Reflect.construct(i,[],X)}else{try{X.call()}catch(K){F=K}i.call(X.prototype)}}else{try{throw Error()}catch(K){F=K}(X=i())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(K){if(K&&F&&typeof K.stack=="string")return[K.stack,F.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),E=y[0],A=y[1];if(E&&A){var O=E.split(`
44
+ `),V=A.split(`
45
+ `);for(g=d=0;d<O.length&&!O[d].includes("DetermineComponentFrameRoot");)d++;for(;g<V.length&&!V[g].includes("DetermineComponentFrameRoot");)g++;if(d===O.length||g===V.length)for(d=O.length-1,g=V.length-1;1<=d&&0<=g&&O[d]!==V[g];)g--;for(;1<=d&&0<=g;d--,g--)if(O[d]!==V[g]){if(d!==1||g!==1)do if(d--,g--,0>g||O[d]!==V[g]){var G=`
46
+ `+O[d].replace(" at new "," at ");return i.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",i.displayName)),G}while(1<=d&&0<=g);break}}}finally{pd=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?lr(c):""}function nE(i,s){switch(i.tag){case 26:case 27:case 5:return lr(i.type);case 16:return lr("Lazy");case 13:return i.child!==s&&s!==null?lr("Suspense Fallback"):lr("Suspense");case 19:return lr("SuspenseList");case 0:case 15:return md(i.type,!1);case 11:return md(i.type.render,!1);case 1:return md(i.type,!0);case 31:return lr("Activity");default:return""}}function h0(i){try{var s="",c=null;do s+=nE(i,c),c=i,i=i.return;while(i);return s}catch(d){return`
47
+ Error generating stack: `+d.message+`
48
+ `+d.stack}}var gd=Object.prototype.hasOwnProperty,yd=t.unstable_scheduleCallback,vd=t.unstable_cancelCallback,rE=t.unstable_shouldYield,iE=t.unstable_requestPaint,rn=t.unstable_now,oE=t.unstable_getCurrentPriorityLevel,p0=t.unstable_ImmediatePriority,m0=t.unstable_UserBlockingPriority,qa=t.unstable_NormalPriority,sE=t.unstable_LowPriority,g0=t.unstable_IdlePriority,lE=t.log,aE=t.unstable_setDisableYieldValue,Xs=null,on=null;function Fr(i){if(typeof lE=="function"&&aE(i),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(Xs,i)}catch{}}var sn=Math.clz32?Math.clz32:fE,cE=Math.log,uE=Math.LN2;function fE(i){return i>>>=0,i===0?32:31-(cE(i)/uE|0)|0}var Ka=256,Ga=262144,Ya=4194304;function Fi(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Za(i,s,c){var d=i.pendingLanes;if(d===0)return 0;var g=0,y=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var A=d&134217727;return A!==0?(d=A&~y,d!==0?g=Fi(d):(E&=A,E!==0?g=Fi(E):c||(c=A&~i,c!==0&&(g=Fi(c))))):(A=d&~y,A!==0?g=Fi(A):E!==0?g=Fi(E):c||(c=d&~i,c!==0&&(g=Fi(c)))),g===0?0:s!==0&&s!==g&&(s&y)===0&&(y=g&-g,c=s&-s,y>=c||y===32&&(c&4194048)!==0)?s:g}function Qs(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function dE(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function y0(){var i=Ya;return Ya<<=1,(Ya&62914560)===0&&(Ya=4194304),i}function bd(i){for(var s=[],c=0;31>c;c++)s.push(i);return s}function Ws(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function hE(i,s,c,d,g,y){var E=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var A=i.entanglements,O=i.expirationTimes,V=i.hiddenUpdates;for(c=E&~c;0<c;){var G=31-sn(c),X=1<<G;A[G]=0,O[G]=-1;var F=V[G];if(F!==null)for(V[G]=null,G=0;G<F.length;G++){var K=F[G];K!==null&&(K.lane&=-536870913)}c&=~X}d!==0&&v0(i,d,0),y!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=y&~(E&~s))}function v0(i,s,c){i.pendingLanes|=s,i.suspendedLanes&=~s;var d=31-sn(s);i.entangledLanes|=s,i.entanglements[d]=i.entanglements[d]|1073741824|c&261930}function b0(i,s){var c=i.entangledLanes|=s;for(i=i.entanglements;c;){var d=31-sn(c),g=1<<d;g&s|i[d]&s&&(i[d]|=s),c&=~g}}function C0(i,s){var c=s&-s;return c=(c&42)!==0?1:Cd(c),(c&(i.suspendedLanes|s))!==0?0:c}function Cd(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function xd(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function x0(){var i=q.p;return i!==0?i:(i=window.event,i===void 0?32:sb(i.type))}function S0(i,s){var c=q.p;try{return q.p=i,s()}finally{q.p=c}}var qr=Math.random().toString(36).slice(2),xt="__reactFiber$"+qr,Gt="__reactProps$"+qr,zo="__reactContainer$"+qr,Sd="__reactEvents$"+qr,pE="__reactListeners$"+qr,mE="__reactHandles$"+qr,w0="__reactResources$"+qr,Js="__reactMarker$"+qr;function wd(i){delete i[xt],delete i[Gt],delete i[Sd],delete i[pE],delete i[mE]}function jo(i){var s=i[xt];if(s)return s;for(var c=i.parentNode;c;){if(s=c[zo]||c[xt]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(i=Fv(i);i!==null;){if(c=i[xt])return c;i=Fv(i)}return s}i=c,c=i.parentNode}return null}function _o(i){if(i=i[xt]||i[zo]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function el(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Io(i){var s=i[w0];return s||(s=i[w0]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function gt(i){i[Js]=!0}var E0=new Set,M0={};function qi(i,s){Ho(i,s),Ho(i+"Capture",s)}function Ho(i,s){for(M0[i]=s,i=0;i<s.length;i++)E0.add(s[i])}var gE=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),T0={},A0={};function yE(i){return gd.call(A0,i)?!0:gd.call(T0,i)?!1:gE.test(i)?A0[i]=!0:(T0[i]=!0,!1)}function Xa(i,s,c){if(yE(s))if(c===null)i.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+c)}}function Qa(i,s,c){if(c===null)i.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+c)}}function ar(i,s,c,d){if(d===null)i.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(s,c,""+d)}}function vn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function k0(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function vE(i,s,c){var d=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,y=d.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return g.call(this)},set:function(E){c=""+E,y.call(this,E)}}),Object.defineProperty(i,s,{enumerable:d.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ed(i){if(!i._valueTracker){var s=k0(i)?"checked":"value";i._valueTracker=vE(i,s,""+i[s])}}function R0(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var c=s.getValue(),d="";return i&&(d=k0(i)?i.checked?"true":"false":i.value),i=d,i!==c?(s.setValue(i),!0):!1}function Wa(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var bE=/[\n"\\]/g;function bn(i){return i.replace(bE,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Md(i,s,c,d,g,y,E,A){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),s!=null?E==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+vn(s)):i.value!==""+vn(s)&&(i.value=""+vn(s)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),s!=null?Td(i,E,vn(s)):c!=null?Td(i,E,vn(c)):d!=null&&i.removeAttribute("value"),g==null&&y!=null&&(i.defaultChecked=!!y),g!=null&&(i.checked=g&&typeof g!="function"&&typeof g!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.name=""+vn(A):i.removeAttribute("name")}function O0(i,s,c,d,g,y,E,A){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),s!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){Ed(i);return}c=c!=null?""+vn(c):"",s=s!=null?""+vn(s):c,A||s===i.value||(i.value=s),i.defaultValue=s}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,i.checked=A?i.checked:!!d,i.defaultChecked=!!d,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),Ed(i)}function Td(i,s,c){s==="number"&&Wa(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function Bo(i,s,c,d){if(i=i.options,s){s={};for(var g=0;g<c.length;g++)s["$"+c[g]]=!0;for(c=0;c<i.length;c++)g=s.hasOwnProperty("$"+i[c].value),i[c].selected!==g&&(i[c].selected=g),g&&d&&(i[c].defaultSelected=!0)}else{for(c=""+vn(c),s=null,g=0;g<i.length;g++){if(i[g].value===c){i[g].selected=!0,d&&(i[g].defaultSelected=!0);return}s!==null||i[g].disabled||(s=i[g])}s!==null&&(s.selected=!0)}}function N0(i,s,c){if(s!=null&&(s=""+vn(s),s!==i.value&&(i.value=s),c==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=c!=null?""+vn(c):""}function D0(i,s,c,d){if(s==null){if(d!=null){if(c!=null)throw Error(r(92));if(ie(d)){if(1<d.length)throw Error(r(93));d=d[0]}c=d}c==null&&(c=""),s=c}c=vn(s),i.defaultValue=c,d=i.textContent,d===c&&d!==""&&d!==null&&(i.value=d),Ed(i)}function Uo(i,s){if(s){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=s;return}}i.textContent=s}var CE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function L0(i,s,c){var d=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?d?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":d?i.setProperty(s,c):typeof c!="number"||c===0||CE.has(s)?s==="float"?i.cssFloat=c:i[s]=(""+c).trim():i[s]=c+"px"}function z0(i,s,c){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,c!=null){for(var d in c)!c.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?i.setProperty(d,""):d==="float"?i.cssFloat="":i[d]="");for(var g in s)d=s[g],s.hasOwnProperty(g)&&c[g]!==d&&L0(i,g,d)}else for(var y in s)s.hasOwnProperty(y)&&L0(i,y,s[y])}function Ad(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),SE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ja(i){return SE.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function cr(){}var kd=null;function Rd(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Vo=null,Po=null;function j0(i){var s=_o(i);if(s&&(i=s.stateNode)){var c=i[Gt]||null;e:switch(i=s.stateNode,s.type){case"input":if(Md(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+bn(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var d=c[s];if(d!==i&&d.form===i.form){var g=d[Gt]||null;if(!g)throw Error(r(90));Md(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(s=0;s<c.length;s++)d=c[s],d.form===i.form&&R0(d)}break e;case"textarea":N0(i,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&Bo(i,!!c.multiple,s,!1)}}}var Od=!1;function _0(i,s,c){if(Od)return i(s,c);Od=!0;try{var d=i(s);return d}finally{if(Od=!1,(Vo!==null||Po!==null)&&(Uc(),Vo&&(s=Vo,i=Po,Po=Vo=null,j0(s),i)))for(s=0;s<i.length;s++)j0(i[s])}}function tl(i,s){var c=i.stateNode;if(c===null)return null;var d=c[Gt]||null;if(d===null)return null;c=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(i=i.type,d=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!d;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,s,typeof c));return c}var ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nd=!1;if(ur)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){Nd=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{Nd=!1}var Kr=null,Dd=null,ec=null;function I0(){if(ec)return ec;var i,s=Dd,c=s.length,d,g="value"in Kr?Kr.value:Kr.textContent,y=g.length;for(i=0;i<c&&s[i]===g[i];i++);var E=c-i;for(d=1;d<=E&&s[c-d]===g[y-d];d++);return ec=g.slice(i,1<d?1-d:void 0)}function tc(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function nc(){return!0}function H0(){return!1}function Yt(i){function s(c,d,g,y,E){this._reactName=c,this._targetInst=g,this.type=d,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var A in i)i.hasOwnProperty(A)&&(c=i[A],this[A]=c?c(y):y[A]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?nc:H0,this.isPropagationStopped=H0,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=nc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=nc)},persist:function(){},isPersistent:nc}),s}var Ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rc=Yt(Ki),rl=m({},Ki,{view:0,detail:0}),wE=Yt(rl),Ld,zd,il,ic=m({},rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_d,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==il&&(il&&i.type==="mousemove"?(Ld=i.screenX-il.screenX,zd=i.screenY-il.screenY):zd=Ld=0,il=i),Ld)},movementY:function(i){return"movementY"in i?i.movementY:zd}}),B0=Yt(ic),EE=m({},ic,{dataTransfer:0}),ME=Yt(EE),TE=m({},rl,{relatedTarget:0}),jd=Yt(TE),AE=m({},Ki,{animationName:0,elapsedTime:0,pseudoElement:0}),kE=Yt(AE),RE=m({},Ki,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),OE=Yt(RE),NE=m({},Ki,{data:0}),U0=Yt(NE),DE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},zE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jE(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=zE[i])?!!s[i]:!1}function _d(){return jE}var _E=m({},rl,{key:function(i){if(i.key){var s=DE[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=tc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?LE[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_d,charCode:function(i){return i.type==="keypress"?tc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?tc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),IE=Yt(_E),HE=m({},ic,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),V0=Yt(HE),BE=m({},rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_d}),UE=Yt(BE),VE=m({},Ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),PE=Yt(VE),$E=m({},ic,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),FE=Yt($E),qE=m({},Ki,{newState:0,oldState:0}),KE=Yt(qE),GE=[9,13,27,32],Id=ur&&"CompositionEvent"in window,ol=null;ur&&"documentMode"in document&&(ol=document.documentMode);var YE=ur&&"TextEvent"in window&&!ol,P0=ur&&(!Id||ol&&8<ol&&11>=ol),$0=" ",F0=!1;function q0(i,s){switch(i){case"keyup":return GE.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function K0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var $o=!1;function ZE(i,s){switch(i){case"compositionend":return K0(s);case"keypress":return s.which!==32?null:(F0=!0,$0);case"textInput":return i=s.data,i===$0&&F0?null:i;default:return null}}function XE(i,s){if($o)return i==="compositionend"||!Id&&q0(i,s)?(i=I0(),ec=Dd=Kr=null,$o=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return P0&&s.locale!=="ko"?null:s.data;default:return null}}var QE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function G0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!QE[i.type]:s==="textarea"}function Y0(i,s,c,d){Vo?Po?Po.push(d):Po=[d]:Vo=d,s=Gc(s,"onChange"),0<s.length&&(c=new rc("onChange","change",null,c,d),i.push({event:c,listeners:s}))}var sl=null,ll=null;function WE(i){Ov(i,0)}function oc(i){var s=el(i);if(R0(s))return i}function Z0(i,s){if(i==="change")return s}var X0=!1;if(ur){var Hd;if(ur){var Bd="oninput"in document;if(!Bd){var Q0=document.createElement("div");Q0.setAttribute("oninput","return;"),Bd=typeof Q0.oninput=="function"}Hd=Bd}else Hd=!1;X0=Hd&&(!document.documentMode||9<document.documentMode)}function W0(){sl&&(sl.detachEvent("onpropertychange",J0),ll=sl=null)}function J0(i){if(i.propertyName==="value"&&oc(ll)){var s=[];Y0(s,ll,i,Rd(i)),_0(WE,s)}}function JE(i,s,c){i==="focusin"?(W0(),sl=s,ll=c,sl.attachEvent("onpropertychange",J0)):i==="focusout"&&W0()}function e9(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return oc(ll)}function t9(i,s){if(i==="click")return oc(s)}function n9(i,s){if(i==="input"||i==="change")return oc(s)}function r9(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var ln=typeof Object.is=="function"?Object.is:r9;function al(i,s){if(ln(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var c=Object.keys(i),d=Object.keys(s);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var g=c[d];if(!gd.call(s,g)||!ln(i[g],s[g]))return!1}return!0}function e2(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function t2(i,s){var c=e2(i);i=0;for(var d;c;){if(c.nodeType===3){if(d=i+c.textContent.length,i<=s&&d>=s)return{node:c,offset:s-i};i=d}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=e2(c)}}function n2(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?n2(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function r2(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Wa(i.document);s instanceof i.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)i=s.contentWindow;else break;s=Wa(i.document)}return s}function Ud(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var i9=ur&&"documentMode"in document&&11>=document.documentMode,Fo=null,Vd=null,cl=null,Pd=!1;function i2(i,s,c){var d=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Pd||Fo==null||Fo!==Wa(d)||(d=Fo,"selectionStart"in d&&Ud(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),cl&&al(cl,d)||(cl=d,d=Gc(Vd,"onSelect"),0<d.length&&(s=new rc("onSelect","select",null,s,c),i.push({event:s,listeners:d}),s.target=Fo)))}function Gi(i,s){var c={};return c[i.toLowerCase()]=s.toLowerCase(),c["Webkit"+i]="webkit"+s,c["Moz"+i]="moz"+s,c}var qo={animationend:Gi("Animation","AnimationEnd"),animationiteration:Gi("Animation","AnimationIteration"),animationstart:Gi("Animation","AnimationStart"),transitionrun:Gi("Transition","TransitionRun"),transitionstart:Gi("Transition","TransitionStart"),transitioncancel:Gi("Transition","TransitionCancel"),transitionend:Gi("Transition","TransitionEnd")},$d={},o2={};ur&&(o2=document.createElement("div").style,"AnimationEvent"in window||(delete qo.animationend.animation,delete qo.animationiteration.animation,delete qo.animationstart.animation),"TransitionEvent"in window||delete qo.transitionend.transition);function Yi(i){if($d[i])return $d[i];if(!qo[i])return i;var s=qo[i],c;for(c in s)if(s.hasOwnProperty(c)&&c in o2)return $d[i]=s[c];return i}var s2=Yi("animationend"),l2=Yi("animationiteration"),a2=Yi("animationstart"),o9=Yi("transitionrun"),s9=Yi("transitionstart"),l9=Yi("transitioncancel"),c2=Yi("transitionend"),u2=new Map,Fd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Fd.push("scrollEnd");function Hn(i,s){u2.set(i,s),qi(s,[i])}var sc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Cn=[],Ko=0,qd=0;function lc(){for(var i=Ko,s=qd=Ko=0;s<i;){var c=Cn[s];Cn[s++]=null;var d=Cn[s];Cn[s++]=null;var g=Cn[s];Cn[s++]=null;var y=Cn[s];if(Cn[s++]=null,d!==null&&g!==null){var E=d.pending;E===null?g.next=g:(g.next=E.next,E.next=g),d.pending=g}y!==0&&f2(c,g,y)}}function ac(i,s,c,d){Cn[Ko++]=i,Cn[Ko++]=s,Cn[Ko++]=c,Cn[Ko++]=d,qd|=d,i.lanes|=d,i=i.alternate,i!==null&&(i.lanes|=d)}function Kd(i,s,c,d){return ac(i,s,c,d),cc(i)}function Zi(i,s){return ac(i,null,null,s),cc(i)}function f2(i,s,c){i.lanes|=c;var d=i.alternate;d!==null&&(d.lanes|=c);for(var g=!1,y=i.return;y!==null;)y.childLanes|=c,d=y.alternate,d!==null&&(d.childLanes|=c),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(g=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,g&&s!==null&&(g=31-sn(c),i=y.hiddenUpdates,d=i[g],d===null?i[g]=[s]:d.push(s),s.lane=c|536870912),y):null}function cc(i){if(50<Nl)throw Nl=0,tp=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Go={};function a9(i,s,c,d){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(i,s,c,d){return new a9(i,s,c,d)}function Gd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function fr(i,s){var c=i.alternate;return c===null?(c=an(i.tag,s,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=s,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,s=i.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function d2(i,s){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,s=c.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function uc(i,s,c,d,g,y){var E=0;if(d=i,typeof i=="function")Gd(i)&&(E=1);else if(typeof i=="string")E=hM(i,c,oe.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Q:return i=an(31,c,s,g),i.elementType=Q,i.lanes=y,i;case x:return Xi(c.children,g,y,s);case M:E=8,g|=24;break;case T:return i=an(12,c,s,g|2),i.elementType=T,i.lanes=y,i;case _:return i=an(13,c,s,g),i.elementType=_,i.lanes=y,i;case j:return i=an(19,c,s,g),i.elementType=j,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:E=10;break e;case k:E=9;break e;case D:E=11;break e;case L:E=14;break e;case B:E=16,d=null;break e}E=29,c=Error(r(130,i===null?"null":typeof i,"")),d=null}return s=an(E,c,s,g),s.elementType=i,s.type=d,s.lanes=y,s}function Xi(i,s,c,d){return i=an(7,i,d,s),i.lanes=c,i}function Yd(i,s,c){return i=an(6,i,null,s),i.lanes=c,i}function h2(i){var s=an(18,null,null,0);return s.stateNode=i,s}function Zd(i,s,c){return s=an(4,i.children!==null?i.children:[],i.key,s),s.lanes=c,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var p2=new WeakMap;function xn(i,s){if(typeof i=="object"&&i!==null){var c=p2.get(i);return c!==void 0?c:(s={value:i,source:s,stack:h0(s)},p2.set(i,s),s)}return{value:i,source:s,stack:h0(s)}}var Yo=[],Zo=0,fc=null,ul=0,Sn=[],wn=0,Gr=null,qn=1,Kn="";function dr(i,s){Yo[Zo++]=ul,Yo[Zo++]=fc,fc=i,ul=s}function m2(i,s,c){Sn[wn++]=qn,Sn[wn++]=Kn,Sn[wn++]=Gr,Gr=i;var d=qn;i=Kn;var g=32-sn(d)-1;d&=~(1<<g),c+=1;var y=32-sn(s)+g;if(30<y){var E=g-g%5;y=(d&(1<<E)-1).toString(32),d>>=E,g-=E,qn=1<<32-sn(s)+g|c<<g|d,Kn=y+i}else qn=1<<y|c<<g|d,Kn=i}function Xd(i){i.return!==null&&(dr(i,1),m2(i,1,0))}function Qd(i){for(;i===fc;)fc=Yo[--Zo],Yo[Zo]=null,ul=Yo[--Zo],Yo[Zo]=null;for(;i===Gr;)Gr=Sn[--wn],Sn[wn]=null,Kn=Sn[--wn],Sn[wn]=null,qn=Sn[--wn],Sn[wn]=null}function g2(i,s){Sn[wn++]=qn,Sn[wn++]=Kn,Sn[wn++]=Gr,qn=s.id,Kn=s.overflow,Gr=i}var St=null,Ge=null,Ne=!1,Yr=null,En=!1,Wd=Error(r(519));function Zr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fl(xn(s,i)),Wd}function y2(i){var s=i.stateNode,c=i.type,d=i.memoizedProps;switch(s[xt]=i,s[Gt]=d,c){case"dialog":ke("cancel",s),ke("close",s);break;case"iframe":case"object":case"embed":ke("load",s);break;case"video":case"audio":for(c=0;c<Ll.length;c++)ke(Ll[c],s);break;case"source":ke("error",s);break;case"img":case"image":case"link":ke("error",s),ke("load",s);break;case"details":ke("toggle",s);break;case"input":ke("invalid",s),O0(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":ke("invalid",s);break;case"textarea":ke("invalid",s),D0(s,d.value,d.defaultValue,d.children)}c=d.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||d.suppressHydrationWarning===!0||zv(s.textContent,c)?(d.popover!=null&&(ke("beforetoggle",s),ke("toggle",s)),d.onScroll!=null&&ke("scroll",s),d.onScrollEnd!=null&&ke("scrollend",s),d.onClick!=null&&(s.onclick=cr),s=!0):s=!1,s||Zr(i,!0)}function v2(i){for(St=i.return;St;)switch(St.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:St=St.return}}function Xo(i){if(i!==St)return!1;if(!Ne)return v2(i),Ne=!0,!1;var s=i.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||gp(i.type,i.memoizedProps)),c=!c),c&&Ge&&Zr(i),v2(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ge=$v(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ge=$v(i)}else s===27?(s=Ge,ci(i.type)?(i=xp,xp=null,Ge=i):Ge=s):Ge=St?Tn(i.stateNode.nextSibling):null;return!0}function Qi(){Ge=St=null,Ne=!1}function Jd(){var i=Yr;return i!==null&&(Wt===null?Wt=i:Wt.push.apply(Wt,i),Yr=null),i}function fl(i){Yr===null?Yr=[i]:Yr.push(i)}var eh=N(null),Wi=null,hr=null;function Xr(i,s,c){J(eh,s._currentValue),s._currentValue=c}function pr(i){i._currentValue=eh.current,$(eh)}function th(i,s,c){for(;i!==null;){var d=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),i===c)break;i=i.return}}function nh(i,s,c,d){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var y=g.dependencies;if(y!==null){var E=g.child;y=y.firstContext;e:for(;y!==null;){var A=y;y=g;for(var O=0;O<s.length;O++)if(A.context===s[O]){y.lanes|=c,A=y.alternate,A!==null&&(A.lanes|=c),th(y.return,c,i),d||(E=null);break e}y=A.next}}else if(g.tag===18){if(E=g.return,E===null)throw Error(r(341));E.lanes|=c,y=E.alternate,y!==null&&(y.lanes|=c),th(E,c,i),E=null}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===i){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}}function Qo(i,s,c,d){i=null;for(var g=s,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var E=g.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var A=g.type;ln(g.pendingProps.value,E.value)||(i!==null?i.push(A):i=[A])}}else if(g===pe.current){if(E=g.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(Hl):i=[Hl])}g=g.return}i!==null&&nh(s,i,c,d),s.flags|=262144}function dc(i){for(i=i.firstContext;i!==null;){if(!ln(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ji(i){Wi=i,hr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function wt(i){return b2(Wi,i)}function hc(i,s){return Wi===null&&Ji(i),b2(i,s)}function b2(i,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},hr===null){if(i===null)throw Error(r(308));hr=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else hr=hr.next=s;return c}var c9=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(c,d){i.push(d)}};this.abort=function(){s.aborted=!0,i.forEach(function(c){return c()})}},u9=t.unstable_scheduleCallback,f9=t.unstable_NormalPriority,at={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rh(){return{controller:new c9,data:new Map,refCount:0}}function dl(i){i.refCount--,i.refCount===0&&u9(f9,function(){i.controller.abort()})}var hl=null,ih=0,Wo=0,Jo=null;function d9(i,s){if(hl===null){var c=hl=[];ih=0,Wo=lp(),Jo={status:"pending",value:void 0,then:function(d){c.push(d)}}}return ih++,s.then(C2,C2),s}function C2(){if(--ih===0&&hl!==null){Jo!==null&&(Jo.status="fulfilled");var i=hl;hl=null,Wo=0,Jo=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function h9(i,s){var c=[],d={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return i.then(function(){d.status="fulfilled",d.value=s;for(var g=0;g<c.length;g++)(0,c[g])(s)},function(g){for(d.status="rejected",d.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),d}var x2=I.S;I.S=function(i,s){iv=rn(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&d9(i,s),x2!==null&&x2(i,s)};var eo=N(null);function oh(){var i=eo.current;return i!==null?i:Fe.pooledCache}function pc(i,s){s===null?J(eo,eo.current):J(eo,s.pool)}function S2(){var i=oh();return i===null?null:{parent:at._currentValue,pool:i}}var es=Error(r(460)),sh=Error(r(474)),mc=Error(r(542)),gc={then:function(){}};function w2(i){return i=i.status,i==="fulfilled"||i==="rejected"}function E2(i,s,c){switch(c=i[c],c===void 0?i.push(s):c!==s&&(s.then(cr,cr),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,T2(i),i;default:if(typeof s.status=="string")s.then(cr,cr);else{if(i=Fe,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(d){if(s.status==="pending"){var g=s;g.status="fulfilled",g.value=d}},function(d){if(s.status==="pending"){var g=s;g.status="rejected",g.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,T2(i),i}throw no=s,es}}function to(i){try{var s=i._init;return s(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(no=c,es):c}}var no=null;function M2(){if(no===null)throw Error(r(459));var i=no;return no=null,i}function T2(i){if(i===es||i===mc)throw Error(r(483))}var ts=null,pl=0;function yc(i){var s=pl;return pl+=1,ts===null&&(ts=[]),E2(ts,i,s)}function ml(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function vc(i,s){throw s.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function A2(i){function s(H,z){if(i){var U=H.deletions;U===null?(H.deletions=[z],H.flags|=16):U.push(z)}}function c(H,z){if(!i)return null;for(;z!==null;)s(H,z),z=z.sibling;return null}function d(H){for(var z=new Map;H!==null;)H.key!==null?z.set(H.key,H):z.set(H.index,H),H=H.sibling;return z}function g(H,z){return H=fr(H,z),H.index=0,H.sibling=null,H}function y(H,z,U){return H.index=U,i?(U=H.alternate,U!==null?(U=U.index,U<z?(H.flags|=67108866,z):U):(H.flags|=67108866,z)):(H.flags|=1048576,z)}function E(H){return i&&H.alternate===null&&(H.flags|=67108866),H}function A(H,z,U,Z){return z===null||z.tag!==6?(z=Yd(U,H.mode,Z),z.return=H,z):(z=g(z,U),z.return=H,z)}function O(H,z,U,Z){var ye=U.type;return ye===x?G(H,z,U.props.children,Z,U.key):z!==null&&(z.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===B&&to(ye)===z.type)?(z=g(z,U.props),ml(z,U),z.return=H,z):(z=uc(U.type,U.key,U.props,null,H.mode,Z),ml(z,U),z.return=H,z)}function V(H,z,U,Z){return z===null||z.tag!==4||z.stateNode.containerInfo!==U.containerInfo||z.stateNode.implementation!==U.implementation?(z=Zd(U,H.mode,Z),z.return=H,z):(z=g(z,U.children||[]),z.return=H,z)}function G(H,z,U,Z,ye){return z===null||z.tag!==7?(z=Xi(U,H.mode,Z,ye),z.return=H,z):(z=g(z,U),z.return=H,z)}function X(H,z,U){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Yd(""+z,H.mode,U),z.return=H,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case v:return U=uc(z.type,z.key,z.props,null,H.mode,U),ml(U,z),U.return=H,U;case C:return z=Zd(z,H.mode,U),z.return=H,z;case B:return z=to(z),X(H,z,U)}if(ie(z)||fe(z))return z=Xi(z,H.mode,U,null),z.return=H,z;if(typeof z.then=="function")return X(H,yc(z),U);if(z.$$typeof===R)return X(H,hc(H,z),U);vc(H,z)}return null}function F(H,z,U,Z){var ye=z!==null?z.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ye!==null?null:A(H,z,""+U,Z);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case v:return U.key===ye?O(H,z,U,Z):null;case C:return U.key===ye?V(H,z,U,Z):null;case B:return U=to(U),F(H,z,U,Z)}if(ie(U)||fe(U))return ye!==null?null:G(H,z,U,Z,null);if(typeof U.then=="function")return F(H,z,yc(U),Z);if(U.$$typeof===R)return F(H,z,hc(H,U),Z);vc(H,U)}return null}function K(H,z,U,Z,ye){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return H=H.get(U)||null,A(z,H,""+Z,ye);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return H=H.get(Z.key===null?U:Z.key)||null,O(z,H,Z,ye);case C:return H=H.get(Z.key===null?U:Z.key)||null,V(z,H,Z,ye);case B:return Z=to(Z),K(H,z,U,Z,ye)}if(ie(Z)||fe(Z))return H=H.get(U)||null,G(z,H,Z,ye,null);if(typeof Z.then=="function")return K(H,z,U,yc(Z),ye);if(Z.$$typeof===R)return K(H,z,U,hc(z,Z),ye);vc(z,Z)}return null}function ue(H,z,U,Z){for(var ye=null,Le=null,he=z,we=z=0,Oe=null;he!==null&&we<U.length;we++){he.index>we?(Oe=he,he=null):Oe=he.sibling;var ze=F(H,he,U[we],Z);if(ze===null){he===null&&(he=Oe);break}i&&he&&ze.alternate===null&&s(H,he),z=y(ze,z,we),Le===null?ye=ze:Le.sibling=ze,Le=ze,he=Oe}if(we===U.length)return c(H,he),Ne&&dr(H,we),ye;if(he===null){for(;we<U.length;we++)he=X(H,U[we],Z),he!==null&&(z=y(he,z,we),Le===null?ye=he:Le.sibling=he,Le=he);return Ne&&dr(H,we),ye}for(he=d(he);we<U.length;we++)Oe=K(he,H,we,U[we],Z),Oe!==null&&(i&&Oe.alternate!==null&&he.delete(Oe.key===null?we:Oe.key),z=y(Oe,z,we),Le===null?ye=Oe:Le.sibling=Oe,Le=Oe);return i&&he.forEach(function(pi){return s(H,pi)}),Ne&&dr(H,we),ye}function be(H,z,U,Z){if(U==null)throw Error(r(151));for(var ye=null,Le=null,he=z,we=z=0,Oe=null,ze=U.next();he!==null&&!ze.done;we++,ze=U.next()){he.index>we?(Oe=he,he=null):Oe=he.sibling;var pi=F(H,he,ze.value,Z);if(pi===null){he===null&&(he=Oe);break}i&&he&&pi.alternate===null&&s(H,he),z=y(pi,z,we),Le===null?ye=pi:Le.sibling=pi,Le=pi,he=Oe}if(ze.done)return c(H,he),Ne&&dr(H,we),ye;if(he===null){for(;!ze.done;we++,ze=U.next())ze=X(H,ze.value,Z),ze!==null&&(z=y(ze,z,we),Le===null?ye=ze:Le.sibling=ze,Le=ze);return Ne&&dr(H,we),ye}for(he=d(he);!ze.done;we++,ze=U.next())ze=K(he,H,we,ze.value,Z),ze!==null&&(i&&ze.alternate!==null&&he.delete(ze.key===null?we:ze.key),z=y(ze,z,we),Le===null?ye=ze:Le.sibling=ze,Le=ze);return i&&he.forEach(function(EM){return s(H,EM)}),Ne&&dr(H,we),ye}function Pe(H,z,U,Z){if(typeof U=="object"&&U!==null&&U.type===x&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case v:e:{for(var ye=U.key;z!==null;){if(z.key===ye){if(ye=U.type,ye===x){if(z.tag===7){c(H,z.sibling),Z=g(z,U.props.children),Z.return=H,H=Z;break e}}else if(z.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===B&&to(ye)===z.type){c(H,z.sibling),Z=g(z,U.props),ml(Z,U),Z.return=H,H=Z;break e}c(H,z);break}else s(H,z);z=z.sibling}U.type===x?(Z=Xi(U.props.children,H.mode,Z,U.key),Z.return=H,H=Z):(Z=uc(U.type,U.key,U.props,null,H.mode,Z),ml(Z,U),Z.return=H,H=Z)}return E(H);case C:e:{for(ye=U.key;z!==null;){if(z.key===ye)if(z.tag===4&&z.stateNode.containerInfo===U.containerInfo&&z.stateNode.implementation===U.implementation){c(H,z.sibling),Z=g(z,U.children||[]),Z.return=H,H=Z;break e}else{c(H,z);break}else s(H,z);z=z.sibling}Z=Zd(U,H.mode,Z),Z.return=H,H=Z}return E(H);case B:return U=to(U),Pe(H,z,U,Z)}if(ie(U))return ue(H,z,U,Z);if(fe(U)){if(ye=fe(U),typeof ye!="function")throw Error(r(150));return U=ye.call(U),be(H,z,U,Z)}if(typeof U.then=="function")return Pe(H,z,yc(U),Z);if(U.$$typeof===R)return Pe(H,z,hc(H,U),Z);vc(H,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,z!==null&&z.tag===6?(c(H,z.sibling),Z=g(z,U),Z.return=H,H=Z):(c(H,z),Z=Yd(U,H.mode,Z),Z.return=H,H=Z),E(H)):c(H,z)}return function(H,z,U,Z){try{pl=0;var ye=Pe(H,z,U,Z);return ts=null,ye}catch(he){if(he===es||he===mc)throw he;var Le=an(29,he,null,H.mode);return Le.lanes=Z,Le.return=H,Le}finally{}}}var ro=A2(!0),k2=A2(!1),Qr=!1;function lh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ah(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Wr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Jr(i,s,c){var d=i.updateQueue;if(d===null)return null;if(d=d.shared,(je&2)!==0){var g=d.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),d.pending=s,s=cc(i),f2(i,null,c),s}return ac(i,d,s,c),cc(i)}function gl(i,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var d=s.lanes;d&=i.pendingLanes,c|=d,s.lanes=c,b0(i,c)}}function ch(i,s){var c=i.updateQueue,d=i.alternate;if(d!==null&&(d=d.updateQueue,c===d)){var g=null,y=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};y===null?g=y=E:y=y.next=E,c=c.next}while(c!==null);y===null?g=y=s:y=y.next=s}else g=y=s;c={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=s}var uh=!1;function yl(){if(uh){var i=Jo;if(i!==null)throw i}}function vl(i,s,c,d){uh=!1;var g=i.updateQueue;Qr=!1;var y=g.firstBaseUpdate,E=g.lastBaseUpdate,A=g.shared.pending;if(A!==null){g.shared.pending=null;var O=A,V=O.next;O.next=null,E===null?y=V:E.next=V,E=O;var G=i.alternate;G!==null&&(G=G.updateQueue,A=G.lastBaseUpdate,A!==E&&(A===null?G.firstBaseUpdate=V:A.next=V,G.lastBaseUpdate=O))}if(y!==null){var X=g.baseState;E=0,G=V=O=null,A=y;do{var F=A.lane&-536870913,K=F!==A.lane;if(K?(Re&F)===F:(d&F)===F){F!==0&&F===Wo&&(uh=!0),G!==null&&(G=G.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var ue=i,be=A;F=s;var Pe=c;switch(be.tag){case 1:if(ue=be.payload,typeof ue=="function"){X=ue.call(Pe,X,F);break e}X=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=be.payload,F=typeof ue=="function"?ue.call(Pe,X,F):ue,F==null)break e;X=m({},X,F);break e;case 2:Qr=!0}}F=A.callback,F!==null&&(i.flags|=64,K&&(i.flags|=8192),K=g.callbacks,K===null?g.callbacks=[F]:K.push(F))}else K={lane:F,tag:A.tag,payload:A.payload,callback:A.callback,next:null},G===null?(V=G=K,O=X):G=G.next=K,E|=F;if(A=A.next,A===null){if(A=g.shared.pending,A===null)break;K=A,A=K.next,K.next=null,g.lastBaseUpdate=K,g.shared.pending=null}}while(!0);G===null&&(O=X),g.baseState=O,g.firstBaseUpdate=V,g.lastBaseUpdate=G,y===null&&(g.shared.lanes=0),ii|=E,i.lanes=E,i.memoizedState=X}}function R2(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function O2(i,s){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)R2(c[i],s)}var ns=N(null),bc=N(0);function N2(i,s){i=wr,J(bc,i),J(ns,s),wr=i|s.baseLanes}function fh(){J(bc,wr),J(ns,ns.current)}function dh(){wr=bc.current,$(ns),$(bc)}var cn=N(null),Mn=null;function ei(i){var s=i.alternate;J(st,st.current&1),J(cn,i),Mn===null&&(s===null||ns.current!==null||s.memoizedState!==null)&&(Mn=i)}function hh(i){J(st,st.current),J(cn,i),Mn===null&&(Mn=i)}function D2(i){i.tag===22?(J(st,st.current),J(cn,i),Mn===null&&(Mn=i)):ti()}function ti(){J(st,st.current),J(cn,cn.current)}function un(i){$(cn),Mn===i&&(Mn=null),$(st)}var st=N(0);function Cc(i){for(var s=i;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||bp(c)||Cp(c)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var mr=0,Se=null,Ue=null,ct=null,xc=!1,rs=!1,io=!1,Sc=0,bl=0,is=null,p9=0;function tt(){throw Error(r(321))}function ph(i,s){if(s===null)return!1;for(var c=0;c<s.length&&c<i.length;c++)if(!ln(i[c],s[c]))return!1;return!0}function mh(i,s,c,d,g,y){return mr=y,Se=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,I.H=i===null||i.memoizedState===null?my:Oh,io=!1,y=c(d,g),io=!1,rs&&(y=z2(s,c,d,g)),L2(i),y}function L2(i){I.H=Sl;var s=Ue!==null&&Ue.next!==null;if(mr=0,ct=Ue=Se=null,xc=!1,bl=0,is=null,s)throw Error(r(300));i===null||ut||(i=i.dependencies,i!==null&&dc(i)&&(ut=!0))}function z2(i,s,c,d){Se=i;var g=0;do{if(rs&&(is=null),bl=0,rs=!1,25<=g)throw Error(r(301));if(g+=1,ct=Ue=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}I.H=gy,y=s(c,d)}while(rs);return y}function m9(){var i=I.H,s=i.useState()[0];return s=typeof s.then=="function"?Cl(s):s,i=i.useState()[0],(Ue!==null?Ue.memoizedState:null)!==i&&(Se.flags|=1024),s}function gh(){var i=Sc!==0;return Sc=0,i}function yh(i,s,c){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~c}function vh(i){if(xc){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}xc=!1}mr=0,ct=Ue=Se=null,rs=!1,bl=Sc=0,is=null}function Vt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?Se.memoizedState=ct=i:ct=ct.next=i,ct}function lt(){if(Ue===null){var i=Se.alternate;i=i!==null?i.memoizedState:null}else i=Ue.next;var s=ct===null?Se.memoizedState:ct.next;if(s!==null)ct=s,Ue=i;else{if(i===null)throw Se.alternate===null?Error(r(467)):Error(r(310));Ue=i,i={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},ct===null?Se.memoizedState=ct=i:ct=ct.next=i}return ct}function wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cl(i){var s=bl;return bl+=1,is===null&&(is=[]),i=E2(is,i,s),s=Se,(ct===null?s.memoizedState:ct.next)===null&&(s=s.alternate,I.H=s===null||s.memoizedState===null?my:Oh),i}function Ec(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Cl(i);if(i.$$typeof===R)return wt(i)}throw Error(r(438,String(i)))}function bh(i){var s=null,c=Se.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var d=Se.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(g){return g.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=wc(),Se.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(i),d=0;d<i;d++)c[d]=ne;return s.index++,c}function gr(i,s){return typeof s=="function"?s(i):s}function Mc(i){var s=lt();return Ch(s,Ue,i)}function Ch(i,s,c){var d=i.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=c;var g=i.baseQueue,y=d.pending;if(y!==null){if(g!==null){var E=g.next;g.next=y.next,y.next=E}s.baseQueue=g=y,d.pending=null}if(y=i.baseState,g===null)i.memoizedState=y;else{s=g.next;var A=E=null,O=null,V=s,G=!1;do{var X=V.lane&-536870913;if(X!==V.lane?(Re&X)===X:(mr&X)===X){var F=V.revertLane;if(F===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),X===Wo&&(G=!0);else if((mr&F)===F){V=V.next,F===Wo&&(G=!0);continue}else X={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},O===null?(A=O=X,E=y):O=O.next=X,Se.lanes|=F,ii|=F;X=V.action,io&&c(y,X),y=V.hasEagerState?V.eagerState:c(y,X)}else F={lane:X,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},O===null?(A=O=F,E=y):O=O.next=F,Se.lanes|=X,ii|=X;V=V.next}while(V!==null&&V!==s);if(O===null?E=y:O.next=A,!ln(y,i.memoizedState)&&(ut=!0,G&&(c=Jo,c!==null)))throw c;i.memoizedState=y,i.baseState=E,i.baseQueue=O,d.lastRenderedState=y}return g===null&&(d.lanes=0),[i.memoizedState,d.dispatch]}function xh(i){var s=lt(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var d=c.dispatch,g=c.pending,y=s.memoizedState;if(g!==null){c.pending=null;var E=g=g.next;do y=i(y,E.action),E=E.next;while(E!==g);ln(y,s.memoizedState)||(ut=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),c.lastRenderedState=y}return[y,d]}function j2(i,s,c){var d=Se,g=lt(),y=Ne;if(y){if(c===void 0)throw Error(r(407));c=c()}else c=s();var E=!ln((Ue||g).memoizedState,c);if(E&&(g.memoizedState=c,ut=!0),g=g.queue,Eh(H2.bind(null,d,g,i),[i]),g.getSnapshot!==s||E||ct!==null&&ct.memoizedState.tag&1){if(d.flags|=2048,ss(9,{destroy:void 0},I2.bind(null,d,g,c,s),null),Fe===null)throw Error(r(349));y||(mr&127)!==0||_2(d,s,c)}return c}function _2(i,s,c){i.flags|=16384,i={getSnapshot:s,value:c},s=Se.updateQueue,s===null?(s=wc(),Se.updateQueue=s,s.stores=[i]):(c=s.stores,c===null?s.stores=[i]:c.push(i))}function I2(i,s,c,d){s.value=c,s.getSnapshot=d,B2(s)&&U2(i)}function H2(i,s,c){return c(function(){B2(s)&&U2(i)})}function B2(i){var s=i.getSnapshot;i=i.value;try{var c=s();return!ln(i,c)}catch{return!0}}function U2(i){var s=Zi(i,2);s!==null&&Jt(s,i,2)}function Sh(i){var s=Vt();if(typeof i=="function"){var c=i;if(i=c(),io){Fr(!0);try{c()}finally{Fr(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:i},s}function V2(i,s,c,d){return i.baseState=c,Ch(i,Ue,typeof d=="function"?d:gr)}function g9(i,s,c,d,g){if(kc(i))throw Error(r(485));if(i=s.action,i!==null){var y={payload:g,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){y.listeners.push(E)}};I.T!==null?c(!0):y.isTransition=!1,d(y),c=s.pending,c===null?(y.next=s.pending=y,P2(s,y)):(y.next=c.next,s.pending=c.next=y)}}function P2(i,s){var c=s.action,d=s.payload,g=i.state;if(s.isTransition){var y=I.T,E={};I.T=E;try{var A=c(g,d),O=I.S;O!==null&&O(E,A),$2(i,s,A)}catch(V){wh(i,s,V)}finally{y!==null&&E.types!==null&&(y.types=E.types),I.T=y}}else try{y=c(g,d),$2(i,s,y)}catch(V){wh(i,s,V)}}function $2(i,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(d){F2(i,s,d)},function(d){return wh(i,s,d)}):F2(i,s,c)}function F2(i,s,c){s.status="fulfilled",s.value=c,q2(s),i.state=c,s=i.pending,s!==null&&(c=s.next,c===s?i.pending=null:(c=c.next,s.next=c,P2(i,c)))}function wh(i,s,c){var d=i.pending;if(i.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=c,q2(s),s=s.next;while(s!==d)}i.action=null}function q2(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function K2(i,s){return s}function G2(i,s){if(Ne){var c=Fe.formState;if(c!==null){e:{var d=Se;if(Ne){if(Ge){t:{for(var g=Ge,y=En;g.nodeType!==8;){if(!y){g=null;break t}if(g=Tn(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){Ge=Tn(g.nextSibling),d=g.data==="F!";break e}}Zr(d)}d=!1}d&&(s=c[0])}}return c=Vt(),c.memoizedState=c.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:K2,lastRenderedState:s},c.queue=d,c=dy.bind(null,Se,d),d.dispatch=c,d=Sh(!1),y=Rh.bind(null,Se,!1,d.queue),d=Vt(),g={state:s,dispatch:null,action:i,pending:null},d.queue=g,c=g9.bind(null,Se,g,y,c),g.dispatch=c,d.memoizedState=i,[s,c,!1]}function Y2(i){var s=lt();return Z2(s,Ue,i)}function Z2(i,s,c){if(s=Ch(i,s,K2)[0],i=Mc(gr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=Cl(s)}catch(E){throw E===es?mc:E}else d=s;s=lt();var g=s.queue,y=g.dispatch;return c!==s.memoizedState&&(Se.flags|=2048,ss(9,{destroy:void 0},y9.bind(null,g,c),null)),[d,y,i]}function y9(i,s){i.action=s}function X2(i){var s=lt(),c=Ue;if(c!==null)return Z2(s,c,i);lt(),s=s.memoizedState,c=lt();var d=c.queue.dispatch;return c.memoizedState=i,[s,d,!1]}function ss(i,s,c,d){return i={tag:i,create:c,deps:d,inst:s,next:null},s=Se.updateQueue,s===null&&(s=wc(),Se.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=i.next=i:(d=c.next,c.next=i,i.next=d,s.lastEffect=i),i}function Q2(){return lt().memoizedState}function Tc(i,s,c,d){var g=Vt();Se.flags|=i,g.memoizedState=ss(1|s,{destroy:void 0},c,d===void 0?null:d)}function Ac(i,s,c,d){var g=lt();d=d===void 0?null:d;var y=g.memoizedState.inst;Ue!==null&&d!==null&&ph(d,Ue.memoizedState.deps)?g.memoizedState=ss(s,y,c,d):(Se.flags|=i,g.memoizedState=ss(1|s,y,c,d))}function W2(i,s){Tc(8390656,8,i,s)}function Eh(i,s){Ac(2048,8,i,s)}function v9(i){Se.flags|=4;var s=Se.updateQueue;if(s===null)s=wc(),Se.updateQueue=s,s.events=[i];else{var c=s.events;c===null?s.events=[i]:c.push(i)}}function J2(i){var s=lt().memoizedState;return v9({ref:s,nextImpl:i}),function(){if((je&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function ey(i,s){return Ac(4,2,i,s)}function ty(i,s){return Ac(4,4,i,s)}function ny(i,s){if(typeof s=="function"){i=i();var c=s(i);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function ry(i,s,c){c=c!=null?c.concat([i]):null,Ac(4,4,ny.bind(null,s,i),c)}function Mh(){}function iy(i,s){var c=lt();s=s===void 0?null:s;var d=c.memoizedState;return s!==null&&ph(s,d[1])?d[0]:(c.memoizedState=[i,s],i)}function oy(i,s){var c=lt();s=s===void 0?null:s;var d=c.memoizedState;if(s!==null&&ph(s,d[1]))return d[0];if(d=i(),io){Fr(!0);try{i()}finally{Fr(!1)}}return c.memoizedState=[d,s],d}function Th(i,s,c){return c===void 0||(mr&1073741824)!==0&&(Re&261930)===0?i.memoizedState=s:(i.memoizedState=c,i=sv(),Se.lanes|=i,ii|=i,c)}function sy(i,s,c,d){return ln(c,s)?c:ns.current!==null?(i=Th(i,c,d),ln(i,s)||(ut=!0),i):(mr&42)===0||(mr&1073741824)!==0&&(Re&261930)===0?(ut=!0,i.memoizedState=c):(i=sv(),Se.lanes|=i,ii|=i,s)}function ly(i,s,c,d,g){var y=q.p;q.p=y!==0&&8>y?y:8;var E=I.T,A={};I.T=A,Rh(i,!1,s,c);try{var O=g(),V=I.S;if(V!==null&&V(A,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var G=h9(O,d);xl(i,s,G,hn(i))}else xl(i,s,d,hn(i))}catch(X){xl(i,s,{then:function(){},status:"rejected",reason:X},hn())}finally{q.p=y,E!==null&&A.types!==null&&(E.types=A.types),I.T=E}}function b9(){}function Ah(i,s,c,d){if(i.tag!==5)throw Error(r(476));var g=ay(i).queue;ly(i,g,s,P,c===null?b9:function(){return cy(i),c(d)})}function ay(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:P},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:c},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function cy(i){var s=ay(i);s.next===null&&(s=i.alternate.memoizedState),xl(i,s.next.queue,{},hn())}function kh(){return wt(Hl)}function uy(){return lt().memoizedState}function fy(){return lt().memoizedState}function C9(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var c=hn();i=Wr(c);var d=Jr(s,i,c);d!==null&&(Jt(d,s,c),gl(d,s,c)),s={cache:rh()},i.payload=s;return}s=s.return}}function x9(i,s,c){var d=hn();c={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},kc(i)?hy(s,c):(c=Kd(i,s,c,d),c!==null&&(Jt(c,i,d),py(c,s,d)))}function dy(i,s,c){var d=hn();xl(i,s,c,d)}function xl(i,s,c,d){var g={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(kc(i))hy(s,g);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var E=s.lastRenderedState,A=y(E,c);if(g.hasEagerState=!0,g.eagerState=A,ln(A,E))return ac(i,s,g,0),Fe===null&&lc(),!1}catch{}finally{}if(c=Kd(i,s,g,d),c!==null)return Jt(c,i,d),py(c,s,d),!0}return!1}function Rh(i,s,c,d){if(d={lane:2,revertLane:lp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},kc(i)){if(s)throw Error(r(479))}else s=Kd(i,c,d,2),s!==null&&Jt(s,i,2)}function kc(i){var s=i.alternate;return i===Se||s!==null&&s===Se}function hy(i,s){rs=xc=!0;var c=i.pending;c===null?s.next=s:(s.next=c.next,c.next=s),i.pending=s}function py(i,s,c){if((c&4194048)!==0){var d=s.lanes;d&=i.pendingLanes,c|=d,s.lanes=c,b0(i,c)}}var Sl={readContext:wt,use:Ec,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};Sl.useEffectEvent=tt;var my={readContext:wt,use:Ec,useCallback:function(i,s){return Vt().memoizedState=[i,s===void 0?null:s],i},useContext:wt,useEffect:W2,useImperativeHandle:function(i,s,c){c=c!=null?c.concat([i]):null,Tc(4194308,4,ny.bind(null,s,i),c)},useLayoutEffect:function(i,s){return Tc(4194308,4,i,s)},useInsertionEffect:function(i,s){Tc(4,2,i,s)},useMemo:function(i,s){var c=Vt();s=s===void 0?null:s;var d=i();if(io){Fr(!0);try{i()}finally{Fr(!1)}}return c.memoizedState=[d,s],d},useReducer:function(i,s,c){var d=Vt();if(c!==void 0){var g=c(s);if(io){Fr(!0);try{c(s)}finally{Fr(!1)}}}else g=s;return d.memoizedState=d.baseState=g,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:g},d.queue=i,i=i.dispatch=x9.bind(null,Se,i),[d.memoizedState,i]},useRef:function(i){var s=Vt();return i={current:i},s.memoizedState=i},useState:function(i){i=Sh(i);var s=i.queue,c=dy.bind(null,Se,s);return s.dispatch=c,[i.memoizedState,c]},useDebugValue:Mh,useDeferredValue:function(i,s){var c=Vt();return Th(c,i,s)},useTransition:function(){var i=Sh(!1);return i=ly.bind(null,Se,i.queue,!0,!1),Vt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,c){var d=Se,g=Vt();if(Ne){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),Fe===null)throw Error(r(349));(Re&127)!==0||_2(d,s,c)}g.memoizedState=c;var y={value:c,getSnapshot:s};return g.queue=y,W2(H2.bind(null,d,y,i),[i]),d.flags|=2048,ss(9,{destroy:void 0},I2.bind(null,d,y,c,s),null),c},useId:function(){var i=Vt(),s=Fe.identifierPrefix;if(Ne){var c=Kn,d=qn;c=(d&~(1<<32-sn(d)-1)).toString(32)+c,s="_"+s+"R_"+c,c=Sc++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=p9++,s="_"+s+"r_"+c.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:kh,useFormState:G2,useActionState:G2,useOptimistic:function(i){var s=Vt();s.memoizedState=s.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=Rh.bind(null,Se,!0,c),c.dispatch=s,[i,s]},useMemoCache:bh,useCacheRefresh:function(){return Vt().memoizedState=C9.bind(null,Se)},useEffectEvent:function(i){var s=Vt(),c={impl:i};return s.memoizedState=c,function(){if((je&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},Oh={readContext:wt,use:Ec,useCallback:iy,useContext:wt,useEffect:Eh,useImperativeHandle:ry,useInsertionEffect:ey,useLayoutEffect:ty,useMemo:oy,useReducer:Mc,useRef:Q2,useState:function(){return Mc(gr)},useDebugValue:Mh,useDeferredValue:function(i,s){var c=lt();return sy(c,Ue.memoizedState,i,s)},useTransition:function(){var i=Mc(gr)[0],s=lt().memoizedState;return[typeof i=="boolean"?i:Cl(i),s]},useSyncExternalStore:j2,useId:uy,useHostTransitionStatus:kh,useFormState:Y2,useActionState:Y2,useOptimistic:function(i,s){var c=lt();return V2(c,Ue,i,s)},useMemoCache:bh,useCacheRefresh:fy};Oh.useEffectEvent=J2;var gy={readContext:wt,use:Ec,useCallback:iy,useContext:wt,useEffect:Eh,useImperativeHandle:ry,useInsertionEffect:ey,useLayoutEffect:ty,useMemo:oy,useReducer:xh,useRef:Q2,useState:function(){return xh(gr)},useDebugValue:Mh,useDeferredValue:function(i,s){var c=lt();return Ue===null?Th(c,i,s):sy(c,Ue.memoizedState,i,s)},useTransition:function(){var i=xh(gr)[0],s=lt().memoizedState;return[typeof i=="boolean"?i:Cl(i),s]},useSyncExternalStore:j2,useId:uy,useHostTransitionStatus:kh,useFormState:X2,useActionState:X2,useOptimistic:function(i,s){var c=lt();return Ue!==null?V2(c,Ue,i,s):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:bh,useCacheRefresh:fy};gy.useEffectEvent=J2;function Nh(i,s,c,d){s=i.memoizedState,c=c(d,s),c=c==null?s:m({},s,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Dh={enqueueSetState:function(i,s,c){i=i._reactInternals;var d=hn(),g=Wr(d);g.payload=s,c!=null&&(g.callback=c),s=Jr(i,g,d),s!==null&&(Jt(s,i,d),gl(s,i,d))},enqueueReplaceState:function(i,s,c){i=i._reactInternals;var d=hn(),g=Wr(d);g.tag=1,g.payload=s,c!=null&&(g.callback=c),s=Jr(i,g,d),s!==null&&(Jt(s,i,d),gl(s,i,d))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var c=hn(),d=Wr(c);d.tag=2,s!=null&&(d.callback=s),s=Jr(i,d,c),s!==null&&(Jt(s,i,c),gl(s,i,c))}};function yy(i,s,c,d,g,y,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(d,y,E):s.prototype&&s.prototype.isPureReactComponent?!al(c,d)||!al(g,y):!0}function vy(i,s,c,d){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,d),s.state!==i&&Dh.enqueueReplaceState(s,s.state,null)}function oo(i,s){var c=s;if("ref"in s){c={};for(var d in s)d!=="ref"&&(c[d]=s[d])}if(i=i.defaultProps){c===s&&(c=m({},c));for(var g in i)c[g]===void 0&&(c[g]=i[g])}return c}function by(i){sc(i)}function Cy(i){console.error(i)}function xy(i){sc(i)}function Rc(i,s){try{var c=i.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function Sy(i,s,c){try{var d=i.onCaughtError;d(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Lh(i,s,c){return c=Wr(c),c.tag=3,c.payload={element:null},c.callback=function(){Rc(i,s)},c}function wy(i){return i=Wr(i),i.tag=3,i}function Ey(i,s,c,d){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var y=d.value;i.payload=function(){return g(y)},i.callback=function(){Sy(s,c,d)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){Sy(s,c,d),typeof g!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var A=d.stack;this.componentDidCatch(d.value,{componentStack:A!==null?A:""})})}function S9(i,s,c,d,g){if(c.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=c.alternate,s!==null&&Qo(s,c,g,!0),c=cn.current,c!==null){switch(c.tag){case 31:case 13:return Mn===null?Vc():c.alternate===null&&nt===0&&(nt=3),c.flags&=-257,c.flags|=65536,c.lanes=g,d===gc?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([d]):s.add(d),ip(i,d,g)),!1;case 22:return c.flags|=65536,d===gc?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([d]):c.add(d)),ip(i,d,g)),!1}throw Error(r(435,c.tag))}return ip(i,d,g),Vc(),!1}if(Ne)return s=cn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=g,d!==Wd&&(i=Error(r(422),{cause:d}),fl(xn(i,c)))):(d!==Wd&&(s=Error(r(423),{cause:d}),fl(xn(s,c))),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,d=xn(d,c),g=Lh(i.stateNode,d,g),ch(i,g),nt!==4&&(nt=2)),!1;var y=Error(r(520),{cause:d});if(y=xn(y,c),Ol===null?Ol=[y]:Ol.push(y),nt!==4&&(nt=2),s===null)return!0;d=xn(d,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,i=g&-g,c.lanes|=i,i=Lh(c.stateNode,d,i),ch(c,i),!1;case 1:if(s=c.type,y=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(oi===null||!oi.has(y))))return c.flags|=65536,g&=-g,c.lanes|=g,g=wy(g),Ey(g,i,c,d),ch(c,g),!1}c=c.return}while(c!==null);return!1}var zh=Error(r(461)),ut=!1;function Et(i,s,c,d){s.child=i===null?k2(s,null,c,d):ro(s,i.child,c,d)}function My(i,s,c,d,g){c=c.render;var y=s.ref;if("ref"in d){var E={};for(var A in d)A!=="ref"&&(E[A]=d[A])}else E=d;return Ji(s),d=mh(i,s,c,E,y,g),A=gh(),i!==null&&!ut?(yh(i,s,g),yr(i,s,g)):(Ne&&A&&Xd(s),s.flags|=1,Et(i,s,d,g),s.child)}function Ty(i,s,c,d,g){if(i===null){var y=c.type;return typeof y=="function"&&!Gd(y)&&y.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=y,Ay(i,s,y,d,g)):(i=uc(c.type,null,d,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!Ph(i,g)){var E=y.memoizedProps;if(c=c.compare,c=c!==null?c:al,c(E,d)&&i.ref===s.ref)return yr(i,s,g)}return s.flags|=1,i=fr(y,d),i.ref=s.ref,i.return=s,s.child=i}function Ay(i,s,c,d,g){if(i!==null){var y=i.memoizedProps;if(al(y,d)&&i.ref===s.ref)if(ut=!1,s.pendingProps=d=y,Ph(i,g))(i.flags&131072)!==0&&(ut=!0);else return s.lanes=i.lanes,yr(i,s,g)}return jh(i,s,c,d,g)}function ky(i,s,c,d){var g=d.children,y=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|c:c,i!==null){for(d=s.child=i.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~y}else d=0,s.child=null;return Ry(i,s,y,c,d)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&pc(s,y!==null?y.cachePool:null),y!==null?N2(s,y):fh(),D2(s);else return d=s.lanes=536870912,Ry(i,s,y!==null?y.baseLanes|c:c,c,d)}else y!==null?(pc(s,y.cachePool),N2(s,y),ti(),s.memoizedState=null):(i!==null&&pc(s,null),fh(),ti());return Et(i,s,g,c),s.child}function wl(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Ry(i,s,c,d,g){var y=oh();return y=y===null?null:{parent:at._currentValue,pool:y},s.memoizedState={baseLanes:c,cachePool:y},i!==null&&pc(s,null),fh(),D2(s),i!==null&&Qo(i,s,d,!0),s.childLanes=g,null}function Oc(i,s){return s=Dc({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Oy(i,s,c){return ro(s,i.child,null,c),i=Oc(s,s.pendingProps),i.flags|=2,un(s),s.memoizedState=null,i}function w9(i,s,c){var d=s.pendingProps,g=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Ne){if(d.mode==="hidden")return i=Oc(s,d),s.lanes=536870912,wl(null,i);if(hh(s),(i=Ge)?(i=Pv(i,En),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Gr!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},c=h2(i),c.return=s,s.child=c,St=s,Ge=null)):i=null,i===null)throw Zr(s);return s.lanes=536870912,null}return Oc(s,d)}var y=i.memoizedState;if(y!==null){var E=y.dehydrated;if(hh(s),g)if(s.flags&256)s.flags&=-257,s=Oy(i,s,c);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(ut||Qo(i,s,c,!1),g=(c&i.childLanes)!==0,ut||g){if(d=Fe,d!==null&&(E=C0(d,c),E!==0&&E!==y.retryLane))throw y.retryLane=E,Zi(i,E),Jt(d,i,E),zh;Vc(),s=Oy(i,s,c)}else i=y.treeContext,Ge=Tn(E.nextSibling),St=s,Ne=!0,Yr=null,En=!1,i!==null&&g2(s,i),s=Oc(s,d),s.flags|=4096;return s}return i=fr(i.child,{mode:d.mode,children:d.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Nc(i,s){var c=s.ref;if(c===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(s.flags|=4194816)}}function jh(i,s,c,d,g){return Ji(s),c=mh(i,s,c,d,void 0,g),d=gh(),i!==null&&!ut?(yh(i,s,g),yr(i,s,g)):(Ne&&d&&Xd(s),s.flags|=1,Et(i,s,c,g),s.child)}function Ny(i,s,c,d,g,y){return Ji(s),s.updateQueue=null,c=z2(s,d,c,g),L2(i),d=gh(),i!==null&&!ut?(yh(i,s,y),yr(i,s,y)):(Ne&&d&&Xd(s),s.flags|=1,Et(i,s,c,y),s.child)}function Dy(i,s,c,d,g){if(Ji(s),s.stateNode===null){var y=Go,E=c.contextType;typeof E=="object"&&E!==null&&(y=wt(E)),y=new c(d,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Dh,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=d,y.state=s.memoizedState,y.refs={},lh(s),E=c.contextType,y.context=typeof E=="object"&&E!==null?wt(E):Go,y.state=s.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Nh(s,c,E,d),y.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(E=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),E!==y.state&&Dh.enqueueReplaceState(y,y.state,null),vl(s,d,y,g),yl(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(i===null){y=s.stateNode;var A=s.memoizedProps,O=oo(c,A);y.props=O;var V=y.context,G=c.contextType;E=Go,typeof G=="object"&&G!==null&&(E=wt(G));var X=c.getDerivedStateFromProps;G=typeof X=="function"||typeof y.getSnapshotBeforeUpdate=="function",A=s.pendingProps!==A,G||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A||V!==E)&&vy(s,y,d,E),Qr=!1;var F=s.memoizedState;y.state=F,vl(s,d,y,g),yl(),V=s.memoizedState,A||F!==V||Qr?(typeof X=="function"&&(Nh(s,c,X,d),V=s.memoizedState),(O=Qr||yy(s,c,O,d,F,V,E))?(G||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=V),y.props=d,y.state=V,y.context=E,d=O):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{y=s.stateNode,ah(i,s),E=s.memoizedProps,G=oo(c,E),y.props=G,X=s.pendingProps,F=y.context,V=c.contextType,O=Go,typeof V=="object"&&V!==null&&(O=wt(V)),A=c.getDerivedStateFromProps,(V=typeof A=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(E!==X||F!==O)&&vy(s,y,d,O),Qr=!1,F=s.memoizedState,y.state=F,vl(s,d,y,g),yl();var K=s.memoizedState;E!==X||F!==K||Qr||i!==null&&i.dependencies!==null&&dc(i.dependencies)?(typeof A=="function"&&(Nh(s,c,A,d),K=s.memoizedState),(G=Qr||yy(s,c,G,d,F,K,O)||i!==null&&i.dependencies!==null&&dc(i.dependencies))?(V||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,K,O),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,K,O)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||E===i.memoizedProps&&F===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&F===i.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=K),y.props=d,y.state=K,y.context=O,d=G):(typeof y.componentDidUpdate!="function"||E===i.memoizedProps&&F===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&F===i.memoizedState||(s.flags|=1024),d=!1)}return y=d,Nc(i,s),d=(s.flags&128)!==0,y||d?(y=s.stateNode,c=d&&typeof c.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,i!==null&&d?(s.child=ro(s,i.child,null,g),s.child=ro(s,null,c,g)):Et(i,s,c,g),s.memoizedState=y.state,i=s.child):i=yr(i,s,g),i}function Ly(i,s,c,d){return Qi(),s.flags|=256,Et(i,s,c,d),s.child}var _h={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ih(i){return{baseLanes:i,cachePool:S2()}}function Hh(i,s,c){return i=i!==null?i.childLanes&~c:0,s&&(i|=dn),i}function zy(i,s,c){var d=s.pendingProps,g=!1,y=(s.flags&128)!==0,E;if((E=y)||(E=i!==null&&i.memoizedState===null?!1:(st.current&2)!==0),E&&(g=!0,s.flags&=-129),E=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ne){if(g?ei(s):ti(),(i=Ge)?(i=Pv(i,En),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Gr!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},c=h2(i),c.return=s,s.child=c,St=s,Ge=null)):i=null,i===null)throw Zr(s);return Cp(i)?s.lanes=32:s.lanes=536870912,null}var A=d.children;return d=d.fallback,g?(ti(),g=s.mode,A=Dc({mode:"hidden",children:A},g),d=Xi(d,g,c,null),A.return=s,d.return=s,A.sibling=d,s.child=A,d=s.child,d.memoizedState=Ih(c),d.childLanes=Hh(i,E,c),s.memoizedState=_h,wl(null,d)):(ei(s),Bh(s,A))}var O=i.memoizedState;if(O!==null&&(A=O.dehydrated,A!==null)){if(y)s.flags&256?(ei(s),s.flags&=-257,s=Uh(i,s,c)):s.memoizedState!==null?(ti(),s.child=i.child,s.flags|=128,s=null):(ti(),A=d.fallback,g=s.mode,d=Dc({mode:"visible",children:d.children},g),A=Xi(A,g,c,null),A.flags|=2,d.return=s,A.return=s,d.sibling=A,s.child=d,ro(s,i.child,null,c),d=s.child,d.memoizedState=Ih(c),d.childLanes=Hh(i,E,c),s.memoizedState=_h,s=wl(null,d));else if(ei(s),Cp(A)){if(E=A.nextSibling&&A.nextSibling.dataset,E)var V=E.dgst;E=V,d=Error(r(419)),d.stack="",d.digest=E,fl({value:d,source:null,stack:null}),s=Uh(i,s,c)}else if(ut||Qo(i,s,c,!1),E=(c&i.childLanes)!==0,ut||E){if(E=Fe,E!==null&&(d=C0(E,c),d!==0&&d!==O.retryLane))throw O.retryLane=d,Zi(i,d),Jt(E,i,d),zh;bp(A)||Vc(),s=Uh(i,s,c)}else bp(A)?(s.flags|=192,s.child=i.child,s=null):(i=O.treeContext,Ge=Tn(A.nextSibling),St=s,Ne=!0,Yr=null,En=!1,i!==null&&g2(s,i),s=Bh(s,d.children),s.flags|=4096);return s}return g?(ti(),A=d.fallback,g=s.mode,O=i.child,V=O.sibling,d=fr(O,{mode:"hidden",children:d.children}),d.subtreeFlags=O.subtreeFlags&65011712,V!==null?A=fr(V,A):(A=Xi(A,g,c,null),A.flags|=2),A.return=s,d.return=s,d.sibling=A,s.child=d,wl(null,d),d=s.child,A=i.child.memoizedState,A===null?A=Ih(c):(g=A.cachePool,g!==null?(O=at._currentValue,g=g.parent!==O?{parent:O,pool:O}:g):g=S2(),A={baseLanes:A.baseLanes|c,cachePool:g}),d.memoizedState=A,d.childLanes=Hh(i,E,c),s.memoizedState=_h,wl(i.child,d)):(ei(s),c=i.child,i=c.sibling,c=fr(c,{mode:"visible",children:d.children}),c.return=s,c.sibling=null,i!==null&&(E=s.deletions,E===null?(s.deletions=[i],s.flags|=16):E.push(i)),s.child=c,s.memoizedState=null,c)}function Bh(i,s){return s=Dc({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Dc(i,s){return i=an(22,i,null,s),i.lanes=0,i}function Uh(i,s,c){return ro(s,i.child,null,c),i=Bh(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function jy(i,s,c){i.lanes|=s;var d=i.alternate;d!==null&&(d.lanes|=s),th(i.return,s,c)}function Vh(i,s,c,d,g,y){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:g,treeForkCount:y}:(E.isBackwards=s,E.rendering=null,E.renderingStartTime=0,E.last=d,E.tail=c,E.tailMode=g,E.treeForkCount=y)}function _y(i,s,c){var d=s.pendingProps,g=d.revealOrder,y=d.tail;d=d.children;var E=st.current,A=(E&2)!==0;if(A?(E=E&1|2,s.flags|=128):E&=1,J(st,E),Et(i,s,d,c),d=Ne?ul:0,!A&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&jy(i,c,s);else if(i.tag===19)jy(i,c,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(g){case"forwards":for(c=s.child,g=null;c!==null;)i=c.alternate,i!==null&&Cc(i)===null&&(g=c),c=c.sibling;c=g,c===null?(g=s.child,s.child=null):(g=c.sibling,c.sibling=null),Vh(s,!1,g,c,y,d);break;case"backwards":case"unstable_legacy-backwards":for(c=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&Cc(i)===null){s.child=g;break}i=g.sibling,g.sibling=c,c=g,g=i}Vh(s,!0,c,null,y,d);break;case"together":Vh(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function yr(i,s,c){if(i!==null&&(s.dependencies=i.dependencies),ii|=s.lanes,(c&s.childLanes)===0)if(i!==null){if(Qo(i,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,c=fr(i,i.pendingProps),s.child=c,c.return=s;i.sibling!==null;)i=i.sibling,c=c.sibling=fr(i,i.pendingProps),c.return=s;c.sibling=null}return s.child}function Ph(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&dc(i)))}function E9(i,s,c){switch(s.tag){case 3:xe(s,s.stateNode.containerInfo),Xr(s,at,i.memoizedState.cache),Qi();break;case 27:case 5:Ut(s);break;case 4:xe(s,s.stateNode.containerInfo);break;case 10:Xr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,hh(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(ei(s),s.flags|=128,null):(c&s.child.childLanes)!==0?zy(i,s,c):(ei(s),i=yr(i,s,c),i!==null?i.sibling:null);ei(s);break;case 19:var g=(i.flags&128)!==0;if(d=(c&s.childLanes)!==0,d||(Qo(i,s,c,!1),d=(c&s.childLanes)!==0),g){if(d)return _y(i,s,c);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),J(st,st.current),d)break;return null;case 22:return s.lanes=0,ky(i,s,c,s.pendingProps);case 24:Xr(s,at,i.memoizedState.cache)}return yr(i,s,c)}function Iy(i,s,c){if(i!==null)if(i.memoizedProps!==s.pendingProps)ut=!0;else{if(!Ph(i,c)&&(s.flags&128)===0)return ut=!1,E9(i,s,c);ut=(i.flags&131072)!==0}else ut=!1,Ne&&(s.flags&1048576)!==0&&m2(s,ul,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(i=to(s.elementType),s.type=i,typeof i=="function")Gd(i)?(d=oo(i,d),s.tag=1,s=Dy(null,s,i,d,c)):(s.tag=0,s=jh(null,s,i,d,c));else{if(i!=null){var g=i.$$typeof;if(g===D){s.tag=11,s=My(null,s,i,d,c);break e}else if(g===L){s.tag=14,s=Ty(null,s,i,d,c);break e}}throw s=W(i)||i,Error(r(306,s,""))}}return s;case 0:return jh(i,s,s.type,s.pendingProps,c);case 1:return d=s.type,g=oo(d,s.pendingProps),Dy(i,s,d,g,c);case 3:e:{if(xe(s,s.stateNode.containerInfo),i===null)throw Error(r(387));d=s.pendingProps;var y=s.memoizedState;g=y.element,ah(i,s),vl(s,d,null,c);var E=s.memoizedState;if(d=E.cache,Xr(s,at,d),d!==y.cache&&nh(s,[at],c,!0),yl(),d=E.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:E.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=Ly(i,s,d,c);break e}else if(d!==g){g=xn(Error(r(424)),s),fl(g),s=Ly(i,s,d,c);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Ge=Tn(i.firstChild),St=s,Ne=!0,Yr=null,En=!0,c=k2(s,null,d,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Qi(),d===g){s=yr(i,s,c);break e}Et(i,s,d,c)}s=s.child}return s;case 26:return Nc(i,s),i===null?(c=Yv(s.type,null,s.pendingProps,null))?s.memoizedState=c:Ne||(c=s.type,i=s.pendingProps,d=Yc(me.current).createElement(c),d[xt]=s,d[Gt]=i,Mt(d,c,i),gt(d),s.stateNode=d):s.memoizedState=Yv(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Ut(s),i===null&&Ne&&(d=s.stateNode=qv(s.type,s.pendingProps,me.current),St=s,En=!0,g=Ge,ci(s.type)?(xp=g,Ge=Tn(d.firstChild)):Ge=g),Et(i,s,s.pendingProps.children,c),Nc(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ne&&((g=d=Ge)&&(d=eM(d,s.type,s.pendingProps,En),d!==null?(s.stateNode=d,St=s,Ge=Tn(d.firstChild),En=!1,g=!0):g=!1),g||Zr(s)),Ut(s),g=s.type,y=s.pendingProps,E=i!==null?i.memoizedProps:null,d=y.children,gp(g,y)?d=null:E!==null&&gp(g,E)&&(s.flags|=32),s.memoizedState!==null&&(g=mh(i,s,m9,null,null,c),Hl._currentValue=g),Nc(i,s),Et(i,s,d,c),s.child;case 6:return i===null&&Ne&&((i=c=Ge)&&(c=tM(c,s.pendingProps,En),c!==null?(s.stateNode=c,St=s,Ge=null,i=!0):i=!1),i||Zr(s)),null;case 13:return zy(i,s,c);case 4:return xe(s,s.stateNode.containerInfo),d=s.pendingProps,i===null?s.child=ro(s,null,d,c):Et(i,s,d,c),s.child;case 11:return My(i,s,s.type,s.pendingProps,c);case 7:return Et(i,s,s.pendingProps,c),s.child;case 8:return Et(i,s,s.pendingProps.children,c),s.child;case 12:return Et(i,s,s.pendingProps.children,c),s.child;case 10:return d=s.pendingProps,Xr(s,s.type,d.value),Et(i,s,d.children,c),s.child;case 9:return g=s.type._context,d=s.pendingProps.children,Ji(s),g=wt(g),d=d(g),s.flags|=1,Et(i,s,d,c),s.child;case 14:return Ty(i,s,s.type,s.pendingProps,c);case 15:return Ay(i,s,s.type,s.pendingProps,c);case 19:return _y(i,s,c);case 31:return w9(i,s,c);case 22:return ky(i,s,c,s.pendingProps);case 24:return Ji(s),d=wt(at),i===null?(g=oh(),g===null&&(g=Fe,y=rh(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=c),g=y),s.memoizedState={parent:d,cache:g},lh(s),Xr(s,at,g)):((i.lanes&c)!==0&&(ah(i,s),vl(s,null,null,c),yl()),g=i.memoizedState,y=s.memoizedState,g.parent!==d?(g={parent:d,cache:d},s.memoizedState=g,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=g),Xr(s,at,d)):(d=y.cache,Xr(s,at,d),d!==g.cache&&nh(s,[at],c,!0))),Et(i,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function vr(i){i.flags|=4}function $h(i,s,c,d,g){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(g&335544128)===g)if(i.stateNode.complete)i.flags|=8192;else if(uv())i.flags|=8192;else throw no=gc,sh}else i.flags&=-16777217}function Hy(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Jv(s))if(uv())i.flags|=8192;else throw no=gc,sh}function Lc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?y0():536870912,i.lanes|=s,us|=s)}function El(i,s){if(!Ne)switch(i.tailMode){case"hidden":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function Ye(i){var s=i.alternate!==null&&i.alternate.child===i.child,c=0,d=0;if(s)for(var g=i.child;g!==null;)c|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=d,i.childLanes=c,s}function M9(i,s,c){var d=s.pendingProps;switch(Qd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ye(s),null;case 1:return Ye(s),null;case 3:return c=s.stateNode,d=null,i!==null&&(d=i.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),pr(at),De(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Xo(s)?vr(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Jd())),Ye(s),null;case 26:var g=s.type,y=s.memoizedState;return i===null?(vr(s),y!==null?(Ye(s),Hy(s,y)):(Ye(s),$h(s,g,null,d,c))):y?y!==i.memoizedState?(vr(s),Ye(s),Hy(s,y)):(Ye(s),s.flags&=-16777217):(i=i.memoizedProps,i!==d&&vr(s),Ye(s),$h(s,g,i,d,c)),null;case 27:if(In(s),c=me.current,g=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==d&&vr(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return Ye(s),null}i=oe.current,Xo(s)?y2(s):(i=qv(g,d,c),s.stateNode=i,vr(s))}return Ye(s),null;case 5:if(In(s),g=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==d&&vr(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return Ye(s),null}if(y=oe.current,Xo(s))y2(s);else{var E=Yc(me.current);switch(y){case 1:y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=E.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?E.createElement("select",{is:d.is}):E.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?E.createElement(g,{is:d.is}):E.createElement(g)}}y[xt]=s,y[Gt]=d;e:for(E=s.child;E!==null;){if(E.tag===5||E.tag===6)y.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===s)break e;for(;E.sibling===null;){if(E.return===null||E.return===s)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}s.stateNode=y;e:switch(Mt(y,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&vr(s)}}return Ye(s),$h(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,c),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==d&&vr(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(r(166));if(i=me.current,Xo(s)){if(i=s.stateNode,c=s.memoizedProps,d=null,g=St,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}i[xt]=s,i=!!(i.nodeValue===c||d!==null&&d.suppressHydrationWarning===!0||zv(i.nodeValue,c)),i||Zr(s,!0)}else i=Yc(i).createTextNode(d),i[xt]=s,s.stateNode=i}return Ye(s),null;case 31:if(c=s.memoizedState,i===null||i.memoizedState!==null){if(d=Xo(s),c!==null){if(i===null){if(!d)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[xt]=s}else Qi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ye(s),i=!1}else c=Jd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return s.flags&256?(un(s),s):(un(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Ye(s),null;case 13:if(d=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=Xo(s),d!==null&&d.dehydrated!==null){if(i===null){if(!g)throw Error(r(318));if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[xt]=s}else Qi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ye(s),g=!1}else g=Jd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=g),g=!0;if(!g)return s.flags&256?(un(s),s):(un(s),null)}return un(s),(s.flags&128)!==0?(s.lanes=c,s):(c=d!==null,i=i!==null&&i.memoizedState!==null,c&&(d=s.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==g&&(d.flags|=2048)),c!==i&&c&&(s.child.flags|=8192),Lc(s,s.updateQueue),Ye(s),null);case 4:return De(),i===null&&fp(s.stateNode.containerInfo),Ye(s),null;case 10:return pr(s.type),Ye(s),null;case 19:if($(st),d=s.memoizedState,d===null)return Ye(s),null;if(g=(s.flags&128)!==0,y=d.rendering,y===null)if(g)El(d,!1);else{if(nt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(y=Cc(i),y!==null){for(s.flags|=128,El(d,!1),i=y.updateQueue,s.updateQueue=i,Lc(s,i),s.subtreeFlags=0,i=c,c=s.child;c!==null;)d2(c,i),c=c.sibling;return J(st,st.current&1|2),Ne&&dr(s,d.treeForkCount),s.child}i=i.sibling}d.tail!==null&&rn()>Hc&&(s.flags|=128,g=!0,El(d,!1),s.lanes=4194304)}else{if(!g)if(i=Cc(y),i!==null){if(s.flags|=128,g=!0,i=i.updateQueue,s.updateQueue=i,Lc(s,i),El(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!Ne)return Ye(s),null}else 2*rn()-d.renderingStartTime>Hc&&c!==536870912&&(s.flags|=128,g=!0,El(d,!1),s.lanes=4194304);d.isBackwards?(y.sibling=s.child,s.child=y):(i=d.last,i!==null?i.sibling=y:s.child=y,d.last=y)}return d.tail!==null?(i=d.tail,d.rendering=i,d.tail=i.sibling,d.renderingStartTime=rn(),i.sibling=null,c=st.current,J(st,g?c&1|2:c&1),Ne&&dr(s,d.treeForkCount),i):(Ye(s),null);case 22:case 23:return un(s),dh(),d=s.memoizedState!==null,i!==null?i.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(c&536870912)!==0&&(s.flags&128)===0&&(Ye(s),s.subtreeFlags&6&&(s.flags|=8192)):Ye(s),c=s.updateQueue,c!==null&&Lc(s,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048),i!==null&&$(eo),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),pr(at),Ye(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function T9(i,s){switch(Qd(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return pr(at),De(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return In(s),null;case 31:if(s.memoizedState!==null){if(un(s),s.alternate===null)throw Error(r(340));Qi()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(un(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Qi()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return $(st),null;case 4:return De(),null;case 10:return pr(s.type),null;case 22:case 23:return un(s),dh(),i!==null&&$(eo),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return pr(at),null;case 25:return null;default:return null}}function By(i,s){switch(Qd(s),s.tag){case 3:pr(at),De();break;case 26:case 27:case 5:In(s);break;case 4:De();break;case 31:s.memoizedState!==null&&un(s);break;case 13:un(s);break;case 19:$(st);break;case 10:pr(s.type);break;case 22:case 23:un(s),dh(),i!==null&&$(eo);break;case 24:pr(at)}}function Ml(i,s){try{var c=s.updateQueue,d=c!==null?c.lastEffect:null;if(d!==null){var g=d.next;c=g;do{if((c.tag&i)===i){d=void 0;var y=c.create,E=c.inst;d=y(),E.destroy=d}c=c.next}while(c!==g)}}catch(A){He(s,s.return,A)}}function ni(i,s,c){try{var d=s.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var y=g.next;d=y;do{if((d.tag&i)===i){var E=d.inst,A=E.destroy;if(A!==void 0){E.destroy=void 0,g=s;var O=c,V=A;try{V()}catch(G){He(g,O,G)}}}d=d.next}while(d!==y)}}catch(G){He(s,s.return,G)}}function Uy(i){var s=i.updateQueue;if(s!==null){var c=i.stateNode;try{O2(s,c)}catch(d){He(i,i.return,d)}}}function Vy(i,s,c){c.props=oo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(d){He(i,s,d)}}function Tl(i,s){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var d=i.stateNode;break;case 30:d=i.stateNode;break;default:d=i.stateNode}typeof c=="function"?i.refCleanup=c(d):c.current=d}}catch(g){He(i,s,g)}}function Gn(i,s){var c=i.ref,d=i.refCleanup;if(c!==null)if(typeof d=="function")try{d()}catch(g){He(i,s,g)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(g){He(i,s,g)}else c.current=null}function Py(i){var s=i.type,c=i.memoizedProps,d=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&d.focus();break e;case"img":c.src?d.src=c.src:c.srcSet&&(d.srcset=c.srcSet)}}catch(g){He(i,i.return,g)}}function Fh(i,s,c){try{var d=i.stateNode;Y9(d,i.type,c,s),d[Gt]=s}catch(g){He(i,i.return,g)}}function $y(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ci(i.type)||i.tag===4}function qh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||$y(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ci(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Kh(i,s,c){var d=i.tag;if(d===5||d===6)i=i.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(i),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=cr));else if(d!==4&&(d===27&&ci(i.type)&&(c=i.stateNode,s=null),i=i.child,i!==null))for(Kh(i,s,c),i=i.sibling;i!==null;)Kh(i,s,c),i=i.sibling}function zc(i,s,c){var d=i.tag;if(d===5||d===6)i=i.stateNode,s?c.insertBefore(i,s):c.appendChild(i);else if(d!==4&&(d===27&&ci(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(zc(i,s,c),i=i.sibling;i!==null;)zc(i,s,c),i=i.sibling}function Fy(i){var s=i.stateNode,c=i.memoizedProps;try{for(var d=i.type,g=s.attributes;g.length;)s.removeAttributeNode(g[0]);Mt(s,d,c),s[xt]=i,s[Gt]=c}catch(y){He(i,i.return,y)}}var br=!1,ft=!1,Gh=!1,qy=typeof WeakSet=="function"?WeakSet:Set,yt=null;function A9(i,s){if(i=i.containerInfo,pp=tu,i=r2(i),Ud(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&d.rangeCount!==0){c=d.anchorNode;var g=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{c.nodeType,y.nodeType}catch{c=null;break e}var E=0,A=-1,O=-1,V=0,G=0,X=i,F=null;t:for(;;){for(var K;X!==c||g!==0&&X.nodeType!==3||(A=E+g),X!==y||d!==0&&X.nodeType!==3||(O=E+d),X.nodeType===3&&(E+=X.nodeValue.length),(K=X.firstChild)!==null;)F=X,X=K;for(;;){if(X===i)break t;if(F===c&&++V===g&&(A=E),F===y&&++G===d&&(O=E),(K=X.nextSibling)!==null)break;X=F,F=X.parentNode}X=K}c=A===-1||O===-1?null:{start:A,end:O}}else c=null}c=c||{start:0,end:0}}else c=null;for(mp={focusedElem:i,selectionRange:c},tu=!1,yt=s;yt!==null;)if(s=yt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,yt=i;else for(;yt!==null;){switch(s=yt,y=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)g=i[c],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,c=s,g=y.memoizedProps,y=y.memoizedState,d=c.stateNode;try{var ue=oo(c.type,g);i=d.getSnapshotBeforeUpdate(ue,y),d.__reactInternalSnapshotBeforeUpdate=i}catch(be){He(c,c.return,be)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,c=i.nodeType,c===9)vp(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":vp(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,yt=i;break}yt=s.return}}function Ky(i,s,c){var d=c.flags;switch(c.tag){case 0:case 11:case 15:xr(i,c),d&4&&Ml(5,c);break;case 1:if(xr(i,c),d&4)if(i=c.stateNode,s===null)try{i.componentDidMount()}catch(E){He(c,c.return,E)}else{var g=oo(c.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(g,s,i.__reactInternalSnapshotBeforeUpdate)}catch(E){He(c,c.return,E)}}d&64&&Uy(c),d&512&&Tl(c,c.return);break;case 3:if(xr(i,c),d&64&&(i=c.updateQueue,i!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{O2(i,s)}catch(E){He(c,c.return,E)}}break;case 27:s===null&&d&4&&Fy(c);case 26:case 5:xr(i,c),s===null&&d&4&&Py(c),d&512&&Tl(c,c.return);break;case 12:xr(i,c);break;case 31:xr(i,c),d&4&&Zy(i,c);break;case 13:xr(i,c),d&4&&Xy(i,c),d&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=_9.bind(null,c),nM(i,c))));break;case 22:if(d=c.memoizedState!==null||br,!d){s=s!==null&&s.memoizedState!==null||ft,g=br;var y=ft;br=d,(ft=s)&&!y?Sr(i,c,(c.subtreeFlags&8772)!==0):xr(i,c),br=g,ft=y}break;case 30:break;default:xr(i,c)}}function Gy(i){var s=i.alternate;s!==null&&(i.alternate=null,Gy(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&wd(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Qe=null,Zt=!1;function Cr(i,s,c){for(c=c.child;c!==null;)Yy(i,s,c),c=c.sibling}function Yy(i,s,c){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(Xs,c)}catch{}switch(c.tag){case 26:ft||Gn(c,s),Cr(i,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:ft||Gn(c,s);var d=Qe,g=Zt;ci(c.type)&&(Qe=c.stateNode,Zt=!1),Cr(i,s,c),jl(c.stateNode),Qe=d,Zt=g;break;case 5:ft||Gn(c,s);case 6:if(d=Qe,g=Zt,Qe=null,Cr(i,s,c),Qe=d,Zt=g,Qe!==null)if(Zt)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(c.stateNode)}catch(y){He(c,s,y)}else try{Qe.removeChild(c.stateNode)}catch(y){He(c,s,y)}break;case 18:Qe!==null&&(Zt?(i=Qe,Uv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),vs(i)):Uv(Qe,c.stateNode));break;case 4:d=Qe,g=Zt,Qe=c.stateNode.containerInfo,Zt=!0,Cr(i,s,c),Qe=d,Zt=g;break;case 0:case 11:case 14:case 15:ni(2,c,s),ft||ni(4,c,s),Cr(i,s,c);break;case 1:ft||(Gn(c,s),d=c.stateNode,typeof d.componentWillUnmount=="function"&&Vy(c,s,d)),Cr(i,s,c);break;case 21:Cr(i,s,c);break;case 22:ft=(d=ft)||c.memoizedState!==null,Cr(i,s,c),ft=d;break;default:Cr(i,s,c)}}function Zy(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{vs(i)}catch(c){He(s,s.return,c)}}}function Xy(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{vs(i)}catch(c){He(s,s.return,c)}}function k9(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new qy),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new qy),s;default:throw Error(r(435,i.tag))}}function jc(i,s){var c=k9(i);s.forEach(function(d){if(!c.has(d)){c.add(d);var g=I9.bind(null,i,d);d.then(g,g)}})}function Xt(i,s){var c=s.deletions;if(c!==null)for(var d=0;d<c.length;d++){var g=c[d],y=i,E=s,A=E;e:for(;A!==null;){switch(A.tag){case 27:if(ci(A.type)){Qe=A.stateNode,Zt=!1;break e}break;case 5:Qe=A.stateNode,Zt=!1;break e;case 3:case 4:Qe=A.stateNode.containerInfo,Zt=!0;break e}A=A.return}if(Qe===null)throw Error(r(160));Yy(y,E,g),Qe=null,Zt=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Qy(s,i),s=s.sibling}var Bn=null;function Qy(i,s){var c=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Xt(s,i),Qt(i),d&4&&(ni(3,i,i.return),Ml(3,i),ni(5,i,i.return));break;case 1:Xt(s,i),Qt(i),d&512&&(ft||c===null||Gn(c,c.return)),d&64&&br&&(i=i.updateQueue,i!==null&&(d=i.callbacks,d!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?d:c.concat(d))));break;case 26:var g=Bn;if(Xt(s,i),Qt(i),d&512&&(ft||c===null||Gn(c,c.return)),d&4){var y=c!==null?c.memoizedState:null;if(d=i.memoizedState,c===null)if(d===null)if(i.stateNode===null){e:{d=i.type,c=i.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":y=g.getElementsByTagName("title")[0],(!y||y[Js]||y[xt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(d),g.head.insertBefore(y,g.querySelector("head > title"))),Mt(y,d,c),y[xt]=i,gt(y),d=y;break e;case"link":var E=Qv("link","href",g).get(d+(c.href||""));if(E){for(var A=0;A<E.length;A++)if(y=E[A],y.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&y.getAttribute("rel")===(c.rel==null?null:c.rel)&&y.getAttribute("title")===(c.title==null?null:c.title)&&y.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(A,1);break t}}y=g.createElement(d),Mt(y,d,c),g.head.appendChild(y);break;case"meta":if(E=Qv("meta","content",g).get(d+(c.content||""))){for(A=0;A<E.length;A++)if(y=E[A],y.getAttribute("content")===(c.content==null?null:""+c.content)&&y.getAttribute("name")===(c.name==null?null:c.name)&&y.getAttribute("property")===(c.property==null?null:c.property)&&y.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&y.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(A,1);break t}}y=g.createElement(d),Mt(y,d,c),g.head.appendChild(y);break;default:throw Error(r(468,d))}y[xt]=i,gt(y),d=y}i.stateNode=d}else Wv(g,i.type,i.stateNode);else i.stateNode=Xv(g,d,i.memoizedProps);else y!==d?(y===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):y.count--,d===null?Wv(g,i.type,i.stateNode):Xv(g,d,i.memoizedProps)):d===null&&i.stateNode!==null&&Fh(i,i.memoizedProps,c.memoizedProps)}break;case 27:Xt(s,i),Qt(i),d&512&&(ft||c===null||Gn(c,c.return)),c!==null&&d&4&&Fh(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Xt(s,i),Qt(i),d&512&&(ft||c===null||Gn(c,c.return)),i.flags&32){g=i.stateNode;try{Uo(g,"")}catch(ue){He(i,i.return,ue)}}d&4&&i.stateNode!=null&&(g=i.memoizedProps,Fh(i,g,c!==null?c.memoizedProps:g)),d&1024&&(Gh=!0);break;case 6:if(Xt(s,i),Qt(i),d&4){if(i.stateNode===null)throw Error(r(162));d=i.memoizedProps,c=i.stateNode;try{c.nodeValue=d}catch(ue){He(i,i.return,ue)}}break;case 3:if(Qc=null,g=Bn,Bn=Zc(s.containerInfo),Xt(s,i),Bn=g,Qt(i),d&4&&c!==null&&c.memoizedState.isDehydrated)try{vs(s.containerInfo)}catch(ue){He(i,i.return,ue)}Gh&&(Gh=!1,Wy(i));break;case 4:d=Bn,Bn=Zc(i.stateNode.containerInfo),Xt(s,i),Qt(i),Bn=d;break;case 12:Xt(s,i),Qt(i);break;case 31:Xt(s,i),Qt(i),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,jc(i,d)));break;case 13:Xt(s,i),Qt(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Ic=rn()),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,jc(i,d)));break;case 22:g=i.memoizedState!==null;var O=c!==null&&c.memoizedState!==null,V=br,G=ft;if(br=V||g,ft=G||O,Xt(s,i),ft=G,br=V,Qt(i),d&8192)e:for(s=i.stateNode,s._visibility=g?s._visibility&-2:s._visibility|1,g&&(c===null||O||br||ft||so(i)),c=null,s=i;;){if(s.tag===5||s.tag===26){if(c===null){O=c=s;try{if(y=O.stateNode,g)E=y.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{A=O.stateNode;var X=O.memoizedProps.style,F=X!=null&&X.hasOwnProperty("display")?X.display:null;A.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ue){He(O,O.return,ue)}}}else if(s.tag===6){if(c===null){O=s;try{O.stateNode.nodeValue=g?"":O.memoizedProps}catch(ue){He(O,O.return,ue)}}}else if(s.tag===18){if(c===null){O=s;try{var K=O.stateNode;g?Vv(K,!0):Vv(O.stateNode,!1)}catch(ue){He(O,O.return,ue)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=i.updateQueue,d!==null&&(c=d.retryQueue,c!==null&&(d.retryQueue=null,jc(i,c))));break;case 19:Xt(s,i),Qt(i),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,jc(i,d)));break;case 30:break;case 21:break;default:Xt(s,i),Qt(i)}}function Qt(i){var s=i.flags;if(s&2){try{for(var c,d=i.return;d!==null;){if($y(d)){c=d;break}d=d.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var g=c.stateNode,y=qh(i);zc(i,y,g);break;case 5:var E=c.stateNode;c.flags&32&&(Uo(E,""),c.flags&=-33);var A=qh(i);zc(i,A,E);break;case 3:case 4:var O=c.stateNode.containerInfo,V=qh(i);Kh(i,V,O);break;default:throw Error(r(161))}}catch(G){He(i,i.return,G)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Wy(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Wy(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function xr(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Ky(i,s.alternate,s),s=s.sibling}function so(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:ni(4,s,s.return),so(s);break;case 1:Gn(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&Vy(s,s.return,c),so(s);break;case 27:jl(s.stateNode);case 26:case 5:Gn(s,s.return),so(s);break;case 22:s.memoizedState===null&&so(s);break;case 30:so(s);break;default:so(s)}i=i.sibling}}function Sr(i,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,g=i,y=s,E=y.flags;switch(y.tag){case 0:case 11:case 15:Sr(g,y,c),Ml(4,y);break;case 1:if(Sr(g,y,c),d=y,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(V){He(d,d.return,V)}if(d=y,g=d.updateQueue,g!==null){var A=d.stateNode;try{var O=g.shared.hiddenCallbacks;if(O!==null)for(g.shared.hiddenCallbacks=null,g=0;g<O.length;g++)R2(O[g],A)}catch(V){He(d,d.return,V)}}c&&E&64&&Uy(y),Tl(y,y.return);break;case 27:Fy(y);case 26:case 5:Sr(g,y,c),c&&d===null&&E&4&&Py(y),Tl(y,y.return);break;case 12:Sr(g,y,c);break;case 31:Sr(g,y,c),c&&E&4&&Zy(g,y);break;case 13:Sr(g,y,c),c&&E&4&&Xy(g,y);break;case 22:y.memoizedState===null&&Sr(g,y,c),Tl(y,y.return);break;case 30:break;default:Sr(g,y,c)}s=s.sibling}}function Yh(i,s){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&dl(c))}function Zh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&dl(i))}function Un(i,s,c,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Jy(i,s,c,d),s=s.sibling}function Jy(i,s,c,d){var g=s.flags;switch(s.tag){case 0:case 11:case 15:Un(i,s,c,d),g&2048&&Ml(9,s);break;case 1:Un(i,s,c,d);break;case 3:Un(i,s,c,d),g&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&dl(i)));break;case 12:if(g&2048){Un(i,s,c,d),i=s.stateNode;try{var y=s.memoizedProps,E=y.id,A=y.onPostCommit;typeof A=="function"&&A(E,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(O){He(s,s.return,O)}}else Un(i,s,c,d);break;case 31:Un(i,s,c,d);break;case 13:Un(i,s,c,d);break;case 23:break;case 22:y=s.stateNode,E=s.alternate,s.memoizedState!==null?y._visibility&2?Un(i,s,c,d):Al(i,s):y._visibility&2?Un(i,s,c,d):(y._visibility|=2,ls(i,s,c,d,(s.subtreeFlags&10256)!==0||!1)),g&2048&&Yh(E,s);break;case 24:Un(i,s,c,d),g&2048&&Zh(s.alternate,s);break;default:Un(i,s,c,d)}}function ls(i,s,c,d,g){for(g=g&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=i,E=s,A=c,O=d,V=E.flags;switch(E.tag){case 0:case 11:case 15:ls(y,E,A,O,g),Ml(8,E);break;case 23:break;case 22:var G=E.stateNode;E.memoizedState!==null?G._visibility&2?ls(y,E,A,O,g):Al(y,E):(G._visibility|=2,ls(y,E,A,O,g)),g&&V&2048&&Yh(E.alternate,E);break;case 24:ls(y,E,A,O,g),g&&V&2048&&Zh(E.alternate,E);break;default:ls(y,E,A,O,g)}s=s.sibling}}function Al(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=i,d=s,g=d.flags;switch(d.tag){case 22:Al(c,d),g&2048&&Yh(d.alternate,d);break;case 24:Al(c,d),g&2048&&Zh(d.alternate,d);break;default:Al(c,d)}s=s.sibling}}var kl=8192;function as(i,s,c){if(i.subtreeFlags&kl)for(i=i.child;i!==null;)ev(i,s,c),i=i.sibling}function ev(i,s,c){switch(i.tag){case 26:as(i,s,c),i.flags&kl&&i.memoizedState!==null&&pM(c,Bn,i.memoizedState,i.memoizedProps);break;case 5:as(i,s,c);break;case 3:case 4:var d=Bn;Bn=Zc(i.stateNode.containerInfo),as(i,s,c),Bn=d;break;case 22:i.memoizedState===null&&(d=i.alternate,d!==null&&d.memoizedState!==null?(d=kl,kl=16777216,as(i,s,c),kl=d):as(i,s,c));break;default:as(i,s,c)}}function tv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Rl(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var d=s[c];yt=d,rv(d,i)}tv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)nv(i),i=i.sibling}function nv(i){switch(i.tag){case 0:case 11:case 15:Rl(i),i.flags&2048&&ni(9,i,i.return);break;case 3:Rl(i);break;case 12:Rl(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,_c(i)):Rl(i);break;default:Rl(i)}}function _c(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var d=s[c];yt=d,rv(d,i)}tv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ni(8,s,s.return),_c(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,_c(s));break;default:_c(s)}i=i.sibling}}function rv(i,s){for(;yt!==null;){var c=yt;switch(c.tag){case 0:case 11:case 15:ni(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var d=c.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:dl(c.memoizedState.cache)}if(d=c.child,d!==null)d.return=c,yt=d;else e:for(c=i;yt!==null;){d=yt;var g=d.sibling,y=d.return;if(Gy(d),d===c){yt=null;break e}if(g!==null){g.return=y,yt=g;break e}yt=y}}}var R9={getCacheForType:function(i){var s=wt(at),c=s.data.get(i);return c===void 0&&(c=i(),s.data.set(i,c)),c},cacheSignal:function(){return wt(at).controller.signal}},O9=typeof WeakMap=="function"?WeakMap:Map,je=0,Fe=null,Ae=null,Re=0,Ie=0,fn=null,ri=!1,cs=!1,Xh=!1,wr=0,nt=0,ii=0,lo=0,Qh=0,dn=0,us=0,Ol=null,Wt=null,Wh=!1,Ic=0,iv=0,Hc=1/0,Bc=null,oi=null,mt=0,si=null,fs=null,Er=0,Jh=0,ep=null,ov=null,Nl=0,tp=null;function hn(){return(je&2)!==0&&Re!==0?Re&-Re:I.T!==null?lp():x0()}function sv(){if(dn===0)if((Re&536870912)===0||Ne){var i=Ga;Ga<<=1,(Ga&3932160)===0&&(Ga=262144),dn=i}else dn=536870912;return i=cn.current,i!==null&&(i.flags|=32),dn}function Jt(i,s,c){(i===Fe&&(Ie===2||Ie===9)||i.cancelPendingCommit!==null)&&(ds(i,0),li(i,Re,dn,!1)),Ws(i,c),((je&2)===0||i!==Fe)&&(i===Fe&&((je&2)===0&&(lo|=c),nt===4&&li(i,Re,dn,!1)),Yn(i))}function lv(i,s,c){if((je&6)!==0)throw Error(r(327));var d=!c&&(s&127)===0&&(s&i.expiredLanes)===0||Qs(i,s),g=d?L9(i,s):rp(i,s,!0),y=d;do{if(g===0){cs&&!d&&li(i,s,0,!1);break}else{if(c=i.current.alternate,y&&!N9(c)){g=rp(i,s,!1),y=!1;continue}if(g===2){if(y=s,i.errorRecoveryDisabledLanes&y)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){s=E;e:{var A=i;g=Ol;var O=A.current.memoizedState.isDehydrated;if(O&&(ds(A,E).flags|=256),E=rp(A,E,!1),E!==2){if(Xh&&!O){A.errorRecoveryDisabledLanes|=y,lo|=y,g=4;break e}y=Wt,Wt=g,y!==null&&(Wt===null?Wt=y:Wt.push.apply(Wt,y))}g=E}if(y=!1,g!==2)continue}}if(g===1){ds(i,0),li(i,s,0,!0);break}e:{switch(d=i,y=g,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:li(d,s,dn,!ri);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(g=Ic+300-rn(),10<g)){if(li(d,s,dn,!ri),Za(d,0,!0)!==0)break e;Er=s,d.timeoutHandle=Hv(av.bind(null,d,c,Wt,Bc,Wh,s,dn,lo,us,ri,y,"Throttled",-0,0),g);break e}av(d,c,Wt,Bc,Wh,s,dn,lo,us,ri,y,null,-0,0)}}break}while(!0);Yn(i)}function av(i,s,c,d,g,y,E,A,O,V,G,X,F,K){if(i.timeoutHandle=-1,X=s.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cr},ev(s,y,X);var ue=(y&62914560)===y?Ic-rn():(y&4194048)===y?iv-rn():0;if(ue=mM(X,ue),ue!==null){Er=y,i.cancelPendingCommit=ue(gv.bind(null,i,s,y,c,d,g,E,A,O,G,X,null,F,K)),li(i,y,E,!V);return}}gv(i,s,y,c,d,g,E,A,O)}function N9(i){for(var s=i;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var d=0;d<c.length;d++){var g=c[d],y=g.getSnapshot;g=g.value;try{if(!ln(y(),g))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function li(i,s,c,d){s&=~Qh,s&=~lo,i.suspendedLanes|=s,i.pingedLanes&=~s,d&&(i.warmLanes|=s),d=i.expirationTimes;for(var g=s;0<g;){var y=31-sn(g),E=1<<y;d[y]=-1,g&=~E}c!==0&&v0(i,c,s)}function Uc(){return(je&6)===0?(Dl(0),!1):!0}function np(){if(Ae!==null){if(Ie===0)var i=Ae.return;else i=Ae,hr=Wi=null,vh(i),ts=null,pl=0,i=Ae;for(;i!==null;)By(i.alternate,i),i=i.return;Ae=null}}function ds(i,s){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,Q9(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Er=0,np(),Fe=i,Ae=c=fr(i.current,null),Re=s,Ie=0,fn=null,ri=!1,cs=Qs(i,s),Xh=!1,us=dn=Qh=lo=ii=nt=0,Wt=Ol=null,Wh=!1,(s&8)!==0&&(s|=s&32);var d=i.entangledLanes;if(d!==0)for(i=i.entanglements,d&=s;0<d;){var g=31-sn(d),y=1<<g;s|=i[g],d&=~y}return wr=s,lc(),c}function cv(i,s){Se=null,I.H=Sl,s===es||s===mc?(s=M2(),Ie=3):s===sh?(s=M2(),Ie=4):Ie=s===zh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,fn=s,Ae===null&&(nt=1,Rc(i,xn(s,i.current)))}function uv(){var i=cn.current;return i===null?!0:(Re&4194048)===Re?Mn===null:(Re&62914560)===Re||(Re&536870912)!==0?i===Mn:!1}function fv(){var i=I.H;return I.H=Sl,i===null?Sl:i}function dv(){var i=I.A;return I.A=R9,i}function Vc(){nt=4,ri||(Re&4194048)!==Re&&cn.current!==null||(cs=!0),(ii&134217727)===0&&(lo&134217727)===0||Fe===null||li(Fe,Re,dn,!1)}function rp(i,s,c){var d=je;je|=2;var g=fv(),y=dv();(Fe!==i||Re!==s)&&(Bc=null,ds(i,s)),s=!1;var E=nt;e:do try{if(Ie!==0&&Ae!==null){var A=Ae,O=fn;switch(Ie){case 8:np(),E=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(s=!0);var V=Ie;if(Ie=0,fn=null,hs(i,A,O,V),c&&cs){E=0;break e}break;default:V=Ie,Ie=0,fn=null,hs(i,A,O,V)}}D9(),E=nt;break}catch(G){cv(i,G)}while(!0);return s&&i.shellSuspendCounter++,hr=Wi=null,je=d,I.H=g,I.A=y,Ae===null&&(Fe=null,Re=0,lc()),E}function D9(){for(;Ae!==null;)hv(Ae)}function L9(i,s){var c=je;je|=2;var d=fv(),g=dv();Fe!==i||Re!==s?(Bc=null,Hc=rn()+500,ds(i,s)):cs=Qs(i,s);e:do try{if(Ie!==0&&Ae!==null){s=Ae;var y=fn;t:switch(Ie){case 1:Ie=0,fn=null,hs(i,s,y,1);break;case 2:case 9:if(w2(y)){Ie=0,fn=null,pv(s);break}s=function(){Ie!==2&&Ie!==9||Fe!==i||(Ie=7),Yn(i)},y.then(s,s);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:w2(y)?(Ie=0,fn=null,pv(s)):(Ie=0,fn=null,hs(i,s,y,7));break;case 5:var E=null;switch(Ae.tag){case 26:E=Ae.memoizedState;case 5:case 27:var A=Ae;if(E?Jv(E):A.stateNode.complete){Ie=0,fn=null;var O=A.sibling;if(O!==null)Ae=O;else{var V=A.return;V!==null?(Ae=V,Pc(V)):Ae=null}break t}}Ie=0,fn=null,hs(i,s,y,5);break;case 6:Ie=0,fn=null,hs(i,s,y,6);break;case 8:np(),nt=6;break e;default:throw Error(r(462))}}z9();break}catch(G){cv(i,G)}while(!0);return hr=Wi=null,I.H=d,I.A=g,je=c,Ae!==null?0:(Fe=null,Re=0,lc(),nt)}function z9(){for(;Ae!==null&&!rE();)hv(Ae)}function hv(i){var s=Iy(i.alternate,i,wr);i.memoizedProps=i.pendingProps,s===null?Pc(i):Ae=s}function pv(i){var s=i,c=s.alternate;switch(s.tag){case 15:case 0:s=Ny(c,s,s.pendingProps,s.type,void 0,Re);break;case 11:s=Ny(c,s,s.pendingProps,s.type.render,s.ref,Re);break;case 5:vh(s);default:By(c,s),s=Ae=d2(s,wr),s=Iy(c,s,wr)}i.memoizedProps=i.pendingProps,s===null?Pc(i):Ae=s}function hs(i,s,c,d){hr=Wi=null,vh(s),ts=null,pl=0;var g=s.return;try{if(S9(i,g,s,c,Re)){nt=1,Rc(i,xn(c,i.current)),Ae=null;return}}catch(y){if(g!==null)throw Ae=g,y;nt=1,Rc(i,xn(c,i.current)),Ae=null;return}s.flags&32768?(Ne||d===1?i=!0:cs||(Re&536870912)!==0?i=!1:(ri=i=!0,(d===2||d===9||d===3||d===6)&&(d=cn.current,d!==null&&d.tag===13&&(d.flags|=16384))),mv(s,i)):Pc(s)}function Pc(i){var s=i;do{if((s.flags&32768)!==0){mv(s,ri);return}i=s.return;var c=M9(s.alternate,s,wr);if(c!==null){Ae=c;return}if(s=s.sibling,s!==null){Ae=s;return}Ae=s=i}while(s!==null);nt===0&&(nt=5)}function mv(i,s){do{var c=T9(i.alternate,i);if(c!==null){c.flags&=32767,Ae=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(i=i.sibling,i!==null)){Ae=i;return}Ae=i=c}while(i!==null);nt=6,Ae=null}function gv(i,s,c,d,g,y,E,A,O){i.cancelPendingCommit=null;do $c();while(mt!==0);if((je&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=qd,hE(i,c,y,E,A,O),i===Fe&&(Ae=Fe=null,Re=0),fs=s,si=i,Er=c,Jh=y,ep=g,ov=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,H9(qa,function(){return xv(),null})):(i.callbackNode=null,i.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=I.T,I.T=null,g=q.p,q.p=2,E=je,je|=4;try{A9(i,s,c)}finally{je=E,q.p=g,I.T=d}}mt=1,yv(),vv(),bv()}}function yv(){if(mt===1){mt=0;var i=si,s=fs,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=I.T,I.T=null;var d=q.p;q.p=2;var g=je;je|=4;try{Qy(s,i);var y=mp,E=r2(i.containerInfo),A=y.focusedElem,O=y.selectionRange;if(E!==A&&A&&A.ownerDocument&&n2(A.ownerDocument.documentElement,A)){if(O!==null&&Ud(A)){var V=O.start,G=O.end;if(G===void 0&&(G=V),"selectionStart"in A)A.selectionStart=V,A.selectionEnd=Math.min(G,A.value.length);else{var X=A.ownerDocument||document,F=X&&X.defaultView||window;if(F.getSelection){var K=F.getSelection(),ue=A.textContent.length,be=Math.min(O.start,ue),Pe=O.end===void 0?be:Math.min(O.end,ue);!K.extend&&be>Pe&&(E=Pe,Pe=be,be=E);var H=t2(A,be),z=t2(A,Pe);if(H&&z&&(K.rangeCount!==1||K.anchorNode!==H.node||K.anchorOffset!==H.offset||K.focusNode!==z.node||K.focusOffset!==z.offset)){var U=X.createRange();U.setStart(H.node,H.offset),K.removeAllRanges(),be>Pe?(K.addRange(U),K.extend(z.node,z.offset)):(U.setEnd(z.node,z.offset),K.addRange(U))}}}}for(X=[],K=A;K=K.parentNode;)K.nodeType===1&&X.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<X.length;A++){var Z=X[A];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}tu=!!pp,mp=pp=null}finally{je=g,q.p=d,I.T=c}}i.current=s,mt=2}}function vv(){if(mt===2){mt=0;var i=si,s=fs,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=I.T,I.T=null;var d=q.p;q.p=2;var g=je;je|=4;try{Ky(i,s.alternate,s)}finally{je=g,q.p=d,I.T=c}}mt=3}}function bv(){if(mt===4||mt===3){mt=0,iE();var i=si,s=fs,c=Er,d=ov;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?mt=5:(mt=0,fs=si=null,Cv(i,i.pendingLanes));var g=i.pendingLanes;if(g===0&&(oi=null),xd(c),s=s.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(Xs,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=I.T,g=q.p,q.p=2,I.T=null;try{for(var y=i.onRecoverableError,E=0;E<d.length;E++){var A=d[E];y(A.value,{componentStack:A.stack})}}finally{I.T=s,q.p=g}}(Er&3)!==0&&$c(),Yn(i),g=i.pendingLanes,(c&261930)!==0&&(g&42)!==0?i===tp?Nl++:(Nl=0,tp=i):Nl=0,Dl(0)}}function Cv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,dl(s)))}function $c(){return yv(),vv(),bv(),xv()}function xv(){if(mt!==5)return!1;var i=si,s=Jh;Jh=0;var c=xd(Er),d=I.T,g=q.p;try{q.p=32>c?32:c,I.T=null,c=ep,ep=null;var y=si,E=Er;if(mt=0,fs=si=null,Er=0,(je&6)!==0)throw Error(r(331));var A=je;if(je|=4,nv(y.current),Jy(y,y.current,E,c),je=A,Dl(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(Xs,y)}catch{}return!0}finally{q.p=g,I.T=d,Cv(i,s)}}function Sv(i,s,c){s=xn(c,s),s=Lh(i.stateNode,s,2),i=Jr(i,s,2),i!==null&&(Ws(i,2),Yn(i))}function He(i,s,c){if(i.tag===3)Sv(i,i,c);else for(;s!==null;){if(s.tag===3){Sv(s,i,c);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(oi===null||!oi.has(d))){i=xn(c,i),c=wy(2),d=Jr(s,c,2),d!==null&&(Ey(c,d,s,i),Ws(d,2),Yn(d));break}}s=s.return}}function ip(i,s,c){var d=i.pingCache;if(d===null){d=i.pingCache=new O9;var g=new Set;d.set(s,g)}else g=d.get(s),g===void 0&&(g=new Set,d.set(s,g));g.has(c)||(Xh=!0,g.add(c),i=j9.bind(null,i,s,c),s.then(i,i))}function j9(i,s,c){var d=i.pingCache;d!==null&&d.delete(s),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,Fe===i&&(Re&c)===c&&(nt===4||nt===3&&(Re&62914560)===Re&&300>rn()-Ic?(je&2)===0&&ds(i,0):Qh|=c,us===Re&&(us=0)),Yn(i)}function wv(i,s){s===0&&(s=y0()),i=Zi(i,s),i!==null&&(Ws(i,s),Yn(i))}function _9(i){var s=i.memoizedState,c=0;s!==null&&(c=s.retryLane),wv(i,c)}function I9(i,s){var c=0;switch(i.tag){case 31:case 13:var d=i.stateNode,g=i.memoizedState;g!==null&&(c=g.retryLane);break;case 19:d=i.stateNode;break;case 22:d=i.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(s),wv(i,c)}function H9(i,s){return yd(i,s)}var Fc=null,ps=null,op=!1,qc=!1,sp=!1,ai=0;function Yn(i){i!==ps&&i.next===null&&(ps===null?Fc=ps=i:ps=ps.next=i),qc=!0,op||(op=!0,U9())}function Dl(i,s){if(!sp&&qc){sp=!0;do for(var c=!1,d=Fc;d!==null;){if(i!==0){var g=d.pendingLanes;if(g===0)var y=0;else{var E=d.suspendedLanes,A=d.pingedLanes;y=(1<<31-sn(42|i)+1)-1,y&=g&~(E&~A),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(c=!0,Av(d,y))}else y=Re,y=Za(d,d===Fe?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||Qs(d,y)||(c=!0,Av(d,y));d=d.next}while(c);sp=!1}}function B9(){Ev()}function Ev(){qc=op=!1;var i=0;ai!==0&&X9()&&(i=ai);for(var s=rn(),c=null,d=Fc;d!==null;){var g=d.next,y=Mv(d,s);y===0?(d.next=null,c===null?Fc=g:c.next=g,g===null&&(ps=c)):(c=d,(i!==0||(y&3)!==0)&&(qc=!0)),d=g}mt!==0&&mt!==5||Dl(i),ai!==0&&(ai=0)}function Mv(i,s){for(var c=i.suspendedLanes,d=i.pingedLanes,g=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var E=31-sn(y),A=1<<E,O=g[E];O===-1?((A&c)===0||(A&d)!==0)&&(g[E]=dE(A,s)):O<=s&&(i.expiredLanes|=A),y&=~A}if(s=Fe,c=Re,c=Za(i,i===s?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),d=i.callbackNode,c===0||i===s&&(Ie===2||Ie===9)||i.cancelPendingCommit!==null)return d!==null&&d!==null&&vd(d),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||Qs(i,c)){if(s=c&-c,s===i.callbackPriority)return s;switch(d!==null&&vd(d),xd(c)){case 2:case 8:c=m0;break;case 32:c=qa;break;case 268435456:c=g0;break;default:c=qa}return d=Tv.bind(null,i),c=yd(c,d),i.callbackPriority=s,i.callbackNode=c,s}return d!==null&&d!==null&&vd(d),i.callbackPriority=2,i.callbackNode=null,2}function Tv(i,s){if(mt!==0&&mt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if($c()&&i.callbackNode!==c)return null;var d=Re;return d=Za(i,i===Fe?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),d===0?null:(lv(i,d,s),Mv(i,rn()),i.callbackNode!=null&&i.callbackNode===c?Tv.bind(null,i):null)}function Av(i,s){if($c())return null;lv(i,s,!0)}function U9(){W9(function(){(je&6)!==0?yd(p0,B9):Ev()})}function lp(){if(ai===0){var i=Wo;i===0&&(i=Ka,Ka<<=1,(Ka&261888)===0&&(Ka=256)),ai=i}return ai}function kv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ja(""+i)}function Rv(i,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,i.id&&c.setAttribute("form",i.id),s.parentNode.insertBefore(c,s),i=new FormData(i),c.parentNode.removeChild(c),i}function V9(i,s,c,d,g){if(s==="submit"&&c&&c.stateNode===g){var y=kv((g[Gt]||null).action),E=d.submitter;E&&(s=(s=E[Gt]||null)?kv(s.formAction):E.getAttribute("formAction"),s!==null&&(y=s,E=null));var A=new rc("action","action",null,d,g);i.push({event:A,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ai!==0){var O=E?Rv(g,E):new FormData(g);Ah(c,{pending:!0,data:O,method:g.method,action:y},null,O)}}else typeof y=="function"&&(A.preventDefault(),O=E?Rv(g,E):new FormData(g),Ah(c,{pending:!0,data:O,method:g.method,action:y},y,O))},currentTarget:g}]})}}for(var ap=0;ap<Fd.length;ap++){var cp=Fd[ap],P9=cp.toLowerCase(),$9=cp[0].toUpperCase()+cp.slice(1);Hn(P9,"on"+$9)}Hn(s2,"onAnimationEnd"),Hn(l2,"onAnimationIteration"),Hn(a2,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(o9,"onTransitionRun"),Hn(s9,"onTransitionStart"),Hn(l9,"onTransitionCancel"),Hn(c2,"onTransitionEnd"),Ho("onMouseEnter",["mouseout","mouseover"]),Ho("onMouseLeave",["mouseout","mouseover"]),Ho("onPointerEnter",["pointerout","pointerover"]),Ho("onPointerLeave",["pointerout","pointerover"]),qi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qi("onBeforeInput",["compositionend","keypress","textInput","paste"]),qi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ll="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),F9=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ll));function Ov(i,s){s=(s&4)!==0;for(var c=0;c<i.length;c++){var d=i[c],g=d.event;d=d.listeners;e:{var y=void 0;if(s)for(var E=d.length-1;0<=E;E--){var A=d[E],O=A.instance,V=A.currentTarget;if(A=A.listener,O!==y&&g.isPropagationStopped())break e;y=A,g.currentTarget=V;try{y(g)}catch(G){sc(G)}g.currentTarget=null,y=O}else for(E=0;E<d.length;E++){if(A=d[E],O=A.instance,V=A.currentTarget,A=A.listener,O!==y&&g.isPropagationStopped())break e;y=A,g.currentTarget=V;try{y(g)}catch(G){sc(G)}g.currentTarget=null,y=O}}}}function ke(i,s){var c=s[Sd];c===void 0&&(c=s[Sd]=new Set);var d=i+"__bubble";c.has(d)||(Nv(s,i,2,!1),c.add(d))}function up(i,s,c){var d=0;s&&(d|=4),Nv(c,i,d,s)}var Kc="_reactListening"+Math.random().toString(36).slice(2);function fp(i){if(!i[Kc]){i[Kc]=!0,E0.forEach(function(c){c!=="selectionchange"&&(F9.has(c)||up(c,!1,i),up(c,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Kc]||(s[Kc]=!0,up("selectionchange",!1,s))}}function Nv(i,s,c,d){switch(sb(s)){case 2:var g=vM;break;case 8:g=bM;break;default:g=Tp}c=g.bind(null,s,c,i),g=void 0,!Nd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),d?g!==void 0?i.addEventListener(s,c,{capture:!0,passive:g}):i.addEventListener(s,c,!0):g!==void 0?i.addEventListener(s,c,{passive:g}):i.addEventListener(s,c,!1)}function dp(i,s,c,d,g){var y=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var E=d.tag;if(E===3||E===4){var A=d.stateNode.containerInfo;if(A===g)break;if(E===4)for(E=d.return;E!==null;){var O=E.tag;if((O===3||O===4)&&E.stateNode.containerInfo===g)return;E=E.return}for(;A!==null;){if(E=jo(A),E===null)return;if(O=E.tag,O===5||O===6||O===26||O===27){d=y=E;continue e}A=A.parentNode}}d=d.return}_0(function(){var V=y,G=Rd(c),X=[];e:{var F=u2.get(i);if(F!==void 0){var K=rc,ue=i;switch(i){case"keypress":if(tc(c)===0)break e;case"keydown":case"keyup":K=IE;break;case"focusin":ue="focus",K=jd;break;case"focusout":ue="blur",K=jd;break;case"beforeblur":case"afterblur":K=jd;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=B0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=ME;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=UE;break;case s2:case l2:case a2:K=kE;break;case c2:K=PE;break;case"scroll":case"scrollend":K=wE;break;case"wheel":K=FE;break;case"copy":case"cut":case"paste":K=OE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=V0;break;case"toggle":case"beforetoggle":K=KE}var be=(s&4)!==0,Pe=!be&&(i==="scroll"||i==="scrollend"),H=be?F!==null?F+"Capture":null:F;be=[];for(var z=V,U;z!==null;){var Z=z;if(U=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||U===null||H===null||(Z=tl(z,H),Z!=null&&be.push(zl(z,Z,U))),Pe)break;z=z.return}0<be.length&&(F=new K(F,ue,null,c,G),X.push({event:F,listeners:be}))}}if((s&7)===0){e:{if(F=i==="mouseover"||i==="pointerover",K=i==="mouseout"||i==="pointerout",F&&c!==kd&&(ue=c.relatedTarget||c.fromElement)&&(jo(ue)||ue[zo]))break e;if((K||F)&&(F=G.window===G?G:(F=G.ownerDocument)?F.defaultView||F.parentWindow:window,K?(ue=c.relatedTarget||c.toElement,K=V,ue=ue?jo(ue):null,ue!==null&&(Pe=l(ue),be=ue.tag,ue!==Pe||be!==5&&be!==27&&be!==6)&&(ue=null)):(K=null,ue=V),K!==ue)){if(be=B0,Z="onMouseLeave",H="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(be=V0,Z="onPointerLeave",H="onPointerEnter",z="pointer"),Pe=K==null?F:el(K),U=ue==null?F:el(ue),F=new be(Z,z+"leave",K,c,G),F.target=Pe,F.relatedTarget=U,Z=null,jo(G)===V&&(be=new be(H,z+"enter",ue,c,G),be.target=U,be.relatedTarget=Pe,Z=be),Pe=Z,K&&ue)t:{for(be=q9,H=K,z=ue,U=0,Z=H;Z;Z=be(Z))U++;Z=0;for(var ye=z;ye;ye=be(ye))Z++;for(;0<U-Z;)H=be(H),U--;for(;0<Z-U;)z=be(z),Z--;for(;U--;){if(H===z||z!==null&&H===z.alternate){be=H;break t}H=be(H),z=be(z)}be=null}else be=null;K!==null&&Dv(X,F,K,be,!1),ue!==null&&Pe!==null&&Dv(X,Pe,ue,be,!0)}}e:{if(F=V?el(V):window,K=F.nodeName&&F.nodeName.toLowerCase(),K==="select"||K==="input"&&F.type==="file")var Le=Z0;else if(G0(F))if(X0)Le=n9;else{Le=e9;var he=JE}else K=F.nodeName,!K||K.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?V&&Ad(V.elementType)&&(Le=Z0):Le=t9;if(Le&&(Le=Le(i,V))){Y0(X,Le,c,G);break e}he&&he(i,F,V),i==="focusout"&&V&&F.type==="number"&&V.memoizedProps.value!=null&&Td(F,"number",F.value)}switch(he=V?el(V):window,i){case"focusin":(G0(he)||he.contentEditable==="true")&&(Fo=he,Vd=V,cl=null);break;case"focusout":cl=Vd=Fo=null;break;case"mousedown":Pd=!0;break;case"contextmenu":case"mouseup":case"dragend":Pd=!1,i2(X,c,G);break;case"selectionchange":if(i9)break;case"keydown":case"keyup":i2(X,c,G)}var we;if(Id)e:{switch(i){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else $o?q0(i,c)&&(Oe="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Oe="onCompositionStart");Oe&&(P0&&c.locale!=="ko"&&($o||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&$o&&(we=I0()):(Kr=G,Dd="value"in Kr?Kr.value:Kr.textContent,$o=!0)),he=Gc(V,Oe),0<he.length&&(Oe=new U0(Oe,i,null,c,G),X.push({event:Oe,listeners:he}),we?Oe.data=we:(we=K0(c),we!==null&&(Oe.data=we)))),(we=YE?ZE(i,c):XE(i,c))&&(Oe=Gc(V,"onBeforeInput"),0<Oe.length&&(he=new U0("onBeforeInput","beforeinput",null,c,G),X.push({event:he,listeners:Oe}),he.data=we)),V9(X,i,V,c,G)}Ov(X,s)})}function zl(i,s,c){return{instance:i,listener:s,currentTarget:c}}function Gc(i,s){for(var c=s+"Capture",d=[];i!==null;){var g=i,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=tl(i,c),g!=null&&d.unshift(zl(i,g,y)),g=tl(i,s),g!=null&&d.push(zl(i,g,y))),i.tag===3)return d;i=i.return}return[]}function q9(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Dv(i,s,c,d,g){for(var y=s._reactName,E=[];c!==null&&c!==d;){var A=c,O=A.alternate,V=A.stateNode;if(A=A.tag,O!==null&&O===d)break;A!==5&&A!==26&&A!==27||V===null||(O=V,g?(V=tl(c,y),V!=null&&E.unshift(zl(c,V,O))):g||(V=tl(c,y),V!=null&&E.push(zl(c,V,O)))),c=c.return}E.length!==0&&i.push({event:s,listeners:E})}var K9=/\r\n?/g,G9=/\u0000|\uFFFD/g;function Lv(i){return(typeof i=="string"?i:""+i).replace(K9,`
49
+ `).replace(G9,"")}function zv(i,s){return s=Lv(s),Lv(i)===s}function Ve(i,s,c,d,g,y){switch(c){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||Uo(i,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&Uo(i,""+d);break;case"className":Qa(i,"class",d);break;case"tabIndex":Qa(i,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Qa(i,c,d);break;case"style":z0(i,d,y);break;case"data":if(s!=="object"){Qa(i,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||c!=="href")){i.removeAttribute(c);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){i.removeAttribute(c);break}d=Ja(""+d),i.setAttribute(c,d);break;case"action":case"formAction":if(typeof d=="function"){i.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(c==="formAction"?(s!=="input"&&Ve(i,s,"name",g.name,g,null),Ve(i,s,"formEncType",g.formEncType,g,null),Ve(i,s,"formMethod",g.formMethod,g,null),Ve(i,s,"formTarget",g.formTarget,g,null)):(Ve(i,s,"encType",g.encType,g,null),Ve(i,s,"method",g.method,g,null),Ve(i,s,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){i.removeAttribute(c);break}d=Ja(""+d),i.setAttribute(c,d);break;case"onClick":d!=null&&(i.onclick=cr);break;case"onScroll":d!=null&&ke("scroll",i);break;case"onScrollEnd":d!=null&&ke("scrollend",i);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(c=d.__html,c!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":i.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){i.removeAttribute("xlink:href");break}c=Ja(""+d),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(c,""+d):i.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":d===!0?i.setAttribute(c,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(c,d):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?i.setAttribute(c,d):i.removeAttribute(c);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?i.removeAttribute(c):i.setAttribute(c,d);break;case"popover":ke("beforetoggle",i),ke("toggle",i),Xa(i,"popover",d);break;case"xlinkActuate":ar(i,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ar(i,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ar(i,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ar(i,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ar(i,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ar(i,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ar(i,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ar(i,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ar(i,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Xa(i,"is",d);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=xE.get(c)||c,Xa(i,c,d))}}function hp(i,s,c,d,g,y){switch(c){case"style":z0(i,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(c=d.__html,c!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof d=="string"?Uo(i,d):(typeof d=="number"||typeof d=="bigint")&&Uo(i,""+d);break;case"onScroll":d!=null&&ke("scroll",i);break;case"onScrollEnd":d!=null&&ke("scrollend",i);break;case"onClick":d!=null&&(i.onclick=cr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!M0.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(g=c.endsWith("Capture"),s=c.slice(2,g?c.length-7:void 0),y=i[Gt]||null,y=y!=null?y[c]:null,typeof y=="function"&&i.removeEventListener(s,y,g),typeof d=="function")){typeof y!="function"&&y!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(s,d,g);break e}c in i?i[c]=d:d===!0?i.setAttribute(c,""):Xa(i,c,d)}}}function Mt(i,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",i),ke("load",i);var d=!1,g=!1,y;for(y in c)if(c.hasOwnProperty(y)){var E=c[y];if(E!=null)switch(y){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ve(i,s,y,E,c,null)}}g&&Ve(i,s,"srcSet",c.srcSet,c,null),d&&Ve(i,s,"src",c.src,c,null);return;case"input":ke("invalid",i);var A=y=E=g=null,O=null,V=null;for(d in c)if(c.hasOwnProperty(d)){var G=c[d];if(G!=null)switch(d){case"name":g=G;break;case"type":E=G;break;case"checked":O=G;break;case"defaultChecked":V=G;break;case"value":y=G;break;case"defaultValue":A=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,s));break;default:Ve(i,s,d,G,c,null)}}O0(i,y,A,O,V,E,g,!1);return;case"select":ke("invalid",i),d=E=y=null;for(g in c)if(c.hasOwnProperty(g)&&(A=c[g],A!=null))switch(g){case"value":y=A;break;case"defaultValue":E=A;break;case"multiple":d=A;default:Ve(i,s,g,A,c,null)}s=y,c=E,i.multiple=!!d,s!=null?Bo(i,!!d,s,!1):c!=null&&Bo(i,!!d,c,!0);return;case"textarea":ke("invalid",i),y=g=d=null;for(E in c)if(c.hasOwnProperty(E)&&(A=c[E],A!=null))switch(E){case"value":d=A;break;case"defaultValue":g=A;break;case"children":y=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:Ve(i,s,E,A,c,null)}D0(i,d,g,y);return;case"option":for(O in c)if(c.hasOwnProperty(O)&&(d=c[O],d!=null))switch(O){case"selected":i.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Ve(i,s,O,d,c,null)}return;case"dialog":ke("beforetoggle",i),ke("toggle",i),ke("cancel",i),ke("close",i);break;case"iframe":case"object":ke("load",i);break;case"video":case"audio":for(d=0;d<Ll.length;d++)ke(Ll[d],i);break;case"image":ke("error",i),ke("load",i);break;case"details":ke("toggle",i);break;case"embed":case"source":case"link":ke("error",i),ke("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in c)if(c.hasOwnProperty(V)&&(d=c[V],d!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ve(i,s,V,d,c,null)}return;default:if(Ad(s)){for(G in c)c.hasOwnProperty(G)&&(d=c[G],d!==void 0&&hp(i,s,G,d,c,void 0));return}}for(A in c)c.hasOwnProperty(A)&&(d=c[A],d!=null&&Ve(i,s,A,d,c,null))}function Y9(i,s,c,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,E=null,A=null,O=null,V=null,G=null;for(K in c){var X=c[K];if(c.hasOwnProperty(K)&&X!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":O=X;default:d.hasOwnProperty(K)||Ve(i,s,K,null,d,X)}}for(var F in d){var K=d[F];if(X=c[F],d.hasOwnProperty(F)&&(K!=null||X!=null))switch(F){case"type":y=K;break;case"name":g=K;break;case"checked":V=K;break;case"defaultChecked":G=K;break;case"value":E=K;break;case"defaultValue":A=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,s));break;default:K!==X&&Ve(i,s,F,K,d,X)}}Md(i,E,A,O,V,G,y,g);return;case"select":K=E=A=F=null;for(y in c)if(O=c[y],c.hasOwnProperty(y)&&O!=null)switch(y){case"value":break;case"multiple":K=O;default:d.hasOwnProperty(y)||Ve(i,s,y,null,d,O)}for(g in d)if(y=d[g],O=c[g],d.hasOwnProperty(g)&&(y!=null||O!=null))switch(g){case"value":F=y;break;case"defaultValue":A=y;break;case"multiple":E=y;default:y!==O&&Ve(i,s,g,y,d,O)}s=A,c=E,d=K,F!=null?Bo(i,!!c,F,!1):!!d!=!!c&&(s!=null?Bo(i,!!c,s,!0):Bo(i,!!c,c?[]:"",!1));return;case"textarea":K=F=null;for(A in c)if(g=c[A],c.hasOwnProperty(A)&&g!=null&&!d.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Ve(i,s,A,null,d,g)}for(E in d)if(g=d[E],y=c[E],d.hasOwnProperty(E)&&(g!=null||y!=null))switch(E){case"value":F=g;break;case"defaultValue":K=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==y&&Ve(i,s,E,g,d,y)}N0(i,F,K);return;case"option":for(var ue in c)if(F=c[ue],c.hasOwnProperty(ue)&&F!=null&&!d.hasOwnProperty(ue))switch(ue){case"selected":i.selected=!1;break;default:Ve(i,s,ue,null,d,F)}for(O in d)if(F=d[O],K=c[O],d.hasOwnProperty(O)&&F!==K&&(F!=null||K!=null))switch(O){case"selected":i.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Ve(i,s,O,F,d,K)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var be in c)F=c[be],c.hasOwnProperty(be)&&F!=null&&!d.hasOwnProperty(be)&&Ve(i,s,be,null,d,F);for(V in d)if(F=d[V],K=c[V],d.hasOwnProperty(V)&&F!==K&&(F!=null||K!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,s));break;default:Ve(i,s,V,F,d,K)}return;default:if(Ad(s)){for(var Pe in c)F=c[Pe],c.hasOwnProperty(Pe)&&F!==void 0&&!d.hasOwnProperty(Pe)&&hp(i,s,Pe,void 0,d,F);for(G in d)F=d[G],K=c[G],!d.hasOwnProperty(G)||F===K||F===void 0&&K===void 0||hp(i,s,G,F,d,K);return}}for(var H in c)F=c[H],c.hasOwnProperty(H)&&F!=null&&!d.hasOwnProperty(H)&&Ve(i,s,H,null,d,F);for(X in d)F=d[X],K=c[X],!d.hasOwnProperty(X)||F===K||F==null&&K==null||Ve(i,s,X,F,d,K)}function jv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z9(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,c=performance.getEntriesByType("resource"),d=0;d<c.length;d++){var g=c[d],y=g.transferSize,E=g.initiatorType,A=g.duration;if(y&&A&&jv(E)){for(E=0,A=g.responseEnd,d+=1;d<c.length;d++){var O=c[d],V=O.startTime;if(V>A)break;var G=O.transferSize,X=O.initiatorType;G&&jv(X)&&(O=O.responseEnd,E+=G*(O<A?1:(A-V)/(O-V)))}if(--d,s+=8*(y+E)/(g.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var pp=null,mp=null;function Yc(i){return i.nodeType===9?i:i.ownerDocument}function _v(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Iv(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function gp(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var yp=null;function X9(){var i=window.event;return i&&i.type==="popstate"?i===yp?!1:(yp=i,!0):(yp=null,!1)}var Hv=typeof setTimeout=="function"?setTimeout:void 0,Q9=typeof clearTimeout=="function"?clearTimeout:void 0,Bv=typeof Promise=="function"?Promise:void 0,W9=typeof queueMicrotask=="function"?queueMicrotask:typeof Bv<"u"?function(i){return Bv.resolve(null).then(i).catch(J9)}:Hv;function J9(i){setTimeout(function(){throw i})}function ci(i){return i==="head"}function Uv(i,s){var c=s,d=0;do{var g=c.nextSibling;if(i.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"||c==="/&"){if(d===0){i.removeChild(g),vs(s);return}d--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")d++;else if(c==="html")jl(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,jl(c);for(var y=c.firstChild;y;){var E=y.nextSibling,A=y.nodeName;y[Js]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&y.rel.toLowerCase()==="stylesheet"||c.removeChild(y),y=E}}else c==="body"&&jl(i.ownerDocument.body);c=g}while(c);vs(s)}function Vv(i,s){var c=i;i=0;do{var d=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),d&&d.nodeType===8)if(c=d.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=d}while(c)}function vp(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":vp(c),wd(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function eM(i,s,c,d){for(;i.nodeType===1;){var g=c;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(d){if(!i[Js])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==g.rel||i.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||i.getAttribute("title")!==(g.title==null?null:g.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(g.src==null?null:g.src)||i.getAttribute("type")!==(g.type==null?null:g.type)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Tn(i.nextSibling),i===null)break}return null}function tM(i,s,c){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=Tn(i.nextSibling),i===null))return null;return i}function Pv(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Tn(i.nextSibling),i===null))return null;return i}function bp(i){return i.data==="$?"||i.data==="$~"}function Cp(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function nM(i,s){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||c.readyState!=="loading")s();else{var d=function(){s(),c.removeEventListener("DOMContentLoaded",d)};c.addEventListener("DOMContentLoaded",d),i._reactRetry=d}}function Tn(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var xp=null;function $v(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(s===0)return Tn(i.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}i=i.nextSibling}return null}function Fv(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return i;s--}else c!=="/$"&&c!=="/&"||s++}i=i.previousSibling}return null}function qv(i,s,c){switch(s=Yc(c),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function jl(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);wd(i)}var An=new Map,Kv=new Set;function Zc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Mr=q.d;q.d={f:rM,r:iM,D:oM,C:sM,L:lM,m:aM,X:uM,S:cM,M:fM};function rM(){var i=Mr.f(),s=Uc();return i||s}function iM(i){var s=_o(i);s!==null&&s.tag===5&&s.type==="form"?cy(s):Mr.r(i)}var ms=typeof document>"u"?null:document;function Gv(i,s,c){var d=ms;if(d&&typeof s=="string"&&s){var g=bn(s);g='link[rel="'+i+'"][href="'+g+'"]',typeof c=="string"&&(g+='[crossorigin="'+c+'"]'),Kv.has(g)||(Kv.add(g),i={rel:i,crossOrigin:c,href:s},d.querySelector(g)===null&&(s=d.createElement("link"),Mt(s,"link",i),gt(s),d.head.appendChild(s)))}}function oM(i){Mr.D(i),Gv("dns-prefetch",i,null)}function sM(i,s){Mr.C(i,s),Gv("preconnect",i,s)}function lM(i,s,c){Mr.L(i,s,c);var d=ms;if(d&&i&&s){var g='link[rel="preload"][as="'+bn(s)+'"]';s==="image"&&c&&c.imageSrcSet?(g+='[imagesrcset="'+bn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(g+='[imagesizes="'+bn(c.imageSizes)+'"]')):g+='[href="'+bn(i)+'"]';var y=g;switch(s){case"style":y=gs(i);break;case"script":y=ys(i)}An.has(y)||(i=m({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:i,as:s},c),An.set(y,i),d.querySelector(g)!==null||s==="style"&&d.querySelector(_l(y))||s==="script"&&d.querySelector(Il(y))||(s=d.createElement("link"),Mt(s,"link",i),gt(s),d.head.appendChild(s)))}}function aM(i,s){Mr.m(i,s);var c=ms;if(c&&i){var d=s&&typeof s.as=="string"?s.as:"script",g='link[rel="modulepreload"][as="'+bn(d)+'"][href="'+bn(i)+'"]',y=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=ys(i)}if(!An.has(y)&&(i=m({rel:"modulepreload",href:i},s),An.set(y,i),c.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Il(y)))return}d=c.createElement("link"),Mt(d,"link",i),gt(d),c.head.appendChild(d)}}}function cM(i,s,c){Mr.S(i,s,c);var d=ms;if(d&&i){var g=Io(d).hoistableStyles,y=gs(i);s=s||"default";var E=g.get(y);if(!E){var A={loading:0,preload:null};if(E=d.querySelector(_l(y)))A.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},c),(c=An.get(y))&&Sp(i,c);var O=E=d.createElement("link");gt(O),Mt(O,"link",i),O._p=new Promise(function(V,G){O.onload=V,O.onerror=G}),O.addEventListener("load",function(){A.loading|=1}),O.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Xc(E,s,d)}E={type:"stylesheet",instance:E,count:1,state:A},g.set(y,E)}}}function uM(i,s){Mr.X(i,s);var c=ms;if(c&&i){var d=Io(c).hoistableScripts,g=ys(i),y=d.get(g);y||(y=c.querySelector(Il(g)),y||(i=m({src:i,async:!0},s),(s=An.get(g))&&wp(i,s),y=c.createElement("script"),gt(y),Mt(y,"link",i),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function fM(i,s){Mr.M(i,s);var c=ms;if(c&&i){var d=Io(c).hoistableScripts,g=ys(i),y=d.get(g);y||(y=c.querySelector(Il(g)),y||(i=m({src:i,async:!0,type:"module"},s),(s=An.get(g))&&wp(i,s),y=c.createElement("script"),gt(y),Mt(y,"link",i),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function Yv(i,s,c,d){var g=(g=me.current)?Zc(g):null;if(!g)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=gs(c.href),c=Io(g).hoistableStyles,d=c.get(s),d||(d={type:"style",instance:null,count:0,state:null},c.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=gs(c.href);var y=Io(g).hoistableStyles,E=y.get(i);if(E||(g=g.ownerDocument||g,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,E),(y=g.querySelector(_l(i)))&&!y._p&&(E.instance=y,E.state.loading=5),An.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},An.set(i,c),y||dM(g,i,c,E.state))),s&&d===null)throw Error(r(528,""));return E}if(s&&d!==null)throw Error(r(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ys(c),c=Io(g).hoistableScripts,d=c.get(s),d||(d={type:"script",instance:null,count:0,state:null},c.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function gs(i){return'href="'+bn(i)+'"'}function _l(i){return'link[rel="stylesheet"]['+i+"]"}function Zv(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function dM(i,s,c,d){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=i.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),Mt(s,"link",c),gt(s),i.head.appendChild(s))}function ys(i){return'[src="'+bn(i)+'"]'}function Il(i){return"script[async]"+i}function Xv(i,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var d=i.querySelector('style[data-href~="'+bn(c.href)+'"]');if(d)return s.instance=d,gt(d),d;var g=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return d=(i.ownerDocument||i).createElement("style"),gt(d),Mt(d,"style",g),Xc(d,c.precedence,i),s.instance=d;case"stylesheet":g=gs(c.href);var y=i.querySelector(_l(g));if(y)return s.state.loading|=4,s.instance=y,gt(y),y;d=Zv(c),(g=An.get(g))&&Sp(d,g),y=(i.ownerDocument||i).createElement("link"),gt(y);var E=y;return E._p=new Promise(function(A,O){E.onload=A,E.onerror=O}),Mt(y,"link",d),s.state.loading|=4,Xc(y,c.precedence,i),s.instance=y;case"script":return y=ys(c.src),(g=i.querySelector(Il(y)))?(s.instance=g,gt(g),g):(d=c,(g=An.get(y))&&(d=m({},c),wp(d,g)),i=i.ownerDocument||i,g=i.createElement("script"),gt(g),Mt(g,"link",d),i.head.appendChild(g),s.instance=g);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,Xc(d,c.precedence,i));return s.instance}function Xc(i,s,c){for(var d=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,y=g,E=0;E<d.length;E++){var A=d[E];if(A.dataset.precedence===s)y=A;else if(y!==g)break}y?y.parentNode.insertBefore(i,y.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(i,s.firstChild))}function Sp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function wp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Qc=null;function Qv(i,s,c){if(Qc===null){var d=new Map,g=Qc=new Map;g.set(c,d)}else g=Qc,d=g.get(c),d||(d=new Map,g.set(c,d));if(d.has(i))return d;for(d.set(i,null),c=c.getElementsByTagName(i),g=0;g<c.length;g++){var y=c[g];if(!(y[Js]||y[xt]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var E=y.getAttribute(s)||"";E=i+E;var A=d.get(E);A?A.push(y):d.set(E,[y])}}return d}function Wv(i,s,c){i=i.ownerDocument||i,i.head.insertBefore(c,s==="title"?i.querySelector("head > title"):null)}function hM(i,s,c){if(c===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Jv(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function pM(i,s,c,d){if(c.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var g=gs(d.href),y=s.querySelector(_l(g));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Wc.bind(i),s.then(i,i)),c.state.loading|=4,c.instance=y,gt(y);return}y=s.ownerDocument||s,d=Zv(d),(g=An.get(g))&&Sp(d,g),y=y.createElement("link"),gt(y);var E=y;E._p=new Promise(function(A,O){E.onload=A,E.onerror=O}),Mt(y,"link",d),c.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=Wc.bind(i),s.addEventListener("load",c),s.addEventListener("error",c))}}var Ep=0;function mM(i,s){return i.stylesheets&&i.count===0&&eu(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var d=setTimeout(function(){if(i.stylesheets&&eu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&Ep===0&&(Ep=62500*Z9());var g=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&eu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Ep?50:800)+s);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function Wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)eu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Jc=null;function eu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Jc=new Map,s.forEach(gM,i),Jc=null,Wc.call(i))}function gM(i,s){if(!(s.state.loading&4)){var c=Jc.get(i);if(c)var d=c.get(null);else{c=new Map,Jc.set(i,c);for(var g=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var E=g[y];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),d=E)}d&&c.set(null,d)}g=s.instance,E=g.getAttribute("data-precedence"),y=c.get(E)||d,y===d&&c.set(null,g),c.set(E,g),this.count++,d=Wc.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),y?y.parentNode.insertBefore(g,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(g,i.firstChild)),s.state.loading|=4}}var Hl={$$typeof:R,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function yM(i,s,c,d,g,y,E,A,O){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=bd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bd(0),this.hiddenUpdates=bd(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function eb(i,s,c,d,g,y,E,A,O,V,G,X){return i=new yM(i,s,c,E,O,V,G,X,A),s=1,y===!0&&(s|=24),y=an(3,null,null,s),i.current=y,y.stateNode=i,s=rh(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:d,isDehydrated:c,cache:s},lh(y),i}function tb(i){return i?(i=Go,i):Go}function nb(i,s,c,d,g,y){g=tb(g),d.context===null?d.context=g:d.pendingContext=g,d=Wr(s),d.payload={element:c},y=y===void 0?null:y,y!==null&&(d.callback=y),c=Jr(i,d,s),c!==null&&(Jt(c,i,s),gl(c,i,s))}function rb(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<s?c:s}}function Mp(i,s){rb(i,s),(i=i.alternate)&&rb(i,s)}function ib(i){if(i.tag===13||i.tag===31){var s=Zi(i,67108864);s!==null&&Jt(s,i,67108864),Mp(i,67108864)}}function ob(i){if(i.tag===13||i.tag===31){var s=hn();s=Cd(s);var c=Zi(i,s);c!==null&&Jt(c,i,s),Mp(i,s)}}var tu=!0;function vM(i,s,c,d){var g=I.T;I.T=null;var y=q.p;try{q.p=2,Tp(i,s,c,d)}finally{q.p=y,I.T=g}}function bM(i,s,c,d){var g=I.T;I.T=null;var y=q.p;try{q.p=8,Tp(i,s,c,d)}finally{q.p=y,I.T=g}}function Tp(i,s,c,d){if(tu){var g=Ap(d);if(g===null)dp(i,s,d,nu,c),lb(i,d);else if(xM(g,i,s,c,d))d.stopPropagation();else if(lb(i,d),s&4&&-1<CM.indexOf(i)){for(;g!==null;){var y=_o(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var E=Fi(y.pendingLanes);if(E!==0){var A=y;for(A.pendingLanes|=2,A.entangledLanes|=2;E;){var O=1<<31-sn(E);A.entanglements[1]|=O,E&=~O}Yn(y),(je&6)===0&&(Hc=rn()+500,Dl(0))}}break;case 31:case 13:A=Zi(y,2),A!==null&&Jt(A,y,2),Uc(),Mp(y,2)}if(y=Ap(d),y===null&&dp(i,s,d,nu,c),y===g)break;g=y}g!==null&&d.stopPropagation()}else dp(i,s,d,null,c)}}function Ap(i){return i=Rd(i),kp(i)}var nu=null;function kp(i){if(nu=null,i=jo(i),i!==null){var s=l(i);if(s===null)i=null;else{var c=s.tag;if(c===13){if(i=a(s),i!==null)return i;i=null}else if(c===31){if(i=u(s),i!==null)return i;i=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return nu=i,null}function sb(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(oE()){case p0:return 2;case m0:return 8;case qa:case sE:return 32;case g0:return 268435456;default:return 32}default:return 32}}var Rp=!1,ui=null,fi=null,di=null,Bl=new Map,Ul=new Map,hi=[],CM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function lb(i,s){switch(i){case"focusin":case"focusout":ui=null;break;case"dragenter":case"dragleave":fi=null;break;case"mouseover":case"mouseout":di=null;break;case"pointerover":case"pointerout":Bl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ul.delete(s.pointerId)}}function Vl(i,s,c,d,g,y){return i===null||i.nativeEvent!==y?(i={blockedOn:s,domEventName:c,eventSystemFlags:d,nativeEvent:y,targetContainers:[g]},s!==null&&(s=_o(s),s!==null&&ib(s)),i):(i.eventSystemFlags|=d,s=i.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),i)}function xM(i,s,c,d,g){switch(s){case"focusin":return ui=Vl(ui,i,s,c,d,g),!0;case"dragenter":return fi=Vl(fi,i,s,c,d,g),!0;case"mouseover":return di=Vl(di,i,s,c,d,g),!0;case"pointerover":var y=g.pointerId;return Bl.set(y,Vl(Bl.get(y)||null,i,s,c,d,g)),!0;case"gotpointercapture":return y=g.pointerId,Ul.set(y,Vl(Ul.get(y)||null,i,s,c,d,g)),!0}return!1}function ab(i){var s=jo(i.target);if(s!==null){var c=l(s);if(c!==null){if(s=c.tag,s===13){if(s=a(c),s!==null){i.blockedOn=s,S0(i.priority,function(){ob(c)});return}}else if(s===31){if(s=u(c),s!==null){i.blockedOn=s,S0(i.priority,function(){ob(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function ru(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var c=Ap(i.nativeEvent);if(c===null){c=i.nativeEvent;var d=new c.constructor(c.type,c);kd=d,c.target.dispatchEvent(d),kd=null}else return s=_o(c),s!==null&&ib(s),i.blockedOn=c,!1;s.shift()}return!0}function cb(i,s,c){ru(i)&&c.delete(s)}function SM(){Rp=!1,ui!==null&&ru(ui)&&(ui=null),fi!==null&&ru(fi)&&(fi=null),di!==null&&ru(di)&&(di=null),Bl.forEach(cb),Ul.forEach(cb)}function iu(i,s){i.blockedOn===s&&(i.blockedOn=null,Rp||(Rp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,SM)))}var ou=null;function ub(i){ou!==i&&(ou=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ou===i&&(ou=null);for(var s=0;s<i.length;s+=3){var c=i[s],d=i[s+1],g=i[s+2];if(typeof d!="function"){if(kp(d||c)===null)continue;break}var y=_o(c);y!==null&&(i.splice(s,3),s-=3,Ah(y,{pending:!0,data:g,method:c.method,action:d},d,g))}}))}function vs(i){function s(O){return iu(O,i)}ui!==null&&iu(ui,i),fi!==null&&iu(fi,i),di!==null&&iu(di,i),Bl.forEach(s),Ul.forEach(s);for(var c=0;c<hi.length;c++){var d=hi[c];d.blockedOn===i&&(d.blockedOn=null)}for(;0<hi.length&&(c=hi[0],c.blockedOn===null);)ab(c),c.blockedOn===null&&hi.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(d=0;d<c.length;d+=3){var g=c[d],y=c[d+1],E=g[Gt]||null;if(typeof y=="function")E||ub(c);else if(E){var A=null;if(y&&y.hasAttribute("formAction")){if(g=y,E=y[Gt]||null)A=E.formAction;else if(kp(g)!==null)continue}else A=E.action;typeof A=="function"?c[d+1]=A:(c.splice(d,3),d-=3),ub(c)}}}function fb(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(E){return g=E})},focusReset:"manual",scroll:"manual"})}function s(){g!==null&&(g(),g=null),d||setTimeout(c,20)}function c(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){d=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),g!==null&&(g(),g=null)}}}function Op(i){this._internalRoot=i}su.prototype.render=Op.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var c=s.current,d=hn();nb(c,d,i,s,null,null)},su.prototype.unmount=Op.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;nb(i.current,2,null,i,null,null),Uc(),s[zo]=null}};function su(i){this._internalRoot=i}su.prototype.unstable_scheduleHydration=function(i){if(i){var s=x0();i={blockedOn:null,target:i,priority:s};for(var c=0;c<hi.length&&s!==0&&s<hi[c].priority;c++);hi.splice(c,0,i),c===0&&ab(i)}};var db=e.version;if(db!=="19.2.4")throw Error(r(527,db,"19.2.4"));q.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var wM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{Xs=lu.inject(wM),on=lu}catch{}}return $l.createRoot=function(i,s){if(!o(i))throw Error(r(299));var c=!1,d="",g=by,y=Cy,E=xy;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),s=eb(i,1,!1,null,null,c,d,null,g,y,E,fb),i[zo]=s.current,fp(i),new Op(s)},$l.hydrateRoot=function(i,s,c){if(!o(i))throw Error(r(299));var d=!1,g="",y=by,E=Cy,A=xy,O=null;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(A=c.onRecoverableError),c.formState!==void 0&&(O=c.formState)),s=eb(i,1,!0,s,c??null,d,g,O,y,E,A,fb),s.context=tb(null),c=s.current,d=hn(),d=Cd(d),g=Wr(d),g.callback=null,Jr(c,g,d),c=d,s.current.lanes=c,Ws(s,c),Yn(s),i[zo]=s.current,fp(i),new su(s)},$l.version="19.2.4",$l}var Sb;function LM(){if(Sb)return Lp.exports;Sb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Lp.exports=DM(),Lp.exports}var zM=LM(),Da=Fx();const qx=jf(Da);var Ip={exports:{}},Hp={};/**
50
+ * @license React
51
+ * use-sync-external-store-shim.production.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */var wb;function jM(){if(wb)return Hp;wb=1;var t=Na();function e(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,l=t.useLayoutEffect,a=t.useDebugValue;function u(m,b){var v=b(),C=r({inst:{value:v,getSnapshot:b}}),x=C[0].inst,M=C[1];return l(function(){x.value=v,x.getSnapshot=b,f(x)&&M({inst:x})},[m,v,b]),o(function(){return f(x)&&M({inst:x}),m(function(){f(x)&&M({inst:x})})},[m]),a(v),v}function f(m){var b=m.getSnapshot;m=m.value;try{var v=b();return!n(m,v)}catch{return!0}}function h(m,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Hp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,Hp}var Eb;function Kx(){return Eb||(Eb=1,Ip.exports=jM()),Ip.exports}var Gx=Kx();function kt(t){this.content=t}kt.prototype={constructor:kt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),l=r.content.slice();return o==-1?l.push(n||t,e):(l[o+1]=e,n&&(l[o]=n)),new kt(l)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new kt(n)},addToStart:function(t,e){return new kt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new kt(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),l=r.find(t);return o.splice(l==-1?o.length:l,0,e,n),new kt(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=kt.from(t),t.size?new kt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=kt.from(t),t.size?new kt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=kt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};kt.from=function(t){if(t instanceof kt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new kt(e)};function Yx(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),l=e.child(r);if(o==l){n+=o.nodeSize;continue}if(!o.sameMarkup(l))return n;if(o.isText&&o.text!=l.text){for(let a=0;o.text[a]==l.text[a];a++)n++;return n}if(o.content.size||l.content.size){let a=Yx(o.content,l.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function Zx(t,e,n,r){for(let o=t.childCount,l=e.childCount;;){if(o==0||l==0)return o==l?null:{a:n,b:r};let a=t.child(--o),u=e.child(--l),f=a.nodeSize;if(a==u){n-=f,r-=f;continue}if(!a.sameMarkup(u))return{a:n,b:r};if(a.isText&&a.text!=u.text){let h=0,p=Math.min(a.text.length,u.text.length);for(;h<p&&a.text[a.text.length-h-1]==u.text[u.text.length-h-1];)h++,n--,r--;return{a:n,b:r}}if(a.content.size||u.content.size){let h=Zx(a.content,u.content,n-1,r-1);if(h)return h}n-=f,r-=f}}class ee{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,l){for(let a=0,u=0;u<n;a++){let f=this.content[a],h=u+f.nodeSize;if(h>e&&r(f,o+u,l||null,a)!==!1&&f.content.size){let p=u+1;f.nodesBetween(Math.max(0,e-p),Math.min(f.content.size,n-p),r,o+p)}u=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let l="",a=!0;return this.nodesBetween(e,n,(u,f)=>{let h=u.isText?u.text.slice(Math.max(e,f)-f,n-f):u.isLeaf?o?typeof o=="function"?o(u):o:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&h||u.isTextblock)&&r&&(a?a=!1:l+=r),l+=h},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),l=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),l=1);l<e.content.length;l++)o.push(e.content[l]);return new ee(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let l=0,a=0;a<n;l++){let u=this.content[l],f=a+u.nodeSize;f>e&&((a<e||f>n)&&(u.isText?u=u.cut(Math.max(0,e-a),Math.min(u.text.length,n-a)):u=u.cut(Math.max(0,e-a-1),Math.min(u.content.size,n-a-1))),r.push(u),o+=u.nodeSize),a=f}return new ee(r,o)}cutByIndex(e,n){return e==n?ee.empty:e==0&&n==this.content.length?this:new ee(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),l=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new ee(o,l)}addToStart(e){return new ee([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ee(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Yx(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Zx(this,e,n,r)}findIndex(e){if(e==0)return cu(0,e);if(e==this.size)return cu(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),l=r+o.nodeSize;if(l>=e)return l==e?cu(n+1,l):cu(n,r);r=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return ee.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ee(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ee.empty;let n,r=0;for(let o=0;o<e.length;o++){let l=e[o];r+=l.nodeSize,o&&l.isText&&e[o-1].sameMarkup(l)?(n||(n=e.slice(0,o)),n[n.length-1]=l.withText(n[n.length-1].text+l.text)):n&&n.push(l)}return new ee(n||e,r)}static from(e){if(!e)return ee.empty;if(e instanceof ee)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ee([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ee.empty=new ee([],0);const Bp={index:0,offset:0};function cu(t,e){return Bp.index=t,Bp.offset=e,Bp}function Bu(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Bu(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Bu(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let qe=class jm{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let l=e[o];if(this.eq(l))return e;if(this.type.excludes(l.type))n||(n=e.slice(0,o));else{if(l.type.excludes(this.type))return e;!r&&l.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(l)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Bu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return jm.none;if(e instanceof jm)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};qe.none=[];class Uu extends Error{}class le{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Qx(this.content,e+this.openStart,n);return r&&new le(r,this.openStart,this.openEnd)}removeBetween(e,n){return new le(Xx(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return le.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new le(ee.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let l=e.firstChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.firstChild)r++;for(let l=e.lastChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.lastChild)o++;return new le(e,r,o)}}le.empty=new le(ee.empty,0,0);function Xx(t,e,n){let{index:r,offset:o}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:u}=t.findIndex(n);if(o==e||l.isText){if(u!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,l.copy(Xx(l.content,e-o-1,n-o-1)))}function Qx(t,e,n,r){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=Qx(a.content,e-l-1,n,a);return u&&t.replaceChild(o,a.copy(u))}function _M(t,e,n){if(n.openStart>t.depth)throw new Uu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Uu("Inconsistent open depths");return Wx(t,e,n,0)}function Wx(t,e,n,r){let o=t.index(r),l=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let a=Wx(t,e,n,r+1);return l.copy(l.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,u=a.content;return vo(a,u.cut(0,t.parentOffset).append(n.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=IM(n,t);return vo(l,eS(t,a,u,e,r))}else return vo(l,Vu(t,e,r))}function Jx(t,e){if(!e.type.compatibleContent(t.type))throw new Uu("Cannot join "+e.type.name+" onto "+t.type.name)}function _m(t,e,n){let r=t.node(n);return Jx(r,e.node(n)),r}function yo(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ea(t,e,n,r){let o=(e||t).node(n),l=0,a=e?e.index(n):o.childCount;t&&(l=t.index(n),t.depth>n?l++:t.textOffset&&(yo(t.nodeAfter,r),l++));for(let u=l;u<a;u++)yo(o.child(u),r);e&&e.depth==n&&e.textOffset&&yo(e.nodeBefore,r)}function vo(t,e){return t.type.checkContent(e),t.copy(e)}function eS(t,e,n,r,o){let l=t.depth>o&&_m(t,e,o+1),a=r.depth>o&&_m(n,r,o+1),u=[];return ea(null,t,o,u),l&&a&&e.index(o)==n.index(o)?(Jx(l,a),yo(vo(l,eS(t,e,n,r,o+1)),u)):(l&&yo(vo(l,Vu(t,e,o+1)),u),ea(e,n,o,u),a&&yo(vo(a,Vu(n,r,o+1)),u)),ea(r,null,o,u),new ee(u)}function Vu(t,e,n){let r=[];if(ea(null,t,n,r),t.depth>n){let o=_m(t,e,n+1);yo(vo(o,Vu(t,e,n+1)),r)}return ea(e,null,n,r),new ee(r)}function IM(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let l=n-1;l>=0;l--)o=e.node(l).copy(ee.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class fa{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let l=0;l<e;l++)o+=r.child(l).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return qe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let u=r;r=o,o=u}let l=r.marks;for(var a=0;a<l.length;a++)l[a].type.spec.inclusive===!1&&(!o||!l[a].isInSet(o.marks))&&(l=l[a--].removeFromSet(l));return l}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var l=0;l<r.length;l++)r[l].type.spec.inclusive===!1&&(!o||!r[l].isInSet(o.marks))&&(r=r[l--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Pu(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,l=n;for(let a=e;;){let{index:u,offset:f}=a.content.findIndex(l),h=l-f;if(r.push(a,u,o+f),!h||(a=a.child(u),a.isText))break;l=h-1,o+=f+1}return new fa(n,r,l)}static resolveCached(e,n){let r=Mb.get(e);if(r)for(let l=0;l<r.elts.length;l++){let a=r.elts[l];if(a.pos==n)return a}else Mb.set(e,r=new HM);let o=r.elts[r.i]=fa.resolve(e,n);return r.i=(r.i+1)%BM,o}}class HM{constructor(){this.elts=[],this.i=0}}const BM=12,Mb=new WeakMap;class Pu{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const UM=Object.create(null);let Ai=class Im{constructor(e,n,r,o=qe.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||ee.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Bu(this.attrs,n||e.defaultAttrs||UM)&&qe.sameSet(this.marks,r||qe.none)}copy(e=null){return e==this.content?this:new Im(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Im(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return le.empty;let o=this.resolve(e),l=this.resolve(n),a=r?0:o.sharedDepth(n),u=o.start(a),h=o.node(a).content.cut(o.pos-u,l.pos-u);return new le(h,o.depth-a,l.depth-a)}replace(e,n,r){return _M(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return fa.resolveCached(this,e)}resolveNoCache(e){return fa.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,l=>(r.isInSet(l.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),tS(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ee.empty,o=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,l),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let f=o;f<l;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let l=this.contentMatchAt(e).matchType(r),a=l&&l.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=qe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!qe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=ee.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,o,r);return l.type.checkAttrs(l.attrs),l}};Ai.prototype.text=void 0;class $u extends Ai{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tS(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new $u(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new $u(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function tS(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class So{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new VM(e,n);if(r.next==null)return So.empty;let o=nS(r);r.next&&r.err("Unexpected trailing text");let l=YM(GM(o));return ZM(l,r),l}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let l=n;o&&l<r;l++)o=o.matchType(e.child(l).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function l(a,u){let f=a.matchFragment(e,r);if(f&&(!n||f.validEnd))return ee.from(u.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:p,next:m}=a.next[h];if(!(p.isText||p.hasRequiredAttrs())&&o.indexOf(m)==-1){o.push(m);let b=l(m,u.concat(p));if(b)return b}}return null}return l(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),l=o.match;if(l.matchType(e)){let a=[];for(let u=o;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<l.next.length;a++){let{type:u,next:f}=l.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!o.type||f.validEnd)&&(r.push({match:u.contentMatch,type:u,via:o}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let l=o+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)l+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return l}).join(`
58
+ `)}}So.empty=new So(!0);class VM{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function nS(t){let e=[];do e.push(PM(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function PM(t){let e=[];do e.push($M(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function $M(t){let e=KM(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=FM(t,e);else break;return e}function Tb(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function FM(t,e){let n=Tb(t),r=n;return t.eat(",")&&(t.next!="}"?r=Tb(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function qM(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let l in n){let a=n[l];a.isInGroup(e)&&o.push(a)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function KM(t){if(t.eat("(")){let e=nS(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=qM(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function GM(t){let e=[[]];return o(l(t,0),n()),e;function n(){return e.push([])-1}function r(a,u,f){let h={term:f,to:u};return e[a].push(h),h}function o(a,u){a.forEach(f=>f.to=u)}function l(a,u){if(a.type=="choice")return a.exprs.reduce((f,h)=>f.concat(l(h,u)),[]);if(a.type=="seq")for(let f=0;;f++){let h=l(a.exprs[f],u);if(f==a.exprs.length-1)return h;o(h,u=n())}else if(a.type=="star"){let f=n();return r(u,f),o(l(a.expr,f),f),[r(f)]}else if(a.type=="plus"){let f=n();return o(l(a.expr,u),f),o(l(a.expr,f),f),[r(f)]}else{if(a.type=="opt")return[r(u)].concat(l(a.expr,u));if(a.type=="range"){let f=u;for(let h=0;h<a.min;h++){let p=n();o(l(a.expr,f),p),f=p}if(a.max==-1)o(l(a.expr,f),f);else for(let h=a.min;h<a.max;h++){let p=n();r(f,p),o(l(a.expr,f),p),f=p}return[r(f)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function rS(t,e){return e-t}function Ab(t,e){let n=[];return r(e),n.sort(rS);function r(o){let l=t[o];if(l.length==1&&!l[0].term)return r(l[0].to);n.push(o);for(let a=0;a<l.length;a++){let{term:u,to:f}=l[a];!u&&n.indexOf(f)==-1&&r(f)}}}function YM(t){let e=Object.create(null);return n(Ab(t,0));function n(r){let o=[];r.forEach(a=>{t[a].forEach(({term:u,to:f})=>{if(!u)return;let h;for(let p=0;p<o.length;p++)o[p][0]==u&&(h=o[p][1]);Ab(t,f).forEach(p=>{h||o.push([u,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let l=e[r.join(",")]=new So(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let u=o[a][1].sort(rS);l.next.push({type:o[a][0],next:e[u.join(",")]||n(u)})}return l}}function ZM(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],l=!o.validEnd,a=[];for(let u=0;u<o.next.length;u++){let{type:f,next:h}=o.next[u];a.push(f.name),l&&!(f.isText||f.hasRequiredAttrs())&&(l=!1),r.indexOf(h)==-1&&r.push(h)}l&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function iS(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function oS(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let l=t[r];if(l.hasDefault)o=l.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function sS(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let l=t[o];l.validate&&l.validate(e[o])}}function lS(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new QM(t,r,e[r]);return n}let kb=class aS{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=lS(e,r.attrs),this.defaultAttrs=iS(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==So.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:oS(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ai(this,this.computeAttrs(e),ee.from(n),qe.setFrom(r))}createChecked(e=null,n,r){return n=ee.from(n),this.checkContent(n),new Ai(this,this.computeAttrs(e),n,qe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=ee.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let o=this.contentMatch.matchFragment(n),l=o&&o.fillBefore(ee.empty,!0);return l?new Ai(this,e,n.append(l),qe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){sS(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:qe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((l,a)=>r[l]=new aS(l,n,a));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let l in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function XM(t,e,n){let r=n.split("|");return o=>{let l=o===null?"null":typeof o;if(r.indexOf(l)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${l}`)}}class QM{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?XM(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class If{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=lS(e,o.attrs),this.excluded=null;let l=iS(this.attrs);this.instance=l?new qe(this,l):null}create(e=null){return!e&&this.instance?this.instance:new qe(this,oS(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((l,a)=>r[l]=new If(l,o++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){sS(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class cS{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=kt.from(e.nodes),n.marks=kt.from(e.marks||{}),this.nodes=kb.compile(this.spec.nodes,this),this.marks=If.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let l=this.nodes[o],a=l.spec.content||"",u=l.spec.marks;if(l.contentMatch=r[a]||(r[a]=So.parse(a,this.nodes)),l.inlineContent=l.contentMatch.inlineContent,l.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!l.isInline||!l.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=l}l.markSet=u=="_"?null:u?Rb(this,u.split(" ")):u==""||!l.inlineContent?[]:null}for(let o in this.marks){let l=this.marks[o],a=l.spec.excludes;l.excluded=a==null?[l]:a==""?[]:Rb(this,a.split(" "))}this.nodeFromJSON=o=>Ai.fromJSON(this,o),this.markFromJSON=o=>qe.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof kb){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new $u(r,r.defaultAttrs,e,qe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Rb(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],l=t.marks[o],a=l;if(l)n.push(l);else for(let u in t.marks){let f=t.marks[u];(o=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=f)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function WM(t){return t.tag!=null}function JM(t){return t.style!=null}class ki{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(WM(o))this.tags.push(o);else if(JM(o)){let l=/[^=]*/.exec(o.style)[0];r.indexOf(l)<0&&r.push(l),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let l=e.nodes[o.node];return l.contentMatch.matchType(l)})}parse(e,n={}){let r=new Nb(this,n,!1);return r.addAll(e,qe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Nb(this,n,!0);return r.addAll(e,qe.none,n.from,n.to),le.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let l=this.tags[o];if(nT(e,l.tag)&&(l.namespace===void 0||e.namespaceURI==l.namespace)&&(!l.context||n.matchesContext(l.context))){if(l.getAttrs){let a=l.getAttrs(e);if(a===!1)continue;l.attrs=a||void 0}return l}}}matchStyle(e,n,r,o){for(let l=o?this.styles.indexOf(o)+1:0;l<this.styles.length;l++){let a=this.styles[l],u=a.style;if(!(u.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=n))){if(a.getAttrs){let f=a.getAttrs(n);if(f===!1)continue;a.attrs=f||void 0}return a}}}static schemaRules(e){let n=[];function r(o){let l=o.priority==null?50:o.priority,a=0;for(;a<n.length;a++){let u=n[a];if((u.priority==null?50:u.priority)<l)break}n.splice(a,0,o)}for(let o in e.marks){let l=e.marks[o].spec.parseDOM;l&&l.forEach(a=>{r(a=Db(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in e.nodes){let l=e.nodes[o].spec.parseDOM;l&&l.forEach(a=>{r(a=Db(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ki(e,ki.schemaRules(e)))}}const uS={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},eT={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fS={ol:!0,ul:!0},da=1,Hm=2,ta=4;function Ob(t,e,n){return e!=null?(e?da:0)|(e==="full"?Hm:0):t&&t.whitespace=="pre"?da|Hm:n&~ta}class uu{constructor(e,n,r,o,l,a){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=qe.none,this.match=l||(a&ta?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ee.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&da)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let l=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=l.withText(l.text.slice(0,l.text.length-o[0].length))}}let n=ee.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ee.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!uS.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Nb{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,l,a=Ob(null,n.preserveWhitespace,0)|(r?ta:0);o?l=new uu(o.type,o.attrs,qe.none,!0,n.topMatch||o.type.contentMatch,a):r?l=new uu(null,null,qe.none,!0,null,a):l=new uu(e.schema.topNodeType,null,qe.none,!0,null,a),this.nodes=[l],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,l=o.options&Hm?"full":this.localPreserveWS||(o.options&da)>0,{schema:a}=this.parser;if(l==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(l)if(l==="full")r=r.replace(/\r\n?/g,`
59
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let u=r.split(/\r?\n|\r/);for(let f=0;f<u.length;f++)f&&this.insertNode(a.linebreakReplacement.create(),n,!0),u[f]&&this.insertNode(a.text(u[f]),n,!/\S/.test(u[f]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let u=o.content[o.content.length-1],f=e.previousSibling;(!u||f&&f.nodeName=="BR"||u.isText&&/[ \t\r\n\u000c]$/.test(u.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,l=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),u;fS.hasOwnProperty(a)&&this.parser.normalizeLists&&tT(e);let f=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(u=this.parser.matchTag(e,this,r));e:if(f?f.ignore:eT.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!f||f.skip||f.closeParent){f&&f.closeParent?this.open=Math.max(0,this.open-1):f&&f.skip.nodeType&&(e=f.skip);let h,p=this.needsBlock;if(uS.hasOwnProperty(a))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),h=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let m=f&&f.skip?n:this.readStyles(e,n);m&&this.addAll(e,m),h&&this.sync(l),this.needsBlock=p}else{let h=this.readStyles(e,n);h&&this.addElementByRule(e,f,h,f.consuming===!1?u:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
60
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let l=this.parser.matchedStyles[o],a=r.getPropertyValue(l);if(a)for(let u=void 0;;){let f=this.parser.matchStyle(l,a,this,u);if(!f)break;if(f.ignore)return null;if(f.clearMark?n=n.filter(h=>!f.clearMark(h)):n=n.concat(this.parser.schema.marks[f.mark].create(f.attrs)),f.consuming===!1)u=f;else break}}return n}addElementByRule(e,n,r,o){let l,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let f=this.enter(a,n.attrs||null,r,n.preserveWhitespace);f&&(l=!0,r=f)}else{let f=this.parser.schema.marks[n.mark];r=r.concat(f.create(n.attrs))}let u=this.top;if(a&&a.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f,r,!1));else{let f=e;typeof n.contentElement=="string"?f=e.querySelector(n.contentElement):typeof n.contentElement=="function"?f=n.contentElement(e):n.contentElement&&(f=n.contentElement),this.findAround(e,f,!0),this.addAll(f,r),this.findAround(e,f,!1)}l&&this.sync(u)&&this.open--}addAll(e,n,r,o){let l=r||0;for(let a=r?e.childNodes[r]:e.firstChild,u=o==null?null:e.childNodes[o];a!=u;a=a.nextSibling,++l)this.findAtPoint(e,l),this.addDOM(a,n);this.findAtPoint(e,l)}findPlace(e,n,r){let o,l;for(let a=this.open,u=0;a>=0;a--){let f=this.nodes[a],h=f.findWrapping(e);if(h&&(!o||o.length>h.length+u)&&(o=h,l=f,!h.length))break;if(f.solid){if(r)break;u+=2}}if(!o)return null;this.sync(l);for(let a=0;a<o.length;a++)n=this.enterInner(o[a],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let l=this.textblockFromContext();l&&(n=this.enterInner(l,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let l=this.top;l.match&&(l.match=l.match.matchType(e.type));let a=qe.none;for(let u of o.concat(e.marks))(l.type?l.type.allowsMarkType(u.type):Lb(u.type,e.type))&&(a=u.addToSet(a));return l.content.push(e.mark(a)),!0}return!1}enter(e,n,r,o){let l=this.findPlace(e.create(n),r,!1);return l&&(l=this.enterInner(e,n,r,!0,o)),l}enterInner(e,n,r,o=!1,l){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let u=Ob(e,l,a.options);a.options&ta&&a.content.length==0&&(u|=ta);let f=qe.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):Lb(h.type,e))?(f=h.addToSet(f),!1):!0),this.nodes.push(new uu(e,n,f,o,null,u)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=da)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),l=-(r?r.depth+1:0)+(o?0:1),a=(u,f)=>{for(;u>=0;u--){let h=n[u];if(h==""){if(u==n.length-1||u==0)continue;for(;f>=l;f--)if(a(u-1,f))return!0;return!1}else{let p=f>0||f==0&&o?this.nodes[f].type:r&&f>=l?r.node(f-l).type:null;if(!p||p.name!=h&&!p.isInGroup(h))return!1;f--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function tT(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&fS.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function nT(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Db(t){let e={};for(let n in t)e[n]=t[n];return e}function Lb(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let l=[],a=u=>{l.push(u);for(let f=0;f<u.edgeCount;f++){let{type:h,next:p}=u.edge(f);if(h==e||l.indexOf(p)<0&&a(p))return!0}};if(a(o.contentMatch))return!0}}class ko{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Up(n).createDocumentFragment());let o=r,l=[];return e.forEach(a=>{if(l.length||a.marks.length){let u=0,f=0;for(;u<l.length&&f<a.marks.length;){let h=a.marks[f];if(!this.marks[h.type.name]){f++;continue}if(!h.eq(l[u][0])||h.type.spec.spanning===!1)break;u++,f++}for(;u<l.length;)o=l.pop()[1];for(;f<a.marks.length;){let h=a.marks[f++],p=this.serializeMark(h,a.isInline,n);p&&(l.push([h,o]),o.appendChild(p.dom),o=p.contentDOM||p.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Ru(Up(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let l=this.serializeMark(e.marks[o],e.isInline,n);l&&((l.contentDOM||l.dom).appendChild(r),r=l.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Ru(Up(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Ru(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ko(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=zb(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return zb(e.marks)}}function zb(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Up(t){return t.document||window.document}const jb=new WeakMap;function rT(t){let e=jb.get(t);return e===void 0&&jb.set(t,e=iT(t)),e}function iT(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Ru(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],l;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(l=rT(r))&&l.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let u,f=n?t.createElementNS(n,o):t.createElement(o),h=e[1],p=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){p=2;for(let m in h)if(h[m]!=null){let b=m.indexOf(" ");b>0?f.setAttributeNS(m.slice(0,b),m.slice(b+1),h[m]):m=="style"&&f.style?f.style.cssText=h[m]:f.setAttribute(m,h[m])}}for(let m=p;m<e.length;m++){let b=e[m];if(b===0){if(m<e.length-1||m>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:f,contentDOM:f}}else{let{dom:v,contentDOM:C}=Ru(t,b,n,r);if(f.appendChild(v),C){if(u)throw new RangeError("Multiple content holes");u=C}}}return{dom:f,contentDOM:u}}const dS=65535,hS=Math.pow(2,16);function oT(t,e){return t+e*hS}function _b(t){return t&dS}function sT(t){return(t-(t&dS))/hS}const pS=1,mS=2,Ou=4,gS=8;class Bm{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&gS)>0}get deletedBefore(){return(this.delInfo&(pS|Ou))>0}get deletedAfter(){return(this.delInfo&(mS|Ou))>0}get deletedAcross(){return(this.delInfo&Ou)>0}}class mn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&mn.empty)return mn.empty}recover(e){let n=0,r=_b(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+sT(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,l=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?o:0);if(f>e)break;let h=this.ranges[u+l],p=this.ranges[u+a],m=f+h;if(e<=m){let b=h?e==f?-1:e==m?1:n:n,v=f+o+(b<0?0:p);if(r)return v;let C=e==(n<0?f:m)?null:oT(u/3,e-f),x=e==f?mS:e==m?pS:Ou;return(n<0?e!=f:e!=m)&&(x|=gS),new Bm(v,x,C)}o+=p-h}return r?e+o:new Bm(e+o,0,null)}touches(e,n){let r=0,o=_b(n),l=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?r:0);if(f>e)break;let h=this.ranges[u+l],p=f+h;if(e<=p&&u==o*3)return!0;r+=this.ranges[u+a]-h}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,l=0;o<this.ranges.length;o+=3){let a=this.ranges[o],u=a-(this.inverted?l:0),f=a+(this.inverted?0:l),h=this.ranges[o+n],p=this.ranges[o+r];e(u,u+h,f,f+p),l+=p-h}}invert(){return new mn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?mn.empty:new mn(e<0?[0,-e,0]:[0,0,e])}}mn.empty=new mn([]);class ha{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new ha(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new ha;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let l=this.from;l<this.to;l++){let a=this._maps[l],u=a.mapResult(e,n);if(u.recover!=null){let f=this.getMirror(l);if(f!=null&&f>l&&f<this.to){l=f,e=this._maps[f].recover(u.recover);continue}}o|=u.delInfo,e=u.pos}return r?e:new Bm(e,o,null)}}const Vp=Object.create(null);class Ht{getMap(){return mn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Vp[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Vp)throw new RangeError("Duplicate use of step JSON ID "+e);return Vp[e]=n,n.prototype.jsonID=e,n}}class dt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new dt(e,null)}static fail(e){return new dt(null,e)}static fromReplace(e,n,r,o){try{return dt.ok(e.replace(n,r,o))}catch(l){if(l instanceof Uu)return dt.fail(l.message);throw l}}}function O1(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let l=t.child(o);l.content.size&&(l=l.copy(O1(l.content,e,l))),l.isInline&&(l=e(l,n,o)),r.push(l)}return ee.fromArray(r)}class Ei extends Ht{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),l=new le(O1(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return dt.fromReplace(e,this.from,this.to,l)}invert(){return new Pn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ei(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ei&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ei(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ei(n.from,n.to,e.markFromJSON(n.mark))}}Ht.jsonID("addMark",Ei);class Pn extends Ht{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new le(O1(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return dt.fromReplace(e,this.from,this.to,r)}invert(){return new Ei(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Pn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Pn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Pn(n.from,n.to,e.markFromJSON(n.mark))}}Ht.jsonID("removeMark",Pn);class Mi extends Ht{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return dt.fromReplace(e,this.pos,this.pos+1,new le(ee.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Mi(this.pos,n.marks[o]);return new Mi(this.pos,this.mark)}}return new wo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Mi(n.pos,e.markFromJSON(n.mark))}}Ht.jsonID("addNodeMark",Mi);class wo extends Ht{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return dt.fromReplace(e,this.pos,this.pos+1,new le(ee.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Mi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new wo(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new wo(n.pos,e.markFromJSON(n.mark))}}Ht.jsonID("removeNodeMark",wo);class vt extends Ht{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Um(e,this.from,this.to)?dt.fail("Structure replace would overwrite content"):dt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new mn([this.from,this.to-this.from,this.slice.size])}invert(e){return new vt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new vt(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof vt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?le.empty:new le(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new vt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?le.empty:new le(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new vt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new vt(n.from,n.to,le.fromJSON(e,n.slice),!!n.structure)}}Ht.jsonID("replace",vt);class bt extends Ht{constructor(e,n,r,o,l,a,u=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=l,this.insert=a,this.structure=u}apply(e){if(this.structure&&(Um(e,this.from,this.gapFrom)||Um(e,this.gapTo,this.to)))return dt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return dt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?dt.fromReplace(e,this.from,this.to,r):dt.fail("Content does not fit in gap")}getMap(){return new mn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new bt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),l=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||l>r.pos?null:new bt(n.pos,r.pos,o,l,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(n.from,n.to,n.gapFrom,n.gapTo,le.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ht.jsonID("replaceAround",bt);function Um(t,e,n){let r=t.resolve(e),o=n-e,l=r.depth;for(;o>0&&l>0&&r.indexAfter(l)==r.node(l).childCount;)l--,o--;if(o>0){let a=r.node(l).maybeChild(r.indexAfter(l));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function lT(t,e,n,r){let o=[],l=[],a,u;t.doc.nodesBetween(e,n,(f,h,p)=>{if(!f.isInline)return;let m=f.marks;if(!r.isInSet(m)&&p.type.allowsMarkType(r.type)){let b=Math.max(h,e),v=Math.min(h+f.nodeSize,n),C=r.addToSet(m);for(let x=0;x<m.length;x++)m[x].isInSet(C)||(a&&a.to==b&&a.mark.eq(m[x])?a.to=v:o.push(a=new Pn(b,v,m[x])));u&&u.to==b?u.to=v:l.push(u=new Ei(b,v,r))}}),o.forEach(f=>t.step(f)),l.forEach(f=>t.step(f))}function aT(t,e,n,r){let o=[],l=0;t.doc.nodesBetween(e,n,(a,u)=>{if(!a.isInline)return;l++;let f=null;if(r instanceof If){let h=a.marks,p;for(;p=r.isInSet(h);)(f||(f=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let h=Math.min(u+a.nodeSize,n);for(let p=0;p<f.length;p++){let m=f[p],b;for(let v=0;v<o.length;v++){let C=o[v];C.step==l-1&&m.eq(o[v].style)&&(b=C)}b?(b.to=h,b.step=l):o.push({style:m,from:Math.max(u,e),to:h,step:l})}}}),o.forEach(a=>t.step(new Pn(a.from,a.to,a.style)))}function N1(t,e,n,r=n.contentMatch,o=!0){let l=t.doc.nodeAt(e),a=[],u=e+1;for(let f=0;f<l.childCount;f++){let h=l.child(f),p=u+h.nodeSize,m=r.matchType(h.type);if(!m)a.push(new vt(u,p,le.empty));else{r=m;for(let b=0;b<h.marks.length;b++)n.allowsMarkType(h.marks[b].type)||t.step(new Pn(u,p,h.marks[b]));if(o&&h.isText&&n.whitespace!="pre"){let b,v=/\r?\n|\r/g,C;for(;b=v.exec(h.text);)C||(C=new le(ee.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new vt(u+b.index,u+b.index+b[0].length,C))}}u=p}if(!r.validEnd){let f=r.fillBefore(ee.empty,!0);t.replace(u,u,new le(f,0,0))}for(let f=a.length-1;f>=0;f--)t.step(a[f])}function cT(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function $s(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),l=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!cT(o,l,a))break}return null}function uT(t,e,n){let{$from:r,$to:o,depth:l}=e,a=r.before(l+1),u=o.after(l+1),f=a,h=u,p=ee.empty,m=0;for(let C=l,x=!1;C>n;C--)x||r.index(C)>0?(x=!0,p=ee.from(r.node(C).copy(p)),m++):f--;let b=ee.empty,v=0;for(let C=l,x=!1;C>n;C--)x||o.after(C+1)<o.end(C)?(x=!0,b=ee.from(o.node(C).copy(b)),v++):h++;t.step(new bt(f,h,a,u,new le(p.append(b),m,v),p.size-m,!0))}function D1(t,e,n=null,r=t){let o=fT(t,e),l=o&&dT(r,e);return l?o.map(Ib).concat({type:e,attrs:n}).concat(l.map(Ib)):null}function Ib(t){return{type:t,attrs:null}}function fT(t,e){let{parent:n,startIndex:r,endIndex:o}=t,l=n.contentMatchAt(r).findWrapping(e);if(!l)return null;let a=l.length?l[0]:e;return n.canReplaceWith(r,o,a)?l:null}function dT(t,e){let{parent:n,startIndex:r,endIndex:o}=t,l=n.child(r),a=e.contentMatch.findWrapping(l.type);if(!a)return null;let f=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;f&&h<o;h++)f=f.matchType(n.child(h).type);return!f||!f.validEnd?null:a}function hT(t,e,n){let r=ee.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let u=n[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ee.from(n[a].type.create(n[a].attrs,r))}let o=e.start,l=e.end;t.step(new bt(o,l,o,l,new le(r,0,0),n.length,!0))}function pT(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=t.steps.length;t.doc.nodesBetween(e,n,(a,u)=>{let f=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,f)&&mT(t.doc,t.mapping.slice(l).map(u),r)){let h=null;if(r.schema.linebreakReplacement){let v=r.whitespace=="pre",C=!!r.contentMatch.matchType(r.schema.linebreakReplacement);v&&!C?h=!1:!v&&C&&(h=!0)}h===!1&&vS(t,a,u,l),N1(t,t.mapping.slice(l).map(u,1),r,void 0,h===null);let p=t.mapping.slice(l),m=p.map(u,1),b=p.map(u+a.nodeSize,1);return t.step(new bt(m,b,m+1,b-1,new le(ee.from(r.create(f,null,a.marks)),0,0),1,!0)),h===!0&&yS(t,a,u,l),!1}})}function yS(t,e,n,r){e.forEach((o,l)=>{if(o.isText){let a,u=/\r?\n|\r/g;for(;a=u.exec(o.text);){let f=t.mapping.slice(r).map(n+1+l+a.index);t.replaceWith(f,f+1,e.type.schema.linebreakReplacement.create())}}})}function vS(t,e,n,r){e.forEach((o,l)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+l);t.replaceWith(a,a+1,e.type.schema.text(`
61
+ `))}})}function mT(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function gT(t,e,n,r,o){let l=t.doc.nodeAt(e);if(!l)throw new RangeError("No node at given position");n||(n=l.type);let a=n.create(r,null,o||l.marks);if(l.isLeaf)return t.replaceWith(e,e+l.nodeSize,a);if(!n.validContent(l.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new bt(e,e+l.nodeSize,e+1,e+l.nodeSize-1,new le(ee.from(a),0,0),1,!0))}function Lr(t,e,n=1,r){let o=t.resolve(e),l=o.depth-n,a=r&&r[r.length-1]||o.parent;if(l<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let h=o.depth-1,p=n-2;h>l;h--,p--){let m=o.node(h),b=o.index(h);if(m.type.spec.isolating)return!1;let v=m.content.cutByIndex(b,m.childCount),C=r&&r[p+1];C&&(v=v.replaceChild(0,C.type.create(C.attrs)));let x=r&&r[p]||m;if(!m.canReplace(b+1,m.childCount)||!x.type.validContent(v))return!1}let u=o.indexAfter(l),f=r&&r[0];return o.node(l).canReplaceWith(u,u,f?f.type:o.node(l+1).type)}function yT(t,e,n=1,r){let o=t.doc.resolve(e),l=ee.empty,a=ee.empty;for(let u=o.depth,f=o.depth-n,h=n-1;u>f;u--,h--){l=ee.from(o.node(u).copy(l));let p=r&&r[h];a=ee.from(p?p.type.create(p.attrs,a):o.node(u).copy(a))}t.step(new vt(e,e,new le(l.append(a),n,n),!0))}function Bi(t,e){let n=t.resolve(e),r=n.index();return bS(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function vT(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let l=e.child(o),a=l.type==r?t.type.schema.nodes.text:l.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(l.marks))return!1}return n.validEnd}function bS(t,e){return!!(t&&e&&!t.isLeaf&&vT(t,e))}function Hf(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let l,a,u=r.index(o);if(o==r.depth?(l=r.nodeBefore,a=r.nodeAfter):n>0?(l=r.node(o+1),u++,a=r.node(o).maybeChild(u)):(l=r.node(o).maybeChild(u-1),a=r.node(o+1)),l&&!l.isTextblock&&bS(l,a)&&r.node(o).canReplace(u,u+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function bT(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,l=t.doc.resolve(e-n),a=l.node().type;if(o&&a.inlineContent){let p=a.whitespace=="pre",m=!!a.contentMatch.matchType(o);p&&!m?r=!1:!p&&m&&(r=!0)}let u=t.steps.length;if(r===!1){let p=t.doc.resolve(e+n);vS(t,p.node(),p.before(),u)}a.inlineContent&&N1(t,e+n-1,a,l.node().contentMatchAt(l.index()),r==null);let f=t.mapping.slice(u),h=f.map(e-n);if(t.step(new vt(h,f.map(e+n,-1),le.empty,!0)),r===!0){let p=t.doc.resolve(h);yS(t,p.node(),p.before(),t.steps.length)}return t}function CT(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let l=r.index(o);if(r.node(o).canReplaceWith(l,l,n))return r.before(o+1);if(l>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let l=r.indexAfter(o);if(r.node(o).canReplaceWith(l,l,n))return r.after(o+1);if(l<r.node(o).childCount)return null}return null}function CS(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let l=0;l<n.openStart;l++)o=o.firstChild.content;for(let l=1;l<=(n.openStart==0&&n.size?2:1);l++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,f=r.index(a)+(u>0?1:0),h=r.node(a),p=!1;if(l==1)p=h.canReplace(f,f,o);else{let m=h.contentMatchAt(f).findWrapping(o.firstChild.type);p=m&&h.canReplaceWith(f,f,m[0])}if(p)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function Bf(t,e,n=e,r=le.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),l=t.resolve(n);return xS(o,l,r)?new vt(e,n,r):new xT(o,l,r).fit()}function xS(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class xT{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ee.empty;for(let o=0;o<=e.depth;o++){let l=e.node(o);this.frontier.push({type:l.type,match:l.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ee.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let l=this.placed,a=r.depth,u=o.depth;for(;a&&u&&l.childCount==1;)l=l.firstChild.content,a--,u--;let f=new le(l,a,u);return e>-1?new bt(r.pos,e,this.$to.pos,this.$to.end(),f,n):f.size||r.pos!=this.$to.pos?new vt(r.pos,o.pos,f):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let l=n.firstChild;if(n.childCount>1&&(o=0),l.type.spec.isolating&&o<=r){e=r;break}n=l.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,l=null;r?(l=Pp(this.unplaced.content,r-1).firstChild,o=l.content):o=this.unplaced.content;let a=o.firstChild;for(let u=this.depth;u>=0;u--){let{type:f,match:h}=this.frontier[u],p,m=null;if(n==1&&(a?h.matchType(a.type)||(m=h.fillBefore(ee.from(a),!1)):l&&f.compatibleContent(l.type)))return{sliceDepth:r,frontierDepth:u,parent:l,inject:m};if(n==2&&a&&(p=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:l,wrap:p};if(l&&h.matchType(l.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Pp(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new le(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Pp(e,n);if(o.childCount<=1&&n>0){let l=e.size-n<=n+o.size;this.unplaced=new le(Gl(e,n-1,1),n-1,l?n-1:r)}else this.unplaced=new le(Gl(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:l}){for(;this.depth>n;)this.closeFrontierNode();if(l)for(let x=0;x<l.length;x++)this.openFrontierNode(l[x]);let a=this.unplaced,u=r?r.content:a.content,f=a.openStart-e,h=0,p=[],{match:m,type:b}=this.frontier[n];if(o){for(let x=0;x<o.childCount;x++)p.push(o.child(x));m=m.matchFragment(o)}let v=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let x=u.child(h),M=m.matchType(x.type);if(!M)break;h++,(h>1||f==0||x.content.size)&&(m=M,p.push(SS(x.mark(b.allowedMarks(x.marks)),h==1?f:0,h==u.childCount?v:-1)))}let C=h==u.childCount;C||(v=-1),this.placed=Yl(this.placed,n,ee.from(p)),this.frontier[n].match=m,C&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let x=0,M=u;x<v;x++){let T=M.lastChild;this.frontier.push({type:T.type,match:T.contentMatchAt(T.childCount)}),M=T.content}this.unplaced=C?e==0?le.empty:new le(Gl(a.content,e-1,1),e-1,v<0?a.openEnd:e-1):new le(Gl(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!$p(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],l=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=$p(e,n,o,r,l);if(a){for(let u=n-1;u>=0;u--){let{match:f,type:h}=this.frontier[u],p=$p(e,u,h,f,!0);if(!p||p.childCount)continue e}return{depth:n,fit:a,move:l?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Yl(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),l=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,l)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Yl(this.placed,this.depth,ee.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ee.empty,!0);n.childCount&&(this.placed=Yl(this.placed,this.frontier.length,n))}}function Gl(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Gl(t.firstChild.content,e-1,n)))}function Yl(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Yl(t.lastChild.content,e-1,n)))}function Pp(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function SS(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,SS(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ee.empty,!0)))),t.copy(r)}function $p(t,e,n,r,o){let l=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==l.childCount&&!n.compatibleContent(l.type))return null;let u=r.fillBefore(l.content,!0,a);return u&&!ST(n,l.content,a)?u:null}function ST(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function wT(t){return t.spec.defining||t.spec.definingForContent}function ET(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),l=t.doc.resolve(n);if(xS(o,l,r))return t.step(new vt(e,n,r));let a=ES(o,t.doc.resolve(n));a[a.length-1]==0&&a.pop();let u=-(o.depth+1);a.unshift(u);for(let b=o.depth,v=o.pos-1;b>0;b--,v--){let C=o.node(b).type.spec;if(C.defining||C.definingAsContext||C.isolating)break;a.indexOf(b)>-1?u=b:o.before(b)==v&&a.splice(1,0,-b)}let f=a.indexOf(u),h=[],p=r.openStart;for(let b=r.content,v=0;;v++){let C=b.firstChild;if(h.push(C),v==r.openStart)break;b=C.content}for(let b=p-1;b>=0;b--){let v=h[b],C=wT(v.type);if(C&&!v.sameMarkup(o.node(Math.abs(u)-1)))p=b;else if(C||!v.type.isTextblock)break}for(let b=r.openStart;b>=0;b--){let v=(b+p+1)%(r.openStart+1),C=h[v];if(C)for(let x=0;x<a.length;x++){let M=a[(x+f)%a.length],T=!0;M<0&&(T=!1,M=-M);let k=o.node(M-1),R=o.index(M-1);if(k.canReplaceWith(R,R,C.type,C.marks))return t.replace(o.before(M),T?l.after(M):n,new le(wS(r.content,0,r.openStart,v),v,r.openEnd))}}let m=t.steps.length;for(let b=a.length-1;b>=0&&(t.replace(e,n,r),!(t.steps.length>m));b--){let v=a[b];v<0||(e=o.before(v),n=l.after(v))}}function wS(t,e,n,r,o){if(e<n){let l=t.firstChild;t=t.replaceChild(0,l.copy(wS(l.content,e+1,n,r,l)))}if(e>r){let l=o.contentMatchAt(0),a=l.fillBefore(t).append(t);t=a.append(l.matchFragment(a).fillBefore(ee.empty,!0))}return t}function MT(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=CT(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new le(ee.from(r),0,0))}function TT(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),l=ES(r,o);for(let a=0;a<l.length;a++){let u=l[a],f=a==l.length-1;if(f&&u==0||r.node(u).type.contentMatch.validEnd)return t.delete(r.start(u),o.end(u));if(u>0&&(f||r.node(u-1).canReplace(r.index(u-1),o.indexAfter(u-1))))return t.delete(r.before(u),o.after(u))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function ES(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let l=t.start(o);if(l<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(l==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==l-1)&&n.push(o)}return n}class Os extends Ht{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return dt.fail("No node at attribute step's position");let r=Object.create(null);for(let l in n.attrs)r[l]=n.attrs[l];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return dt.fromReplace(e,this.pos,this.pos+1,new le(ee.from(o),0,n.isLeaf?0:1))}getMap(){return mn.empty}invert(e){return new Os(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Os(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Os(n.pos,n.attr,n.value)}}Ht.jsonID("attr",Os);class pa extends Ht{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return dt.ok(r)}getMap(){return mn.empty}invert(e){return new pa(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new pa(n.attr,n.value)}}Ht.jsonID("docAttr",pa);let js=class extends Error{};js=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};js.prototype=Object.create(Error.prototype);js.prototype.constructor=js;js.prototype.name="TransformError";class MS{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ha}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new js(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=le.empty){let o=Bf(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new le(ee.from(r),0,0))}delete(e,n){return this.replace(e,n,le.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return ET(this,e,n,r),this}replaceRangeWith(e,n,r){return MT(this,e,n,r),this}deleteRange(e,n){return TT(this,e,n),this}lift(e,n){return uT(this,e,n),this}join(e,n=1){return bT(this,e,n),this}wrap(e,n){return hT(this,e,n),this}setBlockType(e,n=e,r,o=null){return pT(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return gT(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Os(e,n,r)),this}setDocAttribute(e,n){return this.step(new pa(e,n)),this}addNodeMark(e,n){return this.step(new Mi(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof qe)n.isInSet(r.marks)&&this.step(new wo(e,n));else{let o=r.marks,l,a=[];for(;l=n.isInSet(o);)a.push(new wo(e,l)),o=l.removeFromSet(o);for(let u=a.length-1;u>=0;u--)this.step(a[u])}return this}split(e,n=1,r){return yT(this,e,n,r),this}addMark(e,n,r){return lT(this,e,n,r),this}removeMark(e,n,r){return aT(this,e,n,r),this}clearIncompatible(e,n,r){return N1(this,e,n,r),this}}const Fp=Object.create(null);let Ee=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new AT(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=le.empty){let r=n.content.lastChild,o=null;for(let u=0;u<n.openEnd;u++)o=r,r=r.lastChild;let l=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:f,$to:h}=a[u],p=e.mapping.slice(l);e.replaceRange(p.map(f.pos),p.map(h.pos),u?le.empty:n),u==0&&Ub(e,l,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:u}=o[l],f=e.mapping.slice(r),h=f.map(a.pos),p=f.map(u.pos);l?e.deleteRange(h,p):(e.replaceRangeWith(h,p,n),Ub(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new ve(e):Es(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let l=e.depth-1;l>=0;l--){let a=n<0?Es(e.node(0),e.node(l),e.before(l+1),e.index(l),n,r):Es(e.node(0),e.node(l),e.after(l+1),e.index(l)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new gn(e.node(0))}static atStart(e){return Es(e,e,0,0,1)||new gn(e)}static atEnd(e){return Es(e,e,e.content.size,e.childCount,-1)||new gn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Fp[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Fp)throw new RangeError("Duplicate use of selection JSON ID "+e);return Fp[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ve.between(this.$anchor,this.$head).getBookmark()}};Ee.prototype.visible=!0;class AT{constructor(e,n){this.$from=e,this.$to=n}}let Hb=!1;function Bb(t){!Hb&&!t.parent.inlineContent&&(Hb=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ve extends Ee{constructor(e,n=e){Bb(e),Bb(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ee.near(r);let o=e.resolve(n.map(this.anchor));return new ve(o.parent.inlineContent?o:r,r)}replace(e,n=le.empty){if(super.replace(e,n),n==le.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ve&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Uf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ve(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let l=Ee.findFrom(n,r,!0)||Ee.findFrom(n,-r,!0);if(l)n=l.$head;else return Ee.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ee.findFrom(e,-r,!0)||Ee.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new ve(e,n)}}Ee.jsonID("text",ve);class Uf{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Uf(e.map(this.anchor),e.map(this.head))}resolve(e){return ve.between(e.resolve(this.anchor),e.resolve(this.head))}}class de extends Ee{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),l=e.resolve(o);return r?Ee.near(l):new de(l)}content(){return new le(ee.from(this.node),0,0)}eq(e){return e instanceof de&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new L1(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new de(e.resolve(n.anchor))}static create(e,n){return new de(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}de.prototype.visible=!1;Ee.jsonID("node",de);class L1{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Uf(r,r):new L1(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&de.isSelectable(r)?new de(n):Ee.near(n)}}class gn extends Ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=le.empty){if(n==le.empty){e.delete(0,e.doc.content.size);let r=Ee.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new gn(e)}map(e){return new gn(e)}eq(e){return e instanceof gn}getBookmark(){return kT}}Ee.jsonID("all",gn);const kT={map(){return this},resolve(t){return new gn(t)}};function Es(t,e,n,r,o,l=!1){if(e.inlineContent)return ve.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let u=e.child(a);if(u.isAtom){if(!l&&de.isSelectable(u))return de.create(t,n-(o<0?u.nodeSize:0))}else{let f=Es(t,u,n+o,o<0?u.childCount:0,o,l);if(f)return f}n+=u.nodeSize*o}return null}function Ub(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof vt||o instanceof bt))return;let l=t.mapping.maps[r],a;l.forEach((u,f,h,p)=>{a==null&&(a=p)}),t.setSelection(Ee.near(t.doc.resolve(a),n))}const Vb=1,fu=2,Pb=4;class RT extends MS{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Vb)&~fu,this.storedMarks=null,this}get selectionSet(){return(this.updated&Vb)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=fu,this}ensureMarks(e){return qe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&fu)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~fu,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||qe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let l=this.storedMarks;if(!l){let a=this.doc.resolve(n);l=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,l)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(Ee.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Pb,this}get scrolledIntoView(){return(this.updated&Pb)>0}}function $b(t,e){return!e||!t?t:t.bind(e)}class Zl{constructor(e,n,r){this.name=e,this.init=$b(n.init,r),this.apply=$b(n.apply,r)}}const OT=[new Zl("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Zl("selection",{init(t,e){return t.selection||Ee.atStart(e.doc)},apply(t){return t.selection}}),new Zl("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Zl("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class qp{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=OT.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Zl(r.key,r.spec.state,r))})}}class Rs{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let l=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let f=o?o[a].n:0,h=o?o[a].state:this,p=f<n.length&&u.spec.appendTransaction.call(u,f?n.slice(f):n,h,r);if(p&&r.filterTransaction(p,a)){if(p.setMeta("appendedTransaction",e),!o){o=[];for(let m=0;m<this.config.plugins.length;m++)o.push(m<a?{state:r,n:n.length}:{state:this,n:0})}n.push(p),r=r.applyInner(p),l=!0}o&&(o[a]={state:r,n:n.length})}}if(!l)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Rs(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let l=r[o];n[l.name]=l.apply(e,this[l.name],this,n)}return n}get tr(){return new RT(this)}static create(e){let n=new qp(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Rs(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new qp(this.schema,e.plugins),r=n.fields,o=new Rs(n);for(let l=0;l<r.length;l++){let a=r[l].name;o[a]=this.hasOwnProperty(a)?this[a]:r[l].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],l=o.spec.state;l&&l.toJSON&&(n[r]=l.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new qp(e.schema,e.plugins),l=new Rs(o);return o.fields.forEach(a=>{if(a.name=="doc")l.doc=Ai.fromJSON(e.schema,n.doc);else if(a.name=="selection")l.selection=Ee.fromJSON(l.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(l.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let u in r){let f=r[u],h=f.spec.state;if(f.key==a.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){l[a.name]=h.fromJSON.call(f,e,n[u],l);return}}l[a.name]=a.init(e,l)}}),l}}function TS(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=TS(o,e,{})),n[r]=o}return n}class Je{constructor(e){this.spec=e,this.props={},e.props&&TS(e.props,this,this.props),this.key=e.key?e.key.key:AS("plugin")}getState(e){return e[this.key]}}const Kp=Object.create(null);function AS(t){return t in Kp?t+"$"+ ++Kp[t]:(Kp[t]=0,t+"$")}class pt{constructor(e="key"){this.key=AS(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const z1=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function kS(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const RS=(t,e,n)=>{let r=kS(t,n);if(!r)return!1;let o=j1(r);if(!o){let a=r.blockRange(),u=a&&$s(a);return u==null?!1:(e&&e(t.tr.lift(a,u).scrollIntoView()),!0)}let l=o.nodeBefore;if(HS(t,o,e,-1))return!0;if(r.parent.content.size==0&&(_s(l,"end")||de.isSelectable(l)))for(let a=r.depth;;a--){let u=Bf(t.doc,r.before(a),r.after(a),le.empty);if(u&&u.slice.size<u.to-u.from){if(e){let f=t.tr.step(u);f.setSelection(_s(l,"end")?Ee.findFrom(f.doc.resolve(f.mapping.map(o.pos,-1)),-1):de.create(f.doc,o.pos-l.nodeSize)),e(f.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return l.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-l.nodeSize,o.pos).scrollIntoView()),!0):!1},NT=(t,e,n)=>{let r=kS(t,n);if(!r)return!1;let o=j1(r);return o?OS(t,o,e):!1},DT=(t,e,n)=>{let r=DS(t,n);if(!r)return!1;let o=_1(r);return o?OS(t,o,e):!1};function OS(t,e,n){let r=e.nodeBefore,o=r,l=e.pos-1;for(;!o.isTextblock;l--){if(o.type.spec.isolating)return!1;let p=o.lastChild;if(!p)return!1;o=p}let a=e.nodeAfter,u=a,f=e.pos+1;for(;!u.isTextblock;f++){if(u.type.spec.isolating)return!1;let p=u.firstChild;if(!p)return!1;u=p}let h=Bf(t.doc,l,f,le.empty);if(!h||h.from!=l||h instanceof vt&&h.slice.size>=f-l)return!1;if(n){let p=t.tr.step(h);p.setSelection(ve.create(p.doc,l)),n(p.scrollIntoView())}return!0}function _s(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const NS=(t,e,n)=>{let{$head:r,empty:o}=t.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;l=j1(r)}let a=l&&l.nodeBefore;return!a||!de.isSelectable(a)?!1:(e&&e(t.tr.setSelection(de.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)};function j1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function DS(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const LS=(t,e,n)=>{let r=DS(t,n);if(!r)return!1;let o=_1(r);if(!o)return!1;let l=o.nodeAfter;if(HS(t,o,e,1))return!0;if(r.parent.content.size==0&&(_s(l,"start")||de.isSelectable(l))){let a=Bf(t.doc,r.before(),r.after(),le.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=t.tr.step(a);u.setSelection(_s(l,"start")?Ee.findFrom(u.doc.resolve(u.mapping.map(o.pos)),1):de.create(u.doc,u.mapping.map(o.pos))),e(u.scrollIntoView())}return!0}}return l.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+l.nodeSize).scrollIntoView()),!0):!1},zS=(t,e,n)=>{let{$head:r,empty:o}=t.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;l=_1(r)}let a=l&&l.nodeAfter;return!a||!de.isSelectable(a)?!1:(e&&e(t.tr.setSelection(de.create(t.doc,l.pos)).scrollIntoView()),!0)};function _1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const LT=(t,e)=>{let n=t.selection,r=n instanceof de,o;if(r){if(n.node.isTextblock||!Bi(t.doc,n.from))return!1;o=n.from}else if(o=Hf(t.doc,n.from,-1),o==null)return!1;if(e){let l=t.tr.join(o);r&&l.setSelection(de.create(l.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},zT=(t,e)=>{let n=t.selection,r;if(n instanceof de){if(n.node.isTextblock||!Bi(t.doc,n.to))return!1;r=n.to}else if(r=Hf(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},jT=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),l=o&&$s(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)},jS=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
62
+ `).scrollIntoView()),!0)};function I1(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const _T=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),l=n.indexAfter(-1),a=I1(o.contentMatchAt(l));if(!a||!o.canReplaceWith(l,l,a))return!1;if(e){let u=n.after(),f=t.tr.replaceWith(u,u,a.createAndFill());f.setSelection(Ee.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},_S=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof gn||r.parent.inlineContent||o.parent.inlineContent)return!1;let l=I1(o.parent.contentMatchAt(o.indexAfter()));if(!l||!l.isTextblock)return!1;if(e){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,u=t.tr.insert(a,l.createAndFill());u.setSelection(ve.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},IS=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let l=n.before();if(Lr(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),o=r&&$s(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function IT(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof de&&e.selection.node.isBlock)return!r.parentOffset||!Lr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,u,f=!1,h=!1;for(let v=r.depth;;v--)if(r.node(v).isBlock){f=r.end(v)==r.pos+(r.depth-v),h=r.start(v)==r.pos-(r.depth-v),u=I1(r.node(v-1).contentMatchAt(r.indexAfter(v-1))),l.unshift(f&&u?{type:u}:null),a=v;break}else{if(v==1)return!1;l.unshift(null)}let p=e.tr;(e.selection instanceof ve||e.selection instanceof gn)&&p.deleteSelection();let m=p.mapping.map(r.pos),b=Lr(p.doc,m,l.length,l);if(b||(l[0]=u?{type:u}:null,b=Lr(p.doc,m,l.length,l)),!b)return!1;if(p.split(m,l.length,l),!f&&h&&r.node(a).type!=u){let v=p.mapping.map(r.before(a)),C=p.doc.resolve(v);u&&r.node(a-1).canReplaceWith(C.index(),C.index()+1,u)&&p.setNodeMarkup(p.mapping.map(r.before(a)),u)}return n&&n(p.scrollIntoView()),!0}}const HT=IT(),BT=(t,e)=>{let{$from:n,to:r}=t.selection,o,l=n.sharedDepth(r);return l==0?!1:(o=n.before(l),e&&e(t.tr.setSelection(de.create(t.doc,o))),!0)};function UT(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,l=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(l,l+1)||!(o.isTextblock||Bi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function HS(t,e,n,r){let o=e.nodeBefore,l=e.nodeAfter,a,u,f=o.type.spec.isolating||l.type.spec.isolating;if(!f&&UT(t,e,n))return!0;let h=!f&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(u=o.contentMatchAt(o.childCount)).findWrapping(l.type))&&u.matchType(a[0]||l.type).validEnd){if(n){let v=e.pos+l.nodeSize,C=ee.empty;for(let T=a.length-1;T>=0;T--)C=ee.from(a[T].create(null,C));C=ee.from(o.copy(C));let x=t.tr.step(new bt(e.pos-1,v,e.pos,v,new le(C,1,0),a.length,!0)),M=x.doc.resolve(v+2*a.length);M.nodeAfter&&M.nodeAfter.type==o.type&&Bi(x.doc,M.pos)&&x.join(M.pos),n(x.scrollIntoView())}return!0}let p=l.type.spec.isolating||r>0&&f?null:Ee.findFrom(e,1),m=p&&p.$from.blockRange(p.$to),b=m&&$s(m);if(b!=null&&b>=e.depth)return n&&n(t.tr.lift(m,b).scrollIntoView()),!0;if(h&&_s(l,"start",!0)&&_s(o,"end")){let v=o,C=[];for(;C.push(v),!v.isTextblock;)v=v.lastChild;let x=l,M=1;for(;!x.isTextblock;x=x.firstChild)M++;if(v.canReplace(v.childCount,v.childCount,x.content)){if(n){let T=ee.empty;for(let R=C.length-1;R>=0;R--)T=ee.from(C[R].copy(T));let k=t.tr.step(new bt(e.pos-C.length,e.pos+l.nodeSize,e.pos+M,e.pos+l.nodeSize-M,new le(T,C.length,0),0,!0));n(k.scrollIntoView())}return!0}}return!1}function BS(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,l=o.depth;for(;o.node(l).isInline;){if(!l)return!1;l--}return o.node(l).isTextblock?(n&&n(e.tr.setSelection(ve.create(e.doc,t<0?o.start(l):o.end(l)))),!0):!1}}const VT=BS(-1),PT=BS(1);function $T(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l),u=a&&D1(a,t,e);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function Fb(t,e=null){return function(n,r){let o=!1;for(let l=0;l<n.selection.ranges.length&&!o;l++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[l];n.doc.nodesBetween(a,u,(f,h)=>{if(o)return!1;if(!(!f.isTextblock||f.hasMarkup(t,e)))if(f.type==t)o=!0;else{let p=n.doc.resolve(h),m=p.index();o=p.parent.canReplaceWith(m,m+1,t)}})}if(!o)return!1;if(r){let l=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:f}}=n.selection.ranges[a];l.setBlockType(u,f,t,e)}r(l.scrollIntoView())}return!0}}function H1(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}H1(z1,RS,NS);H1(z1,LS,zS);H1(jS,_S,IS,HT);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function FT(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l);if(!a)return!1;let u=r?n.tr:null;return qT(u,a,t,e)?(r&&r(u.scrollIntoView()),!0):!1}}function qT(t,e,n,r=null){let o=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let f=a.resolve(e.start-2);l=new Pu(f,f,e.depth),e.endIndex<e.parent.childCount&&(e=new Pu(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let u=D1(l,n,r,e);return u?(t&&KT(t,e,u,o,n),!0):!1}function KT(t,e,n,r,o){let l=ee.empty;for(let p=n.length-1;p>=0;p--)l=ee.from(n[p].type.create(n[p].attrs,l));t.step(new bt(e.start-(r?2:0),e.end,e.start,e.end,new le(l,0,0),n.length,!0));let a=0;for(let p=0;p<n.length;p++)n[p].type==o&&(a=p+1);let u=n.length-a,f=e.start+n.length-(r?2:0),h=e.parent;for(let p=e.startIndex,m=e.endIndex,b=!0;p<m;p++,b=!1)!b&&Lr(t.doc,f,u)&&(t.split(f,u),f+=2*u),f+=h.child(p).nodeSize;return t}function GT(t){return function(e,n){let{$from:r,$to:o}=e.selection,l=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return l?n?r.node(l.depth-1).type==t?YT(e,n,t,l):ZT(e,n,l):!0:!1}}function YT(t,e,n,r){let o=t.tr,l=r.end,a=r.$to.end(r.depth);l<a&&(o.step(new bt(l-1,a,l,a,new le(ee.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Pu(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const u=$s(r);if(u==null)return!1;o.lift(r,u);let f=o.doc.resolve(o.mapping.map(l,-1)-1);return Bi(o.doc,f.pos)&&f.nodeBefore.type==f.nodeAfter.type&&o.join(f.pos),e(o.scrollIntoView()),!0}function ZT(t,e,n){let r=t.tr,o=n.parent;for(let v=n.end,C=n.endIndex-1,x=n.startIndex;C>x;C--)v-=o.child(C).nodeSize,r.delete(v-1,v+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,f=n.endIndex==o.childCount,h=l.node(-1),p=l.index(-1);if(!h.canReplace(p+(u?0:1),p+1,a.content.append(f?ee.empty:ee.from(o))))return!1;let m=l.pos,b=m+a.nodeSize;return r.step(new bt(m-(u?1:0),b+(f?1:0),m+1,b-1,new le((u?ee.empty:ee.from(o.copy(ee.empty))).append(f?ee.empty:ee.from(o.copy(ee.empty))),u?0:1,f?0:1),u?0:1)),e(r.scrollIntoView()),!0}function XT(t){return function(e,n){let{$from:r,$to:o}=e.selection,l=r.blockRange(o,h=>h.childCount>0&&h.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(a==0)return!1;let u=l.parent,f=u.child(a-1);if(f.type!=t)return!1;if(n){let h=f.lastChild&&f.lastChild.type==u.type,p=ee.from(h?t.create():null),m=new le(ee.from(t.create(null,ee.from(u.type.create(null,p)))),h?3:1,0),b=l.start,v=l.end;n(e.tr.step(new bt(b-(h?3:1),v,b,v,m,1,!0)).scrollIntoView())}return!0}}const Ot=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Is=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Vm=null;const Or=function(t,e,n){let r=Vm||(Vm=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},QT=function(){Vm=null},Eo=function(t,e,n,r){return n&&(qb(t,e,n,r,-1)||qb(t,e,n,r,1))},WT=/^(img|br|input|textarea|hr)$/i;function qb(t,e,n,r,o){for(var l;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Dn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||La(t)||WT.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ot(t)+(o<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(o<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((l=a.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)e+=o;else return!1;else t=a,e=o<0?Dn(t):0}else return!1}}function Dn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function JT(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Dn(t)}else if(t.parentNode&&!La(t))e=Ot(t),t=t.parentNode;else return null}}function e6(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!La(t))e=Ot(t)+1,t=t.parentNode;else return null}}function t6(t,e,n){for(let r=e==0,o=e==Dn(t);r||o;){if(t==n)return!0;let l=Ot(t);if(t=t.parentNode,!t)return!1;r=r&&l==0,o=o&&l==Dn(t)}}function La(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Vf=function(t){return t.focusNode&&Eo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function co(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function n6(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function r6(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Dn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Dn(r.startContainer),r.startOffset)}}}const rr=typeof navigator<"u"?navigator:null,Kb=typeof document<"u"?document:null,Ui=rr&&rr.userAgent||"",Pm=/Edge\/(\d+)/.exec(Ui),US=/MSIE \d/.exec(Ui),$m=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ui),tn=!!(US||$m||Pm),Ri=US?document.documentMode:$m?+$m[1]:Pm?+Pm[1]:0,Ln=!tn&&/gecko\/(\d+)/i.test(Ui);Ln&&+(/Firefox\/(\d+)/.exec(Ui)||[0,0])[1];const Fm=!tn&&/Chrome\/(\d+)/.exec(Ui),_t=!!Fm,VS=Fm?+Fm[1]:0,$t=!tn&&!!rr&&/Apple Computer/.test(rr.vendor),Hs=$t&&(/Mobile\/\w+/.test(Ui)||!!rr&&rr.maxTouchPoints>2),Nn=Hs||(rr?/Mac/.test(rr.platform):!1),i6=rr?/Win/.test(rr.platform):!1,Nr=/Android \d/.test(Ui),za=!!Kb&&"webkitFontSmoothing"in Kb.documentElement.style,o6=za?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function s6(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Tr(t,e){return typeof t=="number"?t:t[e]}function l6(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Gb(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,l=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=Is(a);continue}let u=a,f=u==l.body,h=f?s6(l):l6(u),p=0,m=0;if(e.top<h.top+Tr(r,"top")?m=-(h.top-e.top+Tr(o,"top")):e.bottom>h.bottom-Tr(r,"bottom")&&(m=e.bottom-e.top>h.bottom-h.top?e.top+Tr(o,"top")-h.top:e.bottom-h.bottom+Tr(o,"bottom")),e.left<h.left+Tr(r,"left")?p=-(h.left-e.left+Tr(o,"left")):e.right>h.right-Tr(r,"right")&&(p=e.right-h.right+Tr(o,"right")),p||m)if(f)l.defaultView.scrollBy(p,m);else{let v=u.scrollLeft,C=u.scrollTop;m&&(u.scrollTop+=m),p&&(u.scrollLeft+=p);let x=u.scrollLeft-v,M=u.scrollTop-C;e={left:e.left-x,top:e.top-M,right:e.right-x,bottom:e.bottom-M}}let b=f?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(b))break;a=b=="absolute"?a.offsetParent:Is(a)}}function a6(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let l=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let u=t.root.elementFromPoint(l,a);if(!u||u==t.dom||!t.dom.contains(u))continue;let f=u.getBoundingClientRect();if(f.top>=n-20){r=u,o=f.top;break}}return{refDOM:r,refTop:o,stack:PS(t.dom)}}function PS(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Is(r));return e}function c6({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;$S(n,r==0?0:r-e)}function $S(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:l}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=l&&(r.scrollLeft=l)}}let bs=null;function u6(t){if(t.setActive)return t.setActive();if(bs)return t.focus(bs);let e=PS(t);t.focus(bs==null?{get preventScroll(){return bs={preventScroll:!0},!0}}:void 0),bs||(bs=!1,$S(e,0))}function FS(t,e){let n,r=2e8,o,l=0,a=e.top,u=e.top,f,h;for(let p=t.firstChild,m=0;p;p=p.nextSibling,m++){let b;if(p.nodeType==1)b=p.getClientRects();else if(p.nodeType==3)b=Or(p).getClientRects();else continue;for(let v=0;v<b.length;v++){let C=b[v];if(C.top<=a&&C.bottom>=u){a=Math.max(C.bottom,a),u=Math.min(C.top,u);let x=C.left>e.left?C.left-e.left:C.right<e.left?e.left-C.right:0;if(x<r){n=p,r=x,o=x&&n.nodeType==3?{left:C.right<e.left?C.right:C.left,top:e.top}:e,p.nodeType==1&&x&&(l=m+(e.left>=(C.left+C.right)/2?1:0));continue}}else C.top>e.top&&!f&&C.left<=e.left&&C.right>=e.left&&(f=p,h={left:Math.max(C.left,Math.min(C.right,e.left)),top:C.top});!n&&(e.left>=C.right&&e.top>=C.top||e.left>=C.left&&e.top>=C.bottom)&&(l=m+1)}}return!n&&f&&(n=f,o=h,r=0),n&&n.nodeType==3?f6(n,o):!n||r&&n.nodeType==1?{node:t,offset:l}:FS(n,o)}function f6(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let l=yi(r,1);if(l.top!=l.bottom&&B1(e,l))return{node:t,offset:o+(e.left>=(l.left+l.right)/2?1:0)}}return{node:t,offset:0}}function B1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function d6(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function h6(t,e,n){let{node:r,offset:o}=FS(e,n),l=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();l=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,l)}function p6(t,e,n,r){let o=-1;for(let l=e,a=!1;l!=t.dom;){let u=t.docView.nearestDesc(l,!0),f;if(!u)return null;if(u.dom.nodeType==1&&(u.node.isBlock&&u.parent||!u.contentDOM)&&((f=u.dom.getBoundingClientRect()).width||f.height)&&(u.node.isBlock&&u.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(u.dom.nodeName)&&(!a&&f.left>r.left||f.top>r.top?o=u.posBefore:(!a&&f.right<r.left||f.bottom<r.top)&&(o=u.posAfter),a=!0),!u.contentDOM&&o<0&&!u.node.isText))return(u.node.isBlock?r.top<(f.top+f.bottom)/2:r.left<(f.left+f.right)/2)?u.posBefore:u.posAfter;l=u.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function qS(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),l=o;;){let a=t.childNodes[l];if(a.nodeType==1){let u=a.getClientRects();for(let f=0;f<u.length;f++){let h=u[f];if(B1(e,h))return qS(a,e,h)}}if((l=(l+1)%r)==o)break}return t}function m6(t,e){let n=t.dom.ownerDocument,r,o=0,l=r6(n,e.left,e.top);l&&({node:r,offset:o}=l);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),u;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let h=t.dom.getBoundingClientRect();if(!B1(e,h)||(a=qS(t.dom,e,h),!a))return null}if($t)for(let h=a;r&&h;h=Is(h))h.draggable&&(r=void 0);if(a=d6(a,e),r){if(Ln&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let p=r.childNodes[o],m;p.nodeName=="IMG"&&(m=p.getBoundingClientRect()).right<=e.left&&m.bottom>e.top&&o++}let h;za&&o&&r.nodeType==1&&(h=r.childNodes[o-1]).nodeType==1&&h.contentEditable=="false"&&h.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?u=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(u=p6(t,r,o,e))}u==null&&(u=h6(t,a,e));let f=t.docView.nearestDesc(a,!0);return{pos:u,inside:f?f.posAtStart-f.border:-1}}function Yb(t){return t.top<t.bottom||t.left<t.right}function yi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Yb(r))return r}return Array.prototype.find.call(n,Yb)||t.getBoundingClientRect()}const g6=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function KS(t,e,n){let{node:r,offset:o,atom:l}=t.docView.domFromPos(e,n<0?-1:1),a=za||Ln;if(r.nodeType==3)if(a&&(g6.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let f=yi(Or(r,o,o),n);if(Ln&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let h=yi(Or(r,o-1,o-1),-1);if(h.top==f.top){let p=yi(Or(r,o,o+1),-1);if(p.top!=f.top)return Fl(p,p.left<h.left)}}return f}else{let f=o,h=o,p=n<0?1:-1;return n<0&&!o?(h++,p=-1):n>=0&&o==r.nodeValue.length?(f--,p=1):n<0?f--:h++,Fl(yi(Or(r,f,h),p),p<0)}if(!t.state.doc.resolve(e-(l||0)).parent.inlineContent){if(l==null&&o&&(n<0||o==Dn(r))){let f=r.childNodes[o-1];if(f.nodeType==1)return Gp(f.getBoundingClientRect(),!1)}if(l==null&&o<Dn(r)){let f=r.childNodes[o];if(f.nodeType==1)return Gp(f.getBoundingClientRect(),!0)}return Gp(r.getBoundingClientRect(),n>=0)}if(l==null&&o&&(n<0||o==Dn(r))){let f=r.childNodes[o-1],h=f.nodeType==3?Or(f,Dn(f)-(a?0:1)):f.nodeType==1&&(f.nodeName!="BR"||!f.nextSibling)?f:null;if(h)return Fl(yi(h,1),!1)}if(l==null&&o<Dn(r)){let f=r.childNodes[o];for(;f.pmViewDesc&&f.pmViewDesc.ignoreForCoords;)f=f.nextSibling;let h=f?f.nodeType==3?Or(f,0,a?0:1):f.nodeType==1?f:null:null;if(h)return Fl(yi(h,-1),!0)}return Fl(yi(r.nodeType==3?Or(r):r,-n),n>=0)}function Fl(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Gp(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function GS(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function y6(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return GS(t,e,()=>{let{node:l}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let u=t.docView.nearestDesc(l,!0);if(!u)break;if(u.node.isBlock){l=u.contentDOM||u.dom;break}l=u.dom.parentNode}let a=KS(t,o.pos,1);for(let u=l.firstChild;u;u=u.nextSibling){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Or(u,0,u.nodeValue.length).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.bottom>p.top+1&&(n=="up"?a.top-p.top>(p.bottom-a.top)*2:p.bottom-a.bottom>(a.bottom-p.top)*2))return!1}}return!0})}const v6=/[\u0590-\u08ac]/;function b6(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,l=!o,a=o==r.parent.content.size,u=t.domSelection();return u?!v6.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?l:a:GS(t,e,()=>{let{focusNode:f,focusOffset:h,anchorNode:p,anchorOffset:m}=t.domSelectionRange(),b=u.caretBidiLevel;u.modify("move",n,"character");let v=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:C,focusOffset:x}=t.domSelectionRange(),M=C&&!v.contains(C.nodeType==1?C:C.parentNode)||f==C&&h==x;try{u.collapse(p,m),f&&(f!=p||h!=m)&&u.extend&&u.extend(f,h)}catch{}return b!=null&&(u.caretBidiLevel=b),M}):r.pos==r.start()||r.pos==r.end()}let Zb=null,Xb=null,Qb=!1;function C6(t,e,n){return Zb==e&&Xb==n?Qb:(Zb=e,Xb=n,Qb=n=="up"||n=="down"?y6(t,e,n):b6(t,e,n))}const zn=0,Wb=1,ho=2,ir=3;class ja{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=zn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let l,a;if(e==this.contentDOM)l=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;l=e.previousSibling}for(;l&&!((a=l.pmViewDesc)&&a.parent==this);)l=l.previousSibling;return l?this.posBeforeChild(a)+a.size:this.posAtStart}else{let l,a;if(e==this.contentDOM)l=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;l=e.nextSibling}for(;l&&!((a=l.pmViewDesc)&&a.parent==this);)l=l.nextSibling;return l?this.posBeforeChild(a):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Ot(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let l=e;;l=l.parentNode){if(l==this.dom){o=!1;break}if(l.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let l=e;;l=l.parentNode){if(l==this.dom){o=!0;break}if(l.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let l=this.getDesc(o),a;if(l&&(!n||l.node))if(r&&(a=l.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return l}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let l=this.getDesc(o);if(l)return l.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],l=r+o.size;if(r==e&&l!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let u=o.children[a];if(u.size){o=u;break}}return o}if(e<l)return o.descAt(e-r-o.border);r=l}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let l=0;r<this.children.length;r++){let a=this.children[r],u=l+a.size;if(u>e||a instanceof ZS){o=e-l;break}l=u}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let l;r&&!(l=this.children[r-1]).size&&l instanceof YS&&l.side>=0;r--);if(n<=0){let l,a=!0;for(;l=r?this.children[r-1]:null,!(!l||l.dom.parentNode==this.contentDOM);r--,a=!1);return l&&n&&a&&!l.border&&!l.domAtom?l.domFromPos(l.size,n):{node:this.contentDOM,offset:l?Ot(l.dom)+1:0}}else{let l,a=!0;for(;l=r<this.children.length?this.children[r]:null,!(!l||l.dom.parentNode==this.contentDOM);r++,a=!1);return l&&a&&!l.border&&!l.domAtom?l.domFromPos(0,n):{node:this.contentDOM,offset:l?Ot(l.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,l=-1;for(let a=r,u=0;;u++){let f=this.children[u],h=a+f.size;if(o==-1&&e<=h){let p=a+f.border;if(e>=p&&n<=h-f.border&&f.node&&f.contentDOM&&this.contentDOM.contains(f.contentDOM))return f.parseRange(e,n,p);e=a;for(let m=u;m>0;m--){let b=this.children[m-1];if(b.size&&b.dom.parentNode==this.contentDOM&&!b.emptyChildAt(1)){o=Ot(b.dom)+1;break}e-=b.size}o==-1&&(o=0)}if(o>-1&&(h>n||u==this.children.length-1)){n=h;for(let p=u+1;p<this.children.length;p++){let m=this.children[p];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(-1)){l=Ot(m.dom);break}n+=m.size}l==-1&&(l=this.contentDOM.childNodes.length);break}a=h}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:l}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let l=Math.min(e,n),a=Math.max(e,n);for(let v=0,C=0;v<this.children.length;v++){let x=this.children[v],M=C+x.size;if(l>C&&a<M)return x.setSelection(e-C-x.border,n-C-x.border,r,o);C=M}let u=this.domFromPos(e,e?-1:1),f=n==e?u:this.domFromPos(n,n?-1:1),h=r.root.getSelection(),p=r.domSelectionRange(),m=!1;if((Ln||$t)&&e==n){let{node:v,offset:C}=u;if(v.nodeType==3){if(m=!!(C&&v.nodeValue[C-1]==`
63
+ `),m&&C==v.nodeValue.length)for(let x=v,M;x;x=x.parentNode){if(M=x.nextSibling){M.nodeName=="BR"&&(u=f={node:M.parentNode,offset:Ot(M)+1});break}let T=x.pmViewDesc;if(T&&T.node&&T.node.isBlock)break}}else{let x=v.childNodes[C-1];m=x&&(x.nodeName=="BR"||x.contentEditable=="false")}}if(Ln&&p.focusNode&&p.focusNode!=f.node&&p.focusNode.nodeType==1){let v=p.focusNode.childNodes[p.focusOffset];v&&v.contentEditable=="false"&&(o=!0)}if(!(o||m&&$t)&&Eo(u.node,u.offset,p.anchorNode,p.anchorOffset)&&Eo(f.node,f.offset,p.focusNode,p.focusOffset))return;let b=!1;if((h.extend||e==n)&&!(m&&Ln)){h.collapse(u.node,u.offset);try{e!=n&&h.extend(f.node,f.offset),b=!0}catch{}}if(!b){if(e>n){let C=u;u=f,f=C}let v=document.createRange();v.setEnd(f.node,f.offset),v.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(v)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let l=this.children[o],a=r+l.size;if(r==a?e<=a&&n>=r:e<a&&n>r){let u=r+l.border,f=a-l.border;if(e>=u&&n<=f){this.dirty=e==r||n==a?ho:Wb,e==u&&n==f&&(l.contentLost||l.dom.parentNode!=this.contentDOM)?l.dirty=ir:l.markDirty(e-u,n-u);return}else l.dirty=l.dom==l.contentDOM&&l.dom.parentNode==this.contentDOM&&!l.children.length?ho:ir}r=a}this.dirty=ho}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?ho:Wb;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class YS extends ja{constructor(e,n,r,o){let l,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)})),!n.type.spec.raw){if(a.nodeType!=1){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,l=this}matchesWidget(e){return this.dirty==zn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class x6 extends ja{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Mo extends ja{constructor(e,n,r,o,l){super(e,[],r,o),this.mark=n,this.spec=l}static create(e,n,r,o){let l=o.nodeViews[n.type.name],a=l&&l(n,o,r);return(!a||!a.dom)&&(a=ko.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Mo(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&ir||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ir&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=zn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=zn}}slice(e,n,r){let o=Mo.create(this.parent,this.mark,!0,r),l=this.children,a=this.size;n<a&&(l=Km(l,n,a,r)),e>0&&(l=Km(l,0,e,r));for(let u=0;u<l.length;u++)l[u].parent=o;return o.children=l,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Oi extends ja{constructor(e,n,r,o,l,a,u,f,h){super(e,[],l,a),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=u}static create(e,n,r,o,l,a){let u=l.nodeViews[n.type.name],f,h=u&&u(n,l,()=>{if(!f)return a;if(f.parent)return f.parent.posBeforeChild(f)},r,o),p=h&&h.dom,m=h&&h.contentDOM;if(n.isText){if(!p)p=document.createTextNode(n.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:m}=ko.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!m&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let b=p;return p=WS(p,r,n),h?f=new S6(e,n,r,o,p,m||null,b,h,l,a+1):n.isText?new Pf(e,n,r,o,p,b,l):new Oi(e,n,r,o,p,m||null,b,l,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ee.empty)}return e}matchesNode(e,n,r){return this.dirty==zn&&e.eq(this.node)&&Fu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,l=e.composing?this.localCompositionInfo(e,n):null,a=l&&l.pos>-1?l:null,u=l&&l.pos<0,f=new E6(this,a&&a.node,e);A6(this.node,this.innerDeco,(h,p,m)=>{h.spec.marks?f.syncToMarks(h.spec.marks,r,e):h.type.side>=0&&!m&&f.syncToMarks(p==this.node.childCount?qe.none:this.node.child(p).marks,r,e),f.placeWidget(h,e,o)},(h,p,m,b)=>{f.syncToMarks(h.marks,r,e);let v;f.findNodeMatch(h,p,m,b)||u&&e.state.selection.from>o&&e.state.selection.to<o+h.nodeSize&&(v=f.findIndexWithChild(l.node))>-1&&f.updateNodeAt(h,p,m,v,e)||f.updateNextNode(h,p,m,e,b,o)||f.addNode(h,p,m,e,o),o+=h.nodeSize}),f.syncToMarks([],r,e),this.node.isTextblock&&f.addTextblockHacks(),f.destroyRest(),(f.changed||this.dirty==ho)&&(a&&this.protectLocalComposition(e,a),XS(this.contentDOM,this.children,e),Hs&&k6(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof ve)||r<n||o>n+this.node.content.size)return null;let l=e.input.compositionNode;if(!l||!this.dom.contains(l.parentNode))return null;if(this.node.inlineContent){let a=l.nodeValue,u=R6(this.node.content,a,r-n,o-n);return u<0?null:{node:l,pos:u,text:a}}else return{node:l,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let l=n;for(;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=void 0)}let a=new x6(this,l,n,o);e.input.compositionNodes.push(a),this.children=Km(this.children,r,r+o.length,e,a)}update(e,n,r,o){return this.dirty==ir||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=zn}updateOuterDeco(e){if(Fu(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=QS(this.dom,this.nodeDOM,qm(this.outerDeco,this.node,n),qm(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Jb(t,e,n,r,o){WS(r,e,t);let l=new Oi(void 0,t,e,n,r,r,r,o,0);return l.contentDOM&&l.updateChildren(o,0),l}class Pf extends Oi{constructor(e,n,r,o,l,a,u){super(e,n,r,o,l,null,a,u,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==ir||this.dirty!=zn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=zn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=zn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),l=document.createTextNode(o.text);return new Pf(this.parent,o,this.outerDeco,this.innerDeco,l,l,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ir)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ZS extends ja{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==zn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class S6 extends Oi{constructor(e,n,r,o,l,a,u,f,h,p){super(e,n,r,o,l,a,u,h,p),this.spec=f}update(e,n,r,o){if(this.dirty==ir)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let l=this.spec.update(e,n,r);return l&&this.updateInner(e,n,r,o),l}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function XS(t,e,n){let r=t.firstChild,o=!1;for(let l=0;l<e.length;l++){let a=e[l],u=a.dom;if(u.parentNode==t){for(;u!=r;)r=eC(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(u,r);if(a instanceof Mo){let f=r?r.previousSibling:t.lastChild;XS(a.contentDOM,a.children,n),r=f?f.nextSibling:t.firstChild}}for(;r;)r=eC(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const na=function(t){t&&(this.nodeName=t)};na.prototype=Object.create(null);const po=[new na];function qm(t,e,n){if(t.length==0)return po;let r=n?po[0]:new na,o=[r];for(let l=0;l<t.length;l++){let a=t[l].type.attrs;if(a){a.nodeName&&o.push(r=new na(a.nodeName));for(let u in a){let f=a[u];f!=null&&(n&&o.length==1&&o.push(r=new na(e.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+f:u=="style"?r.style=(r.style?r.style+";":"")+f:u!="nodeName"&&(r[u]=f))}}}return o}function QS(t,e,n,r){if(n==po&&r==po)return e;let o=e;for(let l=0;l<r.length;l++){let a=r[l],u=n[l];if(l){let f;u&&u.nodeName==a.nodeName&&o!=t&&(f=o.parentNode)&&f.nodeName.toLowerCase()==a.nodeName||(f=document.createElement(a.nodeName),f.pmIsDeco=!0,f.appendChild(o),u=po[0]),o=f}w6(o,u||po[0],a)}return o}function w6(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let l=0;l<r.length;l++)o.indexOf(r[l])==-1&&t.classList.remove(r[l]);for(let l=0;l<o.length;l++)r.indexOf(o[l])==-1&&t.classList.add(o[l]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function WS(t,e,n){return QS(t,t,po,qm(e,n,t.nodeType!=1))}function Fu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function eC(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class E6{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=M6(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,l=this.stack.length>>1,a=Math.min(l,e.length);for(;o<a&&(o==l-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<l;)this.destroyRest(),this.top.dirty=zn,this.index=this.stack.pop(),this.top=this.stack.pop(),l--;for(;l<e.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let f=this.index;f<Math.min(this.index+3,this.top.children.length);f++){let h=this.top.children[f];if(h.matchesMark(e[l])&&!this.isLocked(h.dom)){u=f;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let f=Mo.create(this.top,e[l],n,r);this.top.children.splice(this.index,0,f),this.top=f,this.changed=!0}this.index=0,l++}}findNodeMatch(e,n,r,o){let l=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))l=this.top.children.indexOf(a,this.index);else for(let u=this.index,f=Math.min(this.top.children.length,u+5);u<f;u++){let h=this.top.children[u];if(h.matchesNode(e,n,r)&&!this.preMatch.matched.has(h)){l=u;break}}return l<0?!1:(this.destroyBetween(this.index,l),this.index++,!0)}updateNodeAt(e,n,r,o,l){let a=this.top.children[o];return a.dirty==ir&&a.dom==a.contentDOM&&(a.dirty=ho),a.update(e,n,r,l)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,l,a){for(let u=this.index;u<this.top.children.length;u++){let f=this.top.children[u];if(f instanceof Oi){let h=this.preMatch.matched.get(f);if(h!=null&&h!=l)return!1;let p=f.dom,m,b=this.isLocked(p)&&!(e.isText&&f.node&&f.node.isText&&f.nodeDOM.nodeValue==e.text&&f.dirty!=ir&&Fu(n,f.outerDeco));if(!b&&f.update(e,n,r,o))return this.destroyBetween(this.index,u),f.dom!=p&&(this.changed=!0),this.index++,!0;if(!b&&(m=this.recreateWrapper(f,e,n,r,o,a)))return this.destroyBetween(this.index,u),this.top.children[this.index]=m,m.contentDOM&&(m.dirty=ho,m.updateChildren(o,a+1),m.dirty=zn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,l,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Fu(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let u=Oi.create(this.top,n,r,o,l,a);if(u.contentDOM){u.children=e.children,e.children=[];for(let f of u.children)f.parent=u}return e.destroy(),u}addNode(e,n,r,o,l){let a=Oi.create(this.top,e,n,r,o,l);a.contentDOM&&a.updateChildren(o,l+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let l=new YS(this.top,e,n,r);this.top.children.splice(this.index++,0,l),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Mo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Pf)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&(($t||_t)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new ZS(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function M6(t,e){let n=e,r=n.children.length,o=t.childCount,l=new Map,a=[];e:for(;o>0;){let u;for(;;)if(r){let h=n.children[r-1];if(h instanceof Mo)n=h,r=h.children.length;else{u=h,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let f=u.node;if(f){if(f!=t.child(o-1))break;--o,l.set(u,o),a.push(u)}}return{index:o,matched:l,matches:a.reverse()}}function T6(t,e){return t.type.side-e.type.side}function A6(t,e,n,r){let o=e.locals(t),l=0;if(o.length==0){for(let h=0;h<t.childCount;h++){let p=t.child(h);r(p,o,e.forChild(l,p),h),l+=p.nodeSize}return}let a=0,u=[],f=null;for(let h=0;;){let p,m;for(;a<o.length&&o[a].to==l;){let M=o[a++];M.widget&&(p?(m||(m=[p])).push(M):p=M)}if(p)if(m){m.sort(T6);for(let M=0;M<m.length;M++)n(m[M],h,!!f)}else n(p,h,!!f);let b,v;if(f)v=-1,b=f,f=null;else if(h<t.childCount)v=h,b=t.child(h++);else break;for(let M=0;M<u.length;M++)u[M].to<=l&&u.splice(M--,1);for(;a<o.length&&o[a].from<=l&&o[a].to>l;)u.push(o[a++]);let C=l+b.nodeSize;if(b.isText){let M=C;a<o.length&&o[a].from<M&&(M=o[a].from);for(let T=0;T<u.length;T++)u[T].to<M&&(M=u[T].to);M<C&&(f=b.cut(M-l),b=b.cut(0,M-l),C=M,v=-1)}else for(;a<o.length&&o[a].to<C;)a++;let x=b.isInline&&!b.isLeaf?u.filter(M=>!M.inline):u.slice();r(b,x,e.forChild(l,b),v),l=C}}function k6(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function R6(t,e,n,r){for(let o=0,l=0;o<t.childCount&&l<=r;){let a=t.child(o++),u=l;if(l+=a.nodeSize,!a.isText)continue;let f=a.text;for(;o<t.childCount;){let h=t.child(o++);if(l+=h.nodeSize,!h.isText)break;f+=h.text}if(l>=n){if(l>=r&&f.slice(r-e.length-u,r-u)==e)return r-e.length;let h=u<r?f.lastIndexOf(e,r-u-1):-1;if(h>=0&&h+e.length+u>=n)return u+h;if(n==r&&f.length>=r+e.length-u&&f.slice(r-u,r-u+e.length)==e)return r}}return-1}function Km(t,e,n,r,o){let l=[];for(let a=0,u=0;a<t.length;a++){let f=t[a],h=u,p=u+=f.size;h>=n||p<=e?l.push(f):(h<e&&l.push(f.slice(0,e-h,r)),o&&(l.push(o),o=void 0),p>n&&l.push(f.slice(n-h,f.size,r)))}return l}function U1(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),l=o&&o.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),f,h;if(Vf(n)){for(f=a;o&&!o.node;)o=o.parent;let m=o.node;if(o&&m.isAtom&&de.isSelectable(m)&&o.parent&&!(m.isInline&&t6(n.focusNode,n.focusOffset,o.dom))){let b=o.posBefore;h=new de(a==b?u:r.resolve(b))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let m=a,b=a;for(let v=0;v<n.rangeCount;v++){let C=n.getRangeAt(v);m=Math.min(m,t.docView.posFromDOM(C.startContainer,C.startOffset,1)),b=Math.max(b,t.docView.posFromDOM(C.endContainer,C.endOffset,-1))}if(m<0)return null;[f,a]=b==t.state.selection.anchor?[b,m]:[m,b],u=r.resolve(a)}else f=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null}let p=r.resolve(f);if(!h){let m=e=="pointer"||t.state.selection.head<u.pos&&!l?1:-1;h=V1(t,p,u,m)}return h}function JS(t){return t.editable?t.hasFocus():t4(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function zr(t,e=!1){let n=t.state.selection;if(e4(t,n),!!JS(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&_t){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Eo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)N6(t);else{let{anchor:r,head:o}=n,l,a;tC&&!(n instanceof ve)&&(n.$from.parent.inlineContent||(l=nC(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=nC(t,n.to))),t.docView.setSelection(r,o,t,e),tC&&(l&&rC(l),a&&rC(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&O6(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const tC=$t||_t&&VS<63;function nC(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,l=r?n.childNodes[r-1]:null;if($t&&o&&o.contentEditable=="false")return Yp(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return Yp(o);if(l)return Yp(l)}}function Yp(t){return t.contentEditable="true",$t&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function rC(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function O6(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!JS(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function N6(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Ot(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&tn&&Ri<=11&&(n.disabled=!0,n.disabled=!1)}function e4(t,e){if(e instanceof de){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(iC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else iC(t)}function iC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function V1(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||ve.between(e,n,r)}function oC(t){return t.editable&&!t.hasFocus()?!1:t4(t)}function t4(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function D6(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Eo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Gm(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),l=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return l&&Ee.findFrom(l,e)}function bi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function sC(t,e,n){let r=t.state.selection;if(r instanceof ve)if(n.indexOf("s")>-1){let{$head:o}=r,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let a=t.state.doc.resolve(o.pos+l.nodeSize*(e<0?-1:1));return bi(t,new ve(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Gm(t.state,e);return o&&o instanceof de?bi(t,o):!1}else if(!(Nn&&n.indexOf("m")>-1)){let o=r.$head,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,a;if(!l||l.isText)return!1;let u=e<0?o.pos-l.nodeSize:o.pos;return l.isAtom||(a=t.docView.descAt(u))&&!a.contentDOM?de.isSelectable(l)?bi(t,new de(e<0?t.state.doc.resolve(o.pos-l.nodeSize):o)):za?bi(t,new ve(t.state.doc.resolve(e<0?u:u+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof de&&r.node.isInline)return bi(t,new ve(e>0?r.$to:r.$from));{let o=Gm(t.state,e);return o?bi(t,o):!1}}}function qu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ra(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Cs(t,e){return e<0?L6(t):z6(t)}function L6(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,l,a=!1;for(Ln&&n.nodeType==1&&r<qu(n)&&ra(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(ra(u,-1))o=n,l=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(n4(n))break;{let u=n.previousSibling;for(;u&&ra(u,-1);)o=n.parentNode,l=Ot(u),u=u.previousSibling;if(u)n=u,r=qu(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?Ym(t,n,r):o&&Ym(t,o,l)}function z6(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=qu(n),l,a;for(;;)if(r<o){if(n.nodeType!=1)break;let u=n.childNodes[r];if(ra(u,1))l=n,a=++r;else break}else{if(n4(n))break;{let u=n.nextSibling;for(;u&&ra(u,1);)l=u.parentNode,a=Ot(u)+1,u=u.nextSibling;if(u)n=u,r=0,o=qu(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}l&&Ym(t,l,a)}function n4(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function j6(t,e){for(;t&&e==t.childNodes.length&&!La(t);)e=Ot(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function _6(t,e){for(;t&&!e&&!La(t);)e=Ot(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ym(t,e,n){if(e.nodeType!=3){let l,a;(a=j6(e,n))?(e=a,n=0):(l=_6(e,n))&&(e=l,n=l.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Vf(r)){let l=document.createRange();l.setEnd(e,n),l.setStart(e,n),r.removeAllRanges(),r.addRange(l)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&zr(t)},50)}function lC(t,e){let n=t.state.doc.resolve(e);if(!(_t||i6)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let l=t.coordsAtPos(e-1),a=(l.top+l.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(l.left-o.left)>1)return l.left<o.left?"ltr":"rtl"}if(e<n.end()){let l=t.coordsAtPos(e+1),a=(l.top+l.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(l.left-o.left)>1)return l.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function aC(t,e,n){let r=t.state.selection;if(r instanceof ve&&!r.empty||n.indexOf("s")>-1||Nn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:l}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=Gm(t.state,e);if(a&&a instanceof de)return bi(t,a)}if(!o.parent.inlineContent){let a=e<0?o:l,u=r instanceof gn?Ee.near(a,e):Ee.findFrom(a,e);return u?bi(t,u):!1}return!1}function cC(t,e){if(!(t.state.selection instanceof ve))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let l=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(l&&!l.isText){let a=t.state.tr;return e<0?a.delete(n.pos-l.nodeSize,n.pos):a.delete(n.pos,n.pos+l.nodeSize),t.dispatch(a),!0}return!1}function uC(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function I6(t){if(!$t||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;uC(t,r,"true"),setTimeout(()=>uC(t,r,"false"),20)}return!1}function H6(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function B6(t,e){let n=e.keyCode,r=H6(e);if(n==8||Nn&&n==72&&r=="c")return cC(t,-1)||Cs(t,-1);if(n==46&&!e.shiftKey||Nn&&n==68&&r=="c")return cC(t,1)||Cs(t,1);if(n==13||n==27)return!0;if(n==37||Nn&&n==66&&r=="c"){let o=n==37?lC(t,t.state.selection.from)=="ltr"?-1:1:-1;return sC(t,o,r)||Cs(t,o)}else if(n==39||Nn&&n==70&&r=="c"){let o=n==39?lC(t,t.state.selection.from)=="ltr"?1:-1:1;return sC(t,o,r)||Cs(t,o)}else{if(n==38||Nn&&n==80&&r=="c")return aC(t,-1,r)||Cs(t,-1);if(n==40||Nn&&n==78&&r=="c")return I6(t)||aC(t,1,r)||Cs(t,1);if(r==(Nn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function P1(t,e){t.someProp("transformCopied",v=>{e=v(e,t)});let n=[],{content:r,openStart:o,openEnd:l}=e;for(;o>1&&l>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,l--;let v=r.firstChild;n.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),r=v.content}let a=t.someProp("clipboardSerializer")||ko.fromSchema(t.state.schema),u=a4(),f=u.createElement("div");f.appendChild(a.serializeFragment(r,{document:u}));let h=f.firstChild,p,m=0;for(;h&&h.nodeType==1&&(p=l4[h.nodeName.toLowerCase()]);){for(let v=p.length-1;v>=0;v--){let C=u.createElement(p[v]);for(;f.firstChild;)C.appendChild(f.firstChild);f.appendChild(C),m++}h=f.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${o} ${l}${m?` -${m}`:""} ${JSON.stringify(n)}`);let b=t.someProp("clipboardTextSerializer",v=>v(e,t))||e.content.textBetween(0,e.content.size,`
64
+
65
+ `);return{dom:f,text:b,slice:e}}function r4(t,e,n,r,o){let l=o.parent.type.spec.code,a,u;if(!n&&!e)return null;let f=!!e&&(r||l||!n);if(f){if(t.someProp("transformPastedText",b=>{e=b(e,l||r,t)}),l)return u=new le(ee.from(t.state.schema.text(e.replace(/\r\n?/g,`
66
+ `))),0,0),t.someProp("transformPasted",b=>{u=b(u,t,!0)}),u;let m=t.someProp("clipboardTextParser",b=>b(e,o,r,t));if(m)u=m;else{let b=o.marks(),{schema:v}=t.state,C=ko.fromSchema(v);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(x=>{let M=a.appendChild(document.createElement("p"));x&&M.appendChild(C.serializeNode(v.text(x,b)))})}}else t.someProp("transformPastedHTML",m=>{n=m(n,t)}),a=$6(n),za&&F6(a);let h=a&&a.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let m=+p[3];m>0;m--){let b=a.firstChild;for(;b&&b.nodeType!=1;)b=b.nextSibling;if(!b)break;a=b}if(u||(u=(t.someProp("clipboardParser")||t.someProp("domParser")||ki.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||p),context:o,ruleFromNode(b){return b.nodeName=="BR"&&!b.nextSibling&&b.parentNode&&!U6.test(b.parentNode.nodeName)?{ignore:!0}:null}})),p)u=q6(fC(u,+p[1],+p[2]),p[4]);else if(u=le.maxOpen(V6(u.content,o),!0),u.openStart||u.openEnd){let m=0,b=0;for(let v=u.content.firstChild;m<u.openStart&&!v.type.spec.isolating;m++,v=v.firstChild);for(let v=u.content.lastChild;b<u.openEnd&&!v.type.spec.isolating;b++,v=v.lastChild);u=fC(u,m,b)}return t.someProp("transformPasted",m=>{u=m(u,t,f)}),u}const U6=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function V6(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),l,a=[];if(t.forEach(u=>{if(!a)return;let f=o.findWrapping(u.type),h;if(!f)return a=null;if(h=a.length&&l.length&&o4(f,l,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=s4(a[a.length-1],l.length));let p=i4(u,f);a.push(p),o=o.matchType(p.type),l=f}}),a)return ee.from(a)}return t}function i4(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ee.from(t));return t}function o4(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let l=o4(t,e,n,r.lastChild,o+1);if(l)return r.copy(r.content.replaceChild(r.childCount-1,l));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(ee.from(i4(n,t,o+1))))}}function s4(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,s4(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ee.empty,!0);return t.copy(n.append(r))}function Zm(t,e,n,r,o,l){let a=e<0?t.firstChild:t.lastChild,u=a.content;return t.childCount>1&&(l=0),o<r-1&&(u=Zm(u,e,n,r,o+1,l)),o>=n&&(u=e<0?a.contentMatchAt(0).fillBefore(u,l<=o).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(ee.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(u))}function fC(t,e,n){return e<t.openStart&&(t=new le(Zm(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new le(Zm(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const l4={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let dC=null;function a4(){return dC||(dC=document.implementation.createHTMLDocument("title"))}let Zp=null;function P6(t){let e=window.trustedTypes;return e?(Zp||(Zp=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Zp.createHTML(t)):t}function $6(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=a4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&l4[r[1].toLowerCase()])&&(t=o.map(l=>"<"+l+">").join("")+t+o.map(l=>"</"+l+">").reverse().join("")),n.innerHTML=P6(t),o)for(let l=0;l<o.length;l++)n=n.querySelector(o[l])||n;return n}function F6(t){let e=t.querySelectorAll(_t?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function q6(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:l,openEnd:a}=t;for(let u=r.length-2;u>=0;u-=2){let f=n.nodes[r[u]];if(!f||f.hasRequiredAttrs())break;o=ee.from(f.create(r[u+1],o)),l++,a++}return new le(o,l,a)}const Ft={},qt={},K6={touchstart:!0,touchmove:!0};class G6{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Y6(t){for(let e in Ft){let n=Ft[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{X6(t,r)&&!$1(t,r)&&(t.editable||!(r.type in qt))&&n(t,r)},K6[e]?{passive:!0}:void 0)}$t&&t.dom.addEventListener("input",()=>null),Xm(t)}function Ti(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Z6(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Xm(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>$1(t,r))})}function $1(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function X6(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Q6(t,e){!$1(t,e)&&Ft[e.type]&&(t.editable||!(e.type in qt))&&Ft[e.type](t,e)}qt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!u4(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Nr&&_t&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Hs&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,co(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||B6(t,n)?n.preventDefault():Ti(t,"key")};qt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};qt.keypress=(t,e)=>{let n=e;if(u4(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Nn&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ve)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),l=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,o,l))&&t.dispatch(l()),n.preventDefault()}};function $f(t){return{left:t.clientX,top:t.clientY}}function W6(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function F1(t,e,n,r,o){if(r==-1)return!1;let l=t.state.doc.resolve(r);for(let a=l.depth+1;a>0;a--)if(t.someProp(e,u=>a>l.depth?u(t,n,l.nodeAfter,l.before(a),o,!0):u(t,n,l.node(a),l.before(a),o,!1)))return!0;return!1}function Ns(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function J6(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&de.isSelectable(r)?(Ns(t,new de(n)),!0):!1}function e8(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof de&&(r=n.node);let l=t.state.doc.resolve(e);for(let a=l.depth+1;a>0;a--){let u=a>l.depth?l.nodeAfter:l.node(a);if(de.isSelectable(u)){r&&n.$from.depth>0&&a>=n.$from.depth&&l.before(n.$from.depth+1)==n.$from.pos?o=l.before(n.$from.depth):o=l.before(a);break}}return o!=null?(Ns(t,de.create(t.state.doc,o)),!0):!1}function t8(t,e,n,r,o){return F1(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(o?e8(t,n):J6(t,n))}function n8(t,e,n,r){return F1(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function r8(t,e,n,r){return F1(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||i8(t,n,r)}function i8(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ns(t,ve.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let l=o.depth+1;l>0;l--){let a=l>o.depth?o.nodeAfter:o.node(l),u=o.before(l);if(a.inlineContent)Ns(t,ve.create(r,u+1,u+1+a.content.size));else if(de.isSelectable(a))Ns(t,de.create(r,u));else continue;return!0}}function q1(t){return Ku(t)}const c4=Nn?"metaKey":"ctrlKey";Ft.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=q1(t),o=Date.now(),l="singleClick";o-t.input.lastClick.time<500&&W6(n,t.input.lastClick)&&!n[c4]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?l="doubleClick":t.input.lastClick.type=="doubleClick"&&(l="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:l,button:n.button};let a=t.posAtCoords($f(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new o8(t,a,n,!!r)):(l=="doubleClick"?n8:r8)(t,a.pos,a.inside,n)?n.preventDefault():Ti(t,"pointer"))};class o8{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[c4],this.allowDefault=r.shiftKey;let l,a;if(n.inside>-1)l=e.state.doc.nodeAt(n.inside),a=n.inside;else{let p=e.state.doc.resolve(n.pos);l=p.parent,a=p.depth?p.before():0}const u=o?null:r.target,f=u?e.docView.nearestDesc(u,!0):null;this.target=f&&f.nodeDOM.nodeType==1?f.nodeDOM:null;let{selection:h}=e.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||h instanceof de&&h.from<=a&&h.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ln&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ti(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>zr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords($f(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ti(this.view,"pointer"):t8(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||$t&&this.mightDrag&&!this.mightDrag.node.isAtom||_t&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ns(this.view,Ee.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ti(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ti(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ft.touchstart=t=>{t.input.lastTouch=Date.now(),q1(t),Ti(t,"pointer")};Ft.touchmove=t=>{t.input.lastTouch=Date.now(),Ti(t,"pointer")};Ft.contextmenu=t=>q1(t);function u4(t,e){return t.composing?!0:$t&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const s8=Nr?5e3:-1;qt.compositionstart=qt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ve&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ku(t,!0),t.markCursor=null;else if(Ku(t,!e.selection.empty),Ln&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,l=r.focusOffset;o&&o.nodeType==1&&l!=0;){let a=l<0?o.lastChild:o.childNodes[l-1];if(!a)break;if(a.nodeType==3){let u=t.domSelection();u&&u.collapse(a,a.nodeValue.length);break}else o=a,l=-1}}t.input.composing=!0}f4(t,s8)};qt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,f4(t,20))};function f4(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ku(t),e))}function d4(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=a8());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function l8(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=JT(e.focusNode,e.focusOffset),r=e6(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,l=t.domObserver.lastChangedTextNode;if(n==l||r==l)return l;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function a8(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ku(t,e=!1){if(!(Nr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),d4(t),e||t.docView&&t.docView.dirty){let n=U1(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function c8(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ma=tn&&Ri<15||Hs&&o6<604;Ft.copy=qt.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let l=ma?null:n.clipboardData,a=r.content(),{dom:u,text:f}=P1(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",u.innerHTML),l.setData("text/plain",f)):c8(t,u),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function u8(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function f8(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ga(t,r.value,null,o,e):ga(t,r.textContent,r.innerHTML,o,e)},50)}function ga(t,e,n,r,o){let l=r4(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",f=>f(t,o,l||le.empty)))return!0;if(!l)return!1;let a=u8(l),u=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(l);return t.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function h4(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}qt.paste=(t,e)=>{let n=e;if(t.composing&&!Nr)return;let r=ma?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ga(t,h4(r),r.getData("text/html"),o,n)?n.preventDefault():f8(t,n)};class p4{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const d8=Nn?"altKey":"ctrlKey";function m4(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[d8]}Ft.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,l=o.empty?null:t.posAtCoords($f(n)),a;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof de?o.to-1:o.to))){if(r&&r.mightDrag)a=de.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let m=t.docView.nearestDesc(n.target,!0);m&&m.node.type.spec.draggable&&m!=t.docView&&(a=de.create(t.state.doc,m.posBefore))}}let u=(a||t.state.selection).content(),{dom:f,text:h,slice:p}=P1(t,u);(!n.dataTransfer.files.length||!_t||VS>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ma?"Text":"text/html",f.innerHTML),n.dataTransfer.effectAllowed="copyMove",ma||n.dataTransfer.setData("text/plain",h),t.dragging=new p4(p,m4(t,n),a)};Ft.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};qt.dragover=qt.dragenter=(t,e)=>e.preventDefault();qt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords($f(n));if(!o)return;let l=t.state.doc.resolve(o.pos),a=r&&r.slice;a?t.someProp("transformPasted",C=>{a=C(a,t,!1)}):a=r4(t,h4(n.dataTransfer),ma?null:n.dataTransfer.getData("text/html"),!1,l);let u=!!(r&&m4(t,n));if(t.someProp("handleDrop",C=>C(t,n,a||le.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let f=a?CS(t.state.doc,l.pos,a):l.pos;f==null&&(f=l.pos);let h=t.state.tr;if(u){let{node:C}=r;C?C.replace(h):h.deleteSelection()}let p=h.mapping.map(f),m=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,b=h.doc;if(m?h.replaceRangeWith(p,p,a.content.firstChild):h.replaceRange(p,p,a),h.doc.eq(b))return;let v=h.doc.resolve(p);if(m&&de.isSelectable(a.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new de(v));else{let C=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((x,M,T,k)=>C=k),h.setSelection(V1(t,v,h.doc.resolve(C)))}t.focus(),t.dispatch(h.setMeta("uiEvent","drop"))};Ft.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&zr(t)},20))};Ft.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Ft.beforeinput=(t,e)=>{if(_t&&Nr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",l=>l(t,co(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in qt)Ft[t]=qt[t];function ya(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Gu{constructor(e,n){this.toDOM=e,this.spec=n||bo,this.side=this.spec.side||0}map(e,n,r,o){let{pos:l,deleted:a}=e.mapResult(n.from+o,this.side<0?-1:1);return a?null:new Pt(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Gu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ya(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ni{constructor(e,n){this.attrs=e,this.spec=n||bo}map(e,n,r,o){let l=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return l>=a?null:new Pt(l,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Ni&&ya(this.attrs,e.attrs)&&ya(this.spec,e.spec)}static is(e){return e.type instanceof Ni}destroy(){}}class K1{constructor(e,n){this.attrs=e,this.spec=n||bo}map(e,n,r,o){let l=e.mapResult(n.from+o,1);if(l.deleted)return null;let a=e.mapResult(n.to+o,-1);return a.deleted||a.pos<=l.pos?null:new Pt(l.pos-r,a.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),l;return o==n.from&&!(l=e.child(r)).isText&&o+l.nodeSize==n.to}eq(e){return this==e||e instanceof K1&&ya(this.attrs,e.attrs)&&ya(this.spec,e.spec)}destroy(){}}class Pt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Pt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Pt(e,e,new Gu(n,r))}static inline(e,n,r,o){return new Pt(e,n,new Ni(r,o))}static node(e,n,r,o){return new Pt(e,n,new K1(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ni}get widget(){return this.type instanceof Gu}}const Ms=[],bo={};class et{constructor(e,n){this.local=e.length?e:Ms,this.children=n.length?n:Ms}static create(e,n){return n.length?Yu(n,e,0,bo):jt}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,l){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=e&&(!l||l(u.spec))&&r.push(u.copy(u.from+o,u.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let u=this.children[a]+1;this.children[a+2].findInner(e-u,n-u,r,o+u,l)}}map(e,n,r){return this==jt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||bo)}mapInner(e,n,r,o,l){let a;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,o);f&&f.type.valid(n,f)?(a||(a=[])).push(f):l.onRemove&&l.onRemove(this.local[u].spec)}return this.children.length?h8(this.children,a||[],e,n,r,o,l):a?new et(a.sort(Co),Ms):jt}add(e,n){return n.length?this==jt?et.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,l=0;e.forEach((u,f)=>{let h=f+r,p;if(p=y4(n,u,h)){for(o||(o=this.children.slice());l<o.length&&o[l]<f;)l+=3;o[l]==f?o[l+2]=o[l+2].addInner(u,p,h+1):o.splice(l,0,f,f+u.nodeSize,Yu(p,u,h+1,bo)),l+=3}});let a=g4(l?v4(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new et(a.length?this.local.concat(a).sort(Co):this.local,o||this.children)}remove(e){return e.length==0||this==jt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let l=0;l<r.length;l+=3){let a,u=r[l]+n,f=r[l+1]+n;for(let p=0,m;p<e.length;p++)(m=e[p])&&m.from>u&&m.to<f&&(e[p]=null,(a||(a=[])).push(m));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[l+2].removeInner(a,u+1);h!=jt?r[l+2]=h:(r.splice(l,3),l-=3)}if(o.length){for(let l=0,a;l<e.length;l++)if(a=e[l])for(let u=0;u<o.length;u++)o[u].eq(a,n)&&(o==this.local&&(o=this.local.slice()),o.splice(u--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new et(o,r):jt}forChild(e,n){if(this==jt)return this;if(n.isLeaf)return et.empty;let r,o;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let l=e+1,a=l+n.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<a&&f.to>l&&f.type instanceof Ni){let h=Math.max(l,f.from)-l,p=Math.min(a,f.to)-l;h<p&&(o||(o=[])).push(f.copy(h,p))}}if(o){let u=new et(o.sort(Co),Ms);return r?new Si([u,r]):u}return r||jt}eq(e){if(this==e)return!0;if(!(e instanceof et)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return G1(this.localsInner(e))}localsInner(e){if(this==jt)return Ms;if(e.inlineContent||!this.local.some(Ni.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ni||n.push(this.local[r]);return n}forEachSet(e){e(this)}}et.empty=new et([],[]);et.removeOverlap=G1;const jt=et.empty;class Si{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,bo));return Si.from(r)}forChild(e,n){if(n.isLeaf)return et.empty;let r=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(e,n);l!=jt&&(l instanceof Si?r=r.concat(l.members):r.push(l))}return Si.from(r)}eq(e){if(!(e instanceof Si)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let l=this.members[o].localsInner(e);if(l.length)if(!n)n=l;else{r&&(n=n.slice(),r=!1);for(let a=0;a<l.length;a++)n.push(l[a])}}return n?G1(r?n:n.sort(Co)):Ms}static from(e){switch(e.length){case 0:return jt;case 1:return e[0];default:return new Si(e.every(n=>n instanceof et)?e:e.reduce((n,r)=>n.concat(r instanceof et?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function h8(t,e,n,r,o,l,a){let u=t.slice();for(let h=0,p=l;h<n.maps.length;h++){let m=0;n.maps[h].forEach((b,v,C,x)=>{let M=x-C-(v-b);for(let T=0;T<u.length;T+=3){let k=u[T+1];if(k<0||b>k+p-m)continue;let R=u[T]+p-m;v>=R?u[T+1]=b<=R?-2:-1:b>=p&&M&&(u[T]+=M,u[T+1]+=M)}m+=M}),p=n.maps[h].map(p,-1)}let f=!1;for(let h=0;h<u.length;h+=3)if(u[h+1]<0){if(u[h+1]==-2){f=!0,u[h+1]=-1;continue}let p=n.map(t[h]+l),m=p-o;if(m<0||m>=r.content.size){f=!0;continue}let b=n.map(t[h+1]+l,-1),v=b-o,{index:C,offset:x}=r.content.findIndex(m),M=r.maybeChild(C);if(M&&x==m&&x+M.nodeSize==v){let T=u[h+2].mapInner(n,M,p+1,t[h]+l+1,a);T!=jt?(u[h]=m,u[h+1]=v,u[h+2]=T):(u[h+1]=-2,f=!0)}else f=!0}if(f){let h=p8(u,t,e,n,o,l,a),p=Yu(h,r,0,a);e=p.local;for(let m=0;m<u.length;m+=3)u[m+1]<0&&(u.splice(m,3),m-=3);for(let m=0,b=0;m<p.children.length;m+=3){let v=p.children[m];for(;b<u.length&&u[b]<v;)b+=3;u.splice(b,0,p.children[m],p.children[m+1],p.children[m+2])}}return new et(e.sort(Co),u)}function g4(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Pt(o.from+e,o.to+e,o.type))}return n}function p8(t,e,n,r,o,l,a){function u(f,h){for(let p=0;p<f.local.length;p++){let m=f.local[p].map(r,o,h);m?n.push(m):a.onRemove&&a.onRemove(f.local[p].spec)}for(let p=0;p<f.children.length;p+=3)u(f.children[p+2],f.children[p]+h+1)}for(let f=0;f<t.length;f+=3)t[f+1]==-1&&u(t[f+2],e[f]+l+1);return n}function y4(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let l=0,a;l<t.length;l++)(a=t[l])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),t[l]=null);return o}function v4(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Yu(t,e,n,r){let o=[],l=!1;e.forEach((u,f)=>{let h=y4(t,u,f+n);if(h){l=!0;let p=Yu(h,u,n+f+1,r);p!=jt&&o.push(f,f+u.nodeSize,p)}});let a=g4(l?v4(t):t,-n).sort(Co);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||o.length?new et(a,o):jt}function Co(t,e){return t.from-e.from||t.to-e.to}function G1(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let l=e[o];if(l.from==r.from){l.to!=r.to&&(e==t&&(e=t.slice()),e[o]=l.copy(l.from,r.to),hC(e,o+1,l.copy(r.to,l.to)));continue}else{l.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,l.from),hC(e,o,r.copy(l.from,r.to)));break}}}return e}function hC(t,e,n){for(;e<t.length&&Co(n,t[e])>0;)e++;t.splice(e,0,n)}function Xp(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=jt&&e.push(r)}),t.cursorWrapper&&e.push(et.create(t.state.doc,[t.cursorWrapper.deco])),Si.from(e)}const m8={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},g8=tn&&Ri<=11;class y8{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class v8{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new y8,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);tn&&Ri<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),g8&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,m8)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(oC(this.view)){if(this.suppressingSelectionUpdates)return zr(this.view);if(tn&&Ri<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Eo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let l=e.focusNode;l;l=Is(l))n.add(l);for(let l=e.anchorNode;l;l=Is(l))if(n.has(l)){r=l;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&oC(e)&&!this.ignoreSelectionChange(r),l=-1,a=-1,u=!1,f=[];if(e.editable)for(let p=0;p<n.length;p++){let m=this.registerMutation(n[p],f);m&&(l=l<0?m.from:Math.min(m.from,l),a=a<0?m.to:Math.max(m.to,a),m.typeOver&&(u=!0))}if(Ln&&f.length){let p=f.filter(m=>m.nodeName=="BR");if(p.length==2){let[m,b]=p;m.parentNode&&m.parentNode.parentNode==b.parentNode?b.remove():m.remove()}else{let{focusNode:m}=this.currentSelection;for(let b of p){let v=b.parentNode;v&&v.nodeName=="LI"&&(!m||x8(e,m)!=v)&&b.remove()}}}let h=null;l<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Vf(r)&&(h=U1(e))&&h.eq(Ee.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zr(e),this.currentSelection.set(r),e.scrollToSelection()):(l>-1||o)&&(l>-1&&(e.docView.markDirty(l,a),b8(e)),this.handleDOMChange(l,a,u,f),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||zr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let p=0;p<e.addedNodes.length;p++){let m=e.addedNodes[p];n.push(m),m.nodeType==3&&(this.lastChangedTextNode=m)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,l=e.nextSibling;if(tn&&Ri<=11&&e.addedNodes.length)for(let p=0;p<e.addedNodes.length;p++){let{previousSibling:m,nextSibling:b}=e.addedNodes[p];(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(o=m),(!b||Array.prototype.indexOf.call(e.addedNodes,b)<0)&&(l=b)}let a=o&&o.parentNode==e.target?Ot(o)+1:0,u=r.localPosFromDOM(e.target,a,-1),f=l&&l.parentNode==e.target?Ot(l):e.target.childNodes.length,h=r.localPosFromDOM(e.target,f,1);return{from:u,to:h}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let pC=new WeakMap,mC=!1;function b8(t){if(!pC.has(t)&&(pC.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ln,mC)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),mC=!0}}function gC(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,l=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Eo(a.node,a.offset,o,l)&&([n,r,o,l]=[o,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:l}}function C8(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return gC(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?gC(t,n):null}function x8(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function S8(t,e,n){let{node:r,fromOffset:o,toOffset:l,from:a,to:u}=t.docView.parseRange(e,n),f=t.domSelectionRange(),h,p=f.anchorNode;if(p&&t.dom.contains(p.nodeType==1?p:p.parentNode)&&(h=[{node:p,offset:f.anchorOffset}],Vf(f)||h.push({node:f.focusNode,offset:f.focusOffset})),_t&&t.input.lastKeyCode===8)for(let M=l;M>o;M--){let T=r.childNodes[M-1],k=T.pmViewDesc;if(T.nodeName=="BR"&&!k){l=M;break}if(!k||k.size)break}let m=t.state.doc,b=t.someProp("domParser")||ki.fromSchema(t.state.schema),v=m.resolve(a),C=null,x=b.parse(r,{topNode:v.parent,topMatch:v.parent.contentMatchAt(v.index()),topOpen:!0,from:o,to:l,preserveWhitespace:v.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:w8,context:v});if(h&&h[0].pos!=null){let M=h[0].pos,T=h[1]&&h[1].pos;T==null&&(T=M),C={anchor:M+a,head:T+a}}return{doc:x,sel:C,from:a,to:u}}function w8(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if($t&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||$t&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const E8=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function M8(t,e,n,r,o){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let L=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,B=U1(t,L);if(B&&!t.state.selection.eq(B)){if(_t&&Nr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",ne=>ne(t,co(13,"Enter"))))return;let Q=t.state.tr.setSelection(B);L=="pointer"?Q.setMeta("pointer",!0):L=="key"&&Q.scrollIntoView(),l&&Q.setMeta("composition",l),t.dispatch(Q)}return}let a=t.state.doc.resolve(e),u=a.sharedDepth(n);e=a.before(u+1),n=t.state.doc.resolve(n).after(u+1);let f=t.state.selection,h=S8(t,e,n),p=t.state.doc,m=p.slice(h.from,h.to),b,v;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(b=t.state.selection.to,v="end"):(b=t.state.selection.from,v="start"),t.input.lastKeyCode=null;let C=k8(m.content,h.doc.content,h.from,b,v);if(C&&t.input.domChangeCount++,(Hs&&t.input.lastIOSEnter>Date.now()-225||Nr)&&o.some(L=>L.nodeType==1&&!E8.test(L.nodeName))&&(!C||C.endA>=C.endB)&&t.someProp("handleKeyDown",L=>L(t,co(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!C)if(r&&f instanceof ve&&!f.empty&&f.$head.sameParent(f.$anchor)&&!t.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))C={start:f.from,endA:f.to,endB:f.to};else{if(h.sel){let L=yC(t,t.state.doc,h.sel);if(L&&!L.eq(t.state.selection)){let B=t.state.tr.setSelection(L);l&&B.setMeta("composition",l),t.dispatch(B)}}return}t.state.selection.from<t.state.selection.to&&C.start==C.endB&&t.state.selection instanceof ve&&(C.start>t.state.selection.from&&C.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?C.start=t.state.selection.from:C.endA<t.state.selection.to&&C.endA>=t.state.selection.to-2&&t.state.selection.to<=h.to&&(C.endB+=t.state.selection.to-C.endA,C.endA=t.state.selection.to)),tn&&Ri<=11&&C.endB==C.start+1&&C.endA==C.start&&C.start>h.from&&h.doc.textBetween(C.start-h.from-1,C.start-h.from+1)=="  "&&(C.start--,C.endA--,C.endB--);let x=h.doc.resolveNoCache(C.start-h.from),M=h.doc.resolveNoCache(C.endB-h.from),T=p.resolve(C.start),k=x.sameParent(M)&&x.parent.inlineContent&&T.end()>=C.endA;if((Hs&&t.input.lastIOSEnter>Date.now()-225&&(!k||o.some(L=>L.nodeName=="DIV"||L.nodeName=="P"))||!k&&x.pos<h.doc.content.size&&(!x.sameParent(M)||!x.parent.inlineContent)&&x.pos<M.pos&&!/\S/.test(h.doc.textBetween(x.pos,M.pos,"","")))&&t.someProp("handleKeyDown",L=>L(t,co(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>C.start&&A8(p,C.start,C.endA,x,M)&&t.someProp("handleKeyDown",L=>L(t,co(8,"Backspace")))){Nr&&_t&&t.domObserver.suppressSelectionUpdates();return}_t&&C.endB==C.start&&(t.input.lastChromeDelete=Date.now()),Nr&&!k&&x.start()!=M.start()&&M.parentOffset==0&&x.depth==M.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==C.endA&&(C.endB-=2,M=h.doc.resolveNoCache(C.endB-h.from),setTimeout(()=>{t.someProp("handleKeyDown",function(L){return L(t,co(13,"Enter"))})},20));let R=C.start,D=C.endA,_=L=>{let B=L||t.state.tr.replace(R,D,h.doc.slice(C.start-h.from,C.endB-h.from));if(h.sel){let Q=yC(t,B.doc,h.sel);Q&&!(_t&&t.composing&&Q.empty&&(C.start!=C.endB||t.input.lastChromeDelete<Date.now()-100)&&(Q.head==R||Q.head==B.mapping.map(D)-1)||tn&&Q.empty&&Q.head==R)&&B.setSelection(Q)}return l&&B.setMeta("composition",l),B.scrollIntoView()},j;if(k)if(x.pos==M.pos){tn&&Ri<=11&&x.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>zr(t),20));let L=_(t.state.tr.delete(R,D)),B=p.resolve(C.start).marksAcross(p.resolve(C.endA));B&&L.ensureMarks(B),t.dispatch(L)}else if(C.endA==C.endB&&(j=T8(x.parent.content.cut(x.parentOffset,M.parentOffset),T.parent.content.cut(T.parentOffset,C.endA-T.start())))){let L=_(t.state.tr);j.type=="add"?L.addMark(R,D,j.mark):L.removeMark(R,D,j.mark),t.dispatch(L)}else if(x.parent.child(x.index()).isText&&x.index()==M.index()-(M.textOffset?0:1)){let L=x.parent.textBetween(x.parentOffset,M.parentOffset),B=()=>_(t.state.tr.insertText(L,R,D));t.someProp("handleTextInput",Q=>Q(t,R,D,L,B))||t.dispatch(B())}else t.dispatch(_());else t.dispatch(_())}function yC(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:V1(t,e.resolve(n.anchor),e.resolve(n.head))}function T8(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,l=r,a,u,f;for(let p=0;p<r.length;p++)o=r[p].removeFromSet(o);for(let p=0;p<n.length;p++)l=n[p].removeFromSet(l);if(o.length==1&&l.length==0)u=o[0],a="add",f=p=>p.mark(u.addToSet(p.marks));else if(o.length==0&&l.length==1)u=l[0],a="remove",f=p=>p.mark(u.removeFromSet(p.marks));else return null;let h=[];for(let p=0;p<e.childCount;p++)h.push(f(e.child(p)));if(ee.from(h).eq(t))return{mark:u,type:a}}function A8(t,e,n,r,o){if(n-e<=o.pos-r.pos||Qp(r,!0,!1)<o.pos)return!1;let l=t.resolve(e);if(!r.parent.isTextblock){let u=l.nodeAfter;return u!=null&&n==e+u.nodeSize}if(l.parentOffset<l.parent.content.size||!l.parent.isTextblock)return!1;let a=t.resolve(Qp(l,!0,!0));return!a.parent.isTextblock||a.pos>n||Qp(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Qp(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let l=t.node(r).maybeChild(t.indexAfter(r));for(;l&&!l.isLeaf;)l=l.firstChild,o++}return o}function k8(t,e,n,r,o){let l=t.findDiffStart(e,n);if(l==null)return null;let{a,b:u}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let f=Math.max(0,l-Math.min(a,u));r-=a+f-l}if(a<l&&t.size<e.size){let f=r<=l&&r>=a?l-r:0;l-=f,l&&l<e.size&&vC(e.textBetween(l-1,l+1))&&(l+=f?1:-1),u=l+(u-a),a=l}else if(u<l){let f=r<=l&&r>=u?l-r:0;l-=f,l&&l<t.size&&vC(t.textBetween(l-1,l+1))&&(l+=f?1:-1),a=l+(a-u),u=l}return{start:l,endA:a,endB:u}}function vC(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class b4{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new G6,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(wC),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=xC(this),CC(this),this.nodeViews=SC(this),this.docView=Jb(this.state.doc,bC(this),Xp(this),this.dom,this),this.domObserver=new v8(this,(r,o,l,a)=>M8(this,r,o,l,a)),this.domObserver.start(),Y6(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Xm(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(wC),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(d4(this),a=!0),this.state=e;let u=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(u||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let v=SC(this);O8(v,this.nodeViews)&&(this.nodeViews=v,l=!0)}(u||n.handleDOMEvents!=this._props.handleDOMEvents)&&Xm(this),this.editable=xC(this),CC(this);let f=Xp(this),h=bC(this),p=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",m=l||!this.docView.matchesNode(e.doc,h,f);(m||!e.selection.eq(o.selection))&&(a=!0);let b=p=="preserve"&&a&&this.dom.style.overflowAnchor==null&&a6(this);if(a){this.domObserver.stop();let v=m&&(tn||_t)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&R8(o.selection,e.selection);if(m){let C=_t?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=l8(this)),(l||!this.docView.update(e.doc,h,f,this))&&(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=Jb(e.doc,h,f,this.dom,this)),C&&!this.trackWrites&&(v=!0)}v||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&D6(this))?zr(this,v):(e4(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),p=="reset"?this.dom.scrollTop=0:p=="to selection"?this.scrollToSelection():b&&c6(b)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof de){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Gb(this,n.getBoundingClientRect(),e)}else Gb(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let l=r.from+(this.state.doc.content.size-n.doc.content.size);(l>0&&this.state.doc.nodeAt(l))==r.node&&(o=l)}this.dragging=new p4(e.slice,e.move,o<0?void 0:de.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let a=0;a<this.directPlugins.length;a++){let u=this.directPlugins[a].props[e];if(u!=null&&(o=n?n(u):u))return o}let l=this.state.plugins;if(l)for(let a=0;a<l.length;a++){let u=l[a].props[e];if(u!=null&&(o=n?n(u):u))return o}}hasFocus(){if(tn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&u6(this.dom),zr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return m6(this,e)}coordsAtPos(e,n=1){return KS(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return C6(this,n||this.state,e)}pasteHTML(e,n){return ga(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ga(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return P1(this,e)}destroy(){this.docView&&(Z6(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Xp(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,QT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Q6(this,e)}domSelectionRange(){let e=this.domSelection();return e?$t&&this.root.nodeType===11&&n6(this.dom.ownerDocument)==this.dom&&C8(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}b4.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function bC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Pt.node(0,t.state.doc.content.size,e)]}function CC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Pt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function xC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function R8(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function SC(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function O8(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function wC(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var zi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Zu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},N8=typeof navigator<"u"&&/Mac/.test(navigator.platform),D8=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Nt=0;Nt<10;Nt++)zi[48+Nt]=zi[96+Nt]=String(Nt);for(var Nt=1;Nt<=24;Nt++)zi[Nt+111]="F"+Nt;for(var Nt=65;Nt<=90;Nt++)zi[Nt]=String.fromCharCode(Nt+32),Zu[Nt]=String.fromCharCode(Nt);for(var Wp in zi)Zu.hasOwnProperty(Wp)||(Zu[Wp]=zi[Wp]);function L8(t){var e=N8&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||D8&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Zu:zi)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const z8=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),j8=typeof navigator<"u"&&/Win/.test(navigator.platform);function _8(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,l,a;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))o=!0;else if(/^s(hift)?$/i.test(f))l=!0;else if(/^mod$/i.test(f))z8?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),a&&(n="Meta-"+n),l&&(n="Shift-"+n),n}function I8(t){let e=Object.create(null);for(let n in t)e[_8(n)]=t[n];return e}function Jp(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function H8(t){return new Je({props:{handleKeyDown:C4(t)}})}function C4(t){let e=I8(t);return function(n,r){let o=L8(r),l,a=e[Jp(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let u=e[Jp(o,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(j8&&r.ctrlKey&&r.altKey)&&(l=zi[r.keyCode])&&l!=o){let u=e[Jp(l,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}var B8=Object.defineProperty,Y1=(t,e)=>{for(var n in e)B8(t,n,{get:e[n],enumerable:!0})};function Ff(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:l}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return l},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,l=n.storedMarks,n}}}var qf=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,l=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...h)=>{const p=u(...h)(l);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:l}=r,a=[],u=!!t,f=t||o.tr,h=()=>(!u&&e&&!f.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(f),a.every(m=>m===!0)),p={...Object.fromEntries(Object.entries(n).map(([m,b])=>[m,(...C)=>{const x=this.buildProps(f,e),M=b(...C)(x);return a.push(M),p}])),run:h};return p}createCan(t){const{rawCommands:e,state:n}=this,r=!1,o=t||n.tr,l=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...h)=>f(...h)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:l}=r,a={tr:t,editor:r,view:l,state:Ff({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([u,f])=>[u,(...h)=>f(...h)(a)]))}};return a}},x4={};Y1(x4,{blur:()=>U8,clearContent:()=>V8,clearNodes:()=>P8,command:()=>$8,createParagraphNear:()=>F8,cut:()=>q8,deleteCurrentNode:()=>K8,deleteNode:()=>G8,deleteRange:()=>Y8,deleteSelection:()=>Z8,enter:()=>X8,exitCode:()=>Q8,extendMarkRange:()=>W8,first:()=>J8,focus:()=>tA,forEach:()=>nA,insertContent:()=>rA,insertContentAt:()=>sA,joinBackward:()=>cA,joinDown:()=>aA,joinForward:()=>uA,joinItemBackward:()=>fA,joinItemForward:()=>dA,joinTextblockBackward:()=>hA,joinTextblockForward:()=>pA,joinUp:()=>lA,keyboardShortcut:()=>gA,lift:()=>yA,liftEmptyBlock:()=>vA,liftListItem:()=>bA,newlineInCode:()=>CA,resetAttributes:()=>xA,scrollIntoView:()=>SA,selectAll:()=>wA,selectNodeBackward:()=>EA,selectNodeForward:()=>MA,selectParentNode:()=>TA,selectTextblockEnd:()=>AA,selectTextblockStart:()=>kA,setContent:()=>RA,setMark:()=>XA,setMeta:()=>QA,setNode:()=>WA,setNodeSelection:()=>JA,setTextDirection:()=>ek,setTextSelection:()=>tk,sinkListItem:()=>nk,splitBlock:()=>rk,splitListItem:()=>ik,toggleList:()=>ok,toggleMark:()=>sk,toggleNode:()=>lk,toggleWrap:()=>ak,undoInputRule:()=>ck,unsetAllMarks:()=>uk,unsetMark:()=>fk,unsetTextDirection:()=>dk,updateAttributes:()=>hk,wrapIn:()=>pk,wrapInList:()=>mk});var U8=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),V8=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),P8=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:l,$to:a})=>{t.doc.nodesBetween(l.pos,a.pos,(u,f)=>{if(u.type.isText)return;const{doc:h,mapping:p}=e,m=h.resolve(p.map(f)),b=h.resolve(p.map(f+u.nodeSize)),v=m.blockRange(b);if(!v)return;const C=$s(v);if(u.type.isTextblock){const{defaultType:x}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(v.start,x)}(C||C===0)&&e.lift(v,C)})}),!0},$8=t=>e=>t(e),F8=()=>({state:t,dispatch:e})=>_S(t,e),q8=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,l=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(e);return r.insert(a,l.content),r.setSelection(new ve(r.doc.resolve(Math.max(a-1,0)))),!0},K8=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===r.type){if(e){const u=o.before(l),f=o.after(l);t.delete(u,f).scrollIntoView()}return!0}return!1};function ht(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var G8=t=>({tr:e,state:n,dispatch:r})=>{const o=ht(t,n.schema),l=e.selection.$anchor;for(let a=l.depth;a>0;a-=1)if(l.node(a).type===o){if(r){const f=l.before(a),h=l.after(a);e.delete(f,h).scrollIntoView()}return!0}return!1},Y8=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},Z8=()=>({state:t,dispatch:e})=>z1(t,e),X8=()=>({commands:t})=>t.keyboardShortcut("Enter"),Q8=()=>({state:t,dispatch:e})=>_T(t,e);function Z1(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Xu(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Z1(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function S4(t,e,n={}){return t.find(r=>r.type===e&&Xu(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function EC(t,e,n={}){return!!S4(t,e,n)}function X1(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(p=>p.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(p=>p.type===e)||(n=n||((r=o.node.marks[0])==null?void 0:r.attrs),!S4([...o.node.marks],e,n)))return;let a=o.index,u=t.start()+o.offset,f=a+1,h=u+o.node.nodeSize;for(;a>0&&EC([...t.parent.child(a-1).marks],e,n);)a-=1,u-=t.parent.child(a).nodeSize;for(;f<t.parent.childCount&&EC([...t.parent.child(f).marks],e,n);)h+=t.parent.child(f).nodeSize,f+=1;return{from:u,to:h}}function Ur(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var W8=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const l=Ur(t,r.schema),{doc:a,selection:u}=n,{$from:f,from:h,to:p}=u;if(o){const m=X1(f,l,e);if(m&&m.from<=h&&m.to>=p){const b=ve.create(a,m.from,m.to);n.setSelection(b)}}return!0},J8=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function w4(t){return t instanceof ve}function mo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function E4(t,e=null){if(!e)return null;const n=Ee.atStart(t),r=Ee.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,l=r.to;return e==="all"?ve.create(t,mo(0,o,l),mo(t.content.size,o,l)):ve.create(t,mo(e,o,l),mo(e,o,l))}function Qm(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function va(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function eA(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var tA=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:l})=>{e={scrollIntoView:!0,...e};const a=()=>{(va()||Qm())&&r.dom.focus(),eA()&&!va()&&!Qm()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(l&&t===null&&!w4(n.state.selection))return a(),!0;const u=E4(o.doc,t)||n.state.selection,f=n.state.selection.eq(u);return l&&(f||o.setSelection(u),f&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},nA=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),rA=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),M4=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&M4(r)}return t};function du(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return M4(n)}function ba(t,e,n){if(t instanceof Ai||t instanceof ee)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return ee.fromArray(t.map(u=>e.nodeFromJSON(u)));const a=e.nodeFromJSON(t);return n.errorOnInvalidContent&&a.check(),a}catch(l){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:l});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",l),ba("",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,u="";const f=new cS({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,u=typeof h=="string"?h:h.outerHTML,null)}]}})});if(n.slice?ki.fromSchema(f).parseSlice(du(t),n.parseOptions):ki.fromSchema(f).parse(du(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const l=ki.fromSchema(e);return n.slice?l.parseSlice(du(t),n.parseOptions).content:l.parse(du(t),n.parseOptions)}return ba("",e,n)}function iA(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof vt||o instanceof bt))return;const l=t.mapping.maps[r];let a=0;l.forEach((u,f,h,p)=>{a===0&&(a=p)}),t.setSelection(Ee.near(t.doc.resolve(a),n))}var oA=t=>!("type"in t),sA=(t,e,n)=>({tr:r,dispatch:o,editor:l})=>{var a;if(o){n={parseOptions:l.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let u;const f=M=>{l.emit("contentError",{editor:l,error:M,disableCollaboration:()=>{"collaboration"in l.storage&&typeof l.storage.collaboration=="object"&&l.storage.collaboration&&(l.storage.collaboration.isDisabled=!0)}})},h={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!l.options.enableContentCheck&&l.options.emitContentError)try{ba(e,l.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(M){f(M)}try{u=ba(e,l.schema,{parseOptions:h,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:l.options.enableContentCheck})}catch(M){return f(M),!1}let{from:p,to:m}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},b=!0,v=!0;if((oA(u)?u:[u]).forEach(M=>{M.check(),b=b?M.isText&&M.marks.length===0:!1,v=v?M.isBlock:!1}),p===m&&v){const{parent:M}=r.doc.resolve(p);M.isTextblock&&!M.type.spec.code&&!M.childCount&&(p-=1,m+=1)}let x;if(b){if(Array.isArray(e))x=e.map(M=>M.text||"").join("");else if(e instanceof ee){let M="";e.forEach(T=>{T.text&&(M+=T.text)}),x=M}else typeof e=="object"&&e&&e.text?x=e.text:x=e;r.insertText(x,p,m)}else{x=u;const M=r.doc.resolve(p),T=M.node(),k=M.parentOffset===0,R=T.isText||T.isTextblock,D=T.content.size>0;k&&R&&D&&(p=Math.max(0,p-1)),r.replaceWith(p,m,x)}n.updateSelection&&iA(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:p,text:x}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:p,text:x})}return!0},lA=()=>({state:t,dispatch:e})=>LT(t,e),aA=()=>({state:t,dispatch:e})=>zT(t,e),cA=()=>({state:t,dispatch:e})=>RS(t,e),uA=()=>({state:t,dispatch:e})=>LS(t,e),fA=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Hf(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},dA=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Hf(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},hA=()=>({state:t,dispatch:e})=>NT(t,e),pA=()=>({state:t,dispatch:e})=>DT(t,e);function T4(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function mA(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,l,a;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))o=!0;else if(/^s(hift)?$/i.test(f))l=!0;else if(/^mod$/i.test(f))va()||T4()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),l&&(n=`Shift-${n}`),n}var gA=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const l=mA(t).split(/-(?!$)/),a=l.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:l.includes("Alt"),ctrlKey:l.includes("Ctrl"),metaKey:l.includes("Meta"),shiftKey:l.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{n.someProp("handleKeyDown",h=>h(n,u))});return f?.steps.forEach(h=>{const p=h.map(r.mapping);p&&o&&r.maybeStep(p)}),!0};function ji(t,e,n={}){const{from:r,to:o,empty:l}=t.selection,a=e?ht(e,t.schema):null,u=[];t.doc.nodesBetween(r,o,(m,b)=>{if(m.isText)return;const v=Math.max(r,b),C=Math.min(o,b+m.nodeSize);u.push({node:m,from:v,to:C})});const f=o-r,h=u.filter(m=>a?a.name===m.node.type.name:!0).filter(m=>Xu(m.node.attrs,n,{strict:!1}));return l?!!h.length:h.reduce((m,b)=>m+b.to-b.from,0)>=f}var yA=(t,e={})=>({state:n,dispatch:r})=>{const o=ht(t,n.schema);return ji(n,o,e)?jT(n,r):!1},vA=()=>({state:t,dispatch:e})=>IS(t,e),bA=t=>({state:e,dispatch:n})=>{const r=ht(t,e.schema);return GT(r)(e,n)},CA=()=>({state:t,dispatch:e})=>jS(t,e);function Kf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function MC(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var xA=(t,e)=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const u=Kf(typeof t=="string"?t:t.name,r.schema);if(!u)return!1;u==="node"&&(l=ht(t,r.schema)),u==="mark"&&(a=Ur(t,r.schema));let f=!1;return n.selection.ranges.forEach(h=>{r.doc.nodesBetween(h.$from.pos,h.$to.pos,(p,m)=>{l&&l===p.type&&(f=!0,o&&n.setNodeMarkup(m,void 0,MC(p.attrs,e))),a&&p.marks.length&&p.marks.forEach(b=>{a===b.type&&(f=!0,o&&n.addMark(m,m+p.nodeSize,a.create(MC(b.attrs,e))))})})}),f},SA=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),wA=()=>({tr:t,dispatch:e})=>{if(e){const n=new gn(t.doc);t.setSelection(n)}return!0},EA=()=>({state:t,dispatch:e})=>NS(t,e),MA=()=>({state:t,dispatch:e})=>zS(t,e),TA=()=>({state:t,dispatch:e})=>BT(t,e),AA=()=>({state:t,dispatch:e})=>PT(t,e),kA=()=>({state:t,dispatch:e})=>VT(t,e);function Wm(t,e,n={},r={}){return ba(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var RA=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:l,dispatch:a,commands:u})=>{const{doc:f}=l;if(r.preserveWhitespace!=="full"){const h=Wm(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return a&&l.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!n),!0}return a&&l.setMeta("preventUpdate",!n),u.insertContentAt({from:0,to:f.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function A4(t,e){const n=Ur(e,t.schema),{from:r,to:o,empty:l}=t.selection,a=[];l?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,f=>{a.push(...f.marks)});const u=a.find(f=>f.type.name===n.name);return u?{...u.attrs}:{}}function Q1(t,e){const n=new MS(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function OA(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function NA(t,e){const n=[];return t.descendants((r,o)=>{e(r)&&n.push({node:r,pos:o})}),n}function k4(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,l)=>{n(o)&&r.push({node:o,pos:l})}),r}function DA(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Gf(t){return e=>DA(e.$from,t)}function ge(t,e,n){return t.config[e]===void 0&&t.parent?ge(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ge(t.parent,e,n):null}):t.config[e]}function W1(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ge(e,"addExtensions",n);return r?[e,...W1(r())]:e}).flat(10)}function J1(t,e){const n=ko.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function R4(t){return typeof t=="function"}function Be(t,e=void 0,...n){return R4(t)?e?t.bind(e)(...n):t(...n):t}function LA(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Bs(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function O4(t){const e=[],{nodeExtensions:n,markExtensions:r}=Bs(t),o=[...n,...r],l={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(h=>h.name!=="text").map(h=>h.name),u=r.map(h=>h.name),f=[...a,...u];return t.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage,extensions:o},m=ge(h,"addGlobalAttributes",p);if(!m)return;m().forEach(v=>{let C;Array.isArray(v.types)?C=v.types:v.types==="*"?C=f:v.types==="nodes"?C=a:v.types==="marks"?C=u:C=[],C.forEach(x=>{Object.entries(v.attributes).forEach(([M,T])=>{e.push({type:x,name:M,attribute:{...l,...T}})})})})}),o.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage},m=ge(h,"addAttributes",p);if(!m)return;const b=m();Object.entries(b).forEach(([v,C])=>{const x={...l,...C};typeof x?.default=="function"&&(x.default=x.default()),x?.isRequired&&x?.default===void 0&&delete x.default,e.push({type:h.name,name:v,attribute:x})})}),e}function zA(t){const e=[];let n="",r=!1,o=!1,l=0;const a=t.length;for(let u=0;u<a;u+=1){const f=t[u];if(f==="'"&&!o){r=!r,n+=f;continue}if(f==='"'&&!r){o=!o,n+=f;continue}if(!r&&!o){if(f==="("){l+=1,n+=f;continue}if(f===")"&&l>0){l-=1,n+=f;continue}if(f===";"&&l===0){e.push(n),n="";continue}}n+=f}return n&&e.push(n),e}function TC(t){const e=[],n=zA(t||""),r=n.length;for(let o=0;o<r;o+=1){const l=n[o],a=l.indexOf(":");if(a===-1)continue;const u=l.slice(0,a).trim(),f=l.slice(a+1).trim();u&&f&&e.push([u,f])}return e}function $e(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,l])=>{if(!r[o]){r[o]=l;return}if(o==="class"){const u=l?String(l).split(" "):[],f=r[o]?r[o].split(" "):[],h=u.filter(p=>!f.includes(p));r[o]=[...f,...h].join(" ")}else if(o==="style"){const u=new Map([...TC(r[o]),...TC(l)]);r[o]=Array.from(u.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[o]=l}),r},{})}function Ca(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>$e(n,r),{})}function jA(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function AC(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((l,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(n):jA(n.getAttribute(a.name));return u==null?l:{...l,[a.name]:u}},{});return{...r,...o}}}}function kC(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&LA(n)?!1:n!=null))}function RC(t){var e,n;const r={};return!((e=t?.attribute)!=null&&e.isRequired)&&"default"in(t?.attribute||{})&&(r.default=t.attribute.default),((n=t?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function _A(t,e){var n;const r=O4(t),{nodeExtensions:o,markExtensions:l}=Bs(t),a=(n=o.find(h=>ge(h,"topNode")))==null?void 0:n.name,u=Object.fromEntries(o.map(h=>{const p=r.filter(T=>T.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},b=t.reduce((T,k)=>{const R=ge(k,"extendNodeSchema",m);return{...T,...R?R(h):{}}},{}),v=kC({...b,content:Be(ge(h,"content",m)),marks:Be(ge(h,"marks",m)),group:Be(ge(h,"group",m)),inline:Be(ge(h,"inline",m)),atom:Be(ge(h,"atom",m)),selectable:Be(ge(h,"selectable",m)),draggable:Be(ge(h,"draggable",m)),code:Be(ge(h,"code",m)),whitespace:Be(ge(h,"whitespace",m)),linebreakReplacement:Be(ge(h,"linebreakReplacement",m)),defining:Be(ge(h,"defining",m)),isolating:Be(ge(h,"isolating",m)),attrs:Object.fromEntries(p.map(RC))}),C=Be(ge(h,"parseHTML",m));C&&(v.parseDOM=C.map(T=>AC(T,p)));const x=ge(h,"renderHTML",m);x&&(v.toDOM=T=>x({node:T,HTMLAttributes:Ca(T,p)}));const M=ge(h,"renderText",m);return M&&(v.toText=M),[h.name,v]})),f=Object.fromEntries(l.map(h=>{const p=r.filter(M=>M.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},b=t.reduce((M,T)=>{const k=ge(T,"extendMarkSchema",m);return{...M,...k?k(h):{}}},{}),v=kC({...b,inclusive:Be(ge(h,"inclusive",m)),excludes:Be(ge(h,"excludes",m)),group:Be(ge(h,"group",m)),spanning:Be(ge(h,"spanning",m)),code:Be(ge(h,"code",m)),attrs:Object.fromEntries(p.map(RC))}),C=Be(ge(h,"parseHTML",m));C&&(v.parseDOM=C.map(M=>AC(M,p)));const x=ge(h,"renderHTML",m);return x&&(v.toDOM=M=>x({mark:M,HTMLAttributes:Ca(M,p)})),[h.name,v]}));return new cS({topNode:a,nodes:u,marks:f})}function IA(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ia(t){return t.sort((n,r)=>{const o=ge(n,"priority")||100,l=ge(r,"priority")||100;return o>l?-1:o<l?1:0})}function N4(t){const e=ia(W1(t)),n=IA(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function D4(t,e,n){const{from:r,to:o}=e,{blockSeparator:l=`
67
+
68
+ `,textSerializers:a={}}=n||{};let u="";return t.nodesBetween(r,o,(f,h,p,m)=>{var b;f.isBlock&&h>r&&(u+=l);const v=a?.[f.type.name];if(v)return p&&(u+=v({node:f,pos:h,parent:p,index:m,range:e})),!1;f.isText&&(u+=(b=f?.text)==null?void 0:b.slice(Math.max(r,h)-h,o-h))}),u}function HA(t,e){const n={from:0,to:t.content.size};return D4(t,n,e)}function L4(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function BA(t,e){const n=ht(e,t.schema),{from:r,to:o}=t.selection,l=[];t.doc.nodesBetween(r,o,u=>{l.push(u)});const a=l.reverse().find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function z4(t,e){const n=Kf(typeof e=="string"?e:e.name,t.schema);return n==="node"?BA(t,e):n==="mark"?A4(t,e):{}}function UA(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function VA(t){const e=UA(t);return e.length===1?e:e.filter((n,r)=>!e.filter((l,a)=>a!==r).some(l=>n.oldRange.from>=l.oldRange.from&&n.oldRange.to<=l.oldRange.to&&n.newRange.from>=l.newRange.from&&n.newRange.to<=l.newRange.to))}function eg(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,l)=>{const a=[];if(o.ranges.length)o.forEach((u,f)=>{a.push({from:u,to:f})});else{const{from:u,to:f}=n[l];if(u===void 0||f===void 0)return;a.push({from:u,to:f})}a.forEach(({from:u,to:f})=>{const h=e.slice(l).map(u,-1),p=e.slice(l).map(f),m=e.invert().map(h,-1),b=e.invert().map(p);r.push({oldRange:{from:m,to:b},newRange:{from:h,to:p}})})}),VA(r)}function tg(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const l=n.resolve(t),a=X1(l,o.type);a&&r.push({mark:o,...a})}):n.nodesBetween(t,e,(o,l)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(a=>({from:l,to:l+o.nodeSize,mark:a})))}),r}var PA=(t,e,n,r=20)=>{const o=t.doc.resolve(n);let l=r,a=null;for(;l>0&&a===null;){const u=o.node(l);u?.type.name===e?a=u:l-=1}return[a,l]};function ql(t,e){return e.nodes[t]||e.marks[t]||null}function Nu(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(l=>l.type===e&&l.name===r);return o?o.attribute.keepOnSplit:!1}))}var $A=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,l,a,u)=>{var f,h;const p=((h=(f=o.type.spec).toText)==null?void 0:h.call(f,{node:o,pos:l,parent:a,index:u}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?p:p.slice(0,Math.max(0,r-l))}),n};function Jm(t,e,n={}){const{empty:r,ranges:o}=t.selection,l=e?Ur(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(m=>l?l.name===m.type.name:!0).find(m=>Xu(m.attrs,n,{strict:!1}));let a=0;const u=[];if(o.forEach(({$from:m,$to:b})=>{const v=m.pos,C=b.pos;t.doc.nodesBetween(v,C,(x,M)=>{if(l&&x.inlineContent&&!x.type.allowsMarkType(l))return!1;if(!x.isText&&!x.marks.length)return;const T=Math.max(v,M),k=Math.min(C,M+x.nodeSize),R=k-T;a+=R,u.push(...x.marks.map(D=>({mark:D,from:T,to:k})))})}),a===0)return!1;const f=u.filter(m=>l?l.name===m.mark.type.name:!0).filter(m=>Xu(m.mark.attrs,n,{strict:!1})).reduce((m,b)=>m+b.to-b.from,0),h=u.filter(m=>l?m.mark.type!==l&&m.mark.type.excludes(l):!0).reduce((m,b)=>m+b.to-b.from,0);return(f>0?f+h:f)>=a}function FA(t,e,n={}){if(!e)return ji(t,null,n)||Jm(t,null,n);const r=Kf(e,t.schema);return r==="node"?ji(t,e,n):r==="mark"?Jm(t,e,n):!1}var qA=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const l=Gf(u=>u.type.name===e)(t.selection);if(!l)return!1;const a=t.doc.resolve(l.pos+1);return o.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},KA=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function OC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function NC(t,e){const{nodeExtensions:n}=Bs(e),r=n.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},l=Be(ge(r,"group",o));return typeof l!="string"?!1:l.split(" ").includes("list")}function Yf(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(l=>{o!==!1&&(Yf(l,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function j4(t){return t instanceof de}var _4=class I4{constructor(e){this.position=e}static fromJSON(e){return new I4(e.position)}toJSON(){return{position:this.position}}};function GA(t,e){const n=e.mapping.mapResult(t.position);return{position:new _4(n.pos),mapResult:n}}function YA(t){return new _4(t)}function ZA(t,e,n){var r;const{selection:o}=e;let l=null;if(w4(o)&&(l=o.$cursor),l){const u=(r=t.storedMarks)!=null?r:l.marks();return l.parent.type.allowsMarkType(n)&&(!!n.isInSet(u)||!u.some(h=>h.type.excludes(n)))}const{ranges:a}=o;return a.some(({$from:u,$to:f})=>{let h=u.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(u.pos,f.pos,(p,m,b)=>{if(h)return!1;if(p.isInline){const v=!b||b.type.allowsMarkType(n),C=!!n.isInSet(p.marks)||!p.marks.some(x=>x.type.excludes(n));h=v&&C}return!h}),h})}var XA=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=n,{empty:a,ranges:u}=l,f=Ur(t,r.schema);if(o)if(a){const h=A4(r,f);n.addStoredMark(f.create({...h,...e}))}else u.forEach(h=>{const p=h.$from.pos,m=h.$to.pos;r.doc.nodesBetween(p,m,(b,v)=>{const C=Math.max(v,p),x=Math.min(v+b.nodeSize,m);b.marks.find(T=>T.type===f)?b.marks.forEach(T=>{f===T.type&&n.addMark(C,x,f.create({...T.attrs,...e}))}):n.addMark(C,x,f.create(e))})});return ZA(r,n,f)},QA=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),WA=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const l=ht(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),l.isTextblock?o().command(({commands:u})=>Fb(l,{...a,...e})(n)?!0:u.clearNodes()).command(({state:u})=>Fb(l,{...a,...e})(u,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},JA=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=mo(t,0,r.content.size),l=de.create(r,o);e.setSelection(l)}return!0},ek=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=r;let a,u;return typeof e=="number"?(a=e,u=e):e&&"from"in e&&"to"in e?(a=e.from,u=e.to):(a=l.from,u=l.to),o&&n.doc.nodesBetween(a,u,(f,h)=>{f.isText||n.setNodeMarkup(h,void 0,{...f.attrs,dir:t})}),!0},tk=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:l}=typeof t=="number"?{from:t,to:t}:t,a=ve.atStart(r).from,u=ve.atEnd(r).to,f=mo(o,a,u),h=mo(l,a,u),p=ve.create(r,f,h);e.setSelection(p)}return!0},nk=t=>({state:e,dispatch:n})=>{const r=ht(t,e.schema);return XT(r)(e,n)};function DC(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}var rk=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:l,doc:a}=e,{$from:u,$to:f}=l,h=o.extensionManager.attributes,p=Nu(h,u.node().type.name,u.node().attrs);if(l instanceof de&&l.node.isBlock)return!u.parentOffset||!Lr(a,u.pos)?!1:(r&&(t&&DC(n,o.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const m=f.parentOffset===f.parent.content.size,b=u.depth===0?void 0:OA(u.node(-1).contentMatchAt(u.indexAfter(-1)));let v=m&&b?[{type:b,attrs:p}]:void 0,C=Lr(e.doc,e.mapping.map(u.pos),1,v);if(!v&&!C&&Lr(e.doc,e.mapping.map(u.pos),1,b?[{type:b}]:void 0)&&(C=!0,v=b?[{type:b,attrs:p}]:void 0),r){if(C&&(l instanceof ve&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,v),b&&!m&&!u.parentOffset&&u.parent.type!==b)){const x=e.mapping.map(u.before()),M=e.doc.resolve(x);u.node(-1).canReplaceWith(M.index(),M.index()+1,b)&&e.setNodeMarkup(e.mapping.map(u.before()),b)}t&&DC(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return C},ik=(t,e={})=>({tr:n,state:r,dispatch:o,editor:l})=>{var a;const u=ht(t,r.schema),{$from:f,$to:h}=r.selection,p=r.selection.node;if(p&&p.isBlock||f.depth<2||!f.sameParent(h))return!1;const m=f.node(-1);if(m.type!==u)return!1;const b=l.extensionManager.attributes;if(f.parent.content.size===0&&f.node(-1).childCount===f.indexAfter(-1)){if(f.depth===2||f.node(-3).type!==u||f.index(-2)!==f.node(-2).childCount-1)return!1;if(o){let T=ee.empty;const k=f.index(-1)?1:f.index(-2)?2:3;for(let B=f.depth-k;B>=f.depth-3;B-=1)T=ee.from(f.node(B).copy(T));const R=f.indexAfter(-1)<f.node(-2).childCount?1:f.indexAfter(-2)<f.node(-3).childCount?2:3,D={...Nu(b,f.node().type.name,f.node().attrs),...e},_=((a=u.contentMatch.defaultType)==null?void 0:a.createAndFill(D))||void 0;T=T.append(ee.from(u.createAndFill(null,_)||void 0));const j=f.before(f.depth-(k-1));n.replace(j,f.after(-R),new le(T,4-k,0));let L=-1;n.doc.nodesBetween(j,n.doc.content.size,(B,Q)=>{if(L>-1)return!1;B.isTextblock&&B.content.size===0&&(L=Q+1)}),L>-1&&n.setSelection(ve.near(n.doc.resolve(L))),n.scrollIntoView()}return!0}const v=h.pos===f.end()?m.contentMatchAt(0).defaultType:null,C={...Nu(b,m.type.name,m.attrs),...e},x={...Nu(b,f.node().type.name,f.node().attrs),...e};n.delete(f.pos,h.pos);const M=v?[{type:u,attrs:C},{type:v,attrs:x}]:[{type:u,attrs:C}];if(!Lr(n.doc,f.pos,2))return!1;if(o){const{selection:T,storedMarks:k}=r,{splittableMarks:R}=l.extensionManager,D=k||T.$to.parentOffset&&T.$from.marks();if(n.split(f.pos,2,M).scrollIntoView(),!D||!o)return!0;const _=D.filter(j=>R.includes(j.type.name));n.ensureMarks(_)}return!0},em=(t,e)=>{const n=Gf(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Bi(t.doc,n.pos)&&t.join(n.pos),!0},tm=(t,e)=>{const n=Gf(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Bi(t.doc,r)&&t.join(r),!0},ok=(t,e,n,r={})=>({editor:o,tr:l,state:a,dispatch:u,chain:f,commands:h,can:p})=>{const{extensions:m,splittableMarks:b}=o.extensionManager,v=ht(t,a.schema),C=ht(e,a.schema),{selection:x,storedMarks:M}=a,{$from:T,$to:k}=x,R=T.blockRange(k),D=M||x.$to.parentOffset&&x.$from.marks();if(!R)return!1;const _=Gf(j=>NC(j.type.name,m))(x);if(R.depth>=1&&_&&R.depth-_.depth<=1){if(_.node.type===v)return h.liftListItem(C);if(NC(_.node.type.name,m)&&v.validContent(_.node.content)&&u)return f().command(()=>(l.setNodeMarkup(_.pos,v),!0)).command(()=>em(l,v)).command(()=>tm(l,v)).run()}return!n||!D||!u?f().command(()=>p().wrapInList(v,r)?!0:h.clearNodes()).wrapInList(v,r).command(()=>em(l,v)).command(()=>tm(l,v)).run():f().command(()=>{const j=p().wrapInList(v,r),L=D.filter(B=>b.includes(B.type.name));return l.ensureMarks(L),j?!0:h.clearNodes()}).wrapInList(v,r).command(()=>em(l,v)).command(()=>tm(l,v)).run()},sk=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:l=!1}=n,a=Ur(t,r.schema);return Jm(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:l}):o.setMark(a,e)},lk=(t,e,n={})=>({state:r,commands:o})=>{const l=ht(t,r.schema),a=ht(e,r.schema),u=ji(r,l,n);let f;return r.selection.$anchor.sameParent(r.selection.$head)&&(f=r.selection.$anchor.parent.attrs),u?o.setNode(a,f):o.setNode(l,{...f,...n})},ak=(t,e={})=>({state:n,commands:r})=>{const o=ht(t,n.schema);return ji(n,o,e)?r.lift(o):r.wrapIn(o,e)},ck=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let l;if(o.spec.isInputRules&&(l=o.getState(t))){if(e){const a=t.tr,u=l.transform;for(let f=u.steps.length-1;f>=0;f-=1)a.step(u.steps[f].invert(u.docs[f]));if(l.text){const f=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,f))}else a.delete(l.from,l.to)}return!0}}return!1},uk=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(l=>{t.removeMark(l.$from.pos,l.$to.pos)}),!0},fk=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var l;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=n,f=Ur(t,r.schema),{$from:h,empty:p,ranges:m}=u;if(!o)return!0;if(p&&a){let{from:b,to:v}=u;const C=(l=h.marks().find(M=>M.type===f))==null?void 0:l.attrs,x=X1(h,f,C);x&&(b=x.from,v=x.to),n.removeMark(b,v,f)}else m.forEach(b=>{n.removeMark(b.$from.pos,b.$to.pos,f)});return n.removeStoredMark(f),!0},dk=t=>({tr:e,state:n,dispatch:r})=>{const{selection:o}=n;let l,a;return typeof t=="number"?(l=t,a=t):t&&"from"in t&&"to"in t?(l=t.from,a=t.to):(l=o.from,a=o.to),r&&e.doc.nodesBetween(l,a,(u,f)=>{if(u.isText)return;const h={...u.attrs};delete h.dir,e.setNodeMarkup(f,void 0,h)}),!0},hk=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const u=Kf(typeof t=="string"?t:t.name,r.schema);if(!u)return!1;u==="node"&&(l=ht(t,r.schema)),u==="mark"&&(a=Ur(t,r.schema));let f=!1;return n.selection.ranges.forEach(h=>{const p=h.$from.pos,m=h.$to.pos;let b,v,C,x;n.selection.empty?r.doc.nodesBetween(p,m,(M,T)=>{l&&l===M.type&&(f=!0,C=Math.max(T,p),x=Math.min(T+M.nodeSize,m),b=T,v=M)}):r.doc.nodesBetween(p,m,(M,T)=>{T<p&&l&&l===M.type&&(f=!0,C=Math.max(T,p),x=Math.min(T+M.nodeSize,m),b=T,v=M),T>=p&&T<=m&&(l&&l===M.type&&(f=!0,o&&n.setNodeMarkup(T,void 0,{...M.attrs,...e})),a&&M.marks.length&&M.marks.forEach(k=>{if(a===k.type&&(f=!0,o)){const R=Math.max(T,p),D=Math.min(T+M.nodeSize,m);n.addMark(R,D,a.create({...k.attrs,...e}))}}))}),v&&(b!==void 0&&o&&n.setNodeMarkup(b,void 0,{...v.attrs,...e}),a&&v.marks.length&&v.marks.forEach(M=>{a===M.type&&o&&n.addMark(C,x,a.create({...M.attrs,...e}))}))}),f},pk=(t,e={})=>({state:n,dispatch:r})=>{const o=ht(t,n.schema);return $T(o,e)(n,r)},mk=(t,e={})=>({state:n,dispatch:r})=>{const o=ht(t,n.schema);return FT(o,e)(n,r)},gk=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},_a=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},yk=(t,e)=>{if(Z1(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function hu(t){var e;const{editor:n,from:r,to:o,text:l,rules:a,plugin:u}=t,{view:f}=n;if(f.composing)return!1;const h=f.state.doc.resolve(r);if(h.parent.type.spec.code||(e=h.nodeBefore||h.nodeAfter)!=null&&e.marks.find(b=>b.type.spec.code))return!1;let p=!1;const m=$A(h)+l;return a.forEach(b=>{if(p)return;const v=yk(m,b.find);if(!v)return;const C=f.state.tr,x=Ff({state:f.state,transaction:C}),M={from:r-(v[0].length-l.length),to:o},{commands:T,chain:k,can:R}=new qf({editor:n,state:x});b.handler({state:x,range:M,match:v,commands:T,chain:k,can:R})===null||!C.steps.length||(b.undoable&&C.setMeta(u,{transform:C,from:r,to:o,text:l}),f.dispatch(C),p=!0)}),p}function vk(t){const{editor:e,rules:n}=t,r=new Je({state:{init(){return null},apply(o,l,a){const u=o.getMeta(r);if(u)return u;const f=o.getMeta("applyInputRules");return!!f&&setTimeout(()=>{let{text:p}=f;typeof p=="string"?p=p:p=J1(ee.from(p),a.schema);const{from:m}=f,b=m+p.length;hu({editor:e,from:m,to:b,text:p,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:l}},props:{handleTextInput(o,l,a,u){return hu({editor:e,from:l,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:l}=o.state.selection;l&&hu({editor:e,from:l.pos,to:l.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,l){if(l.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?hu({editor:e,from:a.pos,to:a.pos,text:`
69
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function bk(t){return Object.prototype.toString.call(t).slice(8,-1)}function pu(t){return bk(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function H4(t,e){const n={...t};return pu(t)&&pu(e)&&Object.keys(e).forEach(r=>{pu(e[r])&&pu(t[r])?n[r]=H4(t[r],e[r]):n[r]=e[r]}),n}var ng=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...Be(ge(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Be(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>H4(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Fn=class B4 extends ng{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new B4(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const a=o.marks();if(!!!a.find(h=>h?.type.name===n.name))return!1;const f=a.find(h=>h?.type.name===n.name);return f&&r.removeStoredMark(f),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Ck(t){return typeof t=="number"}var xk=class{constructor(t){this.find=t.find,this.handler=t.handler}},Sk=(t,e,n)=>{if(Z1(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const l=[o.text];return l.index=o.index,l.input=t,l.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),l.push(o.replaceWith)),l}):[]};function wk(t){const{editor:e,state:n,from:r,to:o,rule:l,pasteEvent:a,dropEvent:u}=t,{commands:f,chain:h,can:p}=new qf({editor:e,state:n}),m=[];return n.doc.nodesBetween(r,o,(v,C)=>{var x,M,T,k,R;if((M=(x=v.type)==null?void 0:x.spec)!=null&&M.code||!(v.isText||v.isTextblock||v.isInline))return;const D=(R=(k=(T=v.content)==null?void 0:T.size)!=null?k:v.nodeSize)!=null?R:0,_=Math.max(r,C),j=Math.min(o,C+D);if(_>=j)return;const L=v.isText?v.text||"":v.textBetween(_-C,j-C,void 0,"");Sk(L,l.find,a).forEach(Q=>{if(Q.index===void 0)return;const ne=_+Q.index+1,re=ne+Q[0].length,fe={from:n.tr.mapping.map(ne),to:n.tr.mapping.map(re)},ae=l.handler({state:n,range:fe,match:Q,commands:f,chain:h,can:p,pasteEvent:a,dropEvent:u});m.push(ae)})}),m.every(v=>v!==null)}var mu=null,Ek=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function Mk(t){const{editor:e,rules:n}=t;let r=null,o=!1,l=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u;try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}const f=({state:p,from:m,to:b,rule:v,pasteEvt:C})=>{const x=p.tr,M=Ff({state:p,transaction:x});if(!(!wk({editor:e,state:M,from:Math.max(m-1,0),to:b.b-1,rule:v,pasteEvent:C,dropEvent:u})||!x.steps.length)){try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,x}};return n.map(p=>new Je({view(m){const b=C=>{var x;r=(x=m.dom.parentElement)!=null&&x.contains(C.target)?m.dom.parentElement:null,r&&(mu=e)},v=()=>{mu&&(mu=null)};return window.addEventListener("dragstart",b),window.addEventListener("dragend",v),{destroy(){window.removeEventListener("dragstart",b),window.removeEventListener("dragend",v)}}},props:{handleDOMEvents:{drop:(m,b)=>{if(l=r===m.dom.parentElement,u=b,!l){const v=mu;v?.isEditable&&setTimeout(()=>{const C=v.state.selection;C&&v.commands.deleteRange({from:C.from,to:C.to})},10)}return!1},paste:(m,b)=>{var v;const C=(v=b.clipboardData)==null?void 0:v.getData("text/html");return a=b,o=!!C?.includes("data-pm-slice"),!1}}},appendTransaction:(m,b,v)=>{const C=m[0],x=C.getMeta("uiEvent")==="paste"&&!o,M=C.getMeta("uiEvent")==="drop"&&!l,T=C.getMeta("applyPasteRules"),k=!!T;if(!x&&!M&&!k)return;if(k){let{text:_}=T;typeof _=="string"?_=_:_=J1(ee.from(_),v.schema);const{from:j}=T,L=j+_.length,B=Ek(_);return f({rule:p,state:v,from:j,to:{b:L},pasteEvt:B})}const R=b.doc.content.findDiffStart(v.doc.content),D=b.doc.content.findDiffEnd(v.doc.content);if(!(!Ck(R)||!D||R===D.b))return f({rule:p,state:v,from:R,to:D,pasteEvt:a})}}))}var Zf=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=N4(t),this.schema=_A(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ql(e.name,this.schema)},r=ge(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return ia([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:ql(r.name,this.schema)},l=[],a=ge(r,"addKeyboardShortcuts",o);let u={};if(r.type==="mark"&&ge(r,"exitable",o)&&(u.ArrowRight=()=>Fn.handleExit({editor:t,mark:r})),a){const b=Object.fromEntries(Object.entries(a()).map(([v,C])=>[v,()=>C({editor:t})]));u={...u,...b}}const f=H8(u);l.push(f);const h=ge(r,"addInputRules",o);if(OC(r,t.options.enableInputRules)&&h){const b=h();if(b&&b.length){const v=vk({editor:t,rules:b}),C=Array.isArray(v)?v:[v];l.push(...C)}}const p=ge(r,"addPasteRules",o);if(OC(r,t.options.enablePasteRules)&&p){const b=p();if(b&&b.length){const v=Mk({editor:t,rules:b});l.push(...v)}}const m=ge(r,"addProseMirrorPlugins",o);if(m){const b=m();l.push(...b)}return l})}get attributes(){return O4(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Bs(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(n,"addNodeView")).map(n=>{const r=this.attributes.filter(f=>f.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ht(n.name,this.schema)},l=ge(n,"addNodeView",o);if(!l)return[];const a=l();if(!a)return[];const u=(f,h,p,m,b)=>{const v=Ca(f,r);return a({node:f,view:h,getPos:p,decorations:m,innerDecorations:b,editor:t,extension:n,HTMLAttributes:v})};return[n.name,u]}))}dispatchTransaction(t){const{editor:e}=this;return ia([...this.extensions].reverse()).reduceRight((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:ql(o.name,this.schema)},a=ge(o,"dispatchTransaction",l);return a?u=>{a.call(l,{transaction:u,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return ia([...this.extensions]).reduce((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:ql(o.name,this.schema)},a=ge(o,"transformPastedHTML",l);return a?(u,f)=>{const h=r(u,f);return a.call(l,h)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Bs(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(n,"addMarkView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ur(n.name,this.schema)},l=ge(n,"addMarkView",o);if(!l)return[];const a=(u,f,h)=>{const p=Ca(u,r);return l()({mark:u,view:f,inline:h,editor:t,extension:n,HTMLAttributes:p,updateAttributes:m=>{Bk(u,t,m)}})};return[n.name,a]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ql(e.name,this.schema)};e.type==="mark"&&((n=Be(ge(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const o=ge(e,"onBeforeCreate",r),l=ge(e,"onCreate",r),a=ge(e,"onUpdate",r),u=ge(e,"onSelectionUpdate",r),f=ge(e,"onTransaction",r),h=ge(e,"onFocus",r),p=ge(e,"onBlur",r),m=ge(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),l&&this.editor.on("create",l),a&&this.editor.on("update",a),u&&this.editor.on("selectionUpdate",u),f&&this.editor.on("transaction",f),h&&this.editor.on("focus",h),p&&this.editor.on("blur",p),m&&this.editor.on("destroy",m)})}};Zf.resolve=N4;Zf.sort=ia;Zf.flatten=W1;var Tk={};Y1(Tk,{ClipboardTextSerializer:()=>V4,Commands:()=>P4,Delete:()=>$4,Drop:()=>F4,Editable:()=>q4,FocusEvents:()=>G4,Keymap:()=>Y4,Paste:()=>Z4,Tabindex:()=>X4,TextDirection:()=>Q4,focusEventsPluginKey:()=>K4});var _e=class U4 extends ng{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new U4(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},V4=_e.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Je({key:new pt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:l}=o,a=Math.min(...l.map(p=>p.$from.pos)),u=Math.max(...l.map(p=>p.$to.pos)),f=L4(n);return D4(r,{from:a,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:f})}}})]}}),P4=_e.create({name:"commands",addCommands(){return{...x4}}}),$4=_e.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const l=()=>{var a,u,f,h;if((h=(f=(u=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:u.filterTransaction)==null?void 0:f.call(u,t))!=null?h:t.getMeta("y-sync$"))return;const p=Q1(t.before,[t,...e]);eg(p).forEach(v=>{p.mapping.mapResult(v.oldRange.from).deletedAfter&&p.mapping.mapResult(v.oldRange.to).deletedBefore&&p.before.nodesBetween(v.oldRange.from,v.oldRange.to,(C,x)=>{const M=x+C.nodeSize-2,T=v.oldRange.from<=x&&M<=v.oldRange.to;this.editor.emit("delete",{type:"node",node:C,from:x,to:M,newFrom:p.mapping.map(x),newTo:p.mapping.map(M),deletedRange:v.oldRange,newRange:v.newRange,partial:!T,editor:this.editor,transaction:t,combinedTransform:p})})});const b=p.mapping;p.steps.forEach((v,C)=>{var x,M;if(v instanceof Pn){const T=b.slice(C).map(v.from,-1),k=b.slice(C).map(v.to),R=b.invert().map(T,-1),D=b.invert().map(k),_=(x=p.doc.nodeAt(T-1))==null?void 0:x.marks.some(L=>L.eq(v.mark)),j=(M=p.doc.nodeAt(k))==null?void 0:M.marks.some(L=>L.eq(v.mark));this.editor.emit("delete",{type:"mark",mark:v.mark,from:v.from,to:v.to,deletedRange:{from:R,to:D},newRange:{from:T,to:k},partial:!!(j||_),editor:this.editor,transaction:t,combinedTransform:p})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(l,0):l()}}),F4=_e.create({name:"drop",addProseMirrorPlugins(){return[new Je({key:new pt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),q4=_e.create({name:"editable",addProseMirrorPlugins(){return[new Je({key:new pt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),K4=new pt("focusEvents"),G4=_e.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Je({key:K4,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Y4=_e.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:f,doc:h}=u,{empty:p,$anchor:m}=f,{pos:b,parent:v}=m,C=m.parent.isTextblock&&b>0?u.doc.resolve(b-1):m,x=C.parent.type.spec.isolating,M=m.pos-m.parentOffset,T=x&&C.parent.childCount===1?M===m.pos:Ee.atStart(h).from===b;return!p||!v.type.isTextblock||v.textContent.length||!T||T&&m.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},l={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return va()||T4()?l:o},addProseMirrorPlugins(){return[new Je({key:new pt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(x=>x.getMeta("composition")))return;const r=t.some(x=>x.docChanged)&&!e.doc.eq(n.doc),o=t.some(x=>x.getMeta("preventClearDocument"));if(!r||o)return;const{empty:l,from:a,to:u}=e.selection,f=Ee.atStart(e.doc).from,h=Ee.atEnd(e.doc).to;if(l||!(a===f&&u===h)||!Yf(n.doc))return;const b=n.tr,v=Ff({state:n,transaction:b}),{commands:C}=new qf({editor:this.editor,state:v});if(C.clearNodes(),!!b.steps.length)return b}})]}}),Z4=_e.create({name:"paste",addProseMirrorPlugins(){return[new Je({key:new pt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),X4=_e.create({name:"tabindex",addProseMirrorPlugins(){return[new Je({key:new pt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Q4=_e.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Bs(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Je({key:new pt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),Ak=class Xl{constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Xl(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Xl(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Xl(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,l=n.isAtom&&!n.isText,a=n.isInline,u=this.pos+r+(l?0:1);if(u<0||u>this.resolvedPos.doc.nodeSize-2)return;const f=this.resolvedPos.doc.resolve(u);if(!o&&!a&&f.depth<=this.depth)return;const h=new Xl(f,this.editor,o,o||a?n:null);o&&(h.actualDepth=this.depth+1),e.push(h)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const l=o.node.attrs,a=Object.keys(n);for(let u=0;u<a.length;u+=1){const f=a[u];if(l[f]!==n[f])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const l=Object.keys(n);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===e&&l.every(f=>n[f]===a.node.attrs[f])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},kk=`.ProseMirror {
70
+ position: relative;
71
+ }
72
+
73
+ .ProseMirror {
74
+ word-wrap: break-word;
75
+ white-space: pre-wrap;
76
+ white-space: break-spaces;
77
+ -webkit-font-variant-ligatures: none;
78
+ font-variant-ligatures: none;
79
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
80
+ }
81
+
82
+ .ProseMirror [contenteditable="false"] {
83
+ white-space: normal;
84
+ }
85
+
86
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
87
+ white-space: pre-wrap;
88
+ }
89
+
90
+ .ProseMirror pre {
91
+ white-space: pre-wrap;
92
+ }
93
+
94
+ img.ProseMirror-separator {
95
+ display: inline !important;
96
+ border: none !important;
97
+ margin: 0 !important;
98
+ width: 0 !important;
99
+ height: 0 !important;
100
+ }
101
+
102
+ .ProseMirror-gapcursor {
103
+ display: none;
104
+ pointer-events: none;
105
+ position: absolute;
106
+ margin: 0;
107
+ }
108
+
109
+ .ProseMirror-gapcursor:after {
110
+ content: "";
111
+ display: block;
112
+ position: absolute;
113
+ top: -2px;
114
+ width: 20px;
115
+ border-top: 1px solid black;
116
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
117
+ }
118
+
119
+ @keyframes ProseMirror-cursor-blink {
120
+ to {
121
+ visibility: hidden;
122
+ }
123
+ }
124
+
125
+ .ProseMirror-hideselection *::selection {
126
+ background: transparent;
127
+ }
128
+
129
+ .ProseMirror-hideselection *::-moz-selection {
130
+ background: transparent;
131
+ }
132
+
133
+ .ProseMirror-hideselection * {
134
+ caret-color: transparent;
135
+ }
136
+
137
+ .ProseMirror-focused .ProseMirror-gapcursor {
138
+ display: block;
139
+ }`;function Rk(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}var Ok=class extends gk{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:GA,createMappablePosition:YA},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:o,moved:l})=>this.options.onDrop(r,o,l)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=E4(e,this.options.autofocus);this.editorState=Rs.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Rk(kk,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=R4(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(o=>{const l=typeof o=="string"?`${o}$`:o.key;n=n.filter(a=>!a.key.startsWith(l))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[q4,V4.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),P4,G4,Y4,X4,F4,Z4,$4,Q4.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new Zf(r,this)}createCommandManager(){this.commandManager=new qf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Wm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Wm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,l=e.transformPastedHTML,a=this.extensionManager.transformPastedHTML(l);this.editorView=new b4(t,{...e,attributes:{role:"textbox",...e?.attributes},dispatchTransaction:o,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const u=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(u),this.prependClass(),this.injectCSS();const f=this.view.dom;f.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(h=>{var p;return(p=this.capturedTransaction)==null?void 0:p.step(h)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),l=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(h=>h.getMeta("focus")||h.getMeta("blur")),u=a?.getMeta("focus"),f=a?.getMeta("blur");u&&this.emit("focus",{editor:this,event:u.event,transaction:a}),f&&this.emit("blur",{editor:this,event:f.event,transaction:a}),!(t.getMeta("preventUpdate")||!n.some(h=>h.docChanged)||l.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return z4(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return FA(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return J1(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
140
+
141
+ `,textSerializers:n={}}=t||{};return HA(this.state.doc,{blockSeparator:e,textSerializers:{...L4(this.schema),...n}})}get isEmpty(){return Yf(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new Ak(e,this)}get $doc(){return this.$pos(0)}};function To(t){return new _a({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Be(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:l}=e,a=r[r.length-1],u=r[0];if(a){const f=u.search(/\S/),h=n.from+u.indexOf(a),p=h+a.length;if(tg(n.from,n.to,e.doc).filter(v=>v.mark.type.excluded.find(x=>x===t.type&&x!==v.mark.type)).filter(v=>v.to>h).length)return null;p<n.to&&l.delete(p,n.to),h>n.from&&l.delete(n.from+f,h);const b=n.from+f+a.length;l.addMark(n.from+f,b,t.type.create(o||{})),l.removeStoredMark(t.type)}},undoable:t.undoable})}function Nk(t){return new _a({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Be(t.getAttributes,void 0,r)||{},{tr:l}=e,a=n.from;let u=n.to;const f=t.type.create(o);if(r[1]){const h=r[0].lastIndexOf(r[1]);let p=a+h;p>u?p=u:u=p+r[1].length;const m=r[0][r[0].length-1];l.insertText(m,a+r[0].length-1),l.replaceWith(p,u,f)}else if(r[0]){const h=t.type.isInline?a:a-1;l.insert(h,t.type.create(o)).delete(l.mapping.map(a),l.mapping.map(u))}l.scrollIntoView()},undoable:t.undoable})}function e1(t){return new _a({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),l=Be(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,l)},undoable:t.undoable})}function ot(t){return new _a({find:t.find,handler:({state:e,range:n,match:r})=>{let o=t.replace,l=n.from;const a=n.to;if(r[1]){const u=r[0].lastIndexOf(r[1]);o+=r[0].slice(u+r[1].length),l+=u;const f=l-a;f>0&&(o=r[0].slice(u-f,u)+o,l=a)}e.tr.insertText(o,l,a)},undoable:t.undoable})}function Us(t){return new _a({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const l=Be(t.getAttributes,void 0,r)||{},a=e.tr.delete(n.from,n.to),f=a.doc.resolve(n.from).blockRange(),h=f&&D1(f,t.type,l);if(!h)return null;if(a.wrap(f,h),t.keepMarks&&t.editor){const{selection:m,storedMarks:b}=e,{splittableMarks:v}=t.editor.extensionManager,C=b||m.$to.parentOffset&&m.$from.marks();if(C){const x=C.filter(M=>v.includes(M.type.name));a.ensureMarks(x)}}if(t.keepAttributes){const m=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(m,l).run()}const p=a.doc.resolve(n.from-1).nodeBefore;p&&p.type===t.type&&Bi(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,p))&&a.join(n.from-1)},undoable:t.undoable})}function Dk(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof de){const l=r.index();return r.parent.canReplaceWith(l,l+1,e)}let o=r.depth;for(;o>=0;){const l=r.index(o);if(r.node(o).contentMatchAt(l).matchType(e))return!0;o-=1}return!1}var Lk={};Y1(Lk,{createAtomBlockMarkdownSpec:()=>zk,createBlockMarkdownSpec:()=>jk,createInlineMarkdownSpec:()=>Hk,parseAttributes:()=>rg,parseIndentedBlocks:()=>t1,renderNestedMarkdownContent:()=>og,serializeAttributes:()=>ig});function rg(t){if(!t?.trim())return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,h=>(n.push(h),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const h=o.map(p=>p.trim().slice(1));e.class=h.join(" ")}const l=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);l&&(e.id=l[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,h,p])=>{var m;const b=parseInt(((m=p.match(/__QUOTED_(\d+)__/))==null?void 0:m[1])||"0",10),v=n[b];v&&(e[h]=v.slice(1,-1))});const f=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return f&&f.split(/\s+/).filter(Boolean).forEach(p=>{p.match(/^[a-zA-Z][\w-]*$/)&&(e[p]=!0)}),e}function ig(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function zk(t){const{nodeName:e,name:n,parseAttributes:r=rg,serializeAttributes:o=ig,defaultAttributes:l={},requiredAttributes:a=[],allowedAttributes:u}=t,f=n||e,h=p=>{if(!u)return p;const m={};return u.forEach(b=>{b in p&&(m[b]=p[b])}),m};return{parseMarkdown:(p,m)=>{const b={...l,...p.attributes};return m.createNode(e,b,[])},markdownTokenizer:{name:e,level:"block",start(p){var m;const b=new RegExp(`^:::${f}(?:\\s|$)`,"m"),v=(m=p.match(b))==null?void 0:m.index;return v!==void 0?v:-1},tokenize(p,m,b){const v=new RegExp(`^:::${f}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),C=p.match(v);if(!C)return;const x=C[1]||"",M=r(x);if(!a.find(k=>!(k in M)))return{type:e,raw:C[0],attributes:M}}},renderMarkdown:p=>{const m=h(p.attrs||{}),b=o(m),v=b?` {${b}}`:"";return`:::${f}${v} :::`}}}function jk(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=rg,serializeAttributes:l=ig,defaultAttributes:a={},content:u="block",allowedAttributes:f}=t,h=n||e,p=m=>{if(!f)return m;const b={};return f.forEach(v=>{v in m&&(b[v]=m[v])}),b};return{parseMarkdown:(m,b)=>{let v;if(r){const x=r(m);v=typeof x=="string"?[{type:"text",text:x}]:x}else u==="block"?v=b.parseChildren(m.tokens||[]):v=b.parseInline(m.tokens||[]);const C={...a,...m.attributes};return b.createNode(e,C,v)},markdownTokenizer:{name:e,level:"block",start(m){var b;const v=new RegExp(`^:::${h}`,"m"),C=(b=m.match(v))==null?void 0:b.index;return C!==void 0?C:-1},tokenize(m,b,v){var C;const x=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),M=m.match(x);if(!M)return;const[T,k=""]=M,R=o(k);let D=1;const _=T.length;let j="";const L=/^:::([\w-]*)(\s.*)?/gm,B=m.slice(_);for(L.lastIndex=0;;){const Q=L.exec(B);if(Q===null)break;const ne=Q.index,re=Q[1];if(!((C=Q[2])!=null&&C.endsWith(":::"))){if(re)D+=1;else if(D-=1,D===0){const fe=B.slice(0,ne);j=fe.trim();const ae=m.slice(0,_+ne+Q[0].length);let W=[];if(j)if(u==="block")for(W=v.blockTokens(fe),W.forEach(ie=>{ie.text&&(!ie.tokens||ie.tokens.length===0)&&(ie.tokens=v.inlineTokens(ie.text))});W.length>0;){const ie=W[W.length-1];if(ie.type==="paragraph"&&(!ie.text||ie.text.trim()===""))W.pop();else break}else W=v.inlineTokens(j);return{type:e,raw:ae,attributes:R,content:j,tokens:W}}}}}},renderMarkdown:(m,b)=>{const v=p(m.attrs||{}),C=l(v),x=C?` {${C}}`:"",M=b.renderChildren(m.content||[],`
142
+
143
+ `);return`:::${h}${x}
144
+
145
+ ${M}
146
+
147
+ :::`}}}function _k(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,o,l,a]=r;e[o]=l||a,r=n.exec(t)}return e}function Ik(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function Hk(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=_k,serializeAttributes:l=Ik,defaultAttributes:a={},selfClosing:u=!1,allowedAttributes:f}=t,h=n||e,p=b=>{if(!f)return b;const v={};return f.forEach(C=>{const x=typeof C=="string"?C:C.name,M=typeof C=="string"?void 0:C.skipIfDefault;if(x in b){const T=b[x];if(M!==void 0&&T===M)return;v[x]=T}}),v},m=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(b,v)=>{const C={...a,...b.attributes};if(u)return v.createNode(e,C);const x=r?r(b):b.content||"";return x?v.createNode(e,C,[v.createTextNode(x)]):v.createNode(e,C,[])},markdownTokenizer:{name:e,level:"inline",start(b){const v=u?new RegExp(`\\[${m}\\s*[^\\]]*\\]`):new RegExp(`\\[${m}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${m}\\]`),C=b.match(v),x=C?.index;return x!==void 0?x:-1},tokenize(b,v,C){const x=u?new RegExp(`^\\[${m}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${m}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${m}\\]`),M=b.match(x);if(!M)return;let T="",k="";if(u){const[,D]=M;k=D}else{const[,D,_]=M;k=D,T=_||""}const R=o(k.trim());return{type:e,raw:M[0],content:T.trim(),attributes:R}}},renderMarkdown:b=>{let v="";r?v=r(b):b.content&&b.content.length>0&&(v=b.content.filter(T=>T.type==="text").map(T=>T.text).join(""));const C=p(b.attrs||{}),x=l(C),M=x?` ${x}`:"";return u?`[${h}${M}]`:`[${h}${M}]${v}[/${h}]`}}}function t1(t,e,n){var r,o,l,a;const u=t.split(`
148
+ `),f=[];let h="",p=0;const m=e.baseIndentSize||2;for(;p<u.length;){const b=u[p],v=b.match(e.itemPattern);if(!v){if(f.length>0)break;if(b.trim()===""){p+=1,h=`${h}${b}
149
+ `;continue}else return}const C=e.extractItemData(v),{indentLevel:x,mainContent:M}=C;h=`${h}${b}
150
+ `;const T=[M];for(p+=1;p<u.length;){const _=u[p];if(_.trim()===""){const L=u.slice(p+1).findIndex(ne=>ne.trim()!=="");if(L===-1)break;if((((o=(r=u[p+1+L].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>x){T.push(_),h=`${h}${_}
151
+ `,p+=1;continue}else break}if((((a=(l=_.match(/^(\s*)/))==null?void 0:l[1])==null?void 0:a.length)||0)>x)T.push(_),h=`${h}${_}
152
+ `,p+=1;else break}let k;const R=T.slice(1);if(R.length>0){const _=R.map(j=>j.slice(x+m)).join(`
153
+ `);_.trim()&&(e.customNestedParser?k=e.customNestedParser(_):k=n.blockTokens(_))}const D=e.createToken(C,k);f.push(D)}if(f.length!==0)return{items:f,raw:h}}function og(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[l,...a]=t.content,u=e.renderChildren([l]);let f=`${o}${u}`;return a&&a.length>0&&a.forEach((h,p)=>{var m,b;const v=(b=(m=e.renderChild)==null?void 0:m.call(e,h,p+1))!=null?b:e.renderChildren([h]);if(v!=null){const C=v.split(`
154
+ `).map(x=>x?e.indent(x):e.indent("")).join(`
155
+ `);f+=h.type==="paragraph"?`
156
+
157
+ ${C}`:`
158
+ ${C}`}}),f}function Bk(t,e,n={}){const{state:r}=e,{doc:o,tr:l}=r,a=t;o.descendants((u,f)=>{const h=l.mapping.map(f),p=l.mapping.map(f)+u.nodeSize;let m=null;if(u.marks.forEach(v=>{if(v!==a)return!1;m=v}),!m)return;let b=!1;if(Object.keys(n).forEach(v=>{n[v]!==m.attrs[v]&&(b=!0)}),b){const v=t.type.create({...t.attrs,...n});l.removeMark(h,p,t.type),l.addMark(h,p,v)}}),l.docChanged&&e.view.dispatch(l)}var Bt=class W4 extends ng{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new W4(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Uk=class{constructor(t,e,n){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,n,r,o,l,a,u;const{view:f}=this.editor,h=t.target,p=h.nodeType===3?(e=h.parentElement)==null?void 0:e.closest("[data-drag-handle]"):h.closest("[data-drag-handle]");if(!this.dom||(n=this.contentDOM)!=null&&n.contains(h)||!p)return;let m=0,b=0;if(this.dom!==p){const k=this.dom.getBoundingClientRect(),R=p.getBoundingClientRect(),D=(o=t.offsetX)!=null?o:(r=t.nativeEvent)==null?void 0:r.offsetX,_=(a=t.offsetY)!=null?a:(l=t.nativeEvent)==null?void 0:l.offsetY;m=R.x-k.x+D,b=R.y-k.y+_}const v=this.dom.cloneNode(!0);try{const k=this.dom.getBoundingClientRect();v.style.width=`${Math.round(k.width)}px`,v.style.height=`${Math.round(k.height)}px`,v.style.boxSizing="border-box",v.style.pointerEvents="none"}catch{}let C=null;try{C=document.createElement("div"),C.style.position="absolute",C.style.top="-9999px",C.style.left="-9999px",C.style.pointerEvents="none",C.appendChild(v),document.body.appendChild(C),(u=t.dataTransfer)==null||u.setDragImage(v,m,b)}finally{C&&setTimeout(()=>{try{C?.remove()}catch{}},0)}const x=this.getPos();if(typeof x!="number")return;const M=de.create(f.state.doc,x),T=f.state.tr.setSelection(M);f.dispatch(T)}stopEvent(t){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const n=t.target;if(!(this.dom.contains(n)&&!((e=this.contentDOM)!=null&&e.contains(n))))return!1;const o=t.type.startsWith("drag"),l=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!l&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:f}=this,h=!!this.node.type.spec.draggable,p=de.isSelectable(this.node),m=t.type==="copy",b=t.type==="paste",v=t.type==="cut",C=t.type==="mousedown";if(!h&&p&&o&&t.target===this.dom&&t.preventDefault(),h&&o&&!f&&t.target===this.dom)return t.preventDefault(),!1;if(h&&u&&!f&&C){const x=n.closest("[data-drag-handle]");x&&(this.dom===x||this.dom.contains(x))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(f||l||m||b||v||C&&p)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(va()||Qm())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:e})=>{const n=this.getPos();return typeof n!="number"?!1:(e.setNodeMarkup(n,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){const t=this.getPos();if(typeof t!="number")return;const e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}};function _i(t){return new xk({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const l=Be(t.getAttributes,void 0,r,o);if(l===!1||l===null)return null;const{tr:a}=e,u=r[r.length-1],f=r[0];let h=n.to;if(u){const p=f.search(/\S/),m=n.from+f.indexOf(u),b=m+u.length;if(tg(n.from,n.to,e.doc).filter(C=>C.mark.type.excluded.find(M=>M===t.type&&M!==C.mark.type)).filter(C=>C.to>m).length)return null;b<n.to&&a.delete(b,n.to),m>n.from&&a.delete(n.from+p,m),h=n.from+p+u.length,a.addMark(n.from+p,h,t.type.create(l||{})),a.removeStoredMark(t.type)}}})}var nm,LC;function Vk(){return LC||(LC=1,nm=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,l;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],n.get(o[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(l=Object.keys(e),r=l.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,l[o]))return!1;for(o=r;o--!==0;){var a=l[o];if(!(a==="_owner"&&e.$$typeof)&&!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),nm}var Pk=Vk();const $k=jf(Pk);var rm={exports:{}},im={};/**
159
+ * @license React
160
+ * use-sync-external-store-shim/with-selector.production.js
161
+ *
162
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
163
+ *
164
+ * This source code is licensed under the MIT license found in the
165
+ * LICENSE file in the root directory of this source tree.
166
+ */var zC;function Fk(){if(zC)return im;zC=1;var t=Na(),e=Kx();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,l=t.useRef,a=t.useEffect,u=t.useMemo,f=t.useDebugValue;return im.useSyncExternalStoreWithSelector=function(h,p,m,b,v){var C=l(null);if(C.current===null){var x={hasValue:!1,value:null};C.current=x}else x=C.current;C=u(function(){function T(j){if(!k){if(k=!0,R=j,j=b(j),v!==void 0&&x.hasValue){var L=x.value;if(v(L,j))return D=L}return D=j}if(L=D,r(R,j))return L;var B=b(j);return v!==void 0&&v(L,B)?(R=j,L):(R=j,D=B)}var k=!1,R,D,_=m===void 0?null:m;return[function(){return T(p())},_===null?void 0:function(){return T(_())}]},[p,m,b,v]);var M=o(h,C[0],C[1]);return a(function(){x.hasValue=!0,x.value=M},[M]),f(M),M},im}var jC;function qk(){return jC||(jC=1,rm.exports=Fk()),rm.exports}var Kk=qk(),Gk=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Yk=({contentComponent:t})=>{const e=Gx.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return w.jsx(w.Fragment,{children:Object.values(e)})};function Zk(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:qx.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}var Xk=class extends Rt.Component{constructor(t){var e;super(t),this.editorContentRef=Rt.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(t.view.dom),t.setOptions({element:e}),t.contentComponent=Zk(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.firstChild))return;const n=document.createElement("div");n.append(e.view.dom),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:Gk(e,this.editorContentRef),...n}),t?.contentComponent&&w.jsx(Yk,{contentComponent:t.contentComponent})]})}},Qk=S.forwardRef((t,e)=>{const n=Rt.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Rt.createElement(Xk,{key:n,innerRef:e,...t})}),Wk=Rt.memo(Qk),Jk=typeof window<"u"?S.useLayoutEffect:S.useEffect,eR=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function J4(t){var e;const[n]=S.useState(()=>new eR(t.editor)),r=Kk.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:$k);return Jk(()=>n.watch(t.editor),[t.editor,n]),S.useDebugValue(r),r}var tR=!1,n1=typeof window>"u",nR=n1||!!(typeof window<"u"&&window.next),rR=class e7{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?n1||nR?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,l;return(l=(o=this.options.current).onBeforeCreate)==null?void 0:l.call(o,...r)},onBlur:(...r)=>{var o,l;return(l=(o=this.options.current).onBlur)==null?void 0:l.call(o,...r)},onCreate:(...r)=>{var o,l;return(l=(o=this.options.current).onCreate)==null?void 0:l.call(o,...r)},onDestroy:(...r)=>{var o,l;return(l=(o=this.options.current).onDestroy)==null?void 0:l.call(o,...r)},onFocus:(...r)=>{var o,l;return(l=(o=this.options.current).onFocus)==null?void 0:l.call(o,...r)},onSelectionUpdate:(...r)=>{var o,l;return(l=(o=this.options.current).onSelectionUpdate)==null?void 0:l.call(o,...r)},onTransaction:(...r)=>{var o,l;return(l=(o=this.options.current).onTransaction)==null?void 0:l.call(o,...r)},onUpdate:(...r)=>{var o,l;return(l=(o=this.options.current).onUpdate)==null?void 0:l.call(o,...r)},onContentError:(...r)=>{var o,l;return(l=(o=this.options.current).onContentError)==null?void 0:l.call(o,...r)},onDrop:(...r)=>{var o,l;return(l=(o=this.options.current).onDrop)==null?void 0:l.call(o,...r)},onPaste:(...r)=>{var o,l;return(l=(o=this.options.current).onPaste)==null?void 0:l.call(o,...r)},onDelete:(...r)=>{var o,l;return(l=(o=this.options.current).onDelete)==null?void 0:l.call(o,...r)}};return new Ok(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,l)=>{var a;return o===((a=n.extensions)==null?void 0:a[l])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?e7.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function iR(t={},e=[]){const n=S.useRef(t);n.current=t;const[r]=S.useState(()=>new rR(n)),o=Gx.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return S.useDebugValue(o),S.useEffect(r.onRender(e)),J4({editor:o,selector:({transactionNumber:l})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&l===0?0:l+1}),o}var sg=S.createContext({editor:null});sg.Consumer;var oR=()=>S.useContext(sg),t7=S.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),sR=()=>S.useContext(t7),lg=Rt.forwardRef((t,e)=>{const{onDragStart:n}=sR(),r=t.as||"div";return w.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function _C(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function IC(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function lR(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function aR(t){if(_C(t)||IC(t))return!0;if(lR(t)){const e=t.type;if(e)return _C(e)||IC(e)}return!1}function cR(){try{if(S.version)return parseInt(S.version.split(".")[0],10)>=19}catch{}return!1}var uR=class{constructor(t,{editor:e,props:n={},as:r="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?Da.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var t;const e=this.component,n=this.props,r=this.editor,o=cR(),l=aR(e),a={...n};a.ref&&!(o||l)&&delete a.ref,!a.ref&&(o||l)&&(a.ref=u=>{this.ref=u}),this.reactElement=w.jsx(e,{...a}),(t=r?.contentComponent)==null||t.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t;const e=this.editor;(t=e?.contentComponent)==null||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}};Rt.createContext({markViewContentRef:()=>{}});var fR=class extends Uk{constructor(t,e,n){if(super(t,e,n),!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(f={})=>this.updateAttributes(f),deleteNode:()=>this.deleteNode(),ref:S.createRef()};if(!this.component.displayName){const f=h=>h.charAt(0).toUpperCase()+h.substring(1);this.component.displayName=f(this.extension.name)}const r={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:f=>{f&&this.contentDOMElement&&f.firstChild!==this.contentDOMElement&&(f.hasAttribute("data-node-view-wrapper")&&f.removeAttribute("data-node-view-wrapper"),f.appendChild(this.contentDOMElement))}},o=this.component,l=S.memo(f=>w.jsx(t7.Provider,{value:r,children:S.createElement(o,f)}));l.displayName="ReactNodeView";let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:u=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new uR(l,{editor:this.editor,props:t,as:a,className:`node-${this.node.type.name} ${u}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var t;if(this.renderer.element.firstElementChild&&!((t=this.renderer.element.firstElementChild)!=null&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:t,to:e}=this.editor.state.selection,n=this.getPos();if(typeof n=="number")if(t<=n&&e>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,e,n){const r=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,l=this.decorations,a=this.innerDecorations;return this.node=t,this.decorations=e,this.innerDecorations=n,this.options.update({oldNode:o,oldDecorations:l,newNode:t,newDecorations:e,oldInnerDecorations:a,innerDecorations:n,updateProps:()=>r({node:t,decorations:e,innerDecorations:n})})}return t===this.node&&this.decorations===e&&this.innerDecorations===n||(this.node=t,this.decorations=e,this.innerDecorations=n,r({node:t,decorations:e,innerDecorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let t={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,n=Ca(this.node,e);t=this.options.attrs({node:this.node,HTMLAttributes:n})}else t=this.options.attrs;this.renderer.updateAttributes(t)}}};function ag(t,e){return n=>n.editor.contentComponent?new fR(t,n,e):{}}const Tt=[];for(let t=0;t<256;++t)Tt.push((t+256).toString(16).slice(1));function dR(t,e=0){return(Tt[t[e+0]]+Tt[t[e+1]]+Tt[t[e+2]]+Tt[t[e+3]]+"-"+Tt[t[e+4]]+Tt[t[e+5]]+"-"+Tt[t[e+6]]+Tt[t[e+7]]+"-"+Tt[t[e+8]]+Tt[t[e+9]]+"-"+Tt[t[e+10]]+Tt[t[e+11]]+Tt[t[e+12]]+Tt[t[e+13]]+Tt[t[e+14]]+Tt[t[e+15]]).toLowerCase()}let om;const hR=new Uint8Array(16);function pR(){if(!om){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");om=crypto.getRandomValues.bind(crypto)}return om(hR)}const mR=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),HC={randomUUID:mR};function gR(t,e,n){t=t||{};const r=t.random??t.rng?.()??pR();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,dR(r)}function yR(t,e,n){return HC.randomUUID&&!t?HC.randomUUID():gR(t)}var Qu=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},vR=/^\s*>\s$/,bR=Bt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Qu("blockquote",{...$e(this.options.HTMLAttributes,t),children:Qu("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=[];return t.content.forEach(o=>{const a=e.renderChildren(o).split(`
167
+ `).map(u=>`> ${u}`).join(`
168
+ `);n.push(a)}),n.flatMap(o=>[o,"> "]).slice(0,-1).join(`
169
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Us({find:vR,type:this.type})]}}),CR=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xR=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,SR=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,wR=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ER=Fn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Qu("strong",{...$e(this.options.HTMLAttributes,t),children:Qu("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[To({find:CR,type:this.type}),To({find:SR,type:this.type})]},addPasteRules(){return[_i({find:xR,type:this.type}),_i({find:wR,type:this.type})]}}),MR=/(^|[^`])`([^`]+)`(?!`)$/,TR=/(^|[^`])`([^`]+)`(?!`)/g,AR=Fn.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",$e(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[To({find:MR,type:this.type})]},addPasteRules(){return[_i({find:TR,type:this.type})]}}),sm=4,kR=/^```([a-z]+)?[\s\n]$/,RR=/^~~~([a-z]+)?[\s\n]$/,OR=Bt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:sm,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const l=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return l||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",$e(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const o=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join(`
170
+ `):r=`\`\`\`${o}
171
+
172
+ \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:sm,{state:r}=t,{selection:o}=r,{$from:l,empty:a}=o;if(l.parent.type!==this.type)return!1;const u=" ".repeat(n);return a?t.commands.insertContent(u):t.commands.command(({tr:f})=>{const{from:h,to:p}=o,v=r.doc.textBetween(h,p,`
173
+ `,`
174
+ `).split(`
175
+ `).map(C=>u+C).join(`
176
+ `);return f.replaceWith(h,p,r.schema.text(v)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:sm,{state:r}=t,{selection:o}=r,{$from:l,empty:a}=o;return l.parent.type!==this.type?!1:a?t.commands.command(({tr:u})=>{var f;const{pos:h}=l,p=l.start(),m=l.end(),v=r.doc.textBetween(p,m,`
177
+ `,`
178
+ `).split(`
179
+ `);let C=0,x=0;const M=h-p;for(let j=0;j<v.length;j+=1){if(x+v[j].length>=M){C=j;break}x+=v[j].length+1}const k=((f=v[C].match(/^ */))==null?void 0:f[0])||"",R=Math.min(k.length,n);if(R===0)return!0;let D=p;for(let j=0;j<C;j+=1)D+=v[j].length+1;return u.delete(D,D+R),h-D<=R&&u.setSelection(ve.create(u.doc,D)),!0}):t.commands.command(({tr:u})=>{const{from:f,to:h}=o,b=r.doc.textBetween(f,h,`
180
+ `,`
181
+ `).split(`
182
+ `).map(v=>{var C;const x=((C=v.match(/^ */))==null?void 0:C[0])||"",M=Math.min(x.length,n);return v.slice(M)}).join(`
183
+ `);return u.replaceWith(f,h,r.schema.text(b)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const l=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
184
+
185
+ `);return!l||!a?!1:t.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:l}=n;if(!l||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const u=o.after();return u===void 0?!1:r.nodeAt(u)?t.commands.command(({tr:h})=>(h.setSelection(Ee.near(r.resolve(u))),!0)):t.commands.exitCode()}}},addInputRules(){return[e1({find:kR,type:this.type,getAttributes:t=>({language:t[1]})}),e1({find:RR,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Je({key:new pt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,l=o?.mode;if(!n||!l)return!1;const{tr:a,schema:u}=t.state,f=u.text(n.replace(/\r\n?/g,`
186
+ `));return a.replaceSelectionWith(this.type.create({language:l},f)),a.selection.$from.parent.type!==this.type&&a.setSelection(ve.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),NR=Bt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
187
+
188
+ `):""}),DR=Bt.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",$e(this.options.HTMLAttributes,t)]},renderText(){return`
189
+ `},renderMarkdown:(t,e)=>e.indent(`
190
+ `),parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:l}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=r.extensionManager,f=l||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:h,dispatch:p})=>{if(p&&f&&a){const m=f.filter(b=>u.includes(b.type.name));h.ensureMarks(m)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),LR=Bt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,$e(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>e1({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),n7=Bt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",$e(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Dk(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,o=t();return j4(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:l,tr:a,dispatch:u})=>{if(u){const{$to:f}=a.selection,h=f.end();if(f.nodeAfter)f.nodeAfter.isTextblock?a.setSelection(ve.create(a.doc,f.pos+1)):f.nodeAfter.isBlock?a.setSelection(de.create(a.doc,f.pos)):a.setSelection(ve.create(a.doc,f.pos));else{const p=l.schema.nodes[this.options.nextNodeType]||f.parent.type.contentMatch.defaultType,m=p?.create();m&&(a.insert(h,m),a.setSelection(ve.create(a.doc,h+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Nk({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),zR=n7,jR=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_R=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,IR=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,HR=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,BR=Fn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",$e(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[To({find:jR,type:this.type}),To({find:IR,type:this.type})]},addPasteRules(){return[_i({find:_R,type:this.type}),_i({find:HR,type:this.type})]}});const UR="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",VR="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",r1="numeric",i1="ascii",o1="alpha",oa="asciinumeric",Ql="alphanumeric",s1="domain",r7="emoji",PR="scheme",$R="slashscheme",lm="whitespace";function FR(t,e){return t in e||(e[t]=[]),e[t]}function go(t,e,n){e[r1]&&(e[oa]=!0,e[Ql]=!0),e[i1]&&(e[oa]=!0,e[o1]=!0),e[oa]&&(e[Ql]=!0),e[o1]&&(e[Ql]=!0),e[Ql]&&(e[s1]=!0),e[r7]&&(e[s1]=!0);for(const r in e){const o=FR(r,n);o.indexOf(t)<0&&o.push(t)}}function qR(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function en(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}en.groups={};en.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],l=e.jr[r][1];if(l&&o.test(t))return l}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||en.groups;let o;return e&&e.j?o=e:(o=new en(e),n&&r&&go(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const l=t.length;if(!l)return o;for(let a=0;a<l-1;a++)o=o.tt(t[a]);return o.tt(t[l-1],e,n,r)},tt(t,e,n,r){r=r||en.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const l=e;let a,u=o.go(t);if(u?(a=new en,Object.assign(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new en,l){if(r)if(a.t&&typeof a.t=="string"){const f=Object.assign(qR(a.t,r),n);go(l,f,r)}else n&&go(l,n,r);a.t=l}return o.j[t]=a,a}};const Me=(t,e,n,r,o)=>t.ta(e,n,r,o),rt=(t,e,n,r,o)=>t.tr(e,n,r,o),BC=(t,e,n,r,o)=>t.ts(e,n,r,o),te=(t,e,n,r,o)=>t.tt(e,n,r,o),Rr="WORD",l1="UWORD",i7="ASCIINUMERICAL",o7="ALPHANUMERICAL",xa="LOCALHOST",a1="TLD",c1="UTLD",Du="SCHEME",Ts="SLASH_SCHEME",cg="NUM",u1="WS",ug="NL",sa="OPENBRACE",la="CLOSEBRACE",Wu="OPENBRACKET",Ju="CLOSEBRACKET",ef="OPENPAREN",tf="CLOSEPAREN",nf="OPENANGLEBRACKET",rf="CLOSEANGLEBRACKET",of="FULLWIDTHLEFTPAREN",sf="FULLWIDTHRIGHTPAREN",lf="LEFTCORNERBRACKET",af="RIGHTCORNERBRACKET",cf="LEFTWHITECORNERBRACKET",uf="RIGHTWHITECORNERBRACKET",ff="FULLWIDTHLESSTHAN",df="FULLWIDTHGREATERTHAN",hf="AMPERSAND",pf="APOSTROPHE",mf="ASTERISK",Ci="AT",gf="BACKSLASH",yf="BACKTICK",vf="CARET",wi="COLON",fg="COMMA",bf="DOLLAR",Zn="DOT",Cf="EQUALS",dg="EXCLAMATION",On="HYPHEN",aa="PERCENT",xf="PIPE",Sf="PLUS",wf="POUND",ca="QUERY",hg="QUOTE",s7="FULLWIDTHMIDDLEDOT",pg="SEMI",Xn="SLASH",ua="TILDE",Ef="UNDERSCORE",l7="EMOJI",Mf="SYM";var a7=Object.freeze({__proto__:null,ALPHANUMERICAL:o7,AMPERSAND:hf,APOSTROPHE:pf,ASCIINUMERICAL:i7,ASTERISK:mf,AT:Ci,BACKSLASH:gf,BACKTICK:yf,CARET:vf,CLOSEANGLEBRACKET:rf,CLOSEBRACE:la,CLOSEBRACKET:Ju,CLOSEPAREN:tf,COLON:wi,COMMA:fg,DOLLAR:bf,DOT:Zn,EMOJI:l7,EQUALS:Cf,EXCLAMATION:dg,FULLWIDTHGREATERTHAN:df,FULLWIDTHLEFTPAREN:of,FULLWIDTHLESSTHAN:ff,FULLWIDTHMIDDLEDOT:s7,FULLWIDTHRIGHTPAREN:sf,HYPHEN:On,LEFTCORNERBRACKET:lf,LEFTWHITECORNERBRACKET:cf,LOCALHOST:xa,NL:ug,NUM:cg,OPENANGLEBRACKET:nf,OPENBRACE:sa,OPENBRACKET:Wu,OPENPAREN:ef,PERCENT:aa,PIPE:xf,PLUS:Sf,POUND:wf,QUERY:ca,QUOTE:hg,RIGHTCORNERBRACKET:af,RIGHTWHITECORNERBRACKET:uf,SCHEME:Du,SEMI:pg,SLASH:Xn,SLASH_SCHEME:Ts,SYM:Mf,TILDE:ua,TLD:a1,UNDERSCORE:Ef,UTLD:c1,UWORD:l1,WORD:Rr,WS:u1});const Ar=/[a-z]/,Kl=new RegExp("\\p{L}","u"),am=new RegExp("\\p{Emoji}","u"),kr=/\d/,cm=/\s/,UC="\r",um=`
191
+ `,KR="️",GR="‍",fm="";let gu=null,yu=null;function YR(t=[]){const e={};en.groups=e;const n=new en;gu==null&&(gu=VC(UR)),yu==null&&(yu=VC(VR)),te(n,"'",pf),te(n,"{",sa),te(n,"}",la),te(n,"[",Wu),te(n,"]",Ju),te(n,"(",ef),te(n,")",tf),te(n,"<",nf),te(n,">",rf),te(n,"(",of),te(n,")",sf),te(n,"「",lf),te(n,"」",af),te(n,"『",cf),te(n,"』",uf),te(n,"<",ff),te(n,">",df),te(n,"&",hf),te(n,"*",mf),te(n,"@",Ci),te(n,"`",yf),te(n,"^",vf),te(n,":",wi),te(n,",",fg),te(n,"$",bf),te(n,".",Zn),te(n,"=",Cf),te(n,"!",dg),te(n,"-",On),te(n,"%",aa),te(n,"|",xf),te(n,"+",Sf),te(n,"#",wf),te(n,"?",ca),te(n,'"',hg),te(n,"/",Xn),te(n,";",pg),te(n,"~",ua),te(n,"_",Ef),te(n,"\\",gf),te(n,"・",s7);const r=rt(n,kr,cg,{[r1]:!0});rt(r,kr,r);const o=rt(r,Ar,i7,{[oa]:!0}),l=rt(r,Kl,o7,{[Ql]:!0}),a=rt(n,Ar,Rr,{[i1]:!0});rt(a,kr,o),rt(a,Ar,a),rt(o,kr,o),rt(o,Ar,o);const u=rt(n,Kl,l1,{[o1]:!0});rt(u,Ar),rt(u,kr,l),rt(u,Kl,u),rt(l,kr,l),rt(l,Ar),rt(l,Kl,l);const f=te(n,um,ug,{[lm]:!0}),h=te(n,UC,u1,{[lm]:!0}),p=rt(n,cm,u1,{[lm]:!0});te(n,fm,p),te(h,um,f),te(h,fm,p),rt(h,cm,p),te(p,UC),te(p,um),rt(p,cm,p),te(p,fm,p);const m=rt(n,am,l7,{[r7]:!0});te(m,"#"),rt(m,am,m),te(m,KR,m);const b=te(m,GR);te(b,"#"),rt(b,am,m);const v=[[Ar,a],[kr,o]],C=[[Ar,null],[Kl,u],[kr,l]];for(let x=0;x<gu.length;x++)mi(n,gu[x],a1,Rr,v);for(let x=0;x<yu.length;x++)mi(n,yu[x],c1,l1,C);go(a1,{tld:!0,ascii:!0},e),go(c1,{utld:!0,alpha:!0},e),mi(n,"file",Du,Rr,v),mi(n,"mailto",Du,Rr,v),mi(n,"http",Ts,Rr,v),mi(n,"https",Ts,Rr,v),mi(n,"ftp",Ts,Rr,v),mi(n,"ftps",Ts,Rr,v),go(Du,{scheme:!0,ascii:!0},e),go(Ts,{slashscheme:!0,ascii:!0},e),t=t.sort((x,M)=>x[0]>M[0]?1:-1);for(let x=0;x<t.length;x++){const M=t[x][0],k=t[x][1]?{[PR]:!0}:{[$R]:!0};M.indexOf("-")>=0?k[s1]=!0:Ar.test(M)?kr.test(M)?k[oa]=!0:k[i1]=!0:k[r1]=!0,BC(n,M,M,k)}return BC(n,"localhost",xa,{ascii:!0}),n.jd=new en(Mf),{start:n,tokens:Object.assign({groups:e},a7)}}function c7(t,e){const n=ZR(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=n.length,o=[];let l=0,a=0;for(;a<r;){let u=t,f=null,h=0,p=null,m=-1,b=-1;for(;a<r&&(f=u.go(n[a]));)u=f,u.accepts()?(m=0,b=0,p=u):m>=0&&(m+=n[a].length,b++),h+=n[a].length,l+=n[a].length,a++;l-=m,a-=b,h-=m,o.push({t:p.t,v:e.slice(l-h,l),s:l-h,e:l})}return o}function ZR(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),l,a=o<55296||o>56319||r+1===n||(l=t.charCodeAt(r+1))<56320||l>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}function mi(t,e,n,r,o){let l;const a=e.length;for(let u=0;u<a-1;u++){const f=e[u];t.j[f]?l=t.j[f]:(l=new en(r),l.jr=o.slice(),t.j[f]=l),t=l}return l=new en(n),l.jr=o.slice(),t.j[e[a-1]]=l,l}function VC(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let l=0;for(;o.indexOf(t[r+l])>=0;)l++;if(l>0){e.push(n.join(""));for(let a=parseInt(t.substring(r,r+l),10);a>0;a--)n.pop();r+=l}else n.push(t[r]),r++}return e}const Sa={defaultProtocol:"http",events:null,format:PC,formatHref:PC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function mg(t,e=null){let n=Object.assign({},Sa);t&&(n=Object.assign(n,t instanceof mg?t.o:t));const r=n.ignoreTags,o=[];for(let l=0;l<r.length;l++)o.push(r[l].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}mg.prototype={o:Sa,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Sa[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function PC(t){return t}function u7(t,e){this.t="token",this.v=t,this.tk=e}u7.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Sa.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),l=this.toFormattedString(t),a={},u=t.get("className",n,e),f=t.get("target",n,e),h=t.get("rel",n,e),p=t.getObj("attributes",n,e),m=t.getObj("events",n,e);return a.href=r,u&&(a.class=u),f&&(a.target=f),h&&(a.rel=h),p&&Object.assign(a,p),{tagName:o,attributes:a,content:l,eventListeners:m}}};function Xf(t,e){class n extends u7{constructor(o,l){super(o,l),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const $C=Xf("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),FC=Xf("text"),XR=Xf("nl"),vu=Xf("url",{isLink:!0,toHref(t=Sa.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==xa&&t[1].t===wi}}),kn=t=>new en(t);function QR({groups:t}){const e=t.domain.concat([hf,mf,Ci,gf,yf,vf,bf,Cf,On,cg,aa,xf,Sf,wf,Xn,Mf,ua,Ef]),n=[pf,wi,fg,Zn,dg,aa,ca,hg,pg,nf,rf,sa,la,Ju,Wu,ef,tf,of,sf,lf,af,cf,uf,ff,df],r=[hf,pf,mf,gf,yf,vf,bf,Cf,On,sa,la,aa,xf,Sf,wf,ca,Xn,Mf,ua,Ef],o=kn(),l=te(o,ua);Me(l,r,l),Me(l,t.domain,l);const a=kn(),u=kn(),f=kn();Me(o,t.domain,a),Me(o,t.scheme,u),Me(o,t.slashscheme,f),Me(a,r,l),Me(a,t.domain,a);const h=te(a,Ci);te(l,Ci,h),te(u,Ci,h),te(f,Ci,h);const p=te(l,Zn);Me(p,r,l),Me(p,t.domain,l);const m=kn();Me(h,t.domain,m),Me(m,t.domain,m);const b=te(m,Zn);Me(b,t.domain,m);const v=kn($C);Me(b,t.tld,v),Me(b,t.utld,v),te(h,xa,v);const C=te(m,On);te(C,On,C),Me(C,t.domain,m),Me(v,t.domain,m),te(v,Zn,b),te(v,On,C);const x=te(v,wi);Me(x,t.numeric,$C);const M=te(a,On),T=te(a,Zn);te(M,On,M),Me(M,t.domain,a),Me(T,r,l),Me(T,t.domain,a);const k=kn(vu);Me(T,t.tld,k),Me(T,t.utld,k),Me(k,t.domain,a),Me(k,r,l),te(k,Zn,T),te(k,On,M),te(k,Ci,h);const R=te(k,wi),D=kn(vu);Me(R,t.numeric,D);const _=kn(vu),j=kn();Me(_,e,_),Me(_,n,j),Me(j,e,_),Me(j,n,j),te(k,Xn,_),te(D,Xn,_);const L=te(u,wi),B=te(f,wi),Q=te(B,Xn),ne=te(Q,Xn);Me(u,t.domain,a),te(u,Zn,T),te(u,On,M),Me(f,t.domain,a),te(f,Zn,T),te(f,On,M),Me(L,t.domain,_),te(L,Xn,_),te(L,ca,_),Me(ne,t.domain,_),Me(ne,e,_),te(ne,Xn,_);const re=[[sa,la],[Wu,Ju],[ef,tf],[nf,rf],[of,sf],[lf,af],[cf,uf],[ff,df]];for(let fe=0;fe<re.length;fe++){const[ae,W]=re[fe],ie=te(_,ae);te(j,ae,ie),te(ie,W,_);const I=kn(vu);Me(ie,e,I);const q=kn();Me(ie,n),Me(I,e,I),Me(I,n,q),Me(q,e,I),Me(q,n,q),te(I,W,_),te(q,W,_)}return te(o,xa,k),te(o,ug,XR),{start:o,tokens:a7}}function WR(t,e,n){let r=n.length,o=0,l=[],a=[];for(;o<r;){let u=t,f=null,h=null,p=0,m=null,b=-1;for(;o<r&&!(f=u.go(n[o].t));)a.push(n[o++]);for(;o<r&&(h=f||u.go(n[o].t));)f=null,u=h,u.accepts()?(b=0,m=u):b>=0&&b++,o++,p++;if(b<0)o-=p,o<r&&(a.push(n[o]),o++);else{a.length>0&&(l.push(dm(FC,e,a)),a=[]),o-=b,p-=b;const v=m.t,C=n.slice(o-p,o);l.push(dm(v,e,C))}}return a.length>0&&l.push(dm(FC,e,a)),l}function dm(t,e,n){const r=n[0].s,o=n[n.length-1].e,l=e.slice(r,o);return new t(l,n)}const JR=typeof console<"u"&&console&&console.warn||(()=>{}),eO="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ze={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tO(){return en.groups={},Ze.scanner=null,Ze.parser=null,Ze.tokenQueue=[],Ze.pluginQueue=[],Ze.customSchemes=[],Ze.initialized=!1,Ze}function qC(t,e=!1){if(Ze.initialized&&JR(`linkifyjs: already initialized - will not register custom scheme "${t}" ${eO}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
192
+ 1. Must only contain digits, lowercase ASCII letters or "-"
193
+ 2. Cannot start or end with "-"
194
+ 3. "-" cannot repeat`);Ze.customSchemes.push([t,e])}function nO(){Ze.scanner=YR(Ze.customSchemes);for(let t=0;t<Ze.tokenQueue.length;t++)Ze.tokenQueue[t][1]({scanner:Ze.scanner});Ze.parser=QR(Ze.scanner.tokens);for(let t=0;t<Ze.pluginQueue.length;t++)Ze.pluginQueue[t][1]({scanner:Ze.scanner,parser:Ze.parser});return Ze.initialized=!0,Ze}function gg(t){return Ze.initialized||nO(),WR(Ze.parser.start,t,c7(Ze.scanner.start,t))}gg.scan=c7;function f7(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new mg(n),o=gg(t),l=[];for(let a=0;a<o.length;a++){const u=o[a];u.isLink&&(!e||u.t===e)&&r.check(u)&&l.push(u.toFormattedObject(r))}return l}var yg="[\0-   ᠎ -\u2029  ]",rO=new RegExp(yg),iO=new RegExp(`${yg}$`),oO=new RegExp(yg,"g");function sO(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function lO(t){return new Je({key:new pt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(h=>h.docChanged)&&!n.doc.eq(r.doc),l=e.some(h=>h.getMeta("preventAutolink"));if(!o||l)return;const{tr:a}=r,u=Q1(n.doc,[...e]);if(eg(u).forEach(({newRange:h})=>{const p=k4(r.doc,h,v=>v.isTextblock);let m,b;if(p.length>1)m=p[0],b=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ");else if(p.length){const v=r.doc.textBetween(h.from,h.to," "," ");if(!iO.test(v))return;m=p[0],b=r.doc.textBetween(m.pos,h.to,void 0," ")}if(m&&b){const v=b.split(rO).filter(Boolean);if(v.length<=0)return!1;const C=v[v.length-1],x=m.pos+b.lastIndexOf(C);if(!C)return!1;const M=gg(C).map(T=>T.toObject(t.defaultProtocol));if(!sO(M))return!1;M.filter(T=>T.isLink).map(T=>({...T,from:x+T.start+1,to:x+T.end+1})).filter(T=>r.schema.marks.code?!r.doc.rangeHasMark(T.from,T.to,r.schema.marks.code):!0).filter(T=>t.validate(T.value)).filter(T=>t.shouldAutoLink(T.value)).forEach(T=>{tg(T.from,T.to,r.doc).some(k=>k.mark.type===t.type)||a.addMark(T.from,T.to,t.type.create({href:T.href}))})}}),!!a.steps.length)return a}})}function aO(t){return new Je({key:new pt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,l;if(r.button!==0||!e.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{let p=r.target;const m=[];for(;p.nodeName!=="DIV";)m.push(p),p=p.parentNode;a=m.find(b=>b.nodeName==="A")}if(!a)return!1;const u=z4(e.state,t.type.name),f=(o=a?.href)!=null?o:u.href,h=(l=a?.target)!=null?l:u.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),a&&f?(window.open(f,h),!0):!1}}})}function cO(t){return new Je({key:new pt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:o}=t,{state:l}=e,{selection:a}=l,{empty:u}=a;if(u)return!1;let f="";r.content.forEach(p=>{f+=p.textContent});const h=f7(f,{defaultProtocol:t.defaultProtocol}).find(p=>p.isLink&&p.value===f);return!f||!h||o!==void 0&&!o(h.href)?!1:t.editor.commands.setMark(t.type,{href:h.href})}}})}function ao(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(oO,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var uO=Fn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){qC(t);return}qC(t.scheme,t.optionalSlashes)})},onDestroy(){tO()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ao(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!ao(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ao(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$e(this.options.HTMLAttributes,t),0]:["a",$e(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const r=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ao(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ao(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[_i({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=f7(t).filter(l=>l.isLink&&this.options.isAllowedUri(l.value,{defaultValidate:a=>!!ao(a,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(l=>{this.options.shouldAutoLink(l.value)&&e.push({text:l.value,data:{href:l.href},index:l.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(lO({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!ao(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(aO({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(cO({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),fO=Object.defineProperty,dO=(t,e)=>{for(var n in e)fO(t,n,{get:e[n],enumerable:!0})},hO="listItem",KC="textStyle",GC=/^\s*([-+*])\s$/,d7=Bt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",$e(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
195
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(hO,this.editor.getAttributes(KC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Us({find:GC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Us({find:GC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(KC),editor:this.editor})),[t]}}),h7=Bt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",$e(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(o=>o.type==="paragraph"))n=e.parseChildren(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const a=t.tokens.slice(1),u=e.parseChildren(a);n.push(...u)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>og(t,e,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),pO={};dO(pO,{findListItemPos:()=>Ia,getNextListDepth:()=>vg,handleBackspace:()=>f1,handleDelete:()=>d1,hasListBefore:()=>p7,hasListItemAfter:()=>mO,hasListItemBefore:()=>m7,listItemHasSubList:()=>g7,nextListIsDeeper:()=>y7,nextListIsHigher:()=>v7});var Ia=(t,e)=>{const{$from:n}=e.selection,r=ht(t,e.schema);let o=null,l=n.depth,a=n.pos,u=null;for(;l>0&&u===null;)o=n.node(l),o.type===r?u=l:(l-=1,a-=1);return u===null?null:{$pos:e.doc.resolve(a),depth:u}},vg=(t,e)=>{const n=Ia(t,e);if(!n)return!1;const[,r]=PA(e,t,n.$pos.pos+4);return r},p7=(t,e,n)=>{const{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),l=t.doc.resolve(o).node();return!(!l||!n.includes(l.type.name))},m7=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-2);return!(o.index()===0||((n=o.nodeBefore)==null?void 0:n.type.name)!==t)},g7=(t,e,n)=>{if(!n)return!1;const r=ht(t,e.schema);let o=!1;return n.descendants(l=>{l.type===r&&(o=!0)}),o},f1=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!ji(t.state,e)&&p7(t.state,e,n)){const{$anchor:u}=t.state.selection,f=t.state.doc.resolve(u.before()-1),h=[];f.node().descendants((b,v)=>{b.type.name===e&&h.push({node:b,pos:v})});const p=h.at(-1);if(!p)return!1;const m=t.state.doc.resolve(f.start()+p.pos+1);return t.chain().cut({from:u.start()-1,to:u.end()+1},m.end()).joinForward().run()}if(!ji(t.state,e)||!KA(t.state))return!1;const r=Ia(e,t.state);if(!r)return!1;const l=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=g7(e,t.state,l);return m7(e,t.state)&&!a?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},y7=(t,e)=>{const n=vg(t,e),r=Ia(t,e);return!r||!n?!1:n>r.depth},v7=(t,e)=>{const n=vg(t,e),r=Ia(t,e);return!r||!n?!1:n<r.depth},d1=(t,e)=>{if(!ji(t.state,e)||!qA(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:y7(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():v7(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},mO=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-r.parentOffset-2);return!(o.index()===o.parent.childCount-1||((n=o.nodeAfter)==null?void 0:n.type.name)!==t)},b7=_e.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&d1(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&d1(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&f1(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&f1(t,n,r)&&(e=!0)}),e}}}}),YC=/^(\s*)(\d+)\.\s+(.*)$/,gO=/^\s/;function yO(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n],l=o.match(YC);if(!l)break;const[,a,u,f]=l,h=a.length;let p=f,m=n+1;const b=[o];for(;m<t.length;){const v=t[m];if(v.match(YC))break;if(v.trim()==="")b.push(v),p+=`
196
+ `,m+=1;else if(v.match(gO))b.push(v),p+=`
197
+ ${v.slice(h+2)}`,m+=1;else break}e.push({indent:h,number:parseInt(u,10),content:p.trim(),raw:b.join(`
198
+ `)}),r=m,n=m}return[e,r]}function C7(t,e,n){var r;const o=[];let l=0;for(;l<t.length;){const a=t[l];if(a.indent===e){const u=a.content.split(`
199
+ `),f=((r=u[0])==null?void 0:r.trim())||"",h=[];f&&h.push({type:"paragraph",raw:f,tokens:n.inlineTokens(f)});const p=u.slice(1).join(`
200
+ `).trim();if(p){const v=n.blockTokens(p);h.push(...v)}let m=l+1;const b=[];for(;m<t.length&&t[m].indent>e;)b.push(t[m]),m+=1;if(b.length>0){const v=Math.min(...b.map(x=>x.indent)),C=C7(b,v,n);h.push({type:"list",ordered:!0,start:b[0].number,items:C,raw:b.map(x=>x.raw).join(`
201
+ `)})}o.push({type:"list_item",raw:a.raw,tokens:h}),l=m}else l+=1}return o}function vO(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...e.parseChildren([o]));else if(o.type==="text"&&o.tokens){const l=e.parseChildren([o]);r.push({type:"paragraph",content:l})}else{const l=e.parseChildren([o]);l.length>0&&r.push(...l)}}),{type:"listItem",content:r}})}var bO="listItem",ZC="textStyle",XC=/^(\d+)\.\s$/,x7=Bt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",$e(this.options.HTMLAttributes,n),0]:["ol",$e(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?vO(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
202
+ `):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e?.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const o=t.split(`
203
+ `),[l,a]=yO(o);if(l.length===0)return;const u=C7(l,0,n);return u.length===0?void 0:{type:"list",ordered:!0,start:((r=l[0])==null?void 0:r.number)||1,items:u,raw:o.slice(0,a).join(`
204
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(bO,this.editor.getAttributes(ZC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Us({find:XC,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Us({find:XC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ZC)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),CO=/^\s*(\[([( |x])?\])\s$/,S7=Bt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",$e(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const o=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return og(t,e,o)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),l=document.createElement("label"),a=document.createElement("span"),u=document.createElement("input"),f=document.createElement("div"),h=p=>{var m,b;u.ariaLabel=((b=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:b.call(m,p,u.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};return h(t),l.contentEditable="false",u.type="checkbox",u.addEventListener("mousedown",p=>p.preventDefault()),u.addEventListener("change",p=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){u.checked=!u.checked;return}const{checked:m}=p.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:b})=>{const v=n();if(typeof v!="number")return!1;const C=b.doc.nodeAt(v);return b.setNodeMarkup(v,void 0,{...C?.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,m)||(u.checked=!u.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,m])=>{o.setAttribute(p,m)}),o.dataset.checked=t.attrs.checked,u.checked=t.attrs.checked,l.append(u,a),o.append(l,f),Object.entries(e).forEach(([p,m])=>{o.setAttribute(p,m)}),{dom:o,contentDOM:f,update:p=>p.type!==this.type?!1:(o.dataset.checked=p.attrs.checked,u.checked=p.attrs.checked,h(p),!0)}}},addInputRules(){return[Us({find:CO,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),w7=Bt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",$e(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
205
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=l=>{const a=t1(l,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:u=>({indentLevel:u[1].length,mainContent:u[4],checked:u[3].toLowerCase()==="x"}),createToken:(u,f)=>({type:"taskItem",raw:"",mainContent:u.mainContent,indentLevel:u.indentLevel,checked:u.checked,text:u.mainContent,tokens:n.inlineTokens(u.mainContent),nestedTokens:f}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(l)},o=t1(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});_e.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(d7.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(h7.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(b7.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(x7.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(S7.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(w7.configure(this.options.taskList)),t}});var xO=Bt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",$e(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>!t||!Array.isArray(t.content)?"":e.renderChildren(t.content),addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),SO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,wO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,EO=Fn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",$e(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[To({find:SO,type:this.type})]},addPasteRules(){return[_i({find:wO,type:this.type})]}}),MO=Bt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),TO=Fn.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",$e(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;const l=o[2].trim();return{type:"underline",raw:o[0],text:l,tokens:n.inlineTokens(l)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function AO(t={}){return new Je({view(e){return new kO(e,t)}})}class kO{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let l=a=>{this[o](a)};return e.dom.addEventListener(o,l),{name:o,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,l=o.getBoundingClientRect(),a=l.width/o.offsetWidth,u=l.height/o.offsetHeight;if(n){let m=e.nodeBefore,b=e.nodeAfter;if(m||b){let v=this.editorView.nodeDOM(this.cursorPos-(m?m.nodeSize:0));if(v){let C=v.getBoundingClientRect(),x=m?C.bottom:C.top;m&&b&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let M=this.width/2*u;r={left:C.left,right:C.right,top:x-M,bottom:x+M}}}}if(!r){let m=this.editorView.coordsAtPos(this.cursorPos),b=this.width/2*a;r={left:m.left-b,right:m.left+b,top:m.top,bottom:m.bottom}}let f=this.editorView.dom.offsetParent;this.element||(this.element=f.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let h,p;if(!f||f==document.body&&getComputedStyle(f).position=="static")h=-pageXOffset,p=-pageYOffset;else{let m=f.getBoundingClientRect(),b=m.width/f.offsetWidth,v=m.height/f.offsetHeight;h=m.left-f.scrollLeft*b,p=m.top-f.scrollTop*v}this.element.style.left=(r.left-h)/a+"px",this.element.style.top=(r.top-p)/u+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/u+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,l=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!l){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let u=CS(this.editorView.state.doc,a,this.editorView.dragging.slice);u!=null&&(a=u)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class it extends Ee{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return it.valid(r)?new it(r):Ee.near(r)}content(){return le.empty}eq(e){return e instanceof it&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new it(e.resolve(n.pos))}getBookmark(){return new bg(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!RO(e)||!OO(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&it.valid(e))return e;let o=e.pos,l=null;for(let a=e.depth;;a--){let u=e.node(a);if(n>0?e.indexAfter(a)<u.childCount:e.index(a)>0){l=u.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;o+=n;let f=e.doc.resolve(o);if(it.valid(f))return f}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!de.isSelectable(l)){e=e.doc.resolve(o+l.nodeSize*n),r=!1;continue e}break}l=a,o+=n;let u=e.doc.resolve(o);if(it.valid(u))return u}return null}}}it.prototype.visible=!1;it.findFrom=it.findGapCursorFrom;Ee.jsonID("gapcursor",it);class bg{constructor(e){this.pos=e}map(e){return new bg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return it.valid(n)?new it(n):Ee.near(n)}}function E7(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function RO(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||E7(o.type))return!0;if(o.inlineContent)return!1}}return!0}function OO(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||E7(o.type))return!0;if(o.inlineContent)return!1}}return!0}function NO(){return new Je({props:{decorations:jO,createSelectionBetween(t,e,n){return e.pos==n.pos&&it.valid(n)?new it(n):null},handleClick:LO,handleKeyDown:DO,handleDOMEvents:{beforeinput:zO}}})}const DO=C4({ArrowLeft:bu("horiz",-1),ArrowRight:bu("horiz",1),ArrowUp:bu("vert",-1),ArrowDown:bu("vert",1)});function bu(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,l){let a=r.selection,u=e>0?a.$to:a.$from,f=a.empty;if(a instanceof ve){if(!l.endOfTextblock(n)||u.depth==0)return!1;f=!1,u=r.doc.resolve(e>0?u.after():u.before())}let h=it.findGapCursorFrom(u,e,f);return h?(o&&o(r.tr.setSelection(new it(h))),!0):!1}}function LO(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!it.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&de.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new it(r))),!0)}function zO(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof it))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=ee.empty;for(let a=r.length-1;a>=0;a--)o=ee.from(r[a].createAndFill(null,o));let l=t.state.tr.replace(n.pos,n.pos,new le(o,0,0));return l.setSelection(ve.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}function jO(t){if(!(t.selection instanceof it))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",et.create(t.doc,[Pt.widget(t.selection.head,e,{key:"gapcursor"})])}var Tf=200,Ct=function(){};Ct.prototype.append=function(e){return e.length?(e=Ct.from(e),!this.length&&e||e.length<Tf&&this.leafAppend(e)||this.length<Tf&&e.leafPrepend(this)||this.appendInner(e)):this};Ct.prototype.prepend=function(e){return e.length?Ct.from(e).append(this):this};Ct.prototype.appendInner=function(e){return new _O(this,e)};Ct.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ct.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Ct.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ct.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Ct.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(l,a){return o.push(e(l,a))},n,r),o};Ct.from=function(e){return e instanceof Ct?e:e&&e.length?new M7(e):Ct.empty};var M7=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,l){return o==0&&l==this.length?this:new e(this.values.slice(o,l))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,l,a,u){for(var f=l;f<a;f++)if(o(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(o,l,a,u){for(var f=l-1;f>=a;f--)if(o(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Tf)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Tf)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(Ct);Ct.empty=new M7([]);var _O=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,l,a){var u=this.left.length;if(o<u&&this.left.forEachInner(r,o,Math.min(l,u),a)===!1||l>u&&this.right.forEachInner(r,Math.max(o-u,0),Math.min(this.length,l)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,l,a){var u=this.left.length;if(o>u&&this.right.forEachInvertedInner(r,o-u,Math.max(l,u)-u,a+u)===!1||l<u&&this.left.forEachInvertedInner(r,Math.min(o,u),l,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var l=this.left.length;return o<=l?this.left.slice(r,o):r>=l?this.right.slice(r-l,o-l):this.left.slice(r,l).append(this.right.slice(0,o-l))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(Ct);const IO=500;class Vn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,l;n&&(o=this.remapping(r,this.items.length),l=o.maps.length);let a=e.tr,u,f,h=[],p=[];return this.items.forEach((m,b)=>{if(!m.step){o||(o=this.remapping(r,b+1),l=o.maps.length),l--,p.push(m);return}if(o){p.push(new gi(m.map));let v=m.step.map(o.slice(l)),C;v&&a.maybeStep(v).doc&&(C=a.mapping.maps[a.mapping.maps.length-1],h.push(new gi(C,void 0,void 0,h.length+p.length))),l--,C&&o.appendMap(C,l)}else a.maybeStep(m.step);if(m.selection)return u=o?m.selection.map(o.slice(l)):m.selection,f=new Vn(this.items.slice(0,r).append(p.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:a,selection:u}}addTransform(e,n,r,o){let l=[],a=this.eventCount,u=this.items,f=!o&&u.length?u.get(u.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),b=new gi(e.mapping.maps[p],m,n),v;(v=f&&f.merge(b))&&(b=v,p?l.pop():u=u.slice(0,u.length-1)),l.push(b),n&&(a++,n=void 0),o||(f=b)}let h=a-r.depth;return h>BO&&(u=HO(u,h),a-=h),new Vn(u.append(l),a)}remapping(e,n){let r=new ha;return this.items.forEach((o,l)=>{let a=o.mirrorOffset!=null&&l-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new Vn(this.items.append(e.map(n=>new gi(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),l=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(b=>{b.selection&&u--},o);let f=n;this.items.forEach(b=>{let v=l.getMirror(--f);if(v==null)return;a=Math.min(a,v);let C=l.maps[v];if(b.step){let x=e.steps[v].invert(e.docs[v]),M=b.selection&&b.selection.map(l.slice(f+1,v));M&&u++,r.push(new gi(C,x,M))}else r.push(new gi(C))},o);let h=[];for(let b=n;b<a;b++)h.push(new gi(l.maps[b]));let p=this.items.slice(0,o).append(h).append(r),m=new Vn(p,u);return m.emptyItemCount()>IO&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],l=0;return this.items.forEach((a,u)=>{if(u>=e)o.push(a),a.selection&&l++;else if(a.step){let f=a.step.map(n.slice(r)),h=f&&f.getMap();if(r--,h&&n.appendMap(h,r),f){let p=a.selection&&a.selection.map(n.slice(r));p&&l++;let m=new gi(h.invert(),f,p),b,v=o.length-1;(b=o.length&&o[v].merge(m))?o[v]=b:o.push(m)}}else a.map&&r--},this.items.length,0),new Vn(Ct.from(o.reverse()),l)}}Vn.empty=new Vn(Ct.empty,0);function HO(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let gi=class T7{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new T7(n.getMap().invert(),n,this.selection)}}};class xi{constructor(e,n,r,o,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=l}}const BO=20;function UO(t,e,n,r){let o=n.getMeta(xo),l;if(o)return o.historyState;n.getMeta($O)&&(t=new xi(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(xo))return a.getMeta(xo).redo?new xi(t.done.addTransform(n,void 0,r,Lu(e)),t.undone,QC(n.mapping.maps),t.prevTime,t.prevComposition):new xi(t.done,t.undone.addTransform(n,void 0,r,Lu(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=n.getMeta("composition"),f=t.prevTime==0||!a&&t.prevComposition!=u&&(t.prevTime<(n.time||0)-r.newGroupDelay||!VO(n,t.prevRanges)),h=a?hm(t.prevRanges,n.mapping):QC(n.mapping.maps);return new xi(t.done.addTransform(n,f?e.selection.getBookmark():void 0,r,Lu(e)),Vn.empty,h,n.time,u??t.prevComposition)}else return(l=n.getMeta("rebased"))?new xi(t.done.rebased(n,l),t.undone.rebased(n,l),hm(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new xi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),hm(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function VO(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let l=0;l<e.length;l+=2)r<=e[l+1]&&o>=e[l]&&(n=!0)}),n}function QC(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,l,a)=>e.push(l,a));return e}function hm(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),l=e.map(t[r+1],-1);o<=l&&n.push(o,l)}return n}function PO(t,e,n){let r=Lu(e),o=xo.get(e).spec.config,l=(n?t.undone:t.done).popEvent(e,r);if(!l)return null;let a=l.selection.resolve(l.transform.doc),u=(n?t.done:t.undone).addTransform(l.transform,e.selection.getBookmark(),o,r),f=new xi(n?u:l.remaining,n?l.remaining:u,null,0,-1);return l.transform.setSelection(a).setMeta(xo,{redo:n,historyState:f})}let pm=!1,WC=null;function Lu(t){let e=t.plugins;if(WC!=e){pm=!1,WC=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){pm=!0;break}}return pm}const xo=new pt("history"),$O=new pt("closeHistory");function FO(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Je({key:xo,state:{init(){return new xi(Vn.empty,Vn.empty,null,0,-1)},apply(e,n,r){return UO(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?k7:r=="historyRedo"?R7:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function A7(t,e){return(n,r)=>{let o=xo.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let l=PO(o,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}const k7=A7(!1,!0),R7=A7(!0,!0);_e.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Je({key:new pt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const l=this.storage.characters({node:r.doc});if(l>o){const a=l-o,u=0,f=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const h=r.tr.deleteRange(u,f);return t=!0,h}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),l=this.storage.characters({node:e.doc});if(l<=r||o>r&&l>r&&l<=o)return!0;if(o>r&&l>r&&l>o||!e.getMeta("paste"))return!1;const u=e.selection.$head.pos,f=l-r,h=u-f,p=u;return e.deleteRange(h,p),!(this.storage.characters({node:e.doc})>r)}})]}});var qO=_e.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[AO(this.options)]}});_e.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Je({key:new pt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,l=[];if(!n||!r)return et.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((f,h)=>{if(f.isText)return;if(!(o>=h&&o<=h+f.nodeSize-1))return!1;a+=1});let u=0;return t.descendants((f,h)=>{if(f.isText||!(o>=h&&o<=h+f.nodeSize-1))return!1;if(u+=1,this.options.mode==="deepest"&&a-u>0||this.options.mode==="shallowest"&&u>1)return this.options.mode==="deepest";l.push(Pt.node(h,h+f.nodeSize,{class:this.options.className}))}),et.create(t,l)}}})]}});var KO=_e.create({name:"gapCursor",addProseMirrorPlugins(){return[NO()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Be(ge(t,"allowGapCursor",n)))!=null?e:null}}});_e.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Je({key:new pt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const l=this.editor.isEmpty;return t.descendants((a,u)=>{const f=r>=u&&r<=u+a.nodeSize,h=!a.isLeaf&&Yf(a);if((f||!this.options.showOnlyCurrent)&&h){const p=[this.options.emptyNodeClass];l&&p.push(this.options.emptyEditorClass);const m=Pt.node(u,u+a.nodeSize,{class:p.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:u,hasAnchor:f}):this.options.placeholder});o.push(m)}return this.options.includeChildren}),et.create(t,o)}}})]}});var GO=_e.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Je({key:new pt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||j4(n.selection)||t.view.dragging?null:et.create(n.doc,[Pt.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function JC({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var YO=_e.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new pt(this.name),n=((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new Je({key:e,appendTransaction:(o,l,a)=>{const{doc:u,tr:f,schema:h}=a,p=e.getState(a),m=u.content.size,b=h.nodes[n];if(p)return f.insert(m,b.create())},state:{init:(o,l)=>{const a=l.tr.doc.lastChild;return!JC({node:a,types:r})},apply:(o,l)=>{if(!o.docChanged)return l;const a=o.doc.lastChild;return!JC({node:a,types:r})}}})]}}),ZO=_e.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>k7(t,e),redo:()=>({state:t,dispatch:e})=>R7(t,e)}},addProseMirrorPlugins(){return[FO(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),XO=_e.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return this.options.bold!==!1&&o.push(ER.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(bR.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(d7.configure(this.options.bulletList)),this.options.code!==!1&&o.push(AR.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(OR.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(NR.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(qO.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(KO.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(DR.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(LR.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(ZO.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(n7.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(BR.configure(this.options.italic)),this.options.listItem!==!1&&o.push(h7.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(b7.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(uO.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(x7.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(xO.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(EO.configure(this.options.strike)),this.options.text!==!1&&o.push(MO.configure(this.options.text)),this.options.underline!==!1&&o.push(TO.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(YO.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),QO=_e.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),WO=t=>ot({find:/--$/,replace:t??"—"}),JO=t=>ot({find:/\.\.\.$/,replace:t??"…"}),eN=t=>ot({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:t??"“"}),tN=t=>ot({find:/"$/,replace:t??"”"}),nN=t=>ot({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:t??"‘"}),rN=t=>ot({find:/'$/,replace:t??"’"}),iN=t=>ot({find:/<-$/,replace:t??"←"}),oN=t=>ot({find:/->$/,replace:t??"→"}),sN=t=>ot({find:/\(c\)$/,replace:t??"©"}),lN=t=>ot({find:/\(tm\)$/,replace:t??"™"}),aN=t=>ot({find:/\(sm\)$/,replace:t??"℠"}),cN=t=>ot({find:/\(r\)$/,replace:t??"®"}),uN=t=>ot({find:/(?:^|\s)(1\/2)\s$/,replace:t??"½"}),fN=t=>ot({find:/\+\/-$/,replace:t??"±"}),dN=t=>ot({find:/!=$/,replace:t??"≠"}),hN=t=>ot({find:/<<$/,replace:t??"«"}),pN=t=>ot({find:/>>$/,replace:t??"»"}),mN=t=>ot({find:/\d+\s?([*x])\s?\d+$/,replace:t??"×"}),gN=t=>ot({find:/\^2$/,replace:t??"²"}),yN=t=>ot({find:/\^3$/,replace:t??"³"}),vN=t=>ot({find:/(?:^|\s)(1\/4)\s$/,replace:t??"¼"}),bN=t=>ot({find:/(?:^|\s)(3\/4)\s$/,replace:t??"¾"}),CN=_e.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const t=[];return this.options.emDash!==!1&&t.push(WO(this.options.emDash)),this.options.ellipsis!==!1&&t.push(JO(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&t.push(eN(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&t.push(tN(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&t.push(nN(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&t.push(rN(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&t.push(iN(this.options.leftArrow)),this.options.rightArrow!==!1&&t.push(oN(this.options.rightArrow)),this.options.copyright!==!1&&t.push(sN(this.options.copyright)),this.options.trademark!==!1&&t.push(lN(this.options.trademark)),this.options.servicemark!==!1&&t.push(aN(this.options.servicemark)),this.options.registeredTrademark!==!1&&t.push(cN(this.options.registeredTrademark)),this.options.oneHalf!==!1&&t.push(uN(this.options.oneHalf)),this.options.plusMinus!==!1&&t.push(fN(this.options.plusMinus)),this.options.notEqual!==!1&&t.push(dN(this.options.notEqual)),this.options.laquo!==!1&&t.push(hN(this.options.laquo)),this.options.raquo!==!1&&t.push(pN(this.options.raquo)),this.options.multiplication!==!1&&t.push(mN(this.options.multiplication)),this.options.superscriptTwo!==!1&&t.push(gN(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&t.push(yN(this.options.superscriptThree)),this.options.oneQuarter!==!1&&t.push(vN(this.options.oneQuarter)),this.options.threeQuarters!==!1&&t.push(bN(this.options.threeQuarters)),t}}),xN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,SN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,wN=Fn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",$e(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){const o=/^(==)([^=]+)(==)/.exec(t);if(o){const l=o[2].trim(),a=n.inlineTokens(l);return{type:"highlight",raw:o[0],text:l,tokens:a}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[To({find:xN,type:this.type})]},addPasteRules(){return[_i({find:SN,type:this.type})]}}),EN=Fn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",$e(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),MN=Fn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",$e(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),At=[];for(var mm=0;mm<256;++mm)At.push((mm+256).toString(16).slice(1));function TN(t,e=0){return(At[t[e+0]]+At[t[e+1]]+At[t[e+2]]+At[t[e+3]]+"-"+At[t[e+4]]+At[t[e+5]]+"-"+At[t[e+6]]+At[t[e+7]]+"-"+At[t[e+8]]+At[t[e+9]]+"-"+At[t[e+10]]+At[t[e+11]]+At[t[e+12]]+At[t[e+13]]+At[t[e+14]]+At[t[e+15]]).toLowerCase()}var Cu,AN=new Uint8Array(16);function kN(){if(!Cu&&(Cu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cu(AN)}var RN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const ex={randomUUID:RN};function ON(t,e,n){if(ex.randomUUID&&!t)return ex.randomUUID();t=t||{};var r=t.random||(t.rng||kN)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,TN(r)}function NN(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function DN(t){const e=t.filter((r,o)=>t.indexOf(r)!==o);return NN(e)}var LN=_e.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],generateID:()=>ON(),filterTransaction:null,updateDocument:!0}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:t=>t.getAttribute(`data-${this.options.attributeName}`),renderHTML:t=>t[this.options.attributeName]?{[`data-${this.options.attributeName}`]:t[this.options.attributeName]}:{}}}}]},onCreate(){var t;if(!this.options.updateDocument)return;const e=this.editor.extensionManager.extensions.find(u=>u.name==="collaboration"),n=this.editor.extensionManager.extensions.find(u=>u.name==="collaborationCaret"),o=[e,n].filter(Boolean).find(u=>{var f;return(f=u?.options)==null?void 0:f.provider}),l=(t=o?.options)==null?void 0:t.provider,a=()=>{const{view:u,state:f}=this.editor,{tr:h,doc:p}=f,{types:m,attributeName:b,generateID:v}=this.options;NA(p,x=>m.includes(x.type.name)&&x.attrs[b]===null).forEach(({node:x,pos:M})=>{h.setNodeMarkup(M,void 0,{...x.attrs,[b]:v({node:x,pos:M})})}),h.setMeta("addToHistory",!1),u.dispatch(h),l&&l.off("synced",a)};if(o){if(!l)return a();l.on("synced",a)}else return a()},addProseMirrorPlugins(){if(!this.options.updateDocument)return[];let t=null,e=!1;return[new Je({key:new pt("uniqueID"),appendTransaction:(n,r,o)=>{const l=n.some(x=>x.docChanged)&&!r.doc.eq(o.doc),a=this.options.filterTransaction&&n.some(x=>{var M,T;return!((T=(M=this.options).filterTransaction)!=null&&T.call(M,x))});if(n.find(x=>x.getMeta("y-sync$"))||!l||a)return;const{tr:f}=o,{types:h,attributeName:p,generateID:m}=this.options,b=Q1(r.doc,n),{mapping:v}=b;if(eg(b).forEach(({newRange:x})=>{const M=k4(o.doc,x,k=>h.includes(k.type.name)),T=M.map(({node:k})=>k.attrs[p]).filter(k=>k!==null);M.forEach(({node:k,pos:R},D)=>{var _;const j=(_=f.doc.nodeAt(R))==null?void 0:_.attrs[p];if(j===null){f.setNodeMarkup(R,void 0,{...k.attrs,[p]:m({node:k,pos:R})});return}const L=M[D+1];if(L&&k.content.size===0){if(f.setNodeMarkup(L.pos,void 0,{...L.node.attrs,[p]:j}),T[D+1]=j,L.node.attrs[p])return;const re=m({node:k,pos:R});return f.setNodeMarkup(R,void 0,{...k.attrs,[p]:re}),T[D]=re,f}const B=DN(T),{deleted:Q}=v.invert().mapResult(R);Q&&B.includes(j)&&f.setNodeMarkup(R,void 0,{...k.attrs,[p]:m({node:k,pos:R})})})}),!!f.steps.length)return f.setStoredMarks(o.tr.storedMarks),f},view(n){const r=o=>{var l;t=(l=n.dom.parentElement)!=null&&l.contains(o.target)?n.dom.parentElement:null};return window.addEventListener("dragstart",r),{destroy(){window.removeEventListener("dragstart",r)}}},props:{handleDOMEvents:{drop:(n,r)=>{var o,l;return(t!==n.dom.parentElement||((o=r.dataTransfer)==null?void 0:o.effectAllowed)==="copyMove"||((l=r.dataTransfer)==null?void 0:l.effectAllowed)==="copy")&&(t=null,e=!0),!1},paste:()=>(e=!0,!1)},transformPasted:n=>{if(!e)return n;const{types:r,attributeName:o}=this.options,l=a=>{const u=[];return a.forEach(f=>{if(f.isText){u.push(f);return}if(!r.includes(f.type.name)){u.push(f.copy(l(f.content)));return}const h=f.type.create({...f.attrs,[o]:null},l(f.content),f.marks);u.push(h)}),ee.from(u)};return e=!1,new le(l(n.content),n.openStart,n.openEnd)}}})]}}),zN=LN,jN=20,O7=(t,e=0)=>{const n=[];return!t.children.length||e>jN||Array.from(t.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...O7(r,e+1))}),n},_N=t=>{if(!t.children.length)return;const e=O7(t);e&&e.forEach(n=>{var r,o;const l=n.getAttribute("style"),a=(o=(r=n.parentElement)==null?void 0:r.closest("span"))==null?void 0:o.getAttribute("style");n.setAttribute("style",`${a};${l}`)})},N7=Fn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&_N(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",$e(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(l=>!!l))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),IN=_e.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const l=r[o].split(":");if(l.length>=2){const a=l[0].trim().toLowerCase(),u=l.slice(1).join(":").trim();if(a==="background-color")return u.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),D7=_e.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const l=r[o].split(":");if(l.length>=2){const a=l[0].trim().toLowerCase(),u=l.slice(1).join(":").trim();if(a==="color")return u.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),HN=_e.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),BN=_e.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),UN=_e.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});_e.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(IN.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(D7.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(HN.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(BN.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(UN.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(N7.configure(this.options.textStyle)),t}});function Qf(){return typeof window<"u"}function Fs(t){return Cg(t)?(t.nodeName||"").toLowerCase():"#document"}function nn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function or(t){var e;return(e=(Cg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Cg(t){return Qf()?t instanceof Node||t instanceof nn(t).Node:!1}function Xe(t){return Qf()?t instanceof Element||t instanceof nn(t).Element:!1}function yn(t){return Qf()?t instanceof HTMLElement||t instanceof nn(t).HTMLElement:!1}function h1(t){return!Qf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nn(t).ShadowRoot}const VN=new Set(["inline","contents"]);function Ha(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=_n(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!VN.has(o)}const PN=new Set(["table","td","th"]);function $N(t){return PN.has(Fs(t))}const FN=[":popover-open",":modal"];function Wf(t){return FN.some(e=>{try{return t.matches(e)}catch{return!1}})}const qN=["transform","translate","scale","rotate","perspective"],KN=["transform","translate","scale","rotate","perspective","filter"],GN=["paint","layout","strict","content"];function xg(t){const e=Jf(),n=Xe(t)?_n(t):t;return qN.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||KN.some(r=>(n.willChange||"").includes(r))||GN.some(r=>(n.contain||"").includes(r))}function YN(t){let e=_r(t);for(;yn(e)&&!jr(e);){if(xg(e))return e;if(Wf(e))return null;e=_r(e)}return null}function Jf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ZN=new Set(["html","body","#document"]);function jr(t){return ZN.has(Fs(t))}function _n(t){return nn(t).getComputedStyle(t)}function ed(t){return Xe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _r(t){if(Fs(t)==="html")return t;const e=t.assignedSlot||t.parentNode||h1(t)&&t.host||or(t);return h1(e)?e.host:e}function L7(t){const e=_r(t);return jr(e)?t.ownerDocument?t.ownerDocument.body:t.body:yn(e)&&Ha(e)?e:L7(e)}function Di(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=L7(t),l=o===((r=t.ownerDocument)==null?void 0:r.body),a=nn(o);if(l){const u=p1(a);return e.concat(a,a.visualViewport||[],Ha(o)?o:[],u&&n?Di(u):[])}return e.concat(o,Di(o,[],n))}function p1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const XN=["top","right","bottom","left"],Ii=Math.min,pn=Math.max,Af=Math.round,xu=Math.floor,nr=t=>({x:t,y:t}),QN={left:"right",right:"left",bottom:"top",top:"bottom"},WN={start:"end",end:"start"};function m1(t,e,n){return pn(t,Ii(e,n))}function Ir(t,e){return typeof t=="function"?t(e):t}function Hr(t){return t.split("-")[0]}function qs(t){return t.split("-")[1]}function Sg(t){return t==="x"?"y":"x"}function wg(t){return t==="y"?"height":"width"}const JN=new Set(["top","bottom"]);function Jn(t){return JN.has(Hr(t))?"y":"x"}function Eg(t){return Sg(Jn(t))}function eD(t,e,n){n===void 0&&(n=!1);const r=qs(t),o=Eg(t),l=wg(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(a=kf(a)),[a,kf(a)]}function tD(t){const e=kf(t);return[g1(t),e,g1(e)]}function g1(t){return t.replace(/start|end/g,e=>WN[e])}const tx=["left","right"],nx=["right","left"],nD=["top","bottom"],rD=["bottom","top"];function iD(t,e,n){switch(t){case"top":case"bottom":return n?e?nx:tx:e?tx:nx;case"left":case"right":return e?nD:rD;default:return[]}}function oD(t,e,n,r){const o=qs(t);let l=iD(Hr(t),n==="start",r);return o&&(l=l.map(a=>a+"-"+o),e&&(l=l.concat(l.map(g1)))),l}function kf(t){return t.replace(/left|right|bottom|top/g,e=>QN[e])}function sD(t){return{top:0,right:0,bottom:0,left:0,...t}}function z7(t){return typeof t!="number"?sD(t):{top:t,right:t,bottom:t,left:t}}function Rf(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}/*!
206
+ * tabbable 6.3.0
207
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
208
+ */var lD=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],y1=lD.join(","),j7=typeof Element>"u",wa=j7?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Of=!j7&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},Ea=function(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),l=o===""||o==="true",a=l||n&&e&&Ea(e.parentNode);return a},aD=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},cD=function(e,n,r){if(Ea(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(y1));return n&&wa.call(e,y1)&&o.unshift(e),o=o.filter(r),o},v1=function(e,n,r){for(var o=[],l=Array.from(e);l.length;){var a=l.shift();if(!Ea(a,!1))if(a.tagName==="SLOT"){var u=a.assignedElements(),f=u.length?u:a.children,h=v1(f,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:a,candidates:h})}else{var p=wa.call(a,y1);p&&r.filter(a)&&(n||!e.includes(a))&&o.push(a);var m=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),b=!Ea(m,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(m&&b){var v=v1(m===!0?a.children:m.children,!0,r);r.flatten?o.push.apply(o,v):o.push({scopeParent:a,candidates:v})}else l.unshift.apply(l,a.children)}}return o},_7=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},I7=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||aD(e))&&!_7(e)?0:e.tabIndex},uD=function(e,n){var r=I7(e);return r<0&&n&&!_7(e)?0:r},fD=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},H7=function(e){return e.tagName==="INPUT"},dD=function(e){return H7(e)&&e.type==="hidden"},hD=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},pD=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},mD=function(e){if(!e.name)return!0;var n=e.form||Of(e),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var l=pD(o,e.form);return!l||l===e},gD=function(e){return H7(e)&&e.type==="radio"},yD=function(e){return gD(e)&&!mD(e)},vD=function(e){var n,r=e&&Of(e),o=(n=r)===null||n===void 0?void 0:n.host,l=!1;if(r&&r!==e){var a,u,f;for(l=!!((a=o)!==null&&a!==void 0&&(u=a.ownerDocument)!==null&&u!==void 0&&u.contains(o)||e!=null&&(f=e.ownerDocument)!==null&&f!==void 0&&f.contains(e));!l&&o;){var h,p,m;r=Of(o),o=(h=r)===null||h===void 0?void 0:h.host,l=!!((p=o)!==null&&p!==void 0&&(m=p.ownerDocument)!==null&&m!==void 0&&m.contains(o))}}return l},rx=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},bD=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var l=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}if(getComputedStyle(e).visibility==="hidden")return!0;var a=wa.call(e,"details>summary:first-of-type"),u=a?e.parentElement:e;if(wa.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var f=e;e;){var h=e.parentElement,p=Of(e);if(h&&!h.shadowRoot&&o(h)===!0)return rx(e);e.assignedSlot?e=e.assignedSlot:!h&&p!==e.ownerDocument?e=p.host:e=h}e=f}if(vD(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return rx(e);return!1},CD=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return wa.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},xD=function(e,n){return!(n.disabled||Ea(n)||dD(n)||bD(n,e)||hD(n)||CD(n))},ix=function(e,n){return!(yD(n)||I7(n)<0||!xD(e,n))},SD=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},B7=function(e){var n=[],r=[];return e.forEach(function(o,l){var a=!!o.scopeParent,u=a?o.scopeParent:o,f=uD(u,a),h=a?B7(o.candidates):u;f===0?a?n.push.apply(n,h):n.push(u):r.push({documentOrder:l,tabIndex:f,item:o,isScope:a,content:h})}),r.sort(fD).reduce(function(o,l){return l.isScope?o.push.apply(o,l.content):o.push(l.content),o},[]).concat(n)},U7=function(e,n){n=n||{};var r;return n.getShadowRoot?r=v1([e],n.includeContainer,{filter:ix.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:SD}):r=cD(e,n.includeContainer,ix.bind(null,n)),B7(r)};function wD(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function ED(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function V7(){return/apple/i.test(navigator.vendor)}function MD(){return wD().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function TD(){return ED().includes("jsdom/")}const ox="data-floating-ui-focusable",AD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function b1(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Vs(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&h1(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function As(t){return"composedPath"in t?t.composedPath()[0]:t.target}function gm(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function kD(t){return t.matches("html,body")}function er(t){return t?.ownerDocument||document}function RD(t){return yn(t)&&t.matches(AD)}function OD(t){if(!t||TD())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function ND(t){return t?t.hasAttribute(ox)?t:t.querySelector("["+ox+"]")||t:null}function zu(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var l;return o.parentId===e&&(!n||((l=o.context)==null?void 0:l.open))}).flatMap(o=>[o,...zu(t,o.id,n)])}function DD(t){return"nativeEvent"in t}function C1(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var LD=typeof document<"u",zD=function(){},$n=LD?S.useLayoutEffect:zD;const jD={..._f};function Su(t){const e=S.useRef(t);return $n(()=>{e.current=t}),e}const _D=jD.useInsertionEffect,ID=_D||(t=>t());function Qn(t){const e=S.useRef(()=>{});return ID(()=>{e.current=t}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}const P7=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function $7(t,e){const n=U7(t,P7()),r=n.length;if(r===0)return;const o=b1(er(t)),l=n.indexOf(o),a=l===-1?e===1?0:r-1:l+e;return n[a]}function HD(t){return $7(er(t).body,1)||t}function BD(t){return $7(er(t).body,-1)||t}function ym(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Vs(n,r)}function UD(t){U7(t,P7()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function sx(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function lx(t,e,n){let{reference:r,floating:o}=t;const l=Jn(e),a=Eg(e),u=wg(a),f=Hr(e),h=l==="y",p=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,b=r[u]/2-o[u]/2;let v;switch(f){case"top":v={x:p,y:r.y-o.height};break;case"bottom":v={x:p,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:m};break;case"left":v={x:r.x-o.width,y:m};break;default:v={x:r.x,y:r.y}}switch(qs(e)){case"start":v[a]-=b*(n&&h?-1:1);break;case"end":v[a]+=b*(n&&h?-1:1);break}return v}const VD=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,u=l.filter(Boolean),f=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:m}=lx(h,r,f),b=r,v={},C=0;for(let x=0;x<u.length;x++){const{name:M,fn:T}=u[x],{x:k,y:R,data:D,reset:_}=await T({x:p,y:m,initialPlacement:r,placement:b,strategy:o,middlewareData:v,rects:h,platform:a,elements:{reference:t,floating:e}});p=k??p,m=R??m,v={...v,[M]:{...v[M],...D}},_&&C<=50&&(C++,typeof _=="object"&&(_.placement&&(b=_.placement),_.rects&&(h=_.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):_.rects),{x:p,y:m}=lx(h,b,f)),x=-1)}return{x:p,y:m,placement:b,strategy:o,middlewareData:v}};async function Ma(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:l,rects:a,elements:u,strategy:f}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:b=!1,padding:v=0}=Ir(e,t),C=z7(v),M=u[b?m==="floating"?"reference":"floating":m],T=Rf(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(M)))==null||n?M:M.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:f})),k=m==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),D=await(l.isElement==null?void 0:l.isElement(R))?await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1}:{x:1,y:1},_=Rf(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:R,strategy:f}):k);return{top:(T.top-_.top+C.top)/D.y,bottom:(_.bottom-T.bottom+C.bottom)/D.y,left:(T.left-_.left+C.left)/D.x,right:(_.right-T.right+C.right)/D.x}}const PD=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:l,platform:a,elements:u,middlewareData:f}=e,{element:h,padding:p=0}=Ir(t,e)||{};if(h==null)return{};const m=z7(p),b={x:n,y:r},v=Eg(o),C=wg(v),x=await a.getDimensions(h),M=v==="y",T=M?"top":"left",k=M?"bottom":"right",R=M?"clientHeight":"clientWidth",D=l.reference[C]+l.reference[v]-b[v]-l.floating[C],_=b[v]-l.reference[v],j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let L=j?j[R]:0;(!L||!await(a.isElement==null?void 0:a.isElement(j)))&&(L=u.floating[R]||l.floating[C]);const B=D/2-_/2,Q=L/2-x[C]/2-1,ne=Ii(m[T],Q),re=Ii(m[k],Q),fe=ne,ae=L-x[C]-re,W=L/2-x[C]/2+B,ie=m1(fe,W,ae),I=!f.arrow&&qs(o)!=null&&W!==ie&&l.reference[C]/2-(W<fe?ne:re)-x[C]/2<0,q=I?W<fe?W-fe:W-ae:0;return{[v]:b[v]+q,data:{[v]:ie,centerOffset:W-ie-q,...I&&{alignmentOffset:q}},reset:I}}}),$D=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:l,rects:a,initialPlacement:u,platform:f,elements:h}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:x=!0,...M}=Ir(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const T=Hr(o),k=Jn(u),R=Hr(u)===u,D=await(f.isRTL==null?void 0:f.isRTL(h.floating)),_=b||(R||!x?[kf(u)]:tD(u)),j=C!=="none";!b&&j&&_.push(...oD(u,x,C,D));const L=[u,..._],B=await Ma(e,M),Q=[];let ne=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&Q.push(B[T]),m){const W=eD(o,a,D);Q.push(B[W[0]],B[W[1]])}if(ne=[...ne,{placement:o,overflows:Q}],!Q.every(W=>W<=0)){var re,fe;const W=(((re=l.flip)==null?void 0:re.index)||0)+1,ie=L[W];if(ie&&(!(m==="alignment"?k!==Jn(ie):!1)||ne.every(P=>Jn(P.placement)===k?P.overflows[0]>0:!0)))return{data:{index:W,overflows:ne},reset:{placement:ie}};let I=(fe=ne.filter(q=>q.overflows[0]<=0).sort((q,P)=>q.overflows[1]-P.overflows[1])[0])==null?void 0:fe.placement;if(!I)switch(v){case"bestFit":{var ae;const q=(ae=ne.filter(P=>{if(j){const Y=Jn(P.placement);return Y===k||Y==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(Y=>Y>0).reduce((Y,se)=>Y+se,0)]).sort((P,Y)=>P[1]-Y[1])[0])==null?void 0:ae[0];q&&(I=q);break}case"initialPlacement":I=u;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function ax(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function cx(t){return XN.some(e=>t[e]>=0)}const FD=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=Ir(t,e);switch(r){case"referenceHidden":{const l=await Ma(e,{...o,elementContext:"reference"}),a=ax(l,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:cx(a)}}}case"escaped":{const l=await Ma(e,{...o,altBoundary:!0}),a=ax(l,n.floating);return{data:{escapedOffsets:a,escaped:cx(a)}}}default:return{}}}}},F7=new Set(["left","top"]);async function qD(t,e){const{placement:n,platform:r,elements:o}=t,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Hr(n),u=qs(n),f=Jn(n)==="y",h=F7.has(a)?-1:1,p=l&&f?-1:1,m=Ir(e,t);let{mainAxis:b,crossAxis:v,alignmentAxis:C}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof C=="number"&&(v=u==="end"?C*-1:C),f?{x:v*p,y:b*h}:{x:b*h,y:v*p}}const KD=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:l,placement:a,middlewareData:u}=e,f=await qD(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:a}}}}},GD=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:l=!0,crossAxis:a=!1,limiter:u={fn:M=>{let{x:T,y:k}=M;return{x:T,y:k}}},...f}=Ir(t,e),h={x:n,y:r},p=await Ma(e,f),m=Jn(Hr(o)),b=Sg(m);let v=h[b],C=h[m];if(l){const M=b==="y"?"top":"left",T=b==="y"?"bottom":"right",k=v+p[M],R=v-p[T];v=m1(k,v,R)}if(a){const M=m==="y"?"top":"left",T=m==="y"?"bottom":"right",k=C+p[M],R=C-p[T];C=m1(k,C,R)}const x=u.fn({...e,[b]:v,[m]:C});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[b]:l,[m]:a}}}}}},YD=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:l,middlewareData:a}=e,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=Ir(t,e),p={x:n,y:r},m=Jn(o),b=Sg(m);let v=p[b],C=p[m];const x=Ir(u,e),M=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const R=b==="y"?"height":"width",D=l.reference[b]-l.floating[R]+M.mainAxis,_=l.reference[b]+l.reference[R]-M.mainAxis;v<D?v=D:v>_&&(v=_)}if(h){var T,k;const R=b==="y"?"width":"height",D=F7.has(Hr(o)),_=l.reference[m]-l.floating[R]+(D&&((T=a.offset)==null?void 0:T[m])||0)+(D?0:M.crossAxis),j=l.reference[m]+l.reference[R]+(D?0:((k=a.offset)==null?void 0:k[m])||0)-(D?M.crossAxis:0);C<_?C=_:C>j&&(C=j)}return{[b]:v,[m]:C}}}},ZD=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:l,platform:a,elements:u}=e,{apply:f=()=>{},...h}=Ir(t,e),p=await Ma(e,h),m=Hr(o),b=qs(o),v=Jn(o)==="y",{width:C,height:x}=l.floating;let M,T;m==="top"||m==="bottom"?(M=m,T=b===(await(a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(T=m,M=b==="end"?"top":"bottom");const k=x-p.top-p.bottom,R=C-p.left-p.right,D=Ii(x-p[M],k),_=Ii(C-p[T],R),j=!e.middlewareData.shift;let L=D,B=_;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=R),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(L=k),j&&!b){const ne=pn(p.left,0),re=pn(p.right,0),fe=pn(p.top,0),ae=pn(p.bottom,0);v?B=C-2*(ne!==0||re!==0?ne+re:pn(p.left,p.right)):L=x-2*(fe!==0||ae!==0?fe+ae:pn(p.top,p.bottom))}await f({...e,availableWidth:B,availableHeight:L});const Q=await a.getDimensions(u.floating);return C!==Q.width||x!==Q.height?{reset:{rects:!0}}:{}}}};function q7(t){const e=_n(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=yn(t),l=o?t.offsetWidth:n,a=o?t.offsetHeight:r,u=Af(n)!==l||Af(r)!==a;return u&&(n=l,r=a),{width:n,height:r,$:u}}function Mg(t){return Xe(t)?t:t.contextElement}function Ds(t){const e=Mg(t);if(!yn(e))return nr(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:l}=q7(e);let a=(l?Af(n.width):n.width)/r,u=(l?Af(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const XD=nr(0);function K7(t){const e=nn(t);return!Jf()||!e.visualViewport?XD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function QD(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==nn(t)?!1:e}function Ao(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),l=Mg(t);let a=nr(1);e&&(r?Xe(r)&&(a=Ds(r)):a=Ds(t));const u=QD(l,n,r)?K7(l):nr(0);let f=(o.left+u.x)/a.x,h=(o.top+u.y)/a.y,p=o.width/a.x,m=o.height/a.y;if(l){const b=nn(l),v=r&&Xe(r)?nn(r):r;let C=b,x=p1(C);for(;x&&r&&v!==C;){const M=Ds(x),T=x.getBoundingClientRect(),k=_n(x),R=T.left+(x.clientLeft+parseFloat(k.paddingLeft))*M.x,D=T.top+(x.clientTop+parseFloat(k.paddingTop))*M.y;f*=M.x,h*=M.y,p*=M.x,m*=M.y,f+=R,h+=D,C=nn(x),x=p1(C)}}return Rf({width:p,height:m,x:f,y:h})}function td(t,e){const n=ed(t).scrollLeft;return e?e.left+n:Ao(or(t)).left+n}function G7(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-td(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function WD(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const l=o==="fixed",a=or(r),u=e?Wf(e.floating):!1;if(r===a||u&&l)return n;let f={scrollLeft:0,scrollTop:0},h=nr(1);const p=nr(0),m=yn(r);if((m||!m&&!l)&&((Fs(r)!=="body"||Ha(a))&&(f=ed(r)),yn(r))){const v=Ao(r);h=Ds(r),p.x=v.x+r.clientLeft,p.y=v.y+r.clientTop}const b=a&&!m&&!l?G7(a,f):nr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+b.x,y:n.y*h.y-f.scrollTop*h.y+p.y+b.y}}function JD(t){return Array.from(t.getClientRects())}function eL(t){const e=or(t),n=ed(t),r=t.ownerDocument.body,o=pn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=pn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+td(t);const u=-n.scrollTop;return _n(r).direction==="rtl"&&(a+=pn(e.clientWidth,r.clientWidth)-o),{width:o,height:l,x:a,y:u}}const ux=25;function tL(t,e){const n=nn(t),r=or(t),o=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,u=0,f=0;if(o){l=o.width,a=o.height;const p=Jf();(!p||p&&e==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}const h=td(r);if(h<=0){const p=r.ownerDocument,m=p.body,b=getComputedStyle(m),v=p.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,C=Math.abs(r.clientWidth-m.clientWidth-v);C<=ux&&(l-=C)}else h<=ux&&(l+=h);return{width:l,height:a,x:u,y:f}}const nL=new Set(["absolute","fixed"]);function rL(t,e){const n=Ao(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,l=yn(t)?Ds(t):nr(1),a=t.clientWidth*l.x,u=t.clientHeight*l.y,f=o*l.x,h=r*l.y;return{width:a,height:u,x:f,y:h}}function fx(t,e,n){let r;if(e==="viewport")r=tL(t,n);else if(e==="document")r=eL(or(t));else if(Xe(e))r=rL(e,n);else{const o=K7(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Rf(r)}function Y7(t,e){const n=_r(t);return n===e||!Xe(n)||jr(n)?!1:_n(n).position==="fixed"||Y7(n,e)}function iL(t,e){const n=e.get(t);if(n)return n;let r=Di(t,[],!1).filter(u=>Xe(u)&&Fs(u)!=="body"),o=null;const l=_n(t).position==="fixed";let a=l?_r(t):t;for(;Xe(a)&&!jr(a);){const u=_n(a),f=xg(a);!f&&u.position==="fixed"&&(o=null),(l?!f&&!o:!f&&u.position==="static"&&!!o&&nL.has(o.position)||Ha(a)&&!f&&Y7(t,a))?r=r.filter(p=>p!==a):o=u,a=_r(a)}return e.set(t,r),r}function oL(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const a=[...n==="clippingAncestors"?Wf(e)?[]:iL(e,this._c):[].concat(n),r],u=a[0],f=a.reduce((h,p)=>{const m=fx(e,p,o);return h.top=pn(m.top,h.top),h.right=Ii(m.right,h.right),h.bottom=Ii(m.bottom,h.bottom),h.left=pn(m.left,h.left),h},fx(e,u,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function sL(t){const{width:e,height:n}=q7(t);return{width:e,height:n}}function lL(t,e,n){const r=yn(e),o=or(e),l=n==="fixed",a=Ao(t,!0,l,e);let u={scrollLeft:0,scrollTop:0};const f=nr(0);function h(){f.x=td(o)}if(r||!r&&!l)if((Fs(e)!=="body"||Ha(o))&&(u=ed(e)),r){const v=Ao(e,!0,l,e);f.x=v.x+e.clientLeft,f.y=v.y+e.clientTop}else o&&h();l&&!r&&o&&h();const p=o&&!r&&!l?G7(o,u):nr(0),m=a.left+u.scrollLeft-f.x-p.x,b=a.top+u.scrollTop-f.y-p.y;return{x:m,y:b,width:a.width,height:a.height}}function vm(t){return _n(t).position==="static"}function dx(t,e){if(!yn(t)||_n(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return or(t)===n&&(n=n.ownerDocument.body),n}function Z7(t,e){const n=nn(t);if(Wf(t))return n;if(!yn(t)){let o=_r(t);for(;o&&!jr(o);){if(Xe(o)&&!vm(o))return o;o=_r(o)}return n}let r=dx(t,e);for(;r&&$N(r)&&vm(r);)r=dx(r,e);return r&&jr(r)&&vm(r)&&!xg(r)?n:r||YN(t)||n}const aL=async function(t){const e=this.getOffsetParent||Z7,n=this.getDimensions,r=await n(t.floating);return{reference:lL(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cL(t){return _n(t).direction==="rtl"}const uL={convertOffsetParentRelativeRectToViewportRelativeRect:WD,getDocumentElement:or,getClippingRect:oL,getOffsetParent:Z7,getElementRects:aL,getClientRects:JD,getDimensions:sL,getScale:Ds,isElement:Xe,isRTL:cL};function X7(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function fL(t,e){let n=null,r;const o=or(t);function l(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function a(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),l();const h=t.getBoundingClientRect(),{left:p,top:m,width:b,height:v}=h;if(u||e(),!b||!v)return;const C=xu(m),x=xu(o.clientWidth-(p+b)),M=xu(o.clientHeight-(m+v)),T=xu(p),R={rootMargin:-C+"px "+-x+"px "+-M+"px "+-T+"px",threshold:pn(0,Ii(1,f))||1};let D=!0;function _(j){const L=j[0].intersectionRatio;if(L!==f){if(!D)return a();L?a(!1,L):r=setTimeout(()=>{a(!1,1e-7)},1e3)}L===1&&!X7(h,t.getBoundingClientRect())&&a(),D=!1}try{n=new IntersectionObserver(_,{...R,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,R)}n.observe(t)}return a(!0),l}function Q7(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=Mg(t),p=o||l?[...h?Di(h):[],...Di(e)]:[];p.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),l&&T.addEventListener("resize",n)});const m=h&&u?fL(h,n):null;let b=-1,v=null;a&&(v=new ResizeObserver(T=>{let[k]=T;k&&k.target===h&&v&&(v.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=v)==null||R.observe(e)})),n()}),h&&!f&&v.observe(h),v.observe(e));let C,x=f?Ao(t):null;f&&M();function M(){const T=Ao(t);x&&!X7(x,T)&&n(),x=T,C=requestAnimationFrame(M)}return n(),()=>{var T;p.forEach(k=>{o&&k.removeEventListener("scroll",n),l&&k.removeEventListener("resize",n)}),m?.(),(T=v)==null||T.disconnect(),v=null,f&&cancelAnimationFrame(C)}}const dL=KD,hL=GD,pL=$D,mL=ZD,gL=FD,hx=PD,yL=YD,vL=(t,e,n)=>{const r=new Map,o={platform:uL,...n},l={...o.platform,_c:r};return VD(t,e,{...o,platform:l})};var bL=typeof document<"u",CL=function(){},ju=bL?S.useLayoutEffect:CL;function Nf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Nf(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&t.$$typeof)&&!Nf(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function W7(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function px(t,e){const n=W7(t);return Math.round(e*n)/n}function bm(t){const e=S.useRef(t);return ju(()=>{e.current=t}),e}function J7(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:a}={},transform:u=!0,whileElementsMounted:f,open:h}=t,[p,m]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[b,v]=S.useState(r);Nf(b,r)||v(r);const[C,x]=S.useState(null),[M,T]=S.useState(null),k=S.useCallback(P=>{P!==j.current&&(j.current=P,x(P))},[]),R=S.useCallback(P=>{P!==L.current&&(L.current=P,T(P))},[]),D=l||C,_=a||M,j=S.useRef(null),L=S.useRef(null),B=S.useRef(p),Q=f!=null,ne=bm(f),re=bm(o),fe=bm(h),ae=S.useCallback(()=>{if(!j.current||!L.current)return;const P={placement:e,strategy:n,middleware:b};re.current&&(P.platform=re.current),vL(j.current,L.current,P).then(Y=>{const se={...Y,isPositioned:fe.current!==!1};W.current&&!Nf(B.current,se)&&(B.current=se,Da.flushSync(()=>{m(se)}))})},[b,e,n,re,fe]);ju(()=>{h===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,m(P=>({...P,isPositioned:!1})))},[h]);const W=S.useRef(!1);ju(()=>(W.current=!0,()=>{W.current=!1}),[]),ju(()=>{if(D&&(j.current=D),_&&(L.current=_),D&&_){if(ne.current)return ne.current(D,_,ae);ae()}},[D,_,ae,ne,Q]);const ie=S.useMemo(()=>({reference:j,floating:L,setReference:k,setFloating:R}),[k,R]),I=S.useMemo(()=>({reference:D,floating:_}),[D,_]),q=S.useMemo(()=>{const P={position:n,left:0,top:0};if(!I.floating)return P;const Y=px(I.floating,p.x),se=px(I.floating,p.y);return u?{...P,transform:"translate("+Y+"px, "+se+"px)",...W7(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:se}},[n,u,I.floating,p.x,p.y]);return S.useMemo(()=>({...p,update:ae,refs:ie,elements:I,floatingStyles:q}),[p,ae,ie,I,q])}const xL=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?hx({element:r.current,padding:o}).fn(n):{}:r?hx({element:r,padding:o}).fn(n):{}}}},e3=(t,e)=>({...dL(t),options:[t,e]}),t3=(t,e)=>({...hL(t),options:[t,e]}),SL=(t,e)=>({...yL(t),options:[t,e]}),n3=(t,e)=>({...pL(t),options:[t,e]}),wL=(t,e)=>({...mL(t),options:[t,e]}),EL=(t,e)=>({...gL(t),options:[t,e]}),ML=(t,e)=>({...xL(t),options:[t,e]});function r3(t){const e=S.useRef(void 0),n=S.useCallback(r=>{const o=t.map(l=>{if(l!=null){if(typeof l=="function"){const a=l,u=a(r);return typeof u=="function"?u:()=>{a(null)}}return l.current=r,()=>{l.current=null}}});return()=>{o.forEach(l=>l?.())}},t);return S.useMemo(()=>t.every(r=>r==null)?null:r=>{e.current&&(e.current(),e.current=void 0),r!=null&&(e.current=n(r))},t)}const TL="data-floating-ui-focusable",mx="active",gx="selected",AL={..._f};let yx=!1,kL=0;const vx=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+kL++;function RL(){const[t,e]=S.useState(()=>yx?vx():void 0);return $n(()=>{t==null&&e(vx())},[]),S.useEffect(()=>{yx=!0},[]),t}const OL=AL.useId,Tg=OL||RL;function NL(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const DL=S.createContext(null),LL=S.createContext(null),Ag=()=>{var t;return((t=S.useContext(DL))==null?void 0:t.id)||null},kg=()=>S.useContext(LL);function Ba(t){return"data-floating-ui-"+t}function Rn(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const bx=Ba("safe-polygon");function Cm(t,e,n){if(n&&!C1(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const r=t();return typeof r=="number"?r:r?.[e]}return t?.[e]}function xm(t){return typeof t=="function"?t():t}function zL(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:o,events:l,elements:a}=t,{enabled:u=!0,delay:f=0,handleClose:h=null,mouseOnly:p=!1,restMs:m=0,move:b=!0}=e,v=kg(),C=Ag(),x=Su(h),M=Su(f),T=Su(n),k=Su(m),R=S.useRef(),D=S.useRef(-1),_=S.useRef(),j=S.useRef(-1),L=S.useRef(!0),B=S.useRef(!1),Q=S.useRef(()=>{}),ne=S.useRef(!1),re=Qn(()=>{var q;const P=(q=o.current.openEvent)==null?void 0:q.type;return P?.includes("mouse")&&P!=="mousedown"});S.useEffect(()=>{if(!u)return;function q(P){let{open:Y}=P;Y||(Rn(D),Rn(j),L.current=!0,ne.current=!1)}return l.on("openchange",q),()=>{l.off("openchange",q)}},[u,l]),S.useEffect(()=>{if(!u||!x.current||!n)return;function q(Y){re()&&r(!1,Y,"hover")}const P=er(a.floating).documentElement;return P.addEventListener("mouseleave",q),()=>{P.removeEventListener("mouseleave",q)}},[a.floating,n,r,u,x,re]);const fe=S.useCallback(function(q,P,Y){P===void 0&&(P=!0),Y===void 0&&(Y="hover");const se=Cm(M.current,"close",R.current);se&&!_.current?(Rn(D),D.current=window.setTimeout(()=>r(!1,q,Y),se)):P&&(Rn(D),r(!1,q,Y))},[M,r]),ae=Qn(()=>{Q.current(),_.current=void 0}),W=Qn(()=>{if(B.current){const q=er(a.floating).body;q.style.pointerEvents="",q.removeAttribute(bx),B.current=!1}}),ie=Qn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);S.useEffect(()=>{if(!u)return;function q($){if(Rn(D),L.current=!1,p&&!C1(R.current)||xm(k.current)>0&&!Cm(M.current,"open"))return;const J=Cm(M.current,"open",R.current);J?D.current=window.setTimeout(()=>{T.current||r(!0,$,"hover")},J):n||r(!0,$,"hover")}function P($){if(ie()){W();return}Q.current();const J=er(a.floating);if(Rn(j),ne.current=!1,x.current&&o.current.floatingContext){n||Rn(D),_.current=x.current({...o.current.floatingContext,tree:v,x:$.clientX,y:$.clientY,onClose(){W(),ae(),ie()||fe($,!0,"safe-polygon")}});const ce=_.current;J.addEventListener("mousemove",ce),Q.current=()=>{J.removeEventListener("mousemove",ce)};return}(R.current==="touch"?!Vs(a.floating,$.relatedTarget):!0)&&fe($)}function Y($){ie()||o.current.floatingContext&&(x.current==null||x.current({...o.current.floatingContext,tree:v,x:$.clientX,y:$.clientY,onClose(){W(),ae(),ie()||fe($)}})($))}function se(){Rn(D)}function N($){ie()||fe($,!1)}if(Xe(a.domReference)){const $=a.domReference,J=a.floating;return n&&$.addEventListener("mouseleave",Y),b&&$.addEventListener("mousemove",q,{once:!0}),$.addEventListener("mouseenter",q),$.addEventListener("mouseleave",P),J&&(J.addEventListener("mouseleave",Y),J.addEventListener("mouseenter",se),J.addEventListener("mouseleave",N)),()=>{n&&$.removeEventListener("mouseleave",Y),b&&$.removeEventListener("mousemove",q),$.removeEventListener("mouseenter",q),$.removeEventListener("mouseleave",P),J&&(J.removeEventListener("mouseleave",Y),J.removeEventListener("mouseenter",se),J.removeEventListener("mouseleave",N))}}},[a,u,t,p,b,fe,ae,W,r,n,T,v,M,x,o,ie,k]),$n(()=>{var q;if(u&&n&&(q=x.current)!=null&&(q=q.__options)!=null&&q.blockPointerEvents&&re()){B.current=!0;const Y=a.floating;if(Xe(a.domReference)&&Y){var P;const se=er(a.floating).body;se.setAttribute(bx,"");const N=a.domReference,$=v==null||(P=v.nodesRef.current.find(J=>J.id===C))==null||(P=P.context)==null?void 0:P.elements.floating;return $&&($.style.pointerEvents=""),se.style.pointerEvents="none",N.style.pointerEvents="auto",Y.style.pointerEvents="auto",()=>{se.style.pointerEvents="",N.style.pointerEvents="",Y.style.pointerEvents=""}}}},[u,n,C,a,v,x,re]),$n(()=>{n||(R.current=void 0,ne.current=!1,ae(),W())},[n,ae,W]),S.useEffect(()=>()=>{ae(),Rn(D),Rn(j),W()},[u,a.domReference,ae,W]);const I=S.useMemo(()=>{function q(P){R.current=P.pointerType}return{onPointerDown:q,onPointerEnter:q,onMouseMove(P){const{nativeEvent:Y}=P;function se(){!L.current&&!T.current&&r(!0,Y,"hover")}p&&!C1(R.current)||n||xm(k.current)===0||ne.current&&P.movementX**2+P.movementY**2<2||(Rn(j),R.current==="touch"?se():(ne.current=!0,j.current=window.setTimeout(se,xm(k.current))))}}},[p,r,n,T,k]);return S.useMemo(()=>u?{reference:I}:{},[u,I])}const Cx=()=>{},jL=S.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Cx,setState:Cx,isInstantPhase:!1});function _L(t){const{children:e,delay:n,timeoutMs:r=0}=t,[o,l]=S.useReducer((f,h)=>({...f,...h}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),a=S.useRef(null),u=S.useCallback(f=>{l({currentId:f})},[]);return $n(()=>{o.currentId?a.current===null?a.current=o.currentId:o.isInstantPhase||l({isInstantPhase:!0}):(o.isInstantPhase&&l({isInstantPhase:!1}),a.current=null)},[o.currentId,o.isInstantPhase]),w.jsx(jL.Provider,{value:S.useMemo(()=>({...o,setState:l,setCurrentId:u}),[o,u]),children:e})}const i3={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},xx=S.forwardRef(function(e,n){const[r,o]=S.useState();$n(()=>{V7()&&o("button")},[]);const l={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ba("focus-guard")]:"",style:i3};return w.jsx("span",{...e,...l})}),o3=S.createContext(null),Sx=Ba("portal");function IL(t){t===void 0&&(t={});const{id:e,root:n}=t,r=Tg(),o=BL(),[l,a]=S.useState(null),u=S.useRef(null);return $n(()=>()=>{l?.remove(),queueMicrotask(()=>{u.current=null})},[l]),$n(()=>{if(!r||u.current)return;const f=e?document.getElementById(e):null;if(!f)return;const h=document.createElement("div");h.id=r,h.setAttribute(Sx,""),f.appendChild(h),u.current=h,a(h)},[e,r]),$n(()=>{if(n===null||!r||u.current)return;let f=n||o?.portalNode;f&&!Cg(f)&&(f=f.current),f=f||document.body;let h=null;e&&(h=document.createElement("div"),h.id=e,f.appendChild(h));const p=document.createElement("div");p.id=r,p.setAttribute(Sx,""),f=h||f,f.appendChild(p),u.current=p,a(p)},[e,n,r,o]),l}function HL(t){const{children:e,id:n,root:r,preserveTabOrder:o=!0}=t,l=IL({id:n,root:r}),[a,u]=S.useState(null),f=S.useRef(null),h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),b=a?.modal,v=a?.open,C=!!a&&!a.modal&&a.open&&o&&!!(r||l);return S.useEffect(()=>{if(!l||!o||b)return;function x(M){l&&ym(M)&&(M.type==="focusin"?sx:UD)(l)}return l.addEventListener("focusin",x,!0),l.addEventListener("focusout",x,!0),()=>{l.removeEventListener("focusin",x,!0),l.removeEventListener("focusout",x,!0)}},[l,o,b]),S.useEffect(()=>{l&&(v||sx(l))},[v,l]),w.jsxs(o3.Provider,{value:S.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:f,afterOutsideRef:h,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:u}),[o,l]),children:[C&&l&&w.jsx(xx,{"data-type":"outside",ref:f,onFocus:x=>{if(ym(x,l)){var M;(M=p.current)==null||M.focus()}else{const T=a?a.domReference:null,k=BD(T);k?.focus()}}}),C&&l&&w.jsx("span",{"aria-owns":l.id,style:i3}),l&&Da.createPortal(e,l),C&&l&&w.jsx(xx,{"data-type":"outside",ref:h,onFocus:x=>{if(ym(x,l)){var M;(M=m.current)==null||M.focus()}else{const T=a?a.domReference:null,k=HD(T);k?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,x.nativeEvent,"focus-out")}}})]})}const BL=()=>S.useContext(o3),UL={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},VL={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},wx=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function PL(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:l}=t,{enabled:a=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:b=!1,bubbles:v,capture:C}=e,x=kg(),M=Qn(typeof f=="function"?f:()=>!1),T=typeof f=="function"?M:f,k=S.useRef(!1),{escapeKey:R,outsidePress:D}=wx(v),{escapeKey:_,outsidePress:j}=wx(C),L=S.useRef(!1),B=Qn(W=>{var ie;if(!n||!a||!u||W.key!=="Escape"||L.current)return;const I=(ie=l.current.floatingContext)==null?void 0:ie.nodeId,q=x?zu(x.nodesRef.current,I):[];if(!R&&(W.stopPropagation(),q.length>0)){let P=!0;if(q.forEach(Y=>{var se;if((se=Y.context)!=null&&se.open&&!Y.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,DD(W)?W.nativeEvent:W,"escape-key")}),Q=Qn(W=>{var ie;const I=()=>{var q;B(W),(q=As(W))==null||q.removeEventListener("keydown",I)};(ie=As(W))==null||ie.addEventListener("keydown",I)}),ne=Qn(W=>{var ie;const I=l.current.insideReactTree;l.current.insideReactTree=!1;const q=k.current;if(k.current=!1,h==="click"&&q||I||typeof T=="function"&&!T(W))return;const P=As(W),Y="["+Ba("inert")+"]",se=er(o.floating).querySelectorAll(Y);let N=Xe(P)?P:null;for(;N&&!jr(N);){const ce=_r(N);if(jr(ce)||!Xe(ce))break;N=ce}if(se.length&&Xe(P)&&!kD(P)&&!Vs(P,o.floating)&&Array.from(se).every(ce=>!Vs(N,ce)))return;if(yn(P)&&ae){const ce=jr(P),me=_n(P),pe=/auto|scroll/,xe=ce||pe.test(me.overflowX),De=ce||pe.test(me.overflowY),Ut=xe&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,In=De&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,$i=me.direction==="rtl",sr=In&&($i?W.offsetX<=P.offsetWidth-P.clientWidth:W.offsetX>P.clientWidth),lr=Ut&&W.offsetY>P.clientHeight;if(sr||lr)return}const $=(ie=l.current.floatingContext)==null?void 0:ie.nodeId,J=x&&zu(x.nodesRef.current,$).some(ce=>{var me;return gm(W,(me=ce.context)==null?void 0:me.elements.floating)});if(gm(W,o.floating)||gm(W,o.domReference)||J)return;const oe=x?zu(x.nodesRef.current,$):[];if(oe.length>0){let ce=!0;if(oe.forEach(me=>{var pe;if((pe=me.context)!=null&&pe.open&&!me.context.dataRef.current.__outsidePressBubbles){ce=!1;return}}),!ce)return}r(!1,W,"outside-press")}),re=Qn(W=>{var ie;const I=()=>{var q;ne(W),(q=As(W))==null||q.removeEventListener(h,I)};(ie=As(W))==null||ie.addEventListener(h,I)});S.useEffect(()=>{if(!n||!a)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=D;let W=-1;function ie(se){r(!1,se,"ancestor-scroll")}function I(){window.clearTimeout(W),L.current=!0}function q(){W=window.setTimeout(()=>{L.current=!1},Jf()?5:0)}const P=er(o.floating);u&&(P.addEventListener("keydown",_?Q:B,_),P.addEventListener("compositionstart",I),P.addEventListener("compositionend",q)),T&&P.addEventListener(h,j?re:ne,j);let Y=[];return b&&(Xe(o.domReference)&&(Y=Di(o.domReference)),Xe(o.floating)&&(Y=Y.concat(Di(o.floating))),!Xe(o.reference)&&o.reference&&o.reference.contextElement&&(Y=Y.concat(Di(o.reference.contextElement)))),Y=Y.filter(se=>{var N;return se!==((N=P.defaultView)==null?void 0:N.visualViewport)}),Y.forEach(se=>{se.addEventListener("scroll",ie,{passive:!0})}),()=>{u&&(P.removeEventListener("keydown",_?Q:B,_),P.removeEventListener("compositionstart",I),P.removeEventListener("compositionend",q)),T&&P.removeEventListener(h,j?re:ne,j),Y.forEach(se=>{se.removeEventListener("scroll",ie)}),window.clearTimeout(W)}},[l,o,u,T,h,n,r,b,a,R,D,B,_,Q,ne,j,re]),S.useEffect(()=>{l.current.insideReactTree=!1},[l,T,h]);const fe=S.useMemo(()=>({onKeyDown:B,...p&&{[UL[m]]:W=>{r(!1,W.nativeEvent,"reference-press")},...m!=="click"&&{onClick(W){r(!1,W.nativeEvent,"reference-press")}}}}),[B,r,p,m]),ae=S.useMemo(()=>({onKeyDown:B,onMouseDown(){k.current=!0},onMouseUp(){k.current=!0},[VL[h]]:()=>{l.current.insideReactTree=!0}}),[B,h,l]);return S.useMemo(()=>a?{reference:fe,floating:ae}:{},[a,fe,ae])}function $L(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=Tg(),l=S.useRef({}),[a]=S.useState(()=>NL()),u=Ag()!=null,[f,h]=S.useState(r.reference),p=Qn((v,C,x)=>{l.current.openEvent=v?C:void 0,a.emit("openchange",{open:v,event:C,reason:x,nested:u}),n?.(v,C,x)}),m=S.useMemo(()=>({setPositionReference:h}),[]),b=S.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return S.useMemo(()=>({dataRef:l,open:e,onOpenChange:p,elements:b,events:a,floatingId:o,refs:m}),[e,p,b,a,o,m])}function FL(t){t===void 0&&(t={});const{nodeId:e}=t,n=$L({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[l,a]=S.useState(null),[u,f]=S.useState(null),p=o?.domReference||l,m=S.useRef(null),b=kg();$n(()=>{p&&(m.current=p)},[p]);const v=J7({...t,elements:{...o,...u&&{reference:u}}}),C=S.useCallback(R=>{const D=Xe(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;f(D),v.refs.setReference(D)},[v.refs]),x=S.useCallback(R=>{(Xe(R)||R===null)&&(m.current=R,a(R)),(Xe(v.refs.reference.current)||v.refs.reference.current===null||R!==null&&!Xe(R))&&v.refs.setReference(R)},[v.refs]),M=S.useMemo(()=>({...v.refs,setReference:x,setPositionReference:C,domReference:m}),[v.refs,x,C]),T=S.useMemo(()=>({...v.elements,domReference:p}),[v.elements,p]),k=S.useMemo(()=>({...v,...r,refs:M,elements:T,nodeId:e}),[v,M,T,e,r]);return $n(()=>{r.dataRef.current.floatingContext=k;const R=b?.nodesRef.current.find(D=>D.id===e);R&&(R.context=k)}),S.useMemo(()=>({...v,context:k,refs:M,elements:T}),[v,M,T,k])}function Sm(){return MD()&&V7()}function qL(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,events:o,dataRef:l,elements:a}=t,{enabled:u=!0,visibleOnly:f=!0}=e,h=S.useRef(!1),p=S.useRef(-1),m=S.useRef(!0);S.useEffect(()=>{if(!u)return;const v=nn(a.domReference);function C(){!n&&yn(a.domReference)&&a.domReference===b1(er(a.domReference))&&(h.current=!0)}function x(){m.current=!0}function M(){m.current=!1}return v.addEventListener("blur",C),Sm()&&(v.addEventListener("keydown",x,!0),v.addEventListener("pointerdown",M,!0)),()=>{v.removeEventListener("blur",C),Sm()&&(v.removeEventListener("keydown",x,!0),v.removeEventListener("pointerdown",M,!0))}},[a.domReference,n,u]),S.useEffect(()=>{if(!u)return;function v(C){let{reason:x}=C;(x==="reference-press"||x==="escape-key")&&(h.current=!0)}return o.on("openchange",v),()=>{o.off("openchange",v)}},[o,u]),S.useEffect(()=>()=>{Rn(p)},[]);const b=S.useMemo(()=>({onMouseLeave(){h.current=!1},onFocus(v){if(h.current)return;const C=As(v.nativeEvent);if(f&&Xe(C)){if(Sm()&&!v.relatedTarget){if(!m.current&&!RD(C))return}else if(!OD(C))return}r(!0,v.nativeEvent,"focus")},onBlur(v){h.current=!1;const C=v.relatedTarget,x=v.nativeEvent,M=Xe(C)&&C.hasAttribute(Ba("focus-guard"))&&C.getAttribute("data-type")==="outside";p.current=window.setTimeout(()=>{var T;const k=b1(a.domReference?a.domReference.ownerDocument:document);!C&&k===a.domReference||Vs((T=l.current.floatingContext)==null?void 0:T.refs.floating.current,k)||Vs(a.domReference,k)||M||r(!1,x,"focus")})}}),[l,a.domReference,r,f]);return S.useMemo(()=>u?{reference:b}:{},[u,b])}function wm(t,e,n){const r=new Map,o=n==="item";let l=t;if(o&&t){const{[mx]:a,[gx]:u,...f}=t;l=f}return{...n==="floating"&&{tabIndex:-1,[TL]:""},...l,...e.map(a=>{const u=a?a[n]:null;return typeof u=="function"?t?u(t):null:u}).concat(t).reduce((a,u)=>(u&&Object.entries(u).forEach(f=>{let[h,p]=f;if(!(o&&[mx,gx].includes(h)))if(h.indexOf("on")===0){if(r.has(h)||r.set(h,[]),typeof p=="function"){var m;(m=r.get(h))==null||m.push(p),a[h]=function(){for(var b,v=arguments.length,C=new Array(v),x=0;x<v;x++)C[x]=arguments[x];return(b=r.get(h))==null?void 0:b.map(M=>M(...C)).find(M=>M!==void 0)}}}else a[h]=p}),a),{})}}function KL(t){t===void 0&&(t=[]);const e=t.map(u=>u?.reference),n=t.map(u=>u?.floating),r=t.map(u=>u?.item),o=S.useCallback(u=>wm(u,t,"reference"),e),l=S.useCallback(u=>wm(u,t,"floating"),n),a=S.useCallback(u=>wm(u,t,"item"),r);return S.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:a}),[o,l,a])}const GL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function YL(t,e){var n,r;e===void 0&&(e={});const{open:o,elements:l,floatingId:a}=t,{enabled:u=!0,role:f="dialog"}=e,h=Tg(),p=((n=l.domReference)==null?void 0:n.id)||h,m=S.useMemo(()=>{var k;return((k=ND(l.floating))==null?void 0:k.id)||a},[l.floating,a]),b=(r=GL.get(f))!=null?r:f,C=Ag()!=null,x=S.useMemo(()=>b==="tooltip"||f==="label"?{["aria-"+(f==="label"?"labelledby":"describedby")]:o?m:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":b==="alertdialog"?"dialog":b,"aria-controls":o?m:void 0,...b==="listbox"&&{role:"combobox"},...b==="menu"&&{id:p},...b==="menu"&&C&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[b,m,C,o,p,f]),M=S.useMemo(()=>{const k={id:m,...b&&{role:b}};return b==="tooltip"||f==="label"?k:{...k,...b==="menu"&&{"aria-labelledby":p}}},[b,m,p,f]),T=S.useCallback(k=>{let{active:R,selected:D}=k;const _={role:"option",...R&&{id:m+"-fui-option"}};switch(f){case"select":case"combobox":return{..._,"aria-selected":D}}return{}},[m,f]);return S.useMemo(()=>u?{reference:x,floating:M,item:T}:{},[u,x,M,T])}const s3=S.createContext(null);function ZL({children:t,container:e}){return w.jsx(s3.Provider,{value:e,children:t})}function Rg(){return S.useContext(s3)}function XL({initialOpen:t=!1,placement:e="top",open:n,onOpenChange:r,delay:o=600,closeDelay:l=0}={}){const[a,u]=S.useState(t),f=n??a,h=r??u,p=FL({placement:e,open:f,onOpenChange:h,whileElementsMounted:Q7,middleware:[e3(4),n3({crossAxis:e.includes("-"),fallbackAxisSideDirection:"start",padding:4}),t3({padding:4})]}),m=p.context,b=zL(m,{mouseOnly:!0,move:!1,restMs:o,enabled:n==null,delay:{close:l}}),v=qL(m,{enabled:n==null}),C=PL(m),x=YL(m,{role:"tooltip"}),M=KL([b,v,C,x]);return S.useMemo(()=>({open:f,setOpen:h,...M,...p}),[f,h,M,p])}const x1=S.createContext(null);function l3(){const t=S.useContext(x1);if(t==null)throw new Error("Tooltip components must be wrapped in <TooltipProvider />");return t}function a3({children:t,...e}){const n=XL(e);return e.useDelayGroup?w.jsx(_L,{delay:{open:e.delay??0,close:e.closeDelay??0},timeoutMs:e.timeout,children:w.jsx(x1.Provider,{value:n,children:t})}):w.jsx(x1.Provider,{value:n,children:t})}const c3=S.forwardRef(function({children:e,asChild:n=!1,...r},o){const l=l3(),a=S.isValidElement(e)?parseInt(S.version,10)>=19?e.props.ref:e.ref:void 0,u=r3([l.refs.setReference,o,a]);if(n&&S.isValidElement(e)){const f={"data-tooltip-state":l.open?"open":"closed"};return S.cloneElement(e,l.getReferenceProps({ref:u,...r,...typeof e.props=="object"?e.props:{},...f}))}return w.jsx("button",{ref:u,"data-tooltip-state":l.open?"open":"closed",...l.getReferenceProps(r),children:e})}),u3=S.forwardRef(function({style:e,children:n,portal:r=!0,portalProps:o={},...l},a){const u=l3(),f=r3([u.refs.setFloating,a]),h=Rg();if(!u.open)return null;const p=w.jsx("div",{ref:f,style:{...u.floatingStyles,...e},...u.getFloatingProps(l),className:"tiptap-tooltip",children:n});if(r){const{root:m,...b}=o;return w.jsx(HL,{...b,root:m??h??void 0,children:p})}return p});a3.displayName="Tooltip";c3.displayName="TooltipTrigger";u3.displayName="TooltipContent";const QL={mod:"⌘",command:"⌘",meta:"⌘",ctrl:"⌃",control:"⌃",alt:"⌥",option:"⌥",shift:"⇧",backspace:"Del",delete:"⌦",enter:"⏎",escape:"⎋",capslock:"⇪"};function Dt(...t){return t.filter(Boolean).join(" ")}function WL(){return typeof navigator<"u"&&navigator.platform.toLowerCase().includes("mac")}const JL=(t,e,n=!0)=>{if(e){const r=t.toLowerCase();return QL[r]||(n?t.toUpperCase():t)}return n?t.charAt(0).toUpperCase()+t.slice(1):t},Vr=t=>{const{shortcutKeys:e,delimiter:n="+",capitalize:r=!0}=t;return e?e.split(n).map(o=>o.trim()).map(o=>JL(o,WL(),r)):[]},Ro=(t,e)=>e?.schema?e.schema.spec.marks.get(t)!==void 0:!1,Oo=(t,e)=>e?.schema?e.schema.spec.nodes.get(t)!==void 0:!1;function ez(t){const{state:e,view:n}=t,{doc:r,selection:o}=e,l=Ee.findFrom(o.$to,1,!0);if(l)return n.dispatch(e.tr.setSelection(l).scrollIntoView()),!0;const a=e.schema.nodes.paragraph;if(!a)return console.warn("No paragraph node type found in schema."),!1;const u=r.content.size,f=a.create();let h=e.tr.insert(u,f);const p=h.doc.resolve(u+1);return h=h.setSelection(ve.near(p)).scrollIntoView(),n.dispatch(h),!0}function Vi(t){return typeof t=="number"&&t>=0}function nd(t,e){if(!t)return!1;const n=Array.isArray(e)?e:[e],r=n.some(o=>t.extensionManager.extensions.some(l=>l.name===o));return r||console.warn(`None of the extensions [${n.join(", ")}] were found in the editor schema. Ensure they are included in the editor configuration.`),r}function tz(t,e){try{const n=t.state.doc.nodeAt(e);return n||(console.warn(`No node found at position ${e}`),null)}catch(n){return console.error(`Error getting node at position ${e}:`,n),null}}function Ks(t){const{editor:e,node:n,nodePos:r}=t;if(!e||!e.state?.doc)return null;const o=n!=null,l=Vi(r);if(!o&&!l)return null;if(o){let a=-1,u=null;if(e.state.doc.descendants((f,h)=>f===n?(a=h,u=f,!1):!0),a!==-1&&u!==null)return{pos:a,node:u}}if(l){const a=tz(e,r);if(a)return{pos:r,node:a}}return null}function Pr(t,e=[]){if(!t||!t.state.selection)return!1;const{state:n}=t,{selection:r}=n;if(r.empty)return!1;if(r instanceof de){const o=r.node;return o?e.includes(o.type.name):!1}return!1}const nz=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function rz(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return!t||t.replace(nz,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}function iz(t,e,n){try{const r=new URL(t,e);if(rz(r.href,n))return r.href}catch{}return"#"}const oz=({shortcuts:t})=>t.length===0?null:w.jsx("div",{children:t.map((e,n)=>w.jsxs(S.Fragment,{children:[n>0&&w.jsx("kbd",{children:"+"}),w.jsx("kbd",{children:e})]},n))}),We=S.forwardRef(({className:t,children:e,tooltip:n,showTooltip:r=!0,shortcutKeys:o,"aria-label":l,...a},u)=>{const f=S.useMemo(()=>Vr({shortcutKeys:o}),[o]);return!n||!r?w.jsx("button",{className:Dt("tiptap-button",t),ref:u,"aria-label":l,...a,children:e}):w.jsxs(a3,{delay:200,children:[w.jsx(c3,{className:Dt("tiptap-button",t),ref:u,"aria-label":l,...a,children:e}),w.jsxs(u3,{children:[n,w.jsx(oz,{shortcuts:f})]})]})});We.displayName="Button";const tr=S.forwardRef(({className:t,children:e,orientation:n="vertical",...r},o)=>w.jsx("div",{ref:o,className:Dt("tiptap-button-group",t),"data-orientation":n,role:"group",...r,children:e}));tr.displayName="ButtonGroup";function Ex({orientation:t="horizontal",size:e,style:n={},...r}){const o={...n,...t==="horizontal"&&!e&&{flex:1},...e&&{width:t==="vertical"?"1px":e,height:t==="horizontal"?"1px":e}};return w.jsx("div",{...r,style:o})}const Ls=S.forwardRef(({decorative:t,orientation:e="vertical",className:n,...r},o)=>{const a=t?{role:"none"}:{"aria-orientation":e==="vertical"?e:void 0,role:"separator"};return w.jsx("div",{className:Dt("tiptap-separator",n),"data-orientation":e,...a,...r,ref:o})});Ls.displayName="Separator";function f3({editor:t,containerRef:e,query:n,items:r,onSelect:o,onClose:l,orientation:a="vertical",autoSelectFirstItem:u=!0}){const[f,h]=S.useState(u?0:-1);return S.useEffect(()=>{const p=b=>{if(!r.length)return!1;const v=()=>h(x=>x===-1?0:(x+1)%r.length),C=()=>h(x=>x===-1?r.length-1:(x-1+r.length)%r.length);switch(b.key){case"ArrowUp":return a==="horizontal"?!1:(b.preventDefault(),C(),!0);case"ArrowDown":return a==="horizontal"?!1:(b.preventDefault(),v(),!0);case"ArrowLeft":return a==="vertical"?!1:(b.preventDefault(),C(),!0);case"ArrowRight":return a==="vertical"?!1:(b.preventDefault(),v(),!0);case"Tab":return b.preventDefault(),b.shiftKey?C():v(),!0;case"Home":return b.preventDefault(),h(0),!0;case"End":return b.preventDefault(),h(r.length-1),!0;case"Enter":return b.isComposing?!1:(b.preventDefault(),f!==-1&&r[f]&&o?.(r[f]),!0);case"Escape":return b.preventDefault(),l?.(),!0;default:return!1}};let m=null;if(t?m=t.view.dom:e?.current&&(m=e.current),m)return m.addEventListener("keydown",p,!0),()=>{m?.removeEventListener("keydown",p,!0)}},[t,e,r,f,o,l,a]),S.useEffect(()=>{n&&h(u?0:-1)},[n,u]),{selectedIndex:r.length?f:void 0,setSelectedIndex:h}}const Mx=(t,e)=>{typeof t=="function"?t(e):t&&typeof t=="object"&&"current"in t&&(t.current=e)},sz=(t,e)=>{const n=S.useRef(null);return S.useCallback(r=>{t&&"current"in t&&(t.current=r),n.current&&Mx(n.current,null),n.current=e,e&&Mx(e,r)},[t,e])},lz=t=>{const[e,n]=S.useState([]),r=S.useCallback(()=>t.current?Array.from(t.current.querySelectorAll('button:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]:not([disabled])')):[],[t]);S.useEffect(()=>{const l=t.current;if(!l)return;const a=()=>n(r());a();const u=new MutationObserver(a);return u.observe(l,{childList:!0,subtree:!0}),()=>u.disconnect()},[r,t]);const{selectedIndex:o}=f3({containerRef:t,items:e,orientation:"horizontal",onSelect:l=>l.click(),autoSelectFirstItem:!1});S.useEffect(()=>{const l=t.current;if(!l)return;const a=f=>{const h=f.target;l.contains(h)&&h.setAttribute("data-focus-visible","true")},u=f=>{const h=f.target;l.contains(h)&&h.removeAttribute("data-focus-visible")};return l.addEventListener("focus",a,!0),l.addEventListener("blur",u,!0),()=>{l.removeEventListener("focus",a,!0),l.removeEventListener("blur",u,!0)}},[t]),S.useEffect(()=>{o!==void 0&&e[o]&&e[o].focus()},[o,e])},d3=S.forwardRef(({children:t,className:e,variant:n="fixed",...r},o)=>{const l=S.useRef(null),a=sz(l,o);return lz(l),w.jsx("div",{ref:a,role:"toolbar","aria-label":"toolbar","data-variant":n,className:Dt("tiptap-toolbar",e),...r,children:t})});d3.displayName="Toolbar";const uo=S.forwardRef(({children:t,className:e,...n},r)=>w.jsx("div",{ref:r,role:"group",className:Dt("tiptap-toolbar-group",e),...n,children:t}));uo.displayName="ToolbarGroup";const fo=S.forwardRef(({...t},e)=>w.jsx(Ls,{ref:e,orientation:"vertical",decorative:!0,...t}));fo.displayName="ToolbarSeparator";const h3=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{d:"M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z",fill:"currentColor"})}));h3.displayName="CloseIcon";function az(t){const[e,n]=S.useState([]),r=async u=>{if(u.size>t.maxSize){const m=new Error(`File size exceeds maximum allowed (${t.maxSize/1024/1024}MB)`);return t.onError?.(m),null}const f=new AbortController,h=crypto.randomUUID(),p={id:h,file:u,progress:0,status:"uploading",abortController:f};n(m=>[...m,p]);try{if(!t.upload)throw new Error("Upload function is not defined");const m=await t.upload(u,b=>{n(v=>v.map(C=>C.id===h?{...C,progress:b.progress}:C))},f.signal);if(!m)throw new Error("Upload failed: No URL returned");return f.signal.aborted?null:(n(b=>b.map(v=>v.id===h?{...v,status:"success",url:m,progress:100}:v)),t.onSuccess?.(m),m)}catch(m){return f.signal.aborted||(n(b=>b.map(v=>v.id===h?{...v,status:"error",progress:0}:v)),t.onError?.(m instanceof Error?m:new Error("Upload failed"))),null}};return{fileItems:e,uploadFiles:async u=>{if(!u||u.length===0)return t.onError?.(new Error("No files to upload")),[];if(t.limit&&u.length>t.limit)return t.onError?.(new Error(`Maximum ${t.limit} file${t.limit===1?"":"s"} allowed`)),[];const f=u.map(p=>r(p));return(await Promise.all(f)).filter(p=>p!==null)},removeFileItem:u=>{n(f=>{const h=f.find(p=>p.id===u);return h?.abortController&&h.abortController.abort(),h?.url&&URL.revokeObjectURL(h.url),f.filter(p=>p.id!==u)})},clearAllFiles:()=>{e.forEach(u=>{u.abortController&&u.abortController.abort(),u.url&&URL.revokeObjectURL(u.url)}),n([])}}}const p3=()=>w.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",className:"tiptap-image-upload-icon",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[w.jsx("path",{d:"M11.1953 4.41771C10.3478 4.08499 9.43578 3.94949 8.5282 4.02147C7.62062 4.09345 6.74133 4.37102 5.95691 4.83316C5.1725 5.2953 4.50354 5.92989 4.00071 6.68886C3.49788 7.44783 3.17436 8.31128 3.05465 9.2138C2.93495 10.1163 3.0222 11.0343 3.3098 11.8981C3.5974 12.7619 4.07781 13.5489 4.71463 14.1995C5.10094 14.5942 5.09414 15.2274 4.69945 15.6137C4.30476 16 3.67163 15.9932 3.28532 15.5985C2.43622 14.731 1.79568 13.6816 1.41221 12.5299C1.02875 11.3781 0.91241 10.1542 1.07201 8.95084C1.23162 7.74748 1.66298 6.59621 2.33343 5.58425C3.00387 4.57229 3.89581 3.72617 4.9417 3.10998C5.98758 2.4938 7.15998 2.1237 8.37008 2.02773C9.58018 1.93176 10.7963 2.11243 11.9262 2.55605C13.0561 2.99968 14.0703 3.69462 14.8919 4.58825C15.5423 5.29573 16.0585 6.11304 16.4177 7.00002H17.4999C18.6799 6.99991 19.8288 7.37933 20.7766 8.08222C21.7245 8.78515 22.4212 9.7743 22.7637 10.9036C23.1062 12.0328 23.0765 13.2423 22.6788 14.3534C22.2812 15.4644 21.5367 16.4181 20.5554 17.0736C20.0962 17.3803 19.4752 17.2567 19.1684 16.7975C18.8617 16.3382 18.9853 15.7172 19.4445 15.4105C20.069 14.9934 20.5427 14.3865 20.7958 13.6794C21.0488 12.9724 21.0678 12.2027 20.8498 11.4841C20.6318 10.7655 20.1885 10.136 19.5853 9.6887C18.9821 9.24138 18.251 8.99993 17.5001 9.00002H15.71C15.2679 9.00002 14.8783 8.70973 14.7518 8.28611C14.4913 7.41374 14.0357 6.61208 13.4195 5.94186C12.8034 5.27164 12.0427 4.75043 11.1953 4.41771Z",fill:"currentColor"}),w.jsx("path",{d:"M11 14.4142V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V14.4142L15.2929 16.7071C15.6834 17.0976 16.3166 17.0976 16.7071 16.7071C17.0976 16.3166 17.0976 15.6834 16.7071 15.2929L12.7078 11.2936C12.7054 11.2912 12.703 11.2888 12.7005 11.2864C12.5208 11.1099 12.2746 11.0008 12.003 11L12 11L11.997 11C11.8625 11.0004 11.7343 11.0273 11.6172 11.0759C11.502 11.1236 11.3938 11.1937 11.2995 11.2864C11.297 11.2888 11.2946 11.2912 11.2922 11.2936L7.29289 15.2929C6.90237 15.6834 6.90237 16.3166 7.29289 16.7071C7.68342 17.0976 8.31658 17.0976 8.70711 16.7071L11 14.4142Z",fill:"currentColor"})]}),cz=()=>w.jsx("svg",{width:"43",height:"57",viewBox:"0 0 43 57",fill:"currentColor",className:"tiptap-image-upload-dropzone-rect-primary",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M0.75 10.75C0.75 5.64137 4.89137 1.5 10 1.5H32.3431C33.2051 1.5 34.0317 1.84241 34.6412 2.4519L40.2981 8.10876C40.9076 8.71825 41.25 9.5449 41.25 10.4069V46.75C41.25 51.8586 37.1086 56 32 56H10C4.89137 56 0.75 51.8586 0.75 46.75V10.75Z",fill:"currentColor",fillOpacity:"0.11",stroke:"currentColor",strokeWidth:"1.5"})}),uz=()=>w.jsx("svg",{width:"10",height:"10",className:"tiptap-image-upload-dropzone-rect-secondary",viewBox:"0 0 10 10",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M0 0.75H0.343146C1.40401 0.75 2.42143 1.17143 3.17157 1.92157L8.82843 7.57843C9.57857 8.32857 10 9.34599 10 10.4069V10.75H4C1.79086 10.75 0 8.95914 0 6.75V0.75Z",fill:"currentColor"})}),fz=({onFile:t,children:e})=>{const[n,r]=S.useState(!1),[o,l]=S.useState(!1),a=p=>{p.preventDefault(),p.stopPropagation(),l(!0)},u=p=>{p.preventDefault(),p.stopPropagation(),p.currentTarget.contains(p.relatedTarget)||(l(!1),r(!1))},f=p=>{p.preventDefault(),p.stopPropagation(),r(!0)},h=p=>{p.preventDefault(),p.stopPropagation(),l(!1),r(!1);const m=Array.from(p.dataTransfer.files);m.length>0&&t(m)};return w.jsx("div",{className:`tiptap-image-upload-drag-area ${o?"drag-active":""} ${n?"drag-over":""}`,onDragEnter:a,onDragLeave:u,onDragOver:f,onDrop:h,children:e})},dz=({fileItem:t,onRemove:e})=>{const n=r=>{if(r===0)return"0 Bytes";const o=1024,l=["Bytes","KB","MB","GB"],a=Math.floor(Math.log(r)/Math.log(o));return`${parseFloat((r/Math.pow(o,a)).toFixed(2))} ${l[a]}`};return w.jsxs("div",{className:"tiptap-image-upload-preview",children:[t.status==="uploading"&&w.jsx("div",{className:"tiptap-image-upload-progress",style:{width:`${t.progress}%`}}),w.jsxs("div",{className:"tiptap-image-upload-preview-content",children:[w.jsxs("div",{className:"tiptap-image-upload-file-info",children:[w.jsx("div",{className:"tiptap-image-upload-file-icon",children:w.jsx(p3,{})}),w.jsxs("div",{className:"tiptap-image-upload-details",children:[w.jsx("span",{className:"tiptap-image-upload-text",children:t.file.name}),w.jsx("span",{className:"tiptap-image-upload-subtext",children:n(t.file.size)})]})]}),w.jsxs("div",{className:"tiptap-image-upload-actions",children:[t.status==="uploading"&&w.jsxs("span",{className:"tiptap-image-upload-progress-text",children:[t.progress,"%"]}),w.jsx(We,{type:"button","data-style":"ghost",onClick:r=>{r.stopPropagation(),e()},children:w.jsx(h3,{className:"tiptap-button-icon"})})]})]})]})},hz=({maxSize:t,limit:e})=>w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"tiptap-image-upload-dropzone",children:[w.jsx(cz,{}),w.jsx(uz,{}),w.jsx("div",{className:"tiptap-image-upload-icon-container",children:w.jsx(p3,{})})]}),w.jsxs("div",{className:"tiptap-image-upload-content",children:[w.jsxs("span",{className:"tiptap-image-upload-text",children:[w.jsx("em",{children:"Click to upload"})," or drag and drop"]}),w.jsxs("span",{className:"tiptap-image-upload-subtext",children:["Maximum ",e," file",e===1?"":"s",", ",t/1024/1024,"MB each."]})]})]}),pz=t=>{const{accept:e,limit:n,maxSize:r}=t.node.attrs,o=S.useRef(null),l=t.extension,a={maxSize:r,limit:n,accept:e,upload:l.options.upload,onSuccess:l.options.onSuccess,onError:l.options.onError},{fileItems:u,uploadFiles:f,removeFileItem:h,clearAllFiles:p}=az(a),m=async x=>{const M=await f(x);if(M.length>0){const T=t.getPos();if(Vi(T)){const k=M.map((R,D)=>{const _=x[D]?.name.replace(/\.[^/.]+$/,"")||"unknown";return{type:l.options.type,attrs:{...l.options,src:R,alt:_,title:_}}});t.editor.chain().focus().deleteRange({from:T,to:T+t.node.nodeSize}).insertContentAt(T,k).run(),ez(t.editor)}}},b=x=>{const M=x.target.files;if(!M||M.length===0){l.options.onError?.(new Error("No file selected"));return}m(Array.from(M))},v=()=>{o.current&&u.length===0&&(o.current.value="",o.current.click())},C=u.length>0;return w.jsxs(lg,{className:"tiptap-image-upload",tabIndex:0,onClick:v,children:[!C&&w.jsx(fz,{onFile:m,children:w.jsx(hz,{maxSize:r,limit:n})}),C&&w.jsxs("div",{className:"tiptap-image-upload-previews",children:[u.length>1&&w.jsxs("div",{className:"tiptap-image-upload-header",children:[w.jsxs("span",{children:["Uploading ",u.length," files"]}),w.jsx(We,{type:"button","data-style":"ghost",onClick:x=>{x.stopPropagation(),p()},children:"Clear All"})]}),u.map(x=>w.jsx(dz,{fileItem:x,onRemove:()=>h(x.id)},x.id))]}),w.jsx("input",{ref:o,name:"file",accept:e,type:"file",multiple:n>1,onChange:b,onClick:x=>x.stopPropagation()})]})},mz=Bt.create({name:"imageUpload",group:"block",draggable:!0,atom:!0,addOptions(){return{type:"image",accept:"image/*",limit:1,maxSize:0,upload:void 0,onError:void 0,onSuccess:void 0,HTMLAttributes:{}}},addAttributes(){return{accept:{default:this.options.accept},limit:{default:this.options.limit},maxSize:{default:this.options.maxSize}}},parseHTML(){return[{tag:'div[data-type="image-upload"]'}]},renderHTML({HTMLAttributes:t}){return["div",$e({"data-type":"image-upload"},t)]},addNodeView(){return ag(pz)},addCommands(){return{setImageUploadNode:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{selection:e}=t.state,{nodeAfter:n}=e.$from;if(n&&n.type.name==="imageUpload"&&t.isActive("imageUpload")){const r=t.view.nodeDOM(e.$from.pos);if(r&&r instanceof HTMLElement){const o=r.firstChild;if(o&&o instanceof HTMLElement)return o.click(),!0}}return!1}}}}),gz=zR.extend({renderHTML(){return["div",$e(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]}}),yz=({node:t,updateAttributes:e,selected:n})=>{const[r,o]=S.useState(!1),[l,a]=S.useState(t.attrs.width||300),[u,f]=S.useState(t.attrs.alt||""),h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),b=S.useRef(!1),v=S.useRef(0),C=S.useRef(0),x=S.useRef(e);x.current=e;const M=t.attrs.imageId||`img-${Date.now()}`;S.useEffect(()=>{b.current||a(t.attrs.width||300)},[t.attrs.width]),S.useEffect(()=>{f(t.attrs.alt||"")},[t.attrs.alt]);const T=S.useCallback(re=>{f(re.target.value)},[]),k=S.useCallback(()=>{e({alt:u})},[u,e]),R=S.useCallback(re=>{re.key==="Enter"&&(re.preventDefault(),h.current?.blur()),re.stopPropagation()},[]);S.useEffect(()=>{const re=ae=>{if(!b.current)return;const W=ae.clientX-v.current,ie=Math.max(50,C.current+W);a(ie),m.current&&(m.current.style.width=`${ie}px`)},fe=()=>{b.current&&(b.current=!1,o(!1),a(ae=>{const W=Math.round(ae);return x.current({width:W}),W}))};return document.addEventListener("mousemove",re),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",fe)}},[]);const D=S.useCallback(re=>{re.preventDefault(),re.stopPropagation(),b.current=!0,o(!0),v.current=re.clientX,C.current=m.current?.getBoundingClientRect().width??300},[]),_=S.useCallback(()=>{},[]),j=t.attrs.textAlign||"left",L=j==="center"?"center":j==="right"?"flex-end":"flex-start",B={position:"relative",display:"inline-block",width:l,maxWidth:"100%",userSelect:r?"none":"auto",outline:n?"2px solid #007bff":"none",outlineOffset:"2px"},Q={width:"100%",height:"auto",display:"block",objectFit:"contain"},ne={position:"absolute",bottom:-5,right:-5,width:12,height:12,background:"#007bff",border:"2px solid white",borderRadius:"50%",cursor:"nw-resize",opacity:n||r?1:0,transition:"opacity 0.2s ease",zIndex:10,boxShadow:"0 2px 4px rgba(0,0,0,0.2)"};return w.jsx(lg,{className:"resizable-image-wrapper",style:{display:"flex",justifyContent:L},children:w.jsxs("div",{ref:m,id:`resizable-image-${M}`,style:B,onMouseEnter:()=>{if(m.current){const re=m.current.querySelector(".resize-handle");re&&(re.style.opacity="1")}},onMouseLeave:()=>{if(!r&&!n&&m.current){const re=m.current.querySelector(".resize-handle");re&&(re.style.opacity="0")}},children:[w.jsx("img",{ref:p,src:t.attrs.src,alt:t.attrs.alt||"",title:t.attrs.title||"",style:Q,onLoad:_,"data-drag-handle":"",draggable:!1}),w.jsx("div",{className:"resize-handle",style:ne,onMouseDown:D,title:"拖拽調整圖片大小"}),(n||r)&&w.jsxs("div",{style:{position:"absolute",top:-25,left:0,background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"2px 6px",borderRadius:"3px",fontSize:"12px",whiteSpace:"nowrap",zIndex:11},children:[Math.round(l)," × auto"]}),n&&w.jsx("div",{className:"resizable-image-alt-input",children:w.jsx("input",{ref:h,type:"text",value:u,onChange:T,onBlur:k,onKeyDown:R,placeholder:"Add alt text…"})})]})})},vz=Bt.create({name:"resizableImage",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null,parseHTML:t=>{const e=t.getAttribute("width");return e?parseInt(e):null},renderHTML:t=>t.width?{width:t.width,height:"auto"}:{}},imageId:{default:null,parseHTML:t=>t.getAttribute("data-image-id"),renderHTML:t=>t.imageId?{"data-image-id":t.imageId}:{}}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])',getAttrs:t=>{const e=t,n=e.getAttribute("width"),r=e.getAttribute("data-image-id");return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title"),width:n?parseInt(n):300,imageId:r||`img-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}}}]},renderHTML({HTMLAttributes:t}){return["img",$e(this.options.HTMLAttributes,t)]},addCommands(){return{setResizableImage:t=>({commands:e})=>{const n=`img-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return e.insertContent({type:this.name,attrs:{...t,imageId:n,width:t.width||300}})},setImageSize:t=>({commands:e})=>e.updateAttributes(this.name,t)}},addNodeView(){return ag(yz)}}),bz=200,Cz="100%",xz=({node:t,selected:e,updateAttributes:n})=>{const{src:r,provider:o,width:l,textAlign:a}=t.attrs,u=a||"left",f=u==="center"?"center":u==="right"?"flex-end":"flex-start",[h,p]=S.useState(!1),[m,b]=S.useState(l),v=S.useRef(null),C=S.useRef(!1),x=S.useRef(0),M=S.useRef(0),T=S.useRef(n);T.current=n,S.useEffect(()=>{C.current||b(l)},[l]),S.useEffect(()=>{const j=B=>{if(!C.current)return;const Q=B.clientX-x.current,ne=Math.max(bz,Math.round(M.current+Q));b(ne),v.current&&(v.current.style.width=`${ne}px`)},L=()=>{C.current&&(C.current=!1,p(!1),b(B=>(B==null||T.current({width:B}),B)))};return document.addEventListener("mousemove",j),document.addEventListener("mouseup",L),()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",L)}},[]);const k=S.useCallback(j=>{j.preventDefault(),j.stopPropagation(),C.current=!0,p(!0),x.current=j.clientX;const L=v.current?.getBoundingClientRect(),B=l??(L?.width?Math.round(L.width):560);M.current=B,m==null&&v.current&&(b(B),v.current.style.width=`${B}px`)},[l,m]),R=m??l,D={position:"relative",width:R!=null?`${R}px`:Cz,maxWidth:"100%"},_={position:"absolute",bottom:-5,right:-5,width:12,height:12,background:"#007bff",border:"2px solid white",borderRadius:"50%",cursor:"nw-resize",opacity:e||h?1:0,transition:"opacity 0.2s ease",zIndex:10,boxShadow:"0 2px 4px rgba(0,0,0,0.2)"};return w.jsx(lg,{className:"video-embed-wrapper","data-provider":o,"data-drag-handle":"",style:{display:"flex",justifyContent:f,width:"100%"},children:w.jsxs("div",{ref:v,className:`video-embed-container${e?" selected":""}`,style:{...D,display:"inline-block"},onMouseEnter:()=>{const j=v.current?.querySelector(".video-embed-resize-handle");j&&(j.style.opacity="1")},onMouseLeave:()=>{if(!h&&!e&&v.current){const j=v.current.querySelector(".video-embed-resize-handle");j&&(j.style.opacity="0")}},children:[w.jsx("iframe",{src:r,frameBorder:"0",allowFullScreen:!0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",title:"Embedded video",style:h?{pointerEvents:"none"}:void 0}),w.jsx("div",{className:"video-embed-resize-handle",style:_,onMouseDown:k,title:"拖拽調整寬度",contentEditable:!1}),(e||h)&&R!=null&&w.jsxs("div",{style:{position:"absolute",top:-25,left:0,background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"2px 6px",borderRadius:"3px",fontSize:"12px",whiteSpace:"nowrap",zIndex:11},children:[Math.round(R),"px 寬"]})]})})};function m3(t){if(!t)return null;const e=t.trim(),n=[/(?:youtube\.com\/watch\?.*v=)([\w-]{11})/,/(?:youtu\.be\/)([\w-]{11})/,/(?:youtube\.com\/embed\/)([\w-]{11})/,/(?:youtube\.com\/shorts\/)([\w-]{11})/];for(const o of n){const l=e.match(o);if(l?.[1])return{embedUrl:`https://www.youtube.com/embed/${l[1]}`,provider:"youtube"}}const r=e.match(/(?:vimeo\.com\/)(\d+)/);return r?.[1]?{embedUrl:`https://player.vimeo.com/video/${r[1]}`,provider:"vimeo"}:null}const Sz=Bt.create({name:"videoEmbed",addOptions(){return{HTMLAttributes:{},allowFullscreen:!0}},group:"block",atom:!0,draggable:!0,addAttributes(){return{src:{default:null},provider:{default:"other"},width:{default:null,parseHTML:t=>{const n=t.getAttribute("data-width");if(n==null||n==="")return null;const r=parseInt(n,10);return Number.isFinite(r)?r:null},renderHTML:t=>t.width==null?{}:{"data-width":String(t.width)}}}},parseHTML(){return[{tag:"div[data-video-embed]",getAttrs:t=>{const e=t,n=e.querySelector("iframe"),r=e.getAttribute("data-width"),o=r!=null&&r!==""?parseInt(r,10):null;return{src:n?.getAttribute("src")||e.getAttribute("data-src"),provider:e.getAttribute("data-provider")||"other",width:o!=null&&Number.isFinite(o)?o:null}}}]},renderHTML({HTMLAttributes:t}){const e=t.width,n=e!=null?`max-width: 100%; width: ${e}px;`:"max-width: 100%; width: 100%;";return["div",$e({"data-video-embed":"","data-provider":t.provider,...e!=null?{"data-width":String(e)}:{},style:n},t,this.options.HTMLAttributes),["iframe",{src:t.src,frameborder:"0",allowfullscreen:this.options.allowFullscreen?"true":void 0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",style:"width: 100%; aspect-ratio: 16/9; border: 0; display: block;"}]]},addCommands(){return{setVideoEmbed:t=>({commands:e})=>{const n=m3(t.src);return n?e.insertContent({type:this.name,attrs:{src:n.embedUrl,provider:n.provider}}):!1}}},addNodeView(){return ag(xz)}}),Og=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.29289 8.29289C5.68342 7.90237 6.31658 7.90237 6.70711 8.29289L12 13.5858L17.2929 8.29289C17.6834 7.90237 18.3166 7.90237 18.7071 8.29289C19.0976 8.68342 19.0976 9.31658 18.7071 9.70711L12.7071 15.7071C12.3166 16.0976 11.6834 16.0976 11.2929 15.7071L5.29289 9.70711C4.90237 9.31658 4.90237 8.68342 5.29289 8.29289Z",fill:"currentColor"})}));Og.displayName="ChevronDownIcon";function Ke(t){const{editor:e}=oR(),n=S.useMemo(()=>t||e,[t,e]);return J4({editor:n,selector(o){return o.editor?{editor:o.editor,editorState:o.editor.state,canCommand:o.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})||{editor:null}}const $r=S.forwardRef(({variant:t,size:e="default",appearance:n="default",trimText:r=!1,className:o,children:l,...a},u)=>w.jsx("div",{ref:u,className:`tiptap-badge ${o||""}`,"data-style":t,"data-size":e,"data-appearance":n,"data-text-trim":r?"on":"off",...a,children:l}));$r.displayName="Badge";function wz({level:t,shortcutKeys:e=E3[t]}){return w.jsx($r,{children:Vr({shortcutKeys:e})})}const g3=S.forwardRef(({editor:t,level:e,text:n,hideWhenUnavailable:r=!1,onToggled:o,showShortcut:l=!1,onClick:a,children:u,...f},h)=>{const{editor:p}=Ke(t),{isVisible:m,canToggle:b,isActive:v,handleToggle:C,label:x,Icon:M,shortcutKeys:T}=Mz({editor:p,level:e,hideWhenUnavailable:r,onToggled:o}),k=S.useCallback(R=>{a?.(R),!R.defaultPrevented&&C()},[C,a]);return m?w.jsx(We,{type:"button","data-style":"ghost","data-active-state":v?"on":"off",role:"button",tabIndex:-1,disabled:!b,"data-disabled":!b,"aria-label":x,"aria-pressed":v,tooltip:x,onClick:k,...f,ref:h,children:u??w.jsxs(w.Fragment,{children:[w.jsx(M,{className:"tiptap-button-icon"}),n&&w.jsx("span",{className:"tiptap-button-text",children:n}),l&&w.jsx(wz,{level:e,shortcutKeys:T})]})}):null});g3.displayName="HeadingButton";const y3=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),w.jsx("path",{d:"M21.0001 10C21.0001 9.63121 20.7971 9.29235 20.472 9.11833C20.1468 8.94431 19.7523 8.96338 19.4454 9.16795L16.4454 11.168C15.9859 11.4743 15.8617 12.0952 16.1681 12.5547C16.4744 13.0142 17.0953 13.1384 17.5548 12.8321L19.0001 11.8685V18C19.0001 18.5523 19.4478 19 20.0001 19C20.5524 19 21.0001 18.5523 21.0001 18V10Z",fill:"currentColor"})]}));y3.displayName="HeadingOneIcon";const v3=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),w.jsx("path",{d:"M22.0001 12C22.0001 10.7611 21.1663 9.79297 20.0663 9.42632C18.9547 9.05578 17.6171 9.28724 16.4001 10.2C15.9582 10.5314 15.8687 11.1582 16.2001 11.6C16.5314 12.0418 17.1582 12.1314 17.6001 11.8C18.383 11.2128 19.0455 11.1942 19.4338 11.3237C19.8339 11.457 20.0001 11.7389 20.0001 12C20.0001 12.4839 19.8554 12.7379 19.6537 12.9481C19.4275 13.1837 19.1378 13.363 18.7055 13.6307C18.6313 13.6767 18.553 13.7252 18.4701 13.777C17.9572 14.0975 17.3128 14.5261 16.8163 15.2087C16.3007 15.9177 16.0001 16.8183 16.0001 18C16.0001 18.5523 16.4478 19 17.0001 19H21.0001C21.5523 19 22.0001 18.5523 22.0001 18C22.0001 17.4477 21.5523 17 21.0001 17H18.131C18.21 16.742 18.3176 16.5448 18.4338 16.385C18.6873 16.0364 19.0429 15.7775 19.5301 15.473C19.5898 15.4357 19.6536 15.3966 19.7205 15.3556C20.139 15.0992 20.6783 14.7687 21.0964 14.3332C21.6447 13.7621 22.0001 13.0161 22.0001 12Z",fill:"currentColor"})]}));v3.displayName="HeadingTwoIcon";const b3=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4608 11.2169C19.1135 11.0531 18.5876 11.0204 18.0069 11.3619C17.5309 11.642 16.918 11.4831 16.638 11.007C16.358 10.531 16.5169 9.91809 16.9929 9.63807C18.1123 8.97962 19.3364 8.94691 20.314 9.40808C21.2839 9.86558 21.9999 10.818 21.9999 12C21.9999 12.7957 21.6838 13.5587 21.1212 14.1213C20.5586 14.6839 19.7956 15 18.9999 15C18.4476 15 17.9999 14.5523 17.9999 14C17.9999 13.4477 18.4476 13 18.9999 13C19.2651 13 19.5195 12.8947 19.707 12.7071C19.8946 12.5196 19.9999 12.2652 19.9999 12C19.9999 11.6821 19.8159 11.3844 19.4608 11.2169Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0001 14C18.0001 13.4477 18.4478 13 19.0001 13C19.7957 13 20.5588 13.3161 21.1214 13.8787C21.684 14.4413 22.0001 15.2043 22.0001 16C22.0001 17.2853 21.2767 18.3971 20.1604 18.8994C19.0257 19.41 17.642 19.2315 16.4001 18.3C15.9582 17.9686 15.8687 17.3418 16.2001 16.9C16.5314 16.4582 17.1582 16.3686 17.6001 16.7C18.3581 17.2685 18.9744 17.24 19.3397 17.0756C19.7234 16.9029 20.0001 16.5147 20.0001 16C20.0001 15.7348 19.8947 15.4804 19.7072 15.2929C19.5196 15.1054 19.2653 15 19.0001 15C18.4478 15 18.0001 14.5523 18.0001 14Z",fill:"currentColor"})]}));b3.displayName="HeadingThreeIcon";const C3=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",fill:"currentColor"}),w.jsx("path",{d:"M17 9C17.5523 9 18 9.44772 18 10V13H20V10C20 9.44772 20.4477 9 21 9C21.5523 9 22 9.44772 22 10V18C22 18.5523 21.5523 19 21 19C20.4477 19 20 18.5523 20 18V15H17C16.4477 15 16 14.5523 16 14V10C16 9.44772 16.4477 9 17 9Z",fill:"currentColor"})]}));C3.displayName="HeadingFourIcon";const x3=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),w.jsx("path",{d:"M16 10C16 9.44772 16.4477 9 17 9H21C21.5523 9 22 9.44772 22 10C22 10.5523 21.5523 11 21 11H18V12H18.3C20.2754 12 22 13.4739 22 15.5C22 17.5261 20.2754 19 18.3 19C17.6457 19 17.0925 18.8643 16.5528 18.5944C16.0588 18.3474 15.8586 17.7468 16.1055 17.2528C16.3525 16.7588 16.9532 16.5586 17.4472 16.8056C17.7074 16.9357 17.9542 17 18.3 17C19.3246 17 20 16.2739 20 15.5C20 14.7261 19.3246 14 18.3 14H17C16.4477 14 16 13.5523 16 13L16 12.9928V10Z",fill:"currentColor"})]}));x3.displayName="HeadingFiveIcon";const S3=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.7071 9.29289C21.0976 9.68342 21.0976 10.3166 20.7071 10.7071C19.8392 11.575 19.2179 12.2949 18.7889 13.0073C18.8587 13.0025 18.929 13 19 13C20.6569 13 22 14.3431 22 16C22 17.6569 20.6569 19 19 19C17.3431 19 16 17.6569 16 16C16 14.6007 16.2837 13.4368 16.8676 12.3419C17.4384 11.2717 18.2728 10.3129 19.2929 9.29289C19.6834 8.90237 20.3166 8.90237 20.7071 9.29289ZM19 17C18.4477 17 18 16.5523 18 16C18 15.4477 18.4477 15 19 15C19.5523 15 20 15.4477 20 16C20 16.5523 19.5523 17 19 17Z",fill:"currentColor"})]}));S3.displayName="HeadingSixIcon";const w3={1:y3,2:v3,3:b3,4:C3,5:x3,6:S3},E3={1:"ctrl+alt+1",2:"ctrl+alt+2",3:"ctrl+alt+3",4:"ctrl+alt+4",5:"ctrl+alt+5",6:"ctrl+alt+6"};function Ta(t,e,n=!0){if(!t||!t.isEditable||!Oo("heading",t)||Pr(t,["image"]))return!1;if(!n)return e?t.can().setNode("heading",{level:e}):t.can().setNode("heading");try{const o=t.view.state,l=o.selection;if(l.empty||l instanceof ve){const a=Ks({editor:t,node:o.selection.$anchor.node(1)})?.pos;if(!Vi(a))return!1}return!0}catch{return!1}}function Ng(t,e){return!t||!t.isEditable?!1:Array.isArray(e)?e.some(n=>t.isActive("heading",{level:n})):e?t.isActive("heading",{level:e}):t.isActive("heading")}function Ez(t,e){if(!t||!t.isEditable)return!1;const n=Array.isArray(e)?e:[e],r=n.find(o=>Ta(t,o));if(!r)return!1;try{const o=t.view;let l=o.state,a=l.tr;if(l.selection.empty||l.selection instanceof ve){const m=Ks({editor:t,node:l.selection.$anchor.node(1)})?.pos;if(!Vi(m))return!1;a=a.setSelection(de.create(l.doc,m)),o.dispatch(a),l=o.state}const u=l.selection;let f=t.chain().focus();if(u instanceof de){const m=u.node.firstChild?.firstChild,b=u.node.lastChild?.lastChild,v=m?u.from+m.nodeSize:u.from+1,C=b?u.to-b.nodeSize:u.to-1;f=f.setTextSelection({from:v,to:C}).clearNodes()}return(n.some(m=>t.isActive("heading",{level:m}))?f.setNode("paragraph"):f.setNode("heading",{level:r})).run(),t.chain().focus().selectTextblockEnd().run(),!0}catch{return!1}}function M3(t){const{editor:e,level:n,hideWhenUnavailable:r}=t;return!e||!e.isEditable||!Oo("heading",e)?!1:r&&!e.isActive("code")?Array.isArray(n)?n.some(o=>Ta(e,o)):Ta(e,n):!0}function Mz(t){const{editor:e,level:n,hideWhenUnavailable:r=!1,onToggled:o}=t,{editor:l}=Ke(e),[a,u]=S.useState(!0),f=Ta(l,n),h=Ng(l,n);S.useEffect(()=>{if(!l)return;const m=()=>{u(M3({editor:l,level:n,hideWhenUnavailable:r}))};return m(),l.on("selectionUpdate",m),()=>{l.off("selectionUpdate",m)}},[l,n,r]);const p=S.useCallback(()=>{if(!l)return!1;const m=Ez(l,n);return m&&o?.(),m},[l,n,o]);return{isVisible:a,isActive:h,handleToggle:p,canToggle:f,label:`Heading ${n}`,shortcutKeys:E3[n],Icon:w3[n]}}function Te(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}function Tx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function rd(...t){return e=>{let n=!1;const r=t.map(o=>{const l=Tx(o,e);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():Tx(t[o],null)}}}}function It(...t){return S.useCallback(rd(...t),t)}function Gs(t,e=[]){let n=[];function r(l,a){const u=S.createContext(a),f=n.length;n=[...n,a];const h=m=>{const{scope:b,children:v,...C}=m,x=b?.[t]?.[f]||u,M=S.useMemo(()=>C,Object.values(C));return w.jsx(x.Provider,{value:M,children:v})};h.displayName=l+"Provider";function p(m,b){const v=b?.[t]?.[f]||u,C=S.useContext(v);if(C)return C;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${l}\``)}return[h,p]}const o=()=>{const l=n.map(a=>S.createContext(a));return function(u){const f=u?.[t]||l;return S.useMemo(()=>({[`__scope${t}`]:{...u,[t]:f}}),[u,f])}};return o.scopeName=t,[r,Tz(o,...e)]}function Tz(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const a=r.reduce((u,{useScope:f,scopeName:h})=>{const m=f(l)[`__scope${h}`];return{...u,...m}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var Hi=globalThis?.document?S.useLayoutEffect:()=>{},Az=_f[" useInsertionEffect ".trim().toString()]||Hi;function Dg({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,l,a]=kz({defaultProp:e,onChange:n}),u=t!==void 0,f=u?t:o;{const p=S.useRef(t!==void 0);S.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const h=S.useCallback(p=>{if(u){const m=Rz(p)?p(t):p;m!==t&&a.current?.(m)}else l(p)},[u,t,l,a]);return[f,h]}function kz({defaultProp:t,onChange:e}){const[n,r]=S.useState(t),o=S.useRef(n),l=S.useRef(e);return Az(()=>{l.current=e},[e]),S.useEffect(()=>{o.current!==n&&(l.current?.(n),o.current=n)},[n,o]),[n,r,l]}function Rz(t){return typeof t=="function"}function Aa(t){const e=Oz(t),n=S.forwardRef((r,o)=>{const{children:l,...a}=r,u=S.Children.toArray(l),f=u.find(Dz);if(f){const h=f.props.children,p=u.map(m=>m===f?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:m);return w.jsx(e,{...a,ref:o,children:S.isValidElement(h)?S.cloneElement(h,void 0,p):null})}return w.jsx(e,{...a,ref:o,children:l})});return n.displayName=`${t}.Slot`,n}function Oz(t){const e=S.forwardRef((n,r)=>{const{children:o,...l}=n;if(S.isValidElement(o)){const a=zz(o),u=Lz(l,o.props);return o.type!==S.Fragment&&(u.ref=r?rd(r,a):a),S.cloneElement(o,u)}return S.Children.count(o)>1?S.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Nz=Symbol("radix.slottable");function Dz(t){return S.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Nz}function Lz(t,e){const n={...e};for(const r in e){const o=t[r],l=e[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...u)=>{const f=l(...u);return o(...u),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...t,...n}}function zz(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var jz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=jz.reduce((t,e)=>{const n=Aa(`Primitive.${e}`),r=S.forwardRef((o,l)=>{const{asChild:a,...u}=o,f=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(f,{...u,ref:l})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function T3(t,e){t&&Da.flushSync(()=>t.dispatchEvent(e))}function A3(t){const e=t+"CollectionProvider",[n,r]=Gs(e),[o,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:M,children:T}=x,k=Rt.useRef(null),R=Rt.useRef(new Map).current;return w.jsx(o,{scope:M,itemMap:R,collectionRef:k,children:T})};a.displayName=e;const u=t+"CollectionSlot",f=Aa(u),h=Rt.forwardRef((x,M)=>{const{scope:T,children:k}=x,R=l(u,T),D=It(M,R.collectionRef);return w.jsx(f,{ref:D,children:k})});h.displayName=u;const p=t+"CollectionItemSlot",m="data-radix-collection-item",b=Aa(p),v=Rt.forwardRef((x,M)=>{const{scope:T,children:k,...R}=x,D=Rt.useRef(null),_=It(M,D),j=l(p,T);return Rt.useEffect(()=>(j.itemMap.set(D,{ref:D,...R}),()=>void j.itemMap.delete(D))),w.jsx(b,{[m]:"",ref:_,children:k})});v.displayName=p;function C(x){const M=l(t+"CollectionConsumer",x);return Rt.useCallback(()=>{const k=M.collectionRef.current;if(!k)return[];const R=Array.from(k.querySelectorAll(`[${m}]`));return Array.from(M.itemMap.values()).sort((j,L)=>R.indexOf(j.ref.current)-R.indexOf(L.ref.current))},[M.collectionRef,M.itemMap])}return[{Provider:a,Slot:h,ItemSlot:v},C,r]}var _z=S.createContext(void 0);function k3(t){const e=S.useContext(_z);return t||e||"ltr"}function Br(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>e.current?.(...n),[])}function Iz(t,e=globalThis?.document){const n=Br(t);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Hz="DismissableLayer",S1="dismissableLayer.update",Bz="dismissableLayer.pointerDownOutside",Uz="dismissableLayer.focusOutside",Ax,R3=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lg=S.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:a,onDismiss:u,...f}=t,h=S.useContext(R3),[p,m]=S.useState(null),b=p?.ownerDocument??globalThis?.document,[,v]=S.useState({}),C=It(e,L=>m(L)),x=Array.from(h.layers),[M]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),T=x.indexOf(M),k=p?x.indexOf(p):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,D=k>=T,_=$z(L=>{const B=L.target,Q=[...h.branches].some(ne=>ne.contains(B));!D||Q||(o?.(L),a?.(L),L.defaultPrevented||u?.())},b),j=Fz(L=>{const B=L.target;[...h.branches].some(ne=>ne.contains(B))||(l?.(L),a?.(L),L.defaultPrevented||u?.())},b);return Iz(L=>{k===h.layers.size-1&&(r?.(L),!L.defaultPrevented&&u&&(L.preventDefault(),u()))},b),S.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Ax=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),kx(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Ax)}},[p,b,n,h]),S.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),kx())},[p,h]),S.useEffect(()=>{const L=()=>v({});return document.addEventListener(S1,L),()=>document.removeEventListener(S1,L)},[]),w.jsx(Lt.div,{...f,ref:C,style:{pointerEvents:R?D?"auto":"none":void 0,...t.style},onFocusCapture:Te(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Te(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Te(t.onPointerDownCapture,_.onPointerDownCapture)})});Lg.displayName=Hz;var Vz="DismissableLayerBranch",Pz=S.forwardRef((t,e)=>{const n=S.useContext(R3),r=S.useRef(null),o=It(e,r);return S.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),w.jsx(Lt.div,{...t,ref:o})});Pz.displayName=Vz;function $z(t,e=globalThis?.document){const n=Br(t),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const l=u=>{if(u.target&&!r.current){let f=function(){O3(Bz,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=f,e.addEventListener("click",o.current,{once:!0})):f()}else e.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",l),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Fz(t,e=globalThis?.document){const n=Br(t),r=S.useRef(!1);return S.useEffect(()=>{const o=l=>{l.target&&!r.current&&O3(Uz,n,{originalEvent:l},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kx(){const t=new CustomEvent(S1);document.dispatchEvent(t)}function O3(t,e,n,{discrete:r}){const o=n.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?T3(o,l):o.dispatchEvent(l)}var Em=0;function N3(){S.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Rx()),document.body.insertAdjacentElement("beforeend",t[1]??Rx()),Em++,()=>{Em===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Em--}},[])}function Rx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Mm="focusScope.autoFocusOnMount",Tm="focusScope.autoFocusOnUnmount",Ox={bubbles:!1,cancelable:!0},qz="FocusScope",zg=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...a}=t,[u,f]=S.useState(null),h=Br(o),p=Br(l),m=S.useRef(null),b=It(e,x=>f(x)),v=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let x=function(R){if(v.paused||!u)return;const D=R.target;u.contains(D)?m.current=D:vi(m.current,{select:!0})},M=function(R){if(v.paused||!u)return;const D=R.relatedTarget;D!==null&&(u.contains(D)||vi(m.current,{select:!0}))},T=function(R){if(document.activeElement===document.body)for(const _ of R)_.removedNodes.length>0&&vi(u)};document.addEventListener("focusin",x),document.addEventListener("focusout",M);const k=new MutationObserver(T);return u&&k.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",M),k.disconnect()}}},[r,u,v.paused]),S.useEffect(()=>{if(u){Dx.add(v);const x=document.activeElement;if(!u.contains(x)){const T=new CustomEvent(Mm,Ox);u.addEventListener(Mm,h),u.dispatchEvent(T),T.defaultPrevented||(Kz(Qz(D3(u)),{select:!0}),document.activeElement===x&&vi(u))}return()=>{u.removeEventListener(Mm,h),setTimeout(()=>{const T=new CustomEvent(Tm,Ox);u.addEventListener(Tm,p),u.dispatchEvent(T),T.defaultPrevented||vi(x??document.body,{select:!0}),u.removeEventListener(Tm,p),Dx.remove(v)},0)}}},[u,h,p,v]);const C=S.useCallback(x=>{if(!n&&!r||v.paused)return;const M=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,T=document.activeElement;if(M&&T){const k=x.currentTarget,[R,D]=Gz(k);R&&D?!x.shiftKey&&T===D?(x.preventDefault(),n&&vi(R,{select:!0})):x.shiftKey&&T===R&&(x.preventDefault(),n&&vi(D,{select:!0})):T===k&&x.preventDefault()}},[n,r,v.paused]);return w.jsx(Lt.div,{tabIndex:-1,...a,ref:b,onKeyDown:C})});zg.displayName=qz;function Kz(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(vi(r,{select:e}),document.activeElement!==n)return}function Gz(t){const e=D3(t),n=Nx(e,t),r=Nx(e.reverse(),t);return[n,r]}function D3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Nx(t,e){for(const n of t)if(!Yz(n,{upTo:e}))return n}function Yz(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Zz(t){return t instanceof HTMLInputElement&&"select"in t}function vi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Zz(t)&&e&&t.select()}}var Dx=Xz();function Xz(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=Lx(t,e),t.unshift(e)},remove(e){t=Lx(t,e),t[0]?.resume()}}}function Lx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Qz(t){return t.filter(e=>e.tagName!=="A")}var Wz=_f[" useId ".trim().toString()]||(()=>{}),Jz=0;function Df(t){const[e,n]=S.useState(Wz());return Hi(()=>{n(r=>r??String(Jz++))},[t]),t||(e?`radix-${e}`:"")}var ej="Arrow",L3=S.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...l}=t;return w.jsx(Lt.svg,{...l,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});L3.displayName=ej;var tj=L3;function nj(t){const[e,n]=S.useState(void 0);return Hi(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let a,u;if("borderBoxSize"in l){const f=l.borderBoxSize,h=Array.isArray(f)?f[0]:f;a=h.inlineSize,u=h.blockSize}else a=t.offsetWidth,u=t.offsetHeight;n({width:a,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var jg="Popper",[z3,id]=Gs(jg),[rj,j3]=z3(jg),_3=t=>{const{__scopePopper:e,children:n}=t,[r,o]=S.useState(null);return w.jsx(rj,{scope:e,anchor:r,onAnchorChange:o,children:n})};_3.displayName=jg;var I3="PopperAnchor",H3=S.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,l=j3(I3,n),a=S.useRef(null),u=It(e,a),f=S.useRef(null);return S.useEffect(()=>{const h=f.current;f.current=r?.current||a.current,h!==f.current&&l.onAnchorChange(f.current)}),r?null:w.jsx(Lt.div,{...o,ref:u})});H3.displayName=I3;var _g="PopperContent",[ij,oj]=z3(_g),B3=S.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:C,...x}=t,M=j3(_g,n),[T,k]=S.useState(null),R=It(e,pe=>k(pe)),[D,_]=S.useState(null),j=nj(D),L=j?.width??0,B=j?.height??0,Q=r+(l!=="center"?"-"+l:""),ne=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},re=Array.isArray(h)?h:[h],fe=re.length>0,ae={padding:ne,boundary:re.filter(lj),altBoundary:fe},{refs:W,floatingStyles:ie,placement:I,isPositioned:q,middlewareData:P}=J7({strategy:"fixed",placement:Q,whileElementsMounted:(...pe)=>Q7(...pe,{animationFrame:v==="always"}),elements:{reference:M.anchor},middleware:[e3({mainAxis:o+B,alignmentAxis:a}),f&&t3({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?SL():void 0,...ae}),f&&n3({...ae}),wL({...ae,apply:({elements:pe,rects:xe,availableWidth:De,availableHeight:Ut})=>{const{width:In,height:$i}=xe.reference,sr=pe.floating.style;sr.setProperty("--radix-popper-available-width",`${De}px`),sr.setProperty("--radix-popper-available-height",`${Ut}px`),sr.setProperty("--radix-popper-anchor-width",`${In}px`),sr.setProperty("--radix-popper-anchor-height",`${$i}px`)}}),D&&ML({element:D,padding:u}),aj({arrowWidth:L,arrowHeight:B}),b&&EL({strategy:"referenceHidden",...ae})]}),[Y,se]=P3(I),N=Br(C);Hi(()=>{q&&N?.()},[q,N]);const $=P.arrow?.x,J=P.arrow?.y,oe=P.arrow?.centerOffset!==0,[ce,me]=S.useState();return Hi(()=>{T&&me(window.getComputedStyle(T).zIndex)},[T]),w.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:q?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:w.jsx(ij,{scope:n,placedSide:Y,onArrowChange:_,arrowX:$,arrowY:J,shouldHideArrow:oe,children:w.jsx(Lt.div,{"data-side":Y,"data-align":se,...x,ref:R,style:{...x.style,animation:q?void 0:"none"}})})})});B3.displayName=_g;var U3="PopperArrow",sj={top:"bottom",right:"left",bottom:"top",left:"right"},V3=S.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,l=oj(U3,r),a=sj[l.placedSide];return w.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:w.jsx(tj,{...o,ref:n,style:{...o.style,display:"block"}})})});V3.displayName=U3;function lj(t){return t!==null}var aj=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:o}=e,a=o.arrow?.centerOffset!==0,u=a?0:t.arrowWidth,f=a?0:t.arrowHeight,[h,p]=P3(n),m={start:"0%",center:"50%",end:"100%"}[p],b=(o.arrow?.x??0)+u/2,v=(o.arrow?.y??0)+f/2;let C="",x="";return h==="bottom"?(C=a?m:`${b}px`,x=`${-f}px`):h==="top"?(C=a?m:`${b}px`,x=`${r.floating.height+f}px`):h==="right"?(C=`${-f}px`,x=a?m:`${v}px`):h==="left"&&(C=`${r.floating.width+f}px`,x=a?m:`${v}px`),{data:{x:C,y:x}}}});function P3(t){const[e,n="center"]=t.split("-");return[e,n]}var $3=_3,Ig=H3,F3=B3,q3=V3,cj="Portal",Hg=S.forwardRef((t,e)=>{const{container:n,...r}=t,[o,l]=S.useState(!1);Hi(()=>l(!0),[]);const a=n||o&&globalThis?.document?.body;return a?qx.createPortal(w.jsx(Lt.div,{...r,ref:e}),a):null});Hg.displayName=cj;function uj(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var No=t=>{const{present:e,children:n}=t,r=fj(e),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),l=It(r.ref,dj(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:l}):null};No.displayName="Presence";function fj(t){const[e,n]=S.useState(),r=S.useRef(null),o=S.useRef(t),l=S.useRef("none"),a=t?"mounted":"unmounted",[u,f]=uj(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const h=wu(r.current);l.current=u==="mounted"?h:"none"},[u]),Hi(()=>{const h=r.current,p=o.current;if(p!==t){const b=l.current,v=wu(h);t?f("MOUNT"):v==="none"||h?.display==="none"?f("UNMOUNT"):f(p&&b!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,f]),Hi(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=v=>{const x=wu(r.current).includes(CSS.escape(v.animationName));if(v.target===e&&x&&(f("ANIMATION_END"),!o.current)){const M=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=M)})}},b=v=>{v.target===e&&(l.current=wu(r.current))};return e.addEventListener("animationstart",b),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",b),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:S.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function wu(t){return t?.animationName||"none"}function dj(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Am="rovingFocusGroup.onEntryFocus",hj={bubbles:!1,cancelable:!0},Ua="RovingFocusGroup",[w1,K3,pj]=A3(Ua),[mj,G3]=Gs(Ua,[pj]),[gj,yj]=mj(Ua),Y3=S.forwardRef((t,e)=>w.jsx(w1.Provider,{scope:t.__scopeRovingFocusGroup,children:w.jsx(w1.Slot,{scope:t.__scopeRovingFocusGroup,children:w.jsx(vj,{...t,ref:e})})}));Y3.displayName=Ua;var vj=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:l,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...m}=t,b=S.useRef(null),v=It(e,b),C=k3(l),[x,M]=Dg({prop:a,defaultProp:u??null,onChange:f,caller:Ua}),[T,k]=S.useState(!1),R=Br(h),D=K3(n),_=S.useRef(!1),[j,L]=S.useState(0);return S.useEffect(()=>{const B=b.current;if(B)return B.addEventListener(Am,R),()=>B.removeEventListener(Am,R)},[R]),w.jsx(gj,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:x,onItemFocus:S.useCallback(B=>M(B),[M]),onItemShiftTab:S.useCallback(()=>k(!0),[]),onFocusableItemAdd:S.useCallback(()=>L(B=>B+1),[]),onFocusableItemRemove:S.useCallback(()=>L(B=>B-1),[]),children:w.jsx(Lt.div,{tabIndex:T||j===0?-1:0,"data-orientation":r,...m,ref:v,style:{outline:"none",...t.style},onMouseDown:Te(t.onMouseDown,()=>{_.current=!0}),onFocus:Te(t.onFocus,B=>{const Q=!_.current;if(B.target===B.currentTarget&&Q&&!T){const ne=new CustomEvent(Am,hj);if(B.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const re=D().filter(I=>I.focusable),fe=re.find(I=>I.active),ae=re.find(I=>I.id===x),ie=[fe,ae,...re].filter(Boolean).map(I=>I.ref.current);Q3(ie,p)}}_.current=!1}),onBlur:Te(t.onBlur,()=>k(!1))})})}),Z3="RovingFocusGroupItem",X3=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:a,...u}=t,f=Df(),h=l||f,p=yj(Z3,n),m=p.currentTabStopId===h,b=K3(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:x}=p;return S.useEffect(()=>{if(r)return v(),()=>C()},[r,v,C]),w.jsx(w1.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:w.jsx(Lt.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:e,onMouseDown:Te(t.onMouseDown,M=>{r?p.onItemFocus(h):M.preventDefault()}),onFocus:Te(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:Te(t.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){p.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const T=xj(M,p.orientation,p.dir);if(T!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let R=b().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")R.reverse();else if(T==="prev"||T==="next"){T==="prev"&&R.reverse();const D=R.indexOf(M.currentTarget);R=p.loop?Sj(R,D+1):R.slice(D+1)}setTimeout(()=>Q3(R))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:x!=null}):a})})});X3.displayName=Z3;var bj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cj(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function xj(t,e,n){const r=Cj(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return bj[r]}function Q3(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Sj(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var wj=Y3,Ej=X3,Mj=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},xs=new WeakMap,Eu=new WeakMap,Mu={},km=0,W3=function(t){return t&&(t.host||W3(t.parentNode))},Tj=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=W3(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Aj=function(t,e,n,r){var o=Tj(e,Array.isArray(t)?t:[t]);Mu[n]||(Mu[n]=new WeakMap);var l=Mu[n],a=[],u=new Set,f=new Set(o),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};o.forEach(h);var p=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(b){if(u.has(b))p(b);else try{var v=b.getAttribute(r),C=v!==null&&v!=="false",x=(xs.get(b)||0)+1,M=(l.get(b)||0)+1;xs.set(b,x),l.set(b,M),a.push(b),x===1&&C&&Eu.set(b,!0),M===1&&b.setAttribute(n,"true"),C||b.setAttribute(r,"true")}catch(T){console.error("aria-hidden: cannot operate on ",b,T)}})};return p(e),u.clear(),km++,function(){a.forEach(function(m){var b=xs.get(m)-1,v=l.get(m)-1;xs.set(m,b),l.set(m,v),b||(Eu.has(m)||m.removeAttribute(r),Eu.delete(m)),v||m.removeAttribute(n)}),km--,km||(xs=new WeakMap,xs=new WeakMap,Eu=new WeakMap,Mu={})}},J3=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=Mj(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Aj(r,o,n,"aria-hidden")):function(){return null}},Wn=function(){return Wn=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},Wn.apply(this,arguments)};function e5(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function kj(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,l;r<o;r++)(l||!(r in e))&&(l||(l=Array.prototype.slice.call(e,0,r)),l[r]=e[r]);return t.concat(l||Array.prototype.slice.call(e))}var _u="right-scroll-bar-position",Iu="width-before-scroll-bar",Rj="with-scroll-bars-hidden",Oj="--removed-body-scroll-bar-size";function Rm(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Nj(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var Dj=typeof window<"u"?S.useLayoutEffect:S.useEffect,zx=new WeakMap;function Lj(t,e){var n=Nj(null,function(r){return t.forEach(function(o){return Rm(o,r)})});return Dj(function(){var r=zx.get(n);if(r){var o=new Set(r),l=new Set(t),a=n.current;o.forEach(function(u){l.has(u)||Rm(u,null)}),l.forEach(function(u){o.has(u)||Rm(u,a)})}zx.set(n,t)},[t]),n}function zj(t){return t}function jj(t,e){e===void 0&&(e=zj);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(l){var a=e(l,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(l){for(r=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(l),a=n}var f=function(){var p=a;a=[],p.forEach(l)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){a.push(p),h()},filter:function(p){return a=a.filter(p),n}}}};return o}function _j(t){t===void 0&&(t={});var e=jj(null);return e.options=Wn({async:!0,ssr:!1},t),e}var t5=function(t){var e=t.sideCar,n=e5(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,Wn({},n))};t5.isSideCarExport=!0;function Ij(t,e){return t.useMedium(e),t5}var n5=_j(),Om=function(){},od=S.forwardRef(function(t,e){var n=S.useRef(null),r=S.useState({onScrollCapture:Om,onWheelCapture:Om,onTouchMoveCapture:Om}),o=r[0],l=r[1],a=t.forwardProps,u=t.children,f=t.className,h=t.removeScrollBar,p=t.enabled,m=t.shards,b=t.sideCar,v=t.noRelative,C=t.noIsolation,x=t.inert,M=t.allowPinchZoom,T=t.as,k=T===void 0?"div":T,R=t.gapMode,D=e5(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=b,j=Lj([n,e]),L=Wn(Wn({},D),o);return S.createElement(S.Fragment,null,p&&S.createElement(_,{sideCar:n5,removeScrollBar:h,shards:m,noRelative:v,noIsolation:C,inert:x,setCallbacks:l,allowPinchZoom:!!M,lockRef:n,gapMode:R}),a?S.cloneElement(S.Children.only(u),Wn(Wn({},L),{ref:j})):S.createElement(k,Wn({},L,{className:f,ref:j}),u))});od.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};od.classNames={fullWidth:Iu,zeroRight:_u};var Hj=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Bj(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Hj();return e&&t.setAttribute("nonce",e),t}function Uj(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Vj(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Pj=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Bj())&&(Uj(e,n),Vj(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},$j=function(){var t=Pj();return function(e,n){S.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},r5=function(){var t=$j(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},Fj={left:0,top:0,right:0,gap:0},Nm=function(t){return parseInt(t||"",10)||0},qj=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[Nm(n),Nm(r),Nm(o)]},Kj=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Fj;var e=qj(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Gj=r5(),zs="data-scroll-locked",Yj=function(t,e,n,r){var o=t.left,l=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
209
+ .`.concat(Rj,` {
210
+ overflow: hidden `).concat(r,`;
211
+ padding-right: `).concat(u,"px ").concat(r,`;
212
+ }
213
+ body[`).concat(zs,`] {
214
+ overflow: hidden `).concat(r,`;
215
+ overscroll-behavior: contain;
216
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
217
+ padding-left: `.concat(o,`px;
218
+ padding-top: `).concat(l,`px;
219
+ padding-right: `).concat(a,`px;
220
+ margin-left:0;
221
+ margin-top:0;
222
+ margin-right: `).concat(u,"px ").concat(r,`;
223
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
224
+ }
225
+
226
+ .`).concat(_u,` {
227
+ right: `).concat(u,"px ").concat(r,`;
228
+ }
229
+
230
+ .`).concat(Iu,` {
231
+ margin-right: `).concat(u,"px ").concat(r,`;
232
+ }
233
+
234
+ .`).concat(_u," .").concat(_u,` {
235
+ right: 0 `).concat(r,`;
236
+ }
237
+
238
+ .`).concat(Iu," .").concat(Iu,` {
239
+ margin-right: 0 `).concat(r,`;
240
+ }
241
+
242
+ body[`).concat(zs,`] {
243
+ `).concat(Oj,": ").concat(u,`px;
244
+ }
245
+ `)},jx=function(){var t=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(t)?t:0},Zj=function(){S.useEffect(function(){return document.body.setAttribute(zs,(jx()+1).toString()),function(){var t=jx()-1;t<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,t.toString())}},[])},Xj=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;Zj();var l=S.useMemo(function(){return Kj(o)},[o]);return S.createElement(Gj,{styles:Yj(l,!e,o,n?"":"!important")})},E1=!1;if(typeof window<"u")try{var Tu=Object.defineProperty({},"passive",{get:function(){return E1=!0,!0}});window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{E1=!1}var Ss=E1?{passive:!1}:!1,Qj=function(t){return t.tagName==="TEXTAREA"},i5=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Qj(t)&&n[e]==="visible")},Wj=function(t){return i5(t,"overflowY")},Jj=function(t){return i5(t,"overflowX")},_x=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=o5(t,r);if(o){var l=s5(t,r),a=l[1],u=l[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},e_=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},t_=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},o5=function(t,e){return t==="v"?Wj(e):Jj(e)},s5=function(t,e){return t==="v"?e_(e):t_(e)},n_=function(t,e){return t==="h"&&e==="rtl"?-1:1},r_=function(t,e,n,r,o){var l=n_(t,window.getComputedStyle(e).direction),a=l*r,u=n.target,f=e.contains(u),h=!1,p=a>0,m=0,b=0;do{if(!u)break;var v=s5(t,u),C=v[0],x=v[1],M=v[2],T=x-M-l*C;(C||T)&&o5(t,u)&&(m+=T,b+=C);var k=u.parentNode;u=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!f&&u!==document.body||f&&(e.contains(u)||e===u));return(p&&Math.abs(m)<1||!p&&Math.abs(b)<1)&&(h=!0),h},Au=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Ix=function(t){return[t.deltaX,t.deltaY]},Hx=function(t){return t&&"current"in t?t.current:t},i_=function(t,e){return t[0]===e[0]&&t[1]===e[1]},o_=function(t){return`
246
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
247
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
248
+ `)},s_=0,ws=[];function l_(t){var e=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(s_++)[0],l=S.useState(r5)[0],a=S.useRef(t);S.useEffect(function(){a.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var x=kj([t.lockRef.current],(t.shards||[]).map(Hx),!0).filter(Boolean);return x.forEach(function(M){return M.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(M){return M.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var u=S.useCallback(function(x,M){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var T=Au(x),k=n.current,R="deltaX"in x?x.deltaX:k[0]-T[0],D="deltaY"in x?x.deltaY:k[1]-T[1],_,j=x.target,L=Math.abs(R)>Math.abs(D)?"h":"v";if("touches"in x&&L==="h"&&j.type==="range")return!1;var B=_x(L,j);if(!B)return!0;if(B?_=L:(_=L==="v"?"h":"v",B=_x(L,j)),!B)return!1;if(!r.current&&"changedTouches"in x&&(R||D)&&(r.current=_),!_)return!0;var Q=r.current||_;return r_(Q,M,x,Q==="h"?R:D)},[]),f=S.useCallback(function(x){var M=x;if(!(!ws.length||ws[ws.length-1]!==l)){var T="deltaY"in M?Ix(M):Au(M),k=e.current.filter(function(_){return _.name===M.type&&(_.target===M.target||M.target===_.shadowParent)&&i_(_.delta,T)})[0];if(k&&k.should){M.cancelable&&M.preventDefault();return}if(!k){var R=(a.current.shards||[]).map(Hx).filter(Boolean).filter(function(_){return _.contains(M.target)}),D=R.length>0?u(M,R[0]):!a.current.noIsolation;D&&M.cancelable&&M.preventDefault()}}},[]),h=S.useCallback(function(x,M,T,k){var R={name:x,delta:M,target:T,should:k,shadowParent:a_(T)};e.current.push(R),setTimeout(function(){e.current=e.current.filter(function(D){return D!==R})},1)},[]),p=S.useCallback(function(x){n.current=Au(x),r.current=void 0},[]),m=S.useCallback(function(x){h(x.type,Ix(x),x.target,u(x,t.lockRef.current))},[]),b=S.useCallback(function(x){h(x.type,Au(x),x.target,u(x,t.lockRef.current))},[]);S.useEffect(function(){return ws.push(l),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:b}),document.addEventListener("wheel",f,Ss),document.addEventListener("touchmove",f,Ss),document.addEventListener("touchstart",p,Ss),function(){ws=ws.filter(function(x){return x!==l}),document.removeEventListener("wheel",f,Ss),document.removeEventListener("touchmove",f,Ss),document.removeEventListener("touchstart",p,Ss)}},[]);var v=t.removeScrollBar,C=t.inert;return S.createElement(S.Fragment,null,C?S.createElement(l,{styles:o_(o)}):null,v?S.createElement(Xj,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function a_(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const c_=Ij(n5,l_);var Bg=S.forwardRef(function(t,e){return S.createElement(od,Wn({},t,{ref:e,sideCar:c_}))});Bg.classNames=od.classNames;var M1=["Enter"," "],u_=["ArrowDown","PageUp","Home"],l5=["ArrowUp","PageDown","End"],f_=[...u_,...l5],d_={ltr:[...M1,"ArrowRight"],rtl:[...M1,"ArrowLeft"]},h_={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Va="Menu",[ka,p_,m_]=A3(Va),[Do,a5]=Gs(Va,[m_,id,G3]),sd=id(),c5=G3(),[g_,Lo]=Do(Va),[y_,Pa]=Do(Va),u5=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:l,modal:a=!0}=t,u=sd(e),[f,h]=S.useState(null),p=S.useRef(!1),m=Br(l),b=k3(o);return S.useEffect(()=>{const v=()=>{p.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>p.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),w.jsx($3,{...u,children:w.jsx(g_,{scope:e,open:n,onOpenChange:m,content:f,onContentChange:h,children:w.jsx(y_,{scope:e,onClose:S.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:b,modal:a,children:r})})})};u5.displayName=Va;var v_="MenuAnchor",Ug=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=sd(n);return w.jsx(Ig,{...o,...r,ref:e})});Ug.displayName=v_;var Vg="MenuPortal",[b_,f5]=Do(Vg,{forceMount:void 0}),d5=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,l=Lo(Vg,e);return w.jsx(b_,{scope:e,forceMount:n,children:w.jsx(No,{present:n||l.open,children:w.jsx(Hg,{asChild:!0,container:o,children:r})})})};d5.displayName=Vg;var jn="MenuContent",[C_,Pg]=Do(jn),h5=S.forwardRef((t,e)=>{const n=f5(jn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Lo(jn,t.__scopeMenu),a=Pa(jn,t.__scopeMenu);return w.jsx(ka.Provider,{scope:t.__scopeMenu,children:w.jsx(No,{present:r||l.open,children:w.jsx(ka.Slot,{scope:t.__scopeMenu,children:a.modal?w.jsx(x_,{...o,ref:e}):w.jsx(S_,{...o,ref:e})})})})}),x_=S.forwardRef((t,e)=>{const n=Lo(jn,t.__scopeMenu),r=S.useRef(null),o=It(e,r);return S.useEffect(()=>{const l=r.current;if(l)return J3(l)},[]),w.jsx($g,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),S_=S.forwardRef((t,e)=>{const n=Lo(jn,t.__scopeMenu);return w.jsx($g,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),w_=Aa("MenuContent.ScrollLock"),$g=S.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:b,onDismiss:v,disableOutsideScroll:C,...x}=t,M=Lo(jn,n),T=Pa(jn,n),k=sd(n),R=c5(n),D=p_(n),[_,j]=S.useState(null),L=S.useRef(null),B=It(e,L,M.onContentChange),Q=S.useRef(0),ne=S.useRef(""),re=S.useRef(0),fe=S.useRef(null),ae=S.useRef("right"),W=S.useRef(0),ie=C?Bg:S.Fragment,I=C?{as:w_,allowPinchZoom:!0}:void 0,q=Y=>{const se=ne.current+Y,N=D().filter(pe=>!pe.disabled),$=document.activeElement,J=N.find(pe=>pe.ref.current===$)?.textValue,oe=N.map(pe=>pe.textValue),ce=j_(oe,se,J),me=N.find(pe=>pe.textValue===ce)?.ref.current;(function pe(xe){ne.current=xe,window.clearTimeout(Q.current),xe!==""&&(Q.current=window.setTimeout(()=>pe(""),1e3))})(se),me&&setTimeout(()=>me.focus())};S.useEffect(()=>()=>window.clearTimeout(Q.current),[]),N3();const P=S.useCallback(Y=>ae.current===fe.current?.side&&I_(Y,fe.current?.area),[]);return w.jsx(C_,{scope:n,searchRef:ne,onItemEnter:S.useCallback(Y=>{P(Y)&&Y.preventDefault()},[P]),onItemLeave:S.useCallback(Y=>{P(Y)||(L.current?.focus(),j(null))},[P]),onTriggerLeave:S.useCallback(Y=>{P(Y)&&Y.preventDefault()},[P]),pointerGraceTimerRef:re,onPointerGraceIntentChange:S.useCallback(Y=>{fe.current=Y},[]),children:w.jsx(ie,{...I,children:w.jsx(zg,{asChild:!0,trapped:o,onMountAutoFocus:Te(l,Y=>{Y.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:w.jsx(Lg,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:b,onDismiss:v,children:w.jsx(wj,{asChild:!0,...R,dir:T.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:j,onEntryFocus:Te(f,Y=>{T.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(F3,{role:"menu","aria-orientation":"vertical","data-state":R5(M.open),"data-radix-menu-content":"",dir:T.dir,...k,...x,ref:B,style:{outline:"none",...x.style},onKeyDown:Te(x.onKeyDown,Y=>{const N=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,$=Y.ctrlKey||Y.altKey||Y.metaKey,J=Y.key.length===1;N&&(Y.key==="Tab"&&Y.preventDefault(),!$&&J&&q(Y.key));const oe=L.current;if(Y.target!==oe||!f_.includes(Y.key))return;Y.preventDefault();const me=D().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);l5.includes(Y.key)&&me.reverse(),L_(me)}),onBlur:Te(t.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(Q.current),ne.current="")}),onPointerMove:Te(t.onPointerMove,Ra(Y=>{const se=Y.target,N=W.current!==Y.clientX;if(Y.currentTarget.contains(se)&&N){const $=Y.clientX>W.current?"right":"left";ae.current=$,W.current=Y.clientX}}))})})})})})})});h5.displayName=jn;var E_="MenuGroup",Fg=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Lt.div,{role:"group",...r,ref:e})});Fg.displayName=E_;var M_="MenuLabel",p5=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Lt.div,{...r,ref:e})});p5.displayName=M_;var Lf="MenuItem",Bx="menu.itemSelect",ld=S.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,l=S.useRef(null),a=Pa(Lf,t.__scopeMenu),u=Pg(Lf,t.__scopeMenu),f=It(e,l),h=S.useRef(!1),p=()=>{const m=l.current;if(!n&&m){const b=new CustomEvent(Bx,{bubbles:!0,cancelable:!0});m.addEventListener(Bx,v=>r?.(v),{once:!0}),T3(m,b),b.defaultPrevented?h.current=!1:a.onClose()}};return w.jsx(m5,{...o,ref:f,disabled:n,onClick:Te(t.onClick,p),onPointerDown:m=>{t.onPointerDown?.(m),h.current=!0},onPointerUp:Te(t.onPointerUp,m=>{h.current||m.currentTarget?.click()}),onKeyDown:Te(t.onKeyDown,m=>{const b=u.searchRef.current!=="";n||b&&m.key===" "||M1.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});ld.displayName=Lf;var m5=S.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=t,a=Pg(Lf,n),u=c5(n),f=S.useRef(null),h=It(e,f),[p,m]=S.useState(!1),[b,v]=S.useState("");return S.useEffect(()=>{const C=f.current;C&&v((C.textContent??"").trim())},[l.children]),w.jsx(ka.ItemSlot,{scope:n,disabled:r,textValue:o??b,children:w.jsx(Ej,{asChild:!0,...u,focusable:!r,children:w.jsx(Lt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:h,onPointerMove:Te(t.onPointerMove,Ra(C=>{r?a.onItemLeave(C):(a.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(t.onPointerLeave,Ra(C=>a.onItemLeave(C))),onFocus:Te(t.onFocus,()=>m(!0)),onBlur:Te(t.onBlur,()=>m(!1))})})})}),T_="MenuCheckboxItem",g5=S.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return w.jsx(x5,{scope:t.__scopeMenu,checked:n,children:w.jsx(ld,{role:"menuitemcheckbox","aria-checked":zf(n)?"mixed":n,...o,ref:e,"data-state":Kg(n),onSelect:Te(o.onSelect,()=>r?.(zf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});g5.displayName=T_;var y5="MenuRadioGroup",[A_,k_]=Do(y5,{value:void 0,onValueChange:()=>{}}),v5=S.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,l=Br(r);return w.jsx(A_,{scope:t.__scopeMenu,value:n,onValueChange:l,children:w.jsx(Fg,{...o,ref:e})})});v5.displayName=y5;var b5="MenuRadioItem",C5=S.forwardRef((t,e)=>{const{value:n,...r}=t,o=k_(b5,t.__scopeMenu),l=n===o.value;return w.jsx(x5,{scope:t.__scopeMenu,checked:l,children:w.jsx(ld,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":Kg(l),onSelect:Te(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});C5.displayName=b5;var qg="MenuItemIndicator",[x5,R_]=Do(qg,{checked:!1}),S5=S.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,l=R_(qg,n);return w.jsx(No,{present:r||zf(l.checked)||l.checked===!0,children:w.jsx(Lt.span,{...o,ref:e,"data-state":Kg(l.checked)})})});S5.displayName=qg;var O_="MenuSeparator",w5=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Lt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});w5.displayName=O_;var N_="MenuArrow",E5=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=sd(n);return w.jsx(q3,{...o,...r,ref:e})});E5.displayName=N_;var D_="MenuSub",[TB,M5]=Do(D_),Wl="MenuSubTrigger",T5=S.forwardRef((t,e)=>{const n=Lo(Wl,t.__scopeMenu),r=Pa(Wl,t.__scopeMenu),o=M5(Wl,t.__scopeMenu),l=Pg(Wl,t.__scopeMenu),a=S.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=l,h={__scopeMenu:t.__scopeMenu},p=S.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return S.useEffect(()=>p,[p]),S.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),f(null)}},[u,f]),w.jsx(Ug,{asChild:!0,...h,children:w.jsx(m5,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":R5(n.open),...t,ref:rd(e,o.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(t.onPointerMove,Ra(m=>{l.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(l.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Te(t.onPointerLeave,Ra(m=>{p();const b=n.content?.getBoundingClientRect();if(b){const v=n.content?.dataset.side,C=v==="right",x=C?-5:5,M=b[C?"left":"right"],T=b[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:M,y:b.top},{x:T,y:b.top},{x:T,y:b.bottom},{x:M,y:b.bottom}],side:v}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(m),m.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Te(t.onKeyDown,m=>{const b=l.searchRef.current!=="";t.disabled||b&&m.key===" "||d_[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});T5.displayName=Wl;var A5="MenuSubContent",k5=S.forwardRef((t,e)=>{const n=f5(jn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Lo(jn,t.__scopeMenu),a=Pa(jn,t.__scopeMenu),u=M5(A5,t.__scopeMenu),f=S.useRef(null),h=It(e,f);return w.jsx(ka.Provider,{scope:t.__scopeMenu,children:w.jsx(No,{present:r||l.open,children:w.jsx(ka.Slot,{scope:t.__scopeMenu,children:w.jsx($g,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:h,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{a.isUsingKeyboardRef.current&&f.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Te(t.onFocusOutside,p=>{p.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Te(t.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Te(t.onKeyDown,p=>{const m=p.currentTarget.contains(p.target),b=h_[a.dir].includes(p.key);m&&b&&(l.onOpenChange(!1),u.trigger?.focus(),p.preventDefault())})})})})})});k5.displayName=A5;function R5(t){return t?"open":"closed"}function zf(t){return t==="indeterminate"}function Kg(t){return zf(t)?"indeterminate":t?"checked":"unchecked"}function L_(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function z_(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function j_(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let a=z_(t,Math.max(l,0));o.length===1&&(a=a.filter(h=>h!==n));const f=a.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function __(t,e){const{x:n,y:r}=t;let o=!1;for(let l=0,a=e.length-1;l<e.length;a=l++){const u=e[l],f=e[a],h=u.x,p=u.y,m=f.x,b=f.y;p>r!=b>r&&n<(m-h)*(r-p)/(b-p)+h&&(o=!o)}return o}function I_(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return __(n,e)}function Ra(t){return e=>e.pointerType==="mouse"?t(e):void 0}var H_=u5,B_=Ug,U_=d5,V_=h5,P_=Fg,$_=p5,F_=ld,q_=g5,K_=v5,G_=C5,Y_=S5,Z_=w5,X_=E5,Q_=T5,W_=k5,ad="DropdownMenu",[J_]=Gs(ad,[a5]),Kt=a5(),[eI,O5]=J_(ad),N5=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:a,modal:u=!0}=t,f=Kt(e),h=S.useRef(null),[p,m]=Dg({prop:o,defaultProp:l??!1,onChange:a,caller:ad});return w.jsx(eI,{scope:e,triggerId:Df(),triggerRef:h,contentId:Df(),open:p,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(b=>!b),[m]),modal:u,children:w.jsx(H_,{...f,open:p,onOpenChange:m,dir:r,modal:u,children:n})})};N5.displayName=ad;var D5="DropdownMenuTrigger",L5=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,l=O5(D5,n),a=Kt(n);return w.jsx(B_,{asChild:!0,...a,children:w.jsx(Lt.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:rd(e,l.triggerRef),onPointerDown:Te(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(l.onOpenToggle(),l.open||u.preventDefault())}),onKeyDown:Te(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&l.onOpenToggle(),u.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});L5.displayName=D5;var tI="DropdownMenuPortal",z5=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Kt(e);return w.jsx(U_,{...r,...n})};z5.displayName=tI;var j5="DropdownMenuContent",_5=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=O5(j5,n),l=Kt(n),a=S.useRef(!1);return w.jsx(V_,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:e,onCloseAutoFocus:Te(t.onCloseAutoFocus,u=>{a.current||o.triggerRef.current?.focus(),a.current=!1,u.preventDefault()}),onInteractOutside:Te(t.onInteractOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,p=f.button===2||h;(!o.modal||p)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_5.displayName=j5;var nI="DropdownMenuGroup",rI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(P_,{...o,...r,ref:e})});rI.displayName=nI;var iI="DropdownMenuLabel",oI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx($_,{...o,...r,ref:e})});oI.displayName=iI;var sI="DropdownMenuItem",I5=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(F_,{...o,...r,ref:e})});I5.displayName=sI;var lI="DropdownMenuCheckboxItem",aI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(q_,{...o,...r,ref:e})});aI.displayName=lI;var cI="DropdownMenuRadioGroup",uI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(K_,{...o,...r,ref:e})});uI.displayName=cI;var fI="DropdownMenuRadioItem",dI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(G_,{...o,...r,ref:e})});dI.displayName=fI;var hI="DropdownMenuItemIndicator",pI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(Y_,{...o,...r,ref:e})});pI.displayName=hI;var mI="DropdownMenuSeparator",gI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(Z_,{...o,...r,ref:e})});gI.displayName=mI;var yI="DropdownMenuArrow",vI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(X_,{...o,...r,ref:e})});vI.displayName=yI;var bI="DropdownMenuSubTrigger",CI=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(Q_,{...o,...r,ref:e})});CI.displayName=bI;var xI="DropdownMenuSubContent",H5=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return w.jsx(W_,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});H5.displayName=xI;var SI=N5,B5=L5,wI=z5,U5=_5,EI=I5,V5=H5;function P5({...t}){return w.jsx(SI,{modal:!1,...t})}function $5({container:t,...e}){const n=Rg();return w.jsx(wI,{container:t??n??void 0,...e})}const Gg=S.forwardRef(({...t},e)=>w.jsx(B5,{ref:e,...t}));Gg.displayName=B5.displayName;const F5=EI,MI=S.forwardRef(({className:t,portal:e=!0,...n},r)=>{const o=w.jsx(V5,{ref:r,className:Dt("tiptap-dropdown-menu",t),...n});return e?w.jsx($5,{...typeof e=="object"?e:{},children:o}):o});MI.displayName=V5.displayName;const Yg=S.forwardRef(({className:t,sideOffset:e=4,portal:n=!1,...r},o)=>{const l=w.jsx(U5,{ref:o,sideOffset:e,onCloseAutoFocus:a=>a.preventDefault(),className:Dt("tiptap-dropdown-menu",t),...r});return n?w.jsx($5,{...typeof n=="object"?n:{},children:l}):l});Yg.displayName=U5.displayName;const Ys=S.forwardRef(({className:t,...e},n)=>w.jsx("div",{ref:n,className:Dt("tiptap-card",t),...e}));Ys.displayName="Card";const TI=S.forwardRef(({className:t,...e},n)=>w.jsx("div",{ref:n,className:Dt("tiptap-card-header",t),...e}));TI.displayName="CardHeader";const Zs=S.forwardRef(({className:t,...e},n)=>w.jsx("div",{ref:n,className:Dt("tiptap-card-body",t),...e}));Zs.displayName="CardBody";const Oa=S.forwardRef(({className:t,orientation:e="vertical",...n},r)=>w.jsx("div",{ref:r,"data-orientation":e,className:Dt("tiptap-card-item-group",t),...n}));Oa.displayName="CardItemGroup";const AI=S.forwardRef(({className:t,...e},n)=>w.jsx("div",{ref:n,className:Dt("tiptap-card-group-label",t),...e}));AI.displayName="CardGroupLabel";const kI=S.forwardRef(({className:t,...e},n)=>w.jsx("div",{ref:n,className:Dt("tiptap-card-footer",t),...e}));kI.displayName="CardFooter";const q5=S.forwardRef(({editor:t,levels:e=[1,2,3,4,5,6],hideWhenUnavailable:n=!1,portal:r=!1,onOpenChange:o,...l},a)=>{const{editor:u}=Ke(t),[f,h]=S.useState(!1),{isVisible:p,isActive:m,canToggle:b,Icon:v}=OI({editor:u,levels:e,hideWhenUnavailable:n}),C=S.useCallback(x=>{!u||!b||(h(x),o?.(x))},[b,u,o]);return p?w.jsxs(P5,{modal:!0,open:f,onOpenChange:C,children:[w.jsx(Gg,{asChild:!0,children:w.jsxs(We,{type:"button","data-style":"ghost","data-active-state":m?"on":"off",role:"button",tabIndex:-1,disabled:!b,"data-disabled":!b,"aria-label":"Format text as heading","aria-pressed":m,tooltip:"Heading",...l,ref:a,children:[w.jsx(v,{className:"tiptap-button-icon"}),w.jsx(Og,{className:"tiptap-button-dropdown-small"})]})}),w.jsx(Yg,{align:"start",portal:r,children:w.jsx(Ys,{children:w.jsx(Zs,{children:w.jsx(tr,{children:e.map(x=>w.jsx(F5,{asChild:!0,children:w.jsx(g3,{editor:u,level:x,text:`Heading ${x}`,showTooltip:!1})},`heading-${x}`))})})})})]}):null});q5.displayName="HeadingDropdownMenu";const K5=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{d:"M6 3C6.55228 3 7 3.44772 7 4V11H17V4C17 3.44772 17.4477 3 18 3C18.5523 3 19 3.44772 19 4V20C19 20.5523 18.5523 21 18 21C17.4477 21 17 20.5523 17 20V13H7V20C7 20.5523 6.55228 21 6 21C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3Z",fill:"currentColor"})}));K5.displayName="HeadingIcon";function RI(t,e=[1,2,3,4,5,6]){if(!(!t||!t.isEditable))return e.find(n=>Ng(t,n))}function OI(t){const{editor:e,levels:n=[1,2,3,4,5,6],hideWhenUnavailable:r=!1}=t||{},{editor:o}=Ke(e),[l,a]=S.useState(!0),u=RI(o,n),f=Ng(o),h=Ta(o);return S.useEffect(()=>{if(!o)return;const p=()=>{a(M3({editor:o,hideWhenUnavailable:r,level:n}))};return p(),o.on("selectionUpdate",p),()=>{o.off("selectionUpdate",p)}},[o,r,n]),{isVisible:l,activeLevel:u,isActive:f,canToggle:h,levels:n,label:"Heading",Icon:u?w3[u]:K5}}function NI({shortcutKeys:t=T1}){return w.jsx($r,{children:Vr({shortcutKeys:t})})}const G5=S.forwardRef(({editor:t,text:e,hideWhenUnavailable:n=!1,onInserted:r,showShortcut:o=!1,onClick:l,children:a,...u},f)=>{const{editor:h}=Ke(t),{isVisible:p,canInsert:m,handleImage:b,label:v,isActive:C,shortcutKeys:x,Icon:M}=XI({editor:h,hideWhenUnavailable:n,onInserted:r}),T=S.useCallback(k=>{l?.(k),!k.defaultPrevented&&b()},[b,l]);return p?w.jsx(We,{type:"button","data-style":"ghost","data-active-state":C?"on":"off",role:"button",tabIndex:-1,disabled:!m,"data-disabled":!m,"aria-label":v,"aria-pressed":C,tooltip:v,onClick:T,...u,ref:f,children:a??w.jsxs(w.Fragment,{children:[w.jsx(M,{className:"tiptap-button-icon"}),e&&w.jsx("span",{className:"tiptap-button-text",children:e}),o&&w.jsx(NI,{shortcutKeys:x})]})}):null});G5.displayName="ImageUploadButton";const Y5=["shift","alt","meta","mod","ctrl","control"],DI={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Li(t){return(DI[t.trim()]||t.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function Z5(t){return Y5.includes(t)}function Dm(t,e=","){return t.toLowerCase().split(e)}function Lm(t,e="+",n=">",r=!1,o){let l=[],a=!1;t=t.trim(),t.includes(n)?(a=!0,l=t.toLocaleLowerCase().split(n).map(h=>Li(h))):l=t.toLocaleLowerCase().split(e).map(h=>Li(h));const u={alt:l.includes("alt"),ctrl:l.includes("ctrl")||l.includes("control"),shift:l.includes("shift"),meta:l.includes("meta"),mod:l.includes("mod"),useKey:r},f=l.filter(h=>!Y5.includes(h));return{...u,keys:f,description:o,isSequence:a,hotkey:t}}typeof document<"u"&&(document.addEventListener("keydown",t=>{t.code!==void 0&&X5([Li(t.code)])}),document.addEventListener("keyup",t=>{t.code!==void 0&&Q5([Li(t.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{Dr.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{Dr.clear()},0)}));const Dr=new Set;function Zg(t){return Array.isArray(t)}function LI(t,e=","){return(Zg(t)?t:t.split(e)).every(n=>Dr.has(n.trim().toLowerCase()))}function X5(t){const e=Array.isArray(t)?t:[t];Dr.has("meta")&&Dr.forEach(n=>!Z5(n)&&Dr.delete(n.toLowerCase())),e.forEach(n=>Dr.add(n.toLowerCase()))}function Q5(t){const e=Array.isArray(t)?t:[t];t==="meta"?Dr.clear():e.forEach(n=>Dr.delete(n.toLowerCase()))}function zI(t,e,n){(typeof n=="function"&&n(t,e)||n===!0)&&t.preventDefault()}function jI(t,e,n){return typeof n=="function"?n(t,e):n===!0||n===void 0}const _I=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"];function II(t){return W5(t,_I)}function W5(t,e=!1){const{target:n,composed:r}=t;let o,l;return HI(n)&&r?(o=t.composedPath()[0]&&t.composedPath()[0].tagName,l=t.composedPath()[0]&&t.composedPath()[0].role):(o=n&&n.tagName,l=n&&n.role),Zg(e)?!!(o&&e&&e.some(a=>a.toLowerCase()===o.toLowerCase()||a===l)):!!(o&&e&&e)}function HI(t){return!!t.tagName&&!t.tagName.startsWith("-")&&t.tagName.includes("-")}function BI(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):e?t.some(n=>e.includes(n))||t.includes("*"):!0}const UI=(t,e,n=!1)=>{const{alt:r,meta:o,mod:l,shift:a,ctrl:u,keys:f,useKey:h}=e,{code:p,key:m,ctrlKey:b,metaKey:v,shiftKey:C,altKey:x}=t,M=Li(p);if(h&&f?.length===1&&f.includes(m))return!0;if(!f?.includes(M)&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(M))return!1;if(!n){if(r!==x&&M!=="alt"||a!==C&&M!=="shift")return!1;if(l){if(!v&&!b)return!1}else if(o!==v&&M!=="meta"&&M!=="os"||u!==b&&M!=="ctrl"&&M!=="control")return!1}return f&&f.length===1&&f.includes(M)?!0:f?LI(f):!f},VI=S.createContext(void 0),PI=()=>S.useContext(VI);function J5(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce((n,r)=>n&&J5(t[r],e[r]),!0):t===e}const $I=S.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),FI=()=>S.useContext($I);function qI(t){const e=S.useRef(void 0);return J5(e.current,t)||(e.current=t),e.current}const Ux=t=>{t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},KI=typeof window<"u"?S.useLayoutEffect:S.useEffect;function ew(t,e,n,r){const o=S.useRef(null),l=S.useRef(!1),a=Array.isArray(n)?Array.isArray(r)?void 0:r:n,u=Zg(t)?t.join(a?.delimiter):t,f=Array.isArray(n)?n:Array.isArray(r)?r:void 0,h=S.useCallback(e,f??[]),p=S.useRef(h);f?p.current=h:p.current=e;const m=qI(a),{activeScopes:b}=FI(),v=PI();return KI(()=>{if(m?.enabled===!1||!BI(b,m?.scopes))return;let C=[],x;const M=(D,_=!1)=>{if(!(II(D)&&!W5(D,m?.enableOnFormTags))){if(o.current!==null){const j=o.current.getRootNode();if((j instanceof Document||j instanceof ShadowRoot)&&j.activeElement!==o.current&&!o.current.contains(j.activeElement)){Ux(D);return}}D.target?.isContentEditable&&!m?.enableOnContentEditable||Dm(u,m?.delimiter).forEach(j=>{if(j.includes(m?.splitKey??"+")&&j.includes(m?.sequenceSplitKey??">")){console.warn(`Hotkey ${j} contains both ${m?.splitKey??"+"} and ${m?.sequenceSplitKey??">"} which is not supported.`);return}const L=Lm(j,m?.splitKey,m?.sequenceSplitKey,m?.useKey,m?.description);if(L.isSequence){x=setTimeout(()=>{C=[]},m?.sequenceTimeoutMs??1e3);const B=L.useKey?D.key:Li(D.code);if(Z5(B.toLowerCase()))return;C.push(B);const Q=L.keys?.[C.length-1];if(B!==Q){C=[],x&&clearTimeout(x);return}C.length===L.keys?.length&&(p.current(D,L),x&&clearTimeout(x),C=[])}else if(UI(D,L,m?.ignoreModifiers)||L.keys?.includes("*")){if(m?.ignoreEventWhen?.(D)||_&&l.current)return;if(zI(D,L,m?.preventDefault),!jI(D,L,m?.enabled)){Ux(D);return}p.current(D,L),_||(l.current=!0)}})}},T=D=>{D.code!==void 0&&(X5(Li(D.code)),(m?.keydown===void 0&&m?.keyup!==!0||m?.keydown)&&M(D))},k=D=>{D.code!==void 0&&(Q5(Li(D.code)),l.current=!1,m?.keyup&&M(D,!0))},R=o.current||a?.document||document;return R.addEventListener("keyup",k,a?.eventListenerOptions),R.addEventListener("keydown",T,a?.eventListenerOptions),v&&Dm(u,m?.delimiter).forEach(D=>v.addHotkey(Lm(D,m?.splitKey,m?.sequenceSplitKey,m?.useKey,m?.description))),()=>{R.removeEventListener("keyup",k,a?.eventListenerOptions),R.removeEventListener("keydown",T,a?.eventListenerOptions),v&&Dm(u,m?.delimiter).forEach(D=>v.removeHotkey(Lm(D,m?.splitKey,m?.sequenceSplitKey,m?.useKey,m?.description))),C=[],x&&clearTimeout(x)}},[u,m,b]),o}function $a(t=768){const[e,n]=S.useState(void 0);return S.useEffect(()=>{const r=window.matchMedia(`(max-width: ${t-1}px)`),o=()=>{n(window.innerWidth<t)};return r.addEventListener("change",o),n(window.innerWidth<t),()=>r.removeEventListener("change",o)},[t]),!!e}const tw=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 2C20 1.44772 19.5523 1 19 1C18.4477 1 18 1.44772 18 2V4H16C15.4477 4 15 4.44772 15 5C15 5.55228 15.4477 6 16 6H18V8C18 8.55228 18.4477 9 19 9C19.5523 9 20 8.55228 20 8V6H22C22.5523 6 23 5.55228 23 5C23 4.44772 22.5523 4 22 4H20V2ZM5 4C4.73478 4 4.48043 4.10536 4.29289 4.29289C4.10536 4.48043 4 4.73478 4 5V19C4 19.2652 4.10536 19.5196 4.29289 19.7071C4.48043 19.8946 4.73478 20 5 20H5.58579L14.379 11.2068C14.9416 10.6444 15.7045 10.3284 16.5 10.3284C17.2955 10.3284 18.0584 10.6444 18.621 11.2068L20 12.5858V12C20 11.4477 20.4477 11 21 11C21.5523 11 22 11.4477 22 12V14.998C22 14.9994 22 15.0007 22 15.002V19C22 19.7957 21.6839 20.5587 21.1213 21.1213C20.5587 21.6839 19.7957 22 19 22H6.00219C6.00073 22 5.99927 22 5.99781 22H5C4.20435 22 3.44129 21.6839 2.87868 21.1213C2.31607 20.5587 2 19.7957 2 19V5C2 4.20435 2.31607 3.44129 2.87868 2.87868C3.44129 2.31607 4.20435 2 5 2H12C12.5523 2 13 2.44772 13 3C13 3.55228 12.5523 4 12 4H5ZM8.41422 20H19C19.2652 20 19.5196 19.8946 19.7071 19.7071C19.8946 19.5196 20 19.2652 20 19V15.4142L17.207 12.6212C17.0195 12.4338 16.7651 12.3284 16.5 12.3284C16.2349 12.3284 15.9806 12.4337 15.7931 12.6211L8.41422 20ZM6.87868 6.87868C7.44129 6.31607 8.20435 6 9 6C9.79565 6 10.5587 6.31607 11.1213 6.87868C11.6839 7.44129 12 8.20435 12 9C12 9.79565 11.6839 10.5587 11.1213 11.1213C10.5587 11.6839 9.79565 12 9 12C8.20435 12 7.44129 11.6839 6.87868 11.1213C6.31607 10.5587 6 9.79565 6 9C6 8.20435 6.31607 7.44129 6.87868 6.87868ZM9 8C8.73478 8 8.48043 8.10536 8.29289 8.29289C8.10536 8.48043 8 8.73478 8 9C8 9.26522 8.10536 9.51957 8.29289 9.70711C8.48043 9.89464 8.73478 10 9 10C9.26522 10 9.51957 9.89464 9.70711 9.70711C9.89464 9.51957 10 9.26522 10 9C10 8.73478 9.89464 8.48043 9.70711 8.29289C9.51957 8.10536 9.26522 8 9 8Z",fill:"currentColor"})}));tw.displayName="ImagePlusIcon";const T1="mod+shift+i";function Xg(t){return!t||!t.isEditable||!nd(t,"imageUpload")||Pr(t,["image"])?!1:t.can().insertContent({type:"imageUpload"})}function GI(t){return!t||!t.isEditable?!1:t.isActive("imageUpload")}function YI(t){if(!t||!t.isEditable||!Xg(t))return!1;try{return t.chain().focus().insertContent({type:"imageUpload"}).run()}catch{return!1}}function ZI(t){const{editor:e,hideWhenUnavailable:n}=t;return!e||!e.isEditable||!nd(e,"imageUpload")?!1:n&&!e.isActive("code")?Xg(e):!0}function XI(t){const{editor:e,hideWhenUnavailable:n=!1,onInserted:r}=t||{},{editor:o}=Ke(e),l=$a(),[a,u]=S.useState(!0),f=Xg(o),h=GI(o);S.useEffect(()=>{if(!o)return;const m=()=>{u(ZI({editor:o,hideWhenUnavailable:n}))};return m(),o.on("selectionUpdate",m),()=>{o.off("selectionUpdate",m)}},[o,n]);const p=S.useCallback(()=>{if(!o)return!1;const m=YI(o);return m&&r?.(),m},[o,r]);return ew(T1,m=>{m.preventDefault(),p()},{enabled:a&&f,enableOnContentEditable:!l,enableOnFormTags:!0}),{isVisible:a,isActive:h,handleImage:p,canInsert:f,label:"Add image",shortcutKeys:T1,Icon:tw}}const nw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),w.jsx("polygon",{points:"10,8 16,12 10,16",fill:"currentColor",stroke:"none"})]}));nw.displayName="VideoIcon";function Vx(t){return!t||!t.isEditable?!1:t.can().insertContent({type:"videoEmbed",attrs:{src:""}})}function QI(t={}){const{editor:e,hideWhenUnavailable:n=!1,onInserted:r}=t,{editor:o}=Ke(e),[l,a]=S.useState(!0),u=Vx(o);S.useEffect(()=>{if(!o)return;const h=()=>{if(!o.isEditable){a(!1);return}if(!o.extensionManager.extensions.some(m=>m.name==="videoEmbed")){a(!1);return}if(n){a(Vx(o));return}a(!0)};return h(),o.on("selectionUpdate",h),()=>{o.off("selectionUpdate",h)}},[o,n]);const f=S.useCallback(h=>{if(!o||!h)return!1;const p=o.chain().focus().setVideoEmbed({src:h}).run();return p&&r?.(),p},[o,r]);return{isVisible:l,canInsert:u,insertVideo:f,label:"Embed video",Icon:nw}}var cd="Popover",[rw]=Gs(cd,[id]),Fa=id(),[WI,Pi]=rw(cd),iw=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:a=!1}=t,u=Fa(e),f=S.useRef(null),[h,p]=S.useState(!1),[m,b]=Dg({prop:r,defaultProp:o??!1,onChange:l,caller:cd});return w.jsx($3,{...u,children:w.jsx(WI,{scope:e,contentId:Df(),triggerRef:f,open:m,onOpenChange:b,onOpenToggle:S.useCallback(()=>b(v=>!v),[b]),hasCustomAnchor:h,onCustomAnchorAdd:S.useCallback(()=>p(!0),[]),onCustomAnchorRemove:S.useCallback(()=>p(!1),[]),modal:a,children:n})})};iw.displayName=cd;var ow="PopoverAnchor",JI=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Pi(ow,n),l=Fa(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:u}=o;return S.useEffect(()=>(a(),()=>u()),[a,u]),w.jsx(Ig,{...l,...r,ref:e})});JI.displayName=ow;var sw="PopoverTrigger",lw=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Pi(sw,n),l=Fa(n),a=It(e,o.triggerRef),u=w.jsx(Lt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dw(o.open),...r,ref:a,onClick:Te(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:w.jsx(Ig,{asChild:!0,...l,children:u})});lw.displayName=sw;var Qg="PopoverPortal",[eH,tH]=rw(Qg,{forceMount:void 0}),aw=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,l=Pi(Qg,e);return w.jsx(eH,{scope:e,forceMount:n,children:w.jsx(No,{present:n||l.open,children:w.jsx(Hg,{asChild:!0,container:o,children:r})})})};aw.displayName=Qg;var Ps="PopoverContent",cw=S.forwardRef((t,e)=>{const n=tH(Ps,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,l=Pi(Ps,t.__scopePopover);return w.jsx(No,{present:r||l.open,children:l.modal?w.jsx(rH,{...o,ref:e}):w.jsx(iH,{...o,ref:e})})});cw.displayName=Ps;var nH=Aa("PopoverContent.RemoveScroll"),rH=S.forwardRef((t,e)=>{const n=Pi(Ps,t.__scopePopover),r=S.useRef(null),o=It(e,r),l=S.useRef(!1);return S.useEffect(()=>{const a=r.current;if(a)return J3(a)},[]),w.jsx(Bg,{as:nH,allowPinchZoom:!0,children:w.jsx(uw,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(t.onCloseAutoFocus,a=>{a.preventDefault(),l.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Te(t.onPointerDownOutside,a=>{const u=a.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;l.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Te(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),iH=S.forwardRef((t,e)=>{const n=Pi(Ps,t.__scopePopover),r=S.useRef(!1),o=S.useRef(!1);return w.jsx(uw,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),l.defaultPrevented||(r.current||n.triggerRef.current?.focus(),l.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=l.target;n.triggerRef.current?.contains(a)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),uw=S.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,...m}=t,b=Pi(Ps,n),v=Fa(n);return N3(),w.jsx(zg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:w.jsx(Lg,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>b.onOpenChange(!1),children:w.jsx(F3,{"data-state":dw(b.open),role:"dialog",id:b.contentId,...v,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),fw="PopoverClose",oH=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Pi(fw,n);return w.jsx(Lt.button,{type:"button",...r,ref:e,onClick:Te(t.onClick,()=>o.onOpenChange(!1))})});oH.displayName=fw;var sH="PopoverArrow",lH=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Fa(n);return w.jsx(q3,{...o,...r,ref:e})});lH.displayName=sH;function dw(t){return t?"open":"closed"}var aH=iw,cH=lw,uH=aw,fH=cw;function Wg({...t}){return w.jsx(aH,{...t})}function Jg({...t}){return w.jsx(cH,{...t})}function e0({className:t,align:e="center",sideOffset:n=4,...r}){const o=Rg();return w.jsx(uH,{container:o??void 0,children:w.jsx(fH,{align:e,sideOffset:n,className:Dt("tiptap-popover",t),...r})})}function hw({className:t,type:e,...n}){return w.jsx("input",{type:e,className:Dt("tiptap-input",t),...n})}function pw({className:t,children:e,...n}){return w.jsx("div",{className:Dt("tiptap-input-group",t),...n,children:e})}const t0=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 4C21 3.44772 20.5523 3 20 3C19.4477 3 19 3.44772 19 4V11C19 11.7956 18.6839 12.5587 18.1213 13.1213C17.5587 13.6839 16.7956 14 16 14H6.41421L9.70711 10.7071C10.0976 10.3166 10.0976 9.68342 9.70711 9.29289C9.31658 8.90237 8.68342 8.90237 8.29289 9.29289L3.29289 14.2929C2.90237 14.6834 2.90237 15.3166 3.29289 15.7071L8.29289 20.7071C8.68342 21.0976 9.31658 21.0976 9.70711 20.7071C10.0976 20.3166 10.0976 19.6834 9.70711 19.2929L6.41421 16H16C17.3261 16 18.5979 15.4732 19.5355 14.5355C20.4732 13.5979 21 12.3261 21 11V4Z",fill:"currentColor"})}));t0.displayName="CornerDownLeftIcon";const mw=S.forwardRef(({editor:t,text:e,hideWhenUnavailable:n=!1,onInserted:r,onClick:o,children:l,...a},u)=>{const{editor:f}=Ke(t),[h,p]=S.useState(!1),[m,b]=S.useState(""),[v,C]=S.useState(""),{isVisible:x,canInsert:M,insertVideo:T,label:k,Icon:R}=QI({editor:f,hideWhenUnavailable:n,onInserted:r}),D=S.useCallback(()=>{if(!m.trim())return;if(!m3(m.trim())){C("Please enter a valid YouTube or Vimeo URL");return}C(""),T(m.trim())&&(b(""),p(!1))},[m,T]),_=S.useCallback(B=>{B.key==="Enter"&&(B.preventDefault(),D())},[D]),j=S.useCallback(B=>{p(B),B||(b(""),C(""))},[]),L=S.useCallback(B=>{o?.(B),!B.defaultPrevented&&p(!h)},[o,h]);return x?w.jsxs(Wg,{open:h,onOpenChange:j,children:[w.jsx(Jg,{asChild:!0,children:w.jsx(We,{type:"button",disabled:!M,"data-style":"ghost","data-disabled":!M,"aria-label":k,tooltip:k,onClick:L,...a,ref:u,children:l??w.jsxs(w.Fragment,{children:[w.jsx(R,{className:"tiptap-button-icon"}),e&&w.jsx("span",{className:"tiptap-button-text",children:e})]})})}),w.jsx(e0,{children:w.jsx(Ys,{children:w.jsxs(Zs,{children:[w.jsxs(Oa,{orientation:"horizontal",children:[w.jsx(pw,{children:w.jsx(hw,{type:"url",placeholder:"Paste YouTube or Vimeo URL...",value:m,onChange:B=>{b(B.target.value),C("")},onKeyDown:_,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})}),w.jsx(tr,{orientation:"horizontal",children:w.jsx(We,{type:"button",onClick:D,title:"Embed video",disabled:!m.trim(),"data-style":"ghost",children:w.jsx(t0,{className:"tiptap-button-icon"})})})]}),v&&w.jsx("div",{style:{color:"var(--tt-color-red-base, #e53e3e)",fontSize:"12px",padding:"4px 8px 0"},children:v})]})})})]}):null});mw.displayName="VideoEmbedButton";function dH({type:t,shortcutKeys:e=vw[t]}){return w.jsx($r,{children:Vr({shortcutKeys:e})})}const gw=S.forwardRef(({editor:t,type:e,text:n,hideWhenUnavailable:r=!1,onToggled:o,showShortcut:l=!1,onClick:a,children:u,...f},h)=>{const{editor:p}=Ke(t),{isVisible:m,canToggle:b,isActive:v,handleToggle:C,label:x,shortcutKeys:M,Icon:T}=gH({editor:p,type:e,hideWhenUnavailable:r,onToggled:o}),k=S.useCallback(R=>{a?.(R),!R.defaultPrevented&&C()},[C,a]);return m?w.jsx(We,{type:"button","data-style":"ghost","data-active-state":v?"on":"off",role:"button",tabIndex:-1,disabled:!b,"data-disabled":!b,"aria-label":x,"aria-pressed":v,tooltip:x,onClick:k,...f,ref:h,children:u??w.jsxs(w.Fragment,{children:[w.jsx(T,{className:"tiptap-button-icon"}),n&&w.jsx("span",{className:"tiptap-button-text",children:n}),l&&w.jsx(dH,{type:e,shortcutKeys:M})]})}):null});gw.displayName="ListButton";const ud=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));ud.displayName="ListIcon";const n0=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z",fill:"currentColor"})]}));n0.displayName="ListOrderedIcon";const r0=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 4.89543 2.89543 4 4 4H8C9.10457 4 10 4.89543 10 6V10C10 11.1046 9.10457 12 8 12H4C2.89543 12 2 11.1046 2 10V6ZM8 6H4V10H8V6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071L2.29289 17.7071C1.90237 17.3166 1.90237 16.6834 2.29289 16.2929C2.68342 15.9024 3.31658 15.9024 3.70711 16.2929L5 17.5858L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 6C12 5.44772 12.4477 5 13 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H13C12.4477 7 12 6.55228 12 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 12C12 11.4477 12.4477 11 13 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H13C12.4477 13 12 12.5523 12 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18C12 17.4477 12.4477 17 13 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H13C12.4477 19 12 18.5523 12 18Z",fill:"currentColor"})]}));r0.displayName="ListTodoIcon";const yw={bulletList:ud,orderedList:n0,taskList:r0},hH={bulletList:"Bullet List",orderedList:"Ordered List",taskList:"Task List"},vw={bulletList:"mod+shift+8",orderedList:"mod+shift+7",taskList:"mod+shift+9"};function fd(t,e,n=!0){if(!t||!t.isEditable||!Oo(e,t)||Pr(t,["image"]))return!1;if(!n)switch(e){case"bulletList":return t.can().toggleBulletList();case"orderedList":return t.can().toggleOrderedList();case"taskList":return t.can().toggleList("taskList","taskItem");default:return!1}try{const o=t.view.state,l=o.selection;if(l.empty||l instanceof ve){const a=Ks({editor:t,node:o.selection.$anchor.node(1)})?.pos;if(!Vi(a))return!1}return!0}catch{return!1}}function i0(t,e){if(!t||!t.isEditable)return!1;switch(e){case"bulletList":return t.isActive("bulletList");case"orderedList":return t.isActive("orderedList");case"taskList":return t.isActive("taskList");default:return!1}}function pH(t,e){if(!t||!t.isEditable||!fd(t,e))return!1;try{const n=t.view;let r=n.state,o=r.tr;if(r.selection.empty||r.selection instanceof ve){const u=Ks({editor:t,node:r.selection.$anchor.node(1)})?.pos;if(!Vi(u))return!1;o=o.setSelection(de.create(r.doc,u)),n.dispatch(o),r=n.state}const l=r.selection;let a=t.chain().focus();if(l instanceof de){const u=l.node.firstChild?.firstChild,f=l.node.lastChild?.lastChild,h=u?l.from+u.nodeSize:l.from+1,p=f?l.to-f.nodeSize:l.to-1;a=a.setTextSelection({from:h,to:p}).clearNodes()}if(t.isActive(e))a.liftListItem("listItem").lift("bulletList").lift("orderedList").lift("taskList").run();else{const f={bulletList:()=>a.toggleBulletList(),orderedList:()=>a.toggleOrderedList(),taskList:()=>a.toggleList("taskList","taskItem")}[e];if(!f)return!1;f().run()}return t.chain().focus().selectTextblockEnd().run(),!0}catch{return!1}}function mH(t){const{editor:e,type:n,hideWhenUnavailable:r}=t;return!e||!e.isEditable||!Oo(n,e)?!1:r&&!e.isActive("code")?fd(e,n):!0}function gH(t){const{editor:e,type:n,hideWhenUnavailable:r=!1,onToggled:o}=t,{editor:l}=Ke(e),[a,u]=S.useState(!0),f=fd(l,n),h=i0(l,n);S.useEffect(()=>{if(!l)return;const m=()=>{u(mH({editor:l,type:n,hideWhenUnavailable:r}))};return m(),l.on("selectionUpdate",m),()=>{l.off("selectionUpdate",m)}},[l,n,r]);const p=S.useCallback(()=>{if(!l)return!1;const m=pH(l,n);return m&&o?.(),m},[l,n,o]);return{isVisible:a,isActive:h,handleToggle:p,canToggle:f,label:hH[n],shortcutKeys:vw[n],Icon:yw[n]}}const yH=[{label:"Bullet List",type:"bulletList",icon:ud},{label:"Ordered List",type:"orderedList",icon:n0},{label:"Task List",type:"taskList",icon:r0}];function vH(t,e){return!t||!t.isEditable?!1:e.some(n=>fd(t,n))}function bH(t,e){return!t||!t.isEditable?!1:e.some(n=>i0(t,n))}function CH(t){return yH.filter(e=>!e.type||t.includes(e.type))}function xH(t){const{editor:e,hideWhenUnavailable:n,listInSchema:r,canToggleAny:o}=t;return!r||!e?!1:n&&!e.isActive("code")?o:!0}function SH(t,e){if(!(!t||!t.isEditable))return e.find(n=>i0(t,n))}function wH(t){const{editor:e,types:n=["bulletList","orderedList","taskList"],hideWhenUnavailable:r=!1}=t||{},{editor:o}=Ke(e),[l,a]=S.useState(!1),u=n.some(v=>Oo(v,o)),f=S.useMemo(()=>CH(n),[n]),h=vH(o,n),p=bH(o,n),m=SH(o,n),b=f.find(v=>v.type===m);return S.useEffect(()=>{if(!o)return;const v=()=>{a(xH({editor:o,hideWhenUnavailable:r,listInSchema:u,canToggleAny:h}))};return v(),o.on("selectionUpdate",v),()=>{o.off("selectionUpdate",v)}},[h,o,r,u,n]),{isVisible:l,activeType:m,isActive:p,canToggle:h,types:n,filteredLists:f,label:"List",Icon:b?yw[b.type]:ud}}function EH({editor:t,types:e=["bulletList","orderedList","taskList"],hideWhenUnavailable:n=!1,onOpenChange:r,portal:o=!1,...l}){const{editor:a}=Ke(t),[u,f]=S.useState(!1),{filteredLists:h,canToggle:p,isActive:m,isVisible:b,Icon:v}=wH({editor:a,types:e,hideWhenUnavailable:n}),C=S.useCallback(x=>{f(x),r?.(x)},[r]);return!b||!a||!a.isEditable?null:w.jsxs(P5,{open:u,onOpenChange:C,children:[w.jsx(Gg,{asChild:!0,children:w.jsxs(We,{type:"button","data-style":"ghost","data-active-state":m?"on":"off",role:"button",tabIndex:-1,disabled:!p,"data-disabled":!p,"aria-label":"List options",tooltip:"List",...l,children:[w.jsx(v,{className:"tiptap-button-icon"}),w.jsx(Og,{className:"tiptap-button-dropdown-small"})]})}),w.jsx(Yg,{align:"start",portal:o,children:w.jsx(Ys,{children:w.jsx(Zs,{children:w.jsx(tr,{children:h.map(x=>w.jsx(F5,{asChild:!0,children:w.jsx(gw,{editor:a,type:x.type,text:x.label,showTooltip:!1})},x.type))})})})})]})}function MH({shortcutKeys:t=xw}){return w.jsx($r,{children:Vr({shortcutKeys:t})})}const bw=S.forwardRef(({editor:t,text:e,hideWhenUnavailable:n=!1,onToggled:r,showShortcut:o=!1,onClick:l,children:a,...u},f)=>{const{editor:h}=Ke(t),{isVisible:p,canToggle:m,isActive:b,handleToggle:v,label:C,shortcutKeys:x,Icon:M}=kH({editor:h,hideWhenUnavailable:n,onToggled:r}),T=S.useCallback(k=>{l?.(k),!k.defaultPrevented&&v()},[v,l]);return p?w.jsx(We,{type:"button","data-style":"ghost","data-active-state":b?"on":"off",role:"button",tabIndex:-1,disabled:!m,"data-disabled":!m,"aria-label":C,"aria-pressed":b,tooltip:"Blockquote",onClick:T,...u,ref:f,children:a??w.jsxs(w.Fragment,{children:[w.jsx(M,{className:"tiptap-button-icon"}),e&&w.jsx("span",{className:"tiptap-button-text",children:e}),o&&w.jsx(MH,{shortcutKeys:x})]})}):null});bw.displayName="BlockquoteButton";const Cw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 6C8 5.44772 8.44772 5 9 5H16C16.5523 5 17 5.44772 17 6C17 6.55228 16.5523 7 16 7H9C8.44772 7 8 6.55228 8 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3C4.55228 3 5 3.44772 5 4L5 20C5 20.5523 4.55229 21 4 21C3.44772 21 3 20.5523 3 20L3 4C3 3.44772 3.44772 3 4 3Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12C8 11.4477 8.44772 11 9 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H9C8.44772 13 8 12.5523 8 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 18C8 17.4477 8.44772 17 9 17H16C16.5523 17 17 17.4477 17 18C17 18.5523 16.5523 19 16 19H9C8.44772 19 8 18.5523 8 18Z",fill:"currentColor"})]}));Cw.displayName="BlockquoteIcon";const xw="mod+shift+b";function o0(t,e=!0){if(!t||!t.isEditable||!Oo("blockquote",t)||Pr(t,["image"]))return!1;if(!e)return t.can().toggleWrap("blockquote");try{const r=t.view.state,o=r.selection;if(o.empty||o instanceof ve){const l=Ks({editor:t,node:r.selection.$anchor.node(1)})?.pos;if(!Vi(l))return!1}return!0}catch{return!1}}function TH(t){if(!t||!t.isEditable||!o0(t))return!1;try{const e=t.view;let n=e.state,r=n.tr;if(n.selection.empty||n.selection instanceof ve){const u=Ks({editor:t,node:n.selection.$anchor.node(1)})?.pos;if(!Vi(u))return!1;r=r.setSelection(de.create(n.doc,u)),e.dispatch(r),n=e.state}const o=n.selection;let l=t.chain().focus();if(o instanceof de){const u=o.node.firstChild?.firstChild,f=o.node.lastChild?.lastChild,h=u?o.from+u.nodeSize:o.from+1,p=f?o.to-f.nodeSize:o.to-1;l=l.setTextSelection({from:h,to:p}).clearNodes()}return(t.isActive("blockquote")?l.lift("blockquote"):l.wrapIn("blockquote")).run(),t.chain().focus().selectTextblockEnd().run(),!0}catch{return!1}}function AH(t){const{editor:e,hideWhenUnavailable:n}=t;return!e||!e.isEditable||!Oo("blockquote",e)?!1:n&&!e.isActive("code")?o0(e):!0}function kH(t){const{editor:e,hideWhenUnavailable:n=!1,onToggled:r}=t||{},{editor:o}=Ke(e),[l,a]=S.useState(!0),u=o0(o),f=o?.isActive("blockquote")||!1;S.useEffect(()=>{if(!o)return;const p=()=>{a(AH({editor:o,hideWhenUnavailable:n}))};return p(),o.on("selectionUpdate",p),()=>{o.off("selectionUpdate",p)}},[o,n]);const h=S.useCallback(()=>{if(!o)return!1;const p=TH(o);return p&&r?.(),p},[o,r]);return{isVisible:l,isActive:f,handleToggle:h,canToggle:u,label:"Blockquote",shortcutKeys:xw,Icon:Cw}}const A1=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.43471 4.01458C4.34773 4.06032 4.26607 4.11977 4.19292 4.19292C4.11977 4.26607 4.06032 4.34773 4.01458 4.43471C2.14611 6.40628 1 9.0693 1 12C1 18.0751 5.92487 23 12 23C14.9306 23 17.5936 21.854 19.5651 19.9856C19.6522 19.9398 19.7339 19.8803 19.8071 19.8071C19.8803 19.7339 19.9398 19.6522 19.9856 19.5651C21.854 17.5936 23 14.9306 23 12C23 5.92487 18.0751 1 12 1C9.0693 1 6.40628 2.14611 4.43471 4.01458ZM6.38231 4.9681C7.92199 3.73647 9.87499 3 12 3C16.9706 3 21 7.02944 21 12C21 14.125 20.2635 16.078 19.0319 17.6177L6.38231 4.9681ZM17.6177 19.0319C16.078 20.2635 14.125 21 12 21C7.02944 21 3 16.9706 3 12C3 9.87499 3.73647 7.92199 4.9681 6.38231L17.6177 19.0319Z",fill:"currentColor"})}));A1.displayName="BanIcon";const dd=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7072 4.70711C15.0977 4.31658 15.0977 3.68342 14.7072 3.29289C14.3167 2.90237 13.6835 2.90237 13.293 3.29289L8.69294 7.89286L8.68594 7.9C8.13626 8.46079 7.82837 9.21474 7.82837 10C7.82837 10.2306 7.85491 10.4584 7.90631 10.6795L2.29289 16.2929C2.10536 16.4804 2 16.7348 2 17V20C2 20.5523 2.44772 21 3 21H12C12.2652 21 12.5196 20.8946 12.7071 20.7071L15.3205 18.0937C15.5416 18.1452 15.7695 18.1717 16.0001 18.1717C16.7853 18.1717 17.5393 17.8639 18.1001 17.3142L22.7072 12.7071C23.0977 12.3166 23.0977 11.6834 22.7072 11.2929C22.3167 10.9024 21.6835 10.9024 21.293 11.2929L16.6971 15.8887C16.5105 16.0702 16.2605 16.1717 16.0001 16.1717C15.7397 16.1717 15.4897 16.0702 15.303 15.8887L10.1113 10.697C9.92992 10.5104 9.82837 10.2604 9.82837 10C9.82837 9.73963 9.92992 9.48958 10.1113 9.30297L14.7072 4.70711ZM13.5858 17L9.00004 12.4142L4 17.4142V19H11.5858L13.5858 17Z",fill:"currentColor"})}));dd.displayName="HighlighterIcon";function RH({shortcutKeys:t=k1}){return w.jsx($r,{children:Vr({shortcutKeys:t})})}const Sw=S.forwardRef(({editor:t,highlightColor:e,text:n,hideWhenUnavailable:r=!1,onApplied:o,showShortcut:l=!1,onClick:a,children:u,style:f,...h},p)=>{const{editor:m}=Ke(t),{isVisible:b,canColorHighlight:v,isActive:C,handleColorHighlight:x,label:M,shortcutKeys:T}=l0({editor:m,highlightColor:e,label:n||`Toggle highlight (${e})`,hideWhenUnavailable:r,onApplied:o}),k=S.useCallback(D=>{a?.(D),!D.defaultPrevented&&x()},[x,a]),R=S.useMemo(()=>({...f,"--highlight-color":e}),[e,f]);return b?w.jsx(We,{type:"button","data-style":"ghost","data-active-state":C?"on":"off",role:"button",tabIndex:-1,disabled:!v,"data-disabled":!v,"aria-label":M,"aria-pressed":C,tooltip:M,onClick:k,style:R,...h,ref:p,children:u??w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"tiptap-button-highlight",style:{"--highlight-color":e}}),n&&w.jsx("span",{className:"tiptap-button-text",children:n}),l&&w.jsx(RH,{shortcutKeys:T})]})}):null});Sw.displayName="ColorHighlightButton";const k1="mod+shift+h",OH=[{label:"Default background",value:"var(--tt-bg-color)",border:"var(--tt-bg-color-contrast)"},{label:"Gray background",value:"var(--tt-color-highlight-gray)",border:"var(--tt-color-highlight-gray-contrast)"},{label:"Brown background",value:"var(--tt-color-highlight-brown)",border:"var(--tt-color-highlight-brown-contrast)"},{label:"Orange background",value:"var(--tt-color-highlight-orange)",border:"var(--tt-color-highlight-orange-contrast)"},{label:"Yellow background",value:"var(--tt-color-highlight-yellow)",border:"var(--tt-color-highlight-yellow-contrast)"},{label:"Green background",value:"var(--tt-color-highlight-green)",border:"var(--tt-color-highlight-green-contrast)"},{label:"Blue background",value:"var(--tt-color-highlight-blue)",border:"var(--tt-color-highlight-blue-contrast)"},{label:"Purple background",value:"var(--tt-color-highlight-purple)",border:"var(--tt-color-highlight-purple-contrast)"},{label:"Pink background",value:"var(--tt-color-highlight-pink)",border:"var(--tt-color-highlight-pink-contrast)"},{label:"Red background",value:"var(--tt-color-highlight-red)",border:"var(--tt-color-highlight-red-contrast)"}];function NH(t){const e=new Map(OH.map(n=>[n.value,n]));return t.map(n=>e.get(n)).filter(n=>!!n)}function s0(t){return!t||!t.isEditable||!Ro("highlight",t)||Pr(t,["image"])?!1:t.can().setMark("highlight")}function DH(t,e){return!t||!t.isEditable?!1:e?t.isActive("highlight",{color:e}):t.isActive("highlight")}function LH(t){return!t||!t.isEditable||!s0(t)?!1:t.chain().focus().unsetMark("highlight").run()}function zH(t){const{editor:e,hideWhenUnavailable:n}=t;return!e||!e.isEditable||!Ro("highlight",e)?!1:n&&!e.isActive("code")?s0(e):!0}function l0(t){const{editor:e,label:n,highlightColor:r,hideWhenUnavailable:o=!1,onApplied:l}=t,{editor:a}=Ke(e),u=$a(),[f,h]=S.useState(!0),p=s0(a),m=DH(a,r);S.useEffect(()=>{if(!a)return;const C=()=>{h(zH({editor:a,hideWhenUnavailable:o}))};return C(),a.on("selectionUpdate",C),()=>{a.off("selectionUpdate",C)}},[a,o]);const b=S.useCallback(()=>{if(!a||!p||!r||!n)return!1;if(a.state.storedMarks){const C=a.schema.marks.highlight;C&&a.view.dispatch(a.state.tr.removeStoredMark(C))}setTimeout(()=>{const C=a.chain().focus().toggleMark("highlight",{color:r}).run();return C&&l?.({color:r,label:n}),C},0)},[p,r,a,n,l]),v=S.useCallback(()=>{const C=LH(a);return C&&l?.({color:"",label:"Remove highlight"}),C},[a,l]);return ew(k1,C=>{C.preventDefault(),b()},{enabled:f&&p,enableOnContentEditable:!u,enableOnFormTags:!0}),{isVisible:f,isActive:m,handleColorHighlight:b,handleRemoveHighlight:v,canColorHighlight:p,label:n||"Highlight",shortcutKeys:k1,Icon:dd}}const ww=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M11.1 3C11.4762 3 11.8126 3.2286 11.9487 3.5786L16.9487 16.4214C17.1429 16.9213 16.8913 17.4816 16.3877 17.6743C15.884 17.8671 15.3196 17.6173 15.1254 17.1173L13.7569 13.5997H8.24311L6.87456 17.1173C6.68038 17.6173 6.11599 17.8671 5.61235 17.6743C5.10871 17.4816 4.85706 16.9213 5.05123 16.4214L10.0512 3.5786C10.1874 3.2286 10.5238 3 10.9 3H11.1ZM12.9879 11.6233L11 6.51102L9.0121 11.6233H12.9879Z",fill:"currentColor"}),w.jsx("rect",{x:"3",y:"19",width:"18",height:"2.5",rx:"1",fill:"currentColor"})]}));ww.displayName="TextColorIcon";const jH=[{label:"Gray",value:"var(--tt-color-text-gray)",border:"var(--tt-color-text-gray-contrast)"},{label:"Brown",value:"var(--tt-color-text-brown)",border:"var(--tt-color-text-brown-contrast)"},{label:"Orange",value:"var(--tt-color-text-orange)",border:"var(--tt-color-text-orange-contrast)"},{label:"Yellow",value:"var(--tt-color-text-yellow)",border:"var(--tt-color-text-yellow-contrast)"},{label:"Green",value:"var(--tt-color-text-green)",border:"var(--tt-color-text-green-contrast)"},{label:"Blue",value:"var(--tt-color-text-blue)",border:"var(--tt-color-text-blue-contrast)"},{label:"Purple",value:"var(--tt-color-text-purple)",border:"var(--tt-color-text-purple-contrast)"},{label:"Pink",value:"var(--tt-color-text-pink)",border:"var(--tt-color-text-pink-contrast)"},{label:"Red",value:"var(--tt-color-text-red)",border:"var(--tt-color-text-red-contrast)"}];function _H(t){const e=new Map(jH.map(n=>[n.value,n]));return t.map(n=>e.get(n)).filter(n=>!!n)}function Px(t){return!t||!t.isEditable||!Ro("textStyle",t)||Pr(t,["image"])?!1:t.can().setMark("textStyle")}function IH(t,e){return!t||!t.isEditable?!1:e?t.isActive("textStyle",{color:e}):t.isActive("textStyle")}function HH(t){return!t||!t.isEditable?!1:t.chain().focus().unsetColor().run()}function Ew(t){const{editor:e,label:n,color:r,hideWhenUnavailable:o=!1,onApplied:l}=t,{editor:a}=Ke(e),[u,f]=S.useState(!0),h=Px(a),p=IH(a,r);S.useEffect(()=>{if(!a)return;const v=()=>{if(!a.isEditable){f(!1);return}if(!Ro("textStyle",a)){f(!1);return}if(o){f(Px(a));return}f(!0)};return v(),a.on("selectionUpdate",v),()=>{a.off("selectionUpdate",v)}},[a,o]);const m=S.useCallback(()=>{if(!a||!h||!r||!n)return!1;setTimeout(()=>{const v=a.chain().focus().setColor(r).run();return v&&l?.({color:r,label:n}),v},0)},[h,r,a,n,l]),b=S.useCallback(()=>{if(!a)return!1;const v=HH(a);return v&&l?.({color:"",label:"Remove color"}),v},[a,l]);return{isVisible:u,isActive:p,handleSetColor:m,handleRemoveColor:b,canSetColor:h,label:n||"Text color",Icon:ww}}const Mw=S.forwardRef(({editor:t,color:e,text:n,hideWhenUnavailable:r=!1,onApplied:o,onClick:l,children:a,style:u,...f},h)=>{const{editor:p}=Ke(t),{isVisible:m,canSetColor:b,isActive:v,handleSetColor:C,label:x}=Ew({editor:p,color:e,label:n||`Text ${e}`,hideWhenUnavailable:r,onApplied:o}),M=S.useCallback(k=>{l?.(k),!k.defaultPrevented&&C()},[C,l]),T=S.useMemo(()=>({...u,"--text-color":e}),[e,u]);return m?w.jsx(We,{type:"button","data-style":"ghost","data-active-state":v?"on":"off",role:"button",tabIndex:-1,disabled:!b,"data-disabled":!b,"aria-label":x,"aria-pressed":v,tooltip:x,onClick:M,style:T,...f,ref:h,children:a??w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"tiptap-button-text-color",style:{"--text-color":e}}),n&&w.jsx("span",{className:"tiptap-button-text",children:n})]})}):null});Mw.displayName="TextColorButton";const a0=S.forwardRef(({className:t,children:e,...n},r)=>w.jsx(We,{type:"button",className:t,"data-style":"ghost","data-appearance":"default",role:"button",tabIndex:-1,"aria-label":"Highlight text",tooltip:"Highlight",ref:r,...n,children:e??w.jsx(dd,{className:"tiptap-button-icon"})}));a0.displayName="ColorHighlightPopoverButton";const Tw=_H(["var(--tt-color-text-gray)","var(--tt-color-text-brown)","var(--tt-color-text-orange)","var(--tt-color-text-yellow)","var(--tt-color-text-green)","var(--tt-color-text-blue)","var(--tt-color-text-purple)","var(--tt-color-text-pink)","var(--tt-color-text-red)"]),Aw=NH(["var(--tt-color-highlight-green)","var(--tt-color-highlight-blue)","var(--tt-color-highlight-red)","var(--tt-color-highlight-purple)","var(--tt-color-highlight-yellow)"]);function kw({editor:t,colors:e=Aw,textColors:n=Tw}){const{handleRemoveHighlight:r}=l0({editor:t}),{handleRemoveColor:o}=Ew({editor:t}),l=$a(),a=S.useRef(null),u=S.useMemo(()=>[...n.map(v=>({...v,group:"text"})),{label:"Remove color",value:"none-text",group:"text"},...e.map(v=>({...v,group:"highlight"})),{label:"Remove highlight",value:"none-highlight",group:"highlight"}],[n,e]),{selectedIndex:f}=f3({containerRef:a,items:u,orientation:"both",onSelect:v=>{if(!a.current)return!1;const C=a.current.querySelector('[data-highlighted="true"]');C&&C.click(),v.value==="none-text"&&o(),v.value==="none-highlight"&&r()},autoSelectFirstItem:!1}),h=0,p=n.length,m=n.length+1,b=m+e.length;return w.jsx(Ys,{ref:a,tabIndex:0,style:l?{boxShadow:"none",border:0}:{},children:w.jsxs(Zs,{style:l?{padding:0}:{},children:[w.jsxs(Oa,{orientation:"horizontal",children:[w.jsx(tr,{orientation:"horizontal",children:n.map((v,C)=>w.jsx(Mw,{editor:t,color:v.value,tooltip:v.label,"aria-label":`${v.label} text color`,tabIndex:h+C===f?0:-1,"data-highlighted":f===h+C},v.value))}),w.jsx(Ls,{}),w.jsx(tr,{orientation:"horizontal",children:w.jsx(We,{onClick:o,"aria-label":"Remove text color",tooltip:"Remove text color",tabIndex:f===p?0:-1,type:"button",role:"menuitem","data-style":"ghost","data-highlighted":f===p,children:w.jsx(A1,{className:"tiptap-button-icon"})})})]}),w.jsx(Ls,{}),w.jsxs(Oa,{orientation:"horizontal",children:[w.jsx(tr,{orientation:"horizontal",children:e.map((v,C)=>w.jsx(Sw,{editor:t,highlightColor:v.value,tooltip:v.label,"aria-label":`${v.label} highlight color`,tabIndex:m+C===f?0:-1,"data-highlighted":f===m+C},v.value))}),w.jsx(Ls,{}),w.jsx(tr,{orientation:"horizontal",children:w.jsx(We,{onClick:r,"aria-label":"Remove highlight",tooltip:"Remove highlight",tabIndex:f===b?0:-1,type:"button",role:"menuitem","data-style":"ghost","data-highlighted":f===b,children:w.jsx(A1,{className:"tiptap-button-icon"})})})]})]})})}function BH({editor:t,colors:e=Aw,textColors:n=Tw,hideWhenUnavailable:r=!1,onApplied:o,...l}){const{editor:a}=Ke(t),[u,f]=S.useState(!1),{isVisible:h,canColorHighlight:p,isActive:m,label:b,Icon:v}=l0({editor:a,hideWhenUnavailable:r,onApplied:o});return h?w.jsxs(Wg,{open:u,onOpenChange:f,children:[w.jsx(Jg,{asChild:!0,children:w.jsx(a0,{disabled:!p,"data-active-state":m?"on":"off","data-disabled":!p,"aria-pressed":m,"aria-label":b,tooltip:b,...l,children:w.jsx(v,{className:"tiptap-button-icon"})})}),w.jsx(e0,{"aria-label":"Text colors and highlights",children:w.jsx(kw,{editor:a,colors:e,textColors:n})})]}):null}const Rw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L10.7071 14.7071C10.3166 15.0976 9.68342 15.0976 9.29289 14.7071C8.90237 14.3166 8.90237 13.6834 9.29289 13.2929L18.5858 4H15C14.4477 4 14 3.55228 14 3Z",fill:"currentColor"}),w.jsx("path",{d:"M4.29289 7.29289C4.48043 7.10536 4.73478 7 5 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5H5C4.20435 5 3.44129 5.31607 2.87868 5.87868C2.31607 6.44129 2 7.20435 2 8V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H16C16.7957 22 17.5587 21.6839 18.1213 21.1213C18.6839 20.5587 19 19.7957 19 19V13C19 12.4477 18.5523 12 18 12C17.4477 12 17 12.4477 17 13V19C17 19.2652 16.8946 19.5196 16.7071 19.7071C16.5196 19.8946 16.2652 20 16 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V8C4 7.73478 4.10536 7.48043 4.29289 7.29289Z",fill:"currentColor"})]}));Rw.displayName="ExternalLinkIcon";const hd=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z",fill:"currentColor"}),w.jsx("path",{d:"M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",fill:"currentColor"})]}));hd.displayName="LinkIcon";const Ow=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5V4C7 3.17477 7.40255 2.43324 7.91789 1.91789C8.43324 1.40255 9.17477 1 10 1H14C14.8252 1 15.5668 1.40255 16.0821 1.91789C16.5975 2.43324 17 3.17477 17 4V5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H20V20C20 20.8252 19.5975 21.5668 19.0821 22.0821C18.5668 22.5975 17.8252 23 17 23H7C6.17477 23 5.43324 22.5975 4.91789 22.0821C4.40255 21.5668 4 20.8252 4 20V7H3C2.44772 7 2 6.55228 2 6C2 5.44772 2.44772 5 3 5H7ZM9 4C9 3.82523 9.09745 3.56676 9.33211 3.33211C9.56676 3.09745 9.82523 3 10 3H14C14.1748 3 14.4332 3.09745 14.6679 3.33211C14.9025 3.56676 15 3.82523 15 4V5H9V4ZM6 7V20C6 20.1748 6.09745 20.4332 6.33211 20.6679C6.56676 20.9025 6.82523 21 7 21H17C17.1748 21 17.4332 20.9025 17.6679 20.6679C17.9025 20.4332 18 20.1748 18 20V7H6Z",fill:"currentColor"})}));Ow.displayName="TrashIcon";const c0=S.forwardRef(({className:t,children:e,...n},r)=>w.jsx(We,{type:"button",className:t,"data-style":"ghost",role:"button",tabIndex:-1,"aria-label":"Link",tooltip:"Link",ref:r,...n,children:e||w.jsx(hd,{className:"tiptap-button-icon"})}));c0.displayName="LinkButton";const Nw=({url:t,setUrl:e,setLink:n,removeLink:r,openLink:o,isActive:l})=>{const a=$a(),u=f=>{f.key==="Enter"&&(f.preventDefault(),n())};return w.jsx(Ys,{style:{...a?{boxShadow:"none",border:0}:{}},children:w.jsx(Zs,{style:{...a?{padding:0}:{}},children:w.jsxs(Oa,{orientation:"horizontal",children:[w.jsx(pw,{children:w.jsx(hw,{type:"url",placeholder:"Paste a link...",value:t,onChange:f=>e(f.target.value),onKeyDown:u,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})}),w.jsx(tr,{orientation:"horizontal",children:w.jsx(We,{type:"button",onClick:n,title:"Apply link",disabled:!t&&!l,"data-style":"ghost",children:w.jsx(t0,{className:"tiptap-button-icon"})})}),w.jsx(Ls,{}),w.jsxs(tr,{orientation:"horizontal",children:[w.jsx(We,{type:"button",onClick:o,title:"Open in new window",disabled:!t&&!l,"data-style":"ghost",children:w.jsx(Rw,{className:"tiptap-button-icon"})}),w.jsx(We,{type:"button",onClick:r,title:"Remove link",disabled:!t&&!l,"data-style":"ghost",children:w.jsx(Ow,{className:"tiptap-button-icon"})})]})]})})})},UH=({editor:t})=>{const e=jw({editor:t});return w.jsx(Nw,{...e})},Dw=S.forwardRef(({editor:t,hideWhenUnavailable:e=!1,onSetLink:n,onOpenChange:r,autoOpenOnLinkActive:o=!0,onClick:l,children:a,...u},f)=>{const{editor:h}=Ke(t),[p,m]=S.useState(!1),{isVisible:b,canSet:v,isActive:C,url:x,setUrl:M,setLink:T,removeLink:k,openLink:R,label:D,Icon:_}=jw({editor:h,hideWhenUnavailable:e,onSetLink:n}),j=S.useCallback(Q=>{m(Q),r?.(Q)},[r]),L=S.useCallback(()=>{T(),m(!1)},[T]),B=S.useCallback(Q=>{l?.(Q),!Q.defaultPrevented&&m(!p)},[l,p]);return S.useEffect(()=>{o&&C&&m(!0)},[o,C]),b?w.jsxs(Wg,{open:p,onOpenChange:j,children:[w.jsx(Jg,{asChild:!0,children:w.jsx(c0,{disabled:!v,"data-active-state":C?"on":"off","data-disabled":!v,"aria-label":D,"aria-pressed":C,onClick:B,...u,ref:f,children:a??w.jsx(_,{className:"tiptap-button-icon"})})}),w.jsx(e0,{children:w.jsx(Nw,{url:x,setUrl:M,setLink:L,removeLink:k,openLink:R,isActive:C})})]}):null});Dw.displayName="LinkPopover";function Lw(t){return!t||!t.isEditable?!1:t.can().setMark("link")}function zw(t){return!t||!t.isEditable?!1:t.isActive("link")}function VH(t){const{editor:e,hideWhenUnavailable:n}=t;return!Ro("link",e)||!e?!1:n&&!e.isActive("code")?Lw(e):!0}function PH(t){const{editor:e,onSetLink:n}=t,[r,o]=S.useState(null);S.useEffect(()=>{if(!e)return;const{href:f}=e.getAttributes("link");zw(e)&&r===null&&o(f||"")},[e,r]),S.useEffect(()=>{if(!e)return;const f=()=>{const{href:h}=e.getAttributes("link");o(h||"")};return e.on("selectionUpdate",f),()=>{e.off("selectionUpdate",f)}},[e]);const l=S.useCallback(()=>{if(!r||!e)return;const{selection:f}=e.state,h=f.empty;let p=e.chain().focus();p=p.extendMarkRange("link").setLink({href:r}),h&&(p=p.insertContent({type:"text",text:r})),p.run(),o(null),n?.()},[e,n,r]),a=S.useCallback(()=>{e&&(e.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink",!0).run(),o(""))},[e]),u=S.useCallback((f="_blank",h="noopener,noreferrer")=>{if(!r)return;const p=iz(r,window.location.href);p!=="#"&&window.open(p,f,h)},[r]);return{url:r||"",setUrl:o,setLink:l,removeLink:a,openLink:u}}function $H(t){const{editor:e,hideWhenUnavailable:n=!1}=t,r=Lw(e),o=zw(e),[l,a]=S.useState(!1);return S.useEffect(()=>{if(!e)return;const u=()=>{a(VH({editor:e,hideWhenUnavailable:n}))};return u(),e.on("selectionUpdate",u),()=>{e.off("selectionUpdate",u)}},[e,n]),{isVisible:l,canSet:r,isActive:o}}function jw(t){const{editor:e,hideWhenUnavailable:n=!1,onSetLink:r}=t||{},{editor:o}=Ke(e),{isVisible:l,canSet:a,isActive:u}=$H({editor:o,hideWhenUnavailable:n}),f=PH({editor:o,onSetLink:r});return{isVisible:l,canSet:a,isActive:u,label:"Link",Icon:hd,...f}}function FH({type:t,shortcutKeys:e=$w[t]}){return w.jsx($r,{children:Vr({shortcutKeys:e})})}const ks=S.forwardRef(({editor:t,type:e,text:n,hideWhenUnavailable:r=!1,onToggled:o,showShortcut:l=!1,onClick:a,children:u,...f},h)=>{const{editor:p}=Ke(t),{isVisible:m,handleMark:b,label:v,canToggle:C,isActive:x,Icon:M,shortcutKeys:T}=XH({editor:p,type:e,hideWhenUnavailable:r,onToggled:o}),k=S.useCallback(R=>{a?.(R),!R.defaultPrevented&&b()},[b,a]);return m?w.jsx(We,{type:"button",disabled:!C,"data-style":"ghost","data-active-state":x?"on":"off","data-disabled":!C,role:"button",tabIndex:-1,"aria-label":v,"aria-pressed":x,tooltip:v,onClick:k,...f,ref:h,children:u??w.jsxs(w.Fragment,{children:[w.jsx(M,{className:"tiptap-button-icon"}),n&&w.jsx("span",{className:"tiptap-button-text",children:n}),l&&w.jsx(FH,{type:e,shortcutKeys:T})]})}):null});ks.displayName="MarkButton";const _w=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z",fill:"currentColor"})}));_w.displayName="BoldIcon";const Iw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z",fill:"currentColor"}),w.jsx("path",{d:"M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z",fill:"currentColor"}),w.jsx("path",{d:"M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z",fill:"currentColor"})]}));Iw.displayName="Code2Icon";const Hw=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{d:"M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z",fill:"currentColor"})}));Hw.displayName="ItalicIcon";const Bw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{d:"M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z",fill:"currentColor"}),w.jsx("path",{d:"M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z",fill:"currentColor"})]}));Bw.displayName="StrikeIcon";const Uw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.4079 14.3995C18.0284 14.0487 18.7506 13.9217 19.4536 14.0397C20.1566 14.1578 20.7977 14.5138 21.2696 15.0481L21.2779 15.0574L21.2778 15.0575C21.7439 15.5988 22 16.2903 22 17C22 18.0823 21.3962 18.8401 20.7744 19.3404C20.194 19.8073 19.4858 20.141 18.9828 20.378C18.9638 20.387 18.9451 20.3958 18.9266 20.4045C18.4473 20.6306 18.2804 20.7817 18.1922 20.918C18.1773 20.9412 18.1619 20.9681 18.1467 21H21C21.5523 21 22 21.4477 22 22C22 22.5523 21.5523 23 21 23H17C16.4477 23 16 22.5523 16 22C16 21.1708 16.1176 20.4431 16.5128 19.832C16.9096 19.2184 17.4928 18.8695 18.0734 18.5956C18.6279 18.334 19.138 18.0901 19.5207 17.7821C19.8838 17.49 20 17.2477 20 17C20 16.7718 19.9176 16.5452 19.7663 16.3672C19.5983 16.1792 19.3712 16.0539 19.1224 16.0121C18.8722 15.9701 18.6152 16.015 18.3942 16.1394C18.1794 16.2628 18.0205 16.4549 17.9422 16.675C17.7572 17.1954 17.1854 17.4673 16.665 17.2822C16.1446 17.0972 15.8728 16.5254 16.0578 16.005C16.2993 15.3259 16.7797 14.7584 17.4039 14.4018L17.4079 14.3995L17.4079 14.3995Z",fill:"currentColor"})]}));Uw.displayName="SubscriptIcon";const Vw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.405 1.40657C18.0246 1.05456 18.7463 0.92634 19.4492 1.04344C20.1521 1.16054 20.7933 1.51583 21.2652 2.0497L21.2697 2.05469L21.2696 2.05471C21.7431 2.5975 22 3.28922 22 4.00203C22 5.08579 21.3952 5.84326 20.7727 6.34289C20.1966 6.80531 19.4941 7.13675 18.9941 7.37261C18.9714 7.38332 18.9491 7.39383 18.9273 7.40415C18.4487 7.63034 18.2814 7.78152 18.1927 7.91844C18.1778 7.94155 18.1625 7.96834 18.1473 8.00003H21C21.5523 8.00003 22 8.44774 22 9.00003C22 9.55231 21.5523 10 21 10H17C16.4477 10 16 9.55231 16 9.00003C16 8.17007 16.1183 7.44255 16.5138 6.83161C16.9107 6.21854 17.4934 5.86971 18.0728 5.59591C18.6281 5.33347 19.1376 5.09075 19.5208 4.78316C19.8838 4.49179 20 4.25026 20 4.00203C20 3.77192 19.9178 3.54865 19.7646 3.37182C19.5968 3.18324 19.3696 3.05774 19.1205 3.01625C18.8705 2.97459 18.6137 3.02017 18.3933 3.14533C18.1762 3.26898 18.0191 3.45826 17.9406 3.67557C17.7531 4.19504 17.18 4.46414 16.6605 4.27662C16.141 4.0891 15.8719 3.51596 16.0594 2.99649C16.303 2.3219 16.7817 1.76125 17.4045 1.40689L17.405 1.40657Z",fill:"currentColor"})]}));Vw.displayName="SuperscriptIcon";const Pw=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4V10C5 11.8565 5.7375 13.637 7.05025 14.9497C8.36301 16.2625 10.1435 17 12 17C13.8565 17 15.637 16.2625 16.9497 14.9497C18.2625 13.637 19 11.8565 19 10V4C19 3.44772 18.5523 3 18 3C17.4477 3 17 3.44772 17 4V10C17 11.3261 16.4732 12.5979 15.5355 13.5355C14.5979 14.4732 13.3261 15 12 15C10.6739 15 9.40215 14.4732 8.46447 13.5355C7.52678 12.5979 7 11.3261 7 10V4ZM4 19C3.44772 19 3 19.4477 3 20C3 20.5523 3.44772 21 4 21H20C20.5523 21 21 20.5523 21 20C21 19.4477 20.5523 19 20 19H4Z",fill:"currentColor"})}));Pw.displayName="UnderlineIcon";const qH={bold:_w,italic:Hw,underline:Pw,strike:Bw,code:Iw,superscript:Vw,subscript:Uw},$w={bold:"mod+b",italic:"mod+i",underline:"mod+u",strike:"mod+shift+s",code:"mod+e",superscript:"mod+.",subscript:"mod+,"};function u0(t,e){return!t||!t.isEditable||!Ro(e,t)||Pr(t,["image"])?!1:t.can().toggleMark(e)}function KH(t,e){return!t||!t.isEditable?!1:t.isActive(e)}function GH(t,e){return!t||!t.isEditable||!u0(t,e)?!1:t.chain().focus().toggleMark(e).run()}function YH(t){const{editor:e,type:n,hideWhenUnavailable:r}=t;return!e||!e.isEditable||!Ro(n,e)?!1:r&&!e.isActive("code")?u0(e,n):!0}function ZH(t){return t.charAt(0).toUpperCase()+t.slice(1)}function XH(t){const{editor:e,type:n,hideWhenUnavailable:r=!1,onToggled:o}=t,{editor:l}=Ke(e),[a,u]=S.useState(!0),f=u0(l,n),h=KH(l,n);S.useEffect(()=>{if(!l)return;const m=()=>{u(YH({editor:l,type:n,hideWhenUnavailable:r}))};return m(),l.on("selectionUpdate",m),()=>{l.off("selectionUpdate",m)}},[l,n,r]);const p=S.useCallback(()=>{if(!l)return!1;const m=GH(l,n);return m&&o?.(),m},[l,n,o]);return{isVisible:a,isActive:h,handleMark:p,canToggle:f,label:ZH(n),shortcutKeys:$w[n],Icon:qH[n]}}function QH({align:t,shortcutKeys:e=Yw[t]}){return w.jsx($r,{children:Vr({shortcutKeys:e})})}const Jl=S.forwardRef(({editor:t,align:e,text:n,hideWhenUnavailable:r=!1,onAligned:o,showShortcut:l=!1,onClick:a,icon:u,children:f,...h},p)=>{const{editor:m}=Ke(t),{isVisible:b,handleTextAlign:v,label:C,canAlign:x,isActive:M,Icon:T,shortcutKeys:k}=iB({editor:m,align:e,hideWhenUnavailable:r,onAligned:o}),R=S.useCallback(_=>{a?.(_),!_.defaultPrevented&&v()},[v,a]);if(!b)return null;const D=u??T;return w.jsx(We,{type:"button",disabled:!x,"data-style":"ghost","data-active-state":M?"on":"off","data-disabled":!x,role:"button",tabIndex:-1,"aria-label":C,"aria-pressed":M,tooltip:C,onClick:R,...h,ref:p,children:f??w.jsxs(w.Fragment,{children:[w.jsx(D,{className:"tiptap-button-icon"}),n&&w.jsx("span",{className:"tiptap-button-text",children:n}),l&&w.jsx(QH,{align:e,shortcutKeys:k})]})})});Jl.displayName="TextAlignButton";const Fw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 18C4 17.4477 4.44772 17 5 17H19C19.5523 17 20 17.4477 20 18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18Z",fill:"currentColor"})]}));Fw.displayName="AlignCenterIcon";const qw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));qw.displayName="AlignJustifyIcon";const Kw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H17C17.5523 17 18 17.4477 18 18C18 18.5523 17.5523 19 17 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));Kw.displayName="AlignLeftIcon";const Gw=S.memo(({className:t,...e})=>w.jsxs("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12C8 11.4477 8.44772 11 9 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H9C8.44772 13 8 12.5523 8 12Z",fill:"currentColor"}),w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 18C6 17.4477 6.44772 17 7 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H7C6.44772 19 6 18.5523 6 18Z",fill:"currentColor"})]}));Gw.displayName="AlignRightIcon";const Yw={left:"mod+shift+l",center:"mod+shift+e",right:"mod+shift+r",justify:"mod+shift+j"},WH={left:Kw,center:Fw,right:Gw,justify:qw},JH={left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"};function f0(t,e){if(!t||!t.isEditable||!nd(t,"textAlign"))return!1;const{selection:n}=t.state;if(n instanceof de){const r=n.node;return r?(t.extensionManager.extensions.find(a=>a.name==="textAlign")?.options?.types??[]).includes(r.type.name):!1}return Pr(t,["image"])?!1:t.can().setTextAlign(e)}function eB(t){return"setTextAlign"in t}function tB(t,e){return!t||!t.isEditable?!1:t.isActive({textAlign:e})}function nB(t,e){if(!t||!t.isEditable||!f0(t,e))return!1;const n=t.chain().focus();return eB(n)?n.setTextAlign(e).run():!1}function rB(t){const{editor:e,hideWhenUnavailable:n,align:r}=t;return!e||!e.isEditable||!nd(e,"textAlign")?!1:n&&!e.isActive("code")?f0(e,r):!0}function iB(t){const{editor:e,align:n,hideWhenUnavailable:r=!1,onAligned:o}=t,{editor:l}=Ke(e),[a,u]=S.useState(!0),f=f0(l,n),h=tB(l,n);S.useEffect(()=>{if(!l)return;const m=()=>{u(rB({editor:l,align:n,hideWhenUnavailable:r}))};return m(),l.on("selectionUpdate",m),()=>{l.off("selectionUpdate",m)}},[l,r,n]);const p=S.useCallback(()=>{if(!l)return!1;const m=nB(l,n);return m&&o?.(),m},[l,n,o]);return{isVisible:a,isActive:h,handleTextAlign:p,canAlign:f,label:JH[n],shortcutKeys:Yw[n],Icon:WH[n]}}function oB({action:t,shortcutKeys:e=Qw[t]}){return w.jsx($r,{children:Vr({shortcutKeys:e})})}const R1=S.forwardRef(({editor:t,action:e,text:n,hideWhenUnavailable:r=!1,onExecuted:o,showShortcut:l=!1,onClick:a,children:u,...f},h)=>{const{editor:p}=Ke(t),{isVisible:m,handleAction:b,label:v,canExecute:C,Icon:x,shortcutKeys:M}=uB({editor:p,action:e,hideWhenUnavailable:r,onExecuted:o}),T=S.useCallback(k=>{a?.(k),!k.defaultPrevented&&b()},[b,a]);return m?w.jsx(We,{type:"button",disabled:!C,"data-style":"ghost","data-disabled":!C,role:"button",tabIndex:-1,"aria-label":v,tooltip:v,onClick:T,...f,ref:h,children:u??w.jsxs(w.Fragment,{children:[w.jsx(x,{className:"tiptap-button-icon"}),n&&w.jsx("span",{className:"tiptap-button-text",children:n}),l&&w.jsx(oB,{action:e,shortcutKeys:M})]})}):null});R1.displayName="UndoRedoButton";const Zw=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.7071 2.29289C15.3166 1.90237 14.6834 1.90237 14.2929 2.29289C13.9024 2.68342 13.9024 3.31658 14.2929 3.70711L17.5858 7H9.5C7.77609 7 6.12279 7.68482 4.90381 8.90381C3.68482 10.1228 3 11.7761 3 13.5C3 14.3536 3.16813 15.1988 3.49478 15.9874C3.82144 16.7761 4.30023 17.4926 4.90381 18.0962C6.12279 19.3152 7.77609 20 9.5 20H13C13.5523 20 14 19.5523 14 19C14 18.4477 13.5523 18 13 18H9.5C8.30653 18 7.16193 17.5259 6.31802 16.682C5.90016 16.2641 5.56869 15.768 5.34254 15.2221C5.1164 14.6761 5 14.0909 5 13.5C5 12.3065 5.47411 11.1619 6.31802 10.318C7.16193 9.47411 8.30653 9 9.5 9H17.5858L14.2929 12.2929C13.9024 12.6834 13.9024 13.3166 14.2929 13.7071C14.6834 14.0976 15.3166 14.0976 15.7071 13.7071L20.7071 8.70711C21.0976 8.31658 21.0976 7.68342 20.7071 7.29289L15.7071 2.29289Z",fill:"currentColor"})}));Zw.displayName="Redo2Icon";const Xw=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.70711 3.70711C10.0976 3.31658 10.0976 2.68342 9.70711 2.29289C9.31658 1.90237 8.68342 1.90237 8.29289 2.29289L3.29289 7.29289C2.90237 7.68342 2.90237 8.31658 3.29289 8.70711L8.29289 13.7071C8.68342 14.0976 9.31658 14.0976 9.70711 13.7071C10.0976 13.3166 10.0976 12.6834 9.70711 12.2929L6.41421 9H14.5C15.0909 9 15.6761 9.1164 16.2221 9.34254C16.768 9.56869 17.2641 9.90016 17.682 10.318C18.0998 10.7359 18.4313 11.232 18.6575 11.7779C18.8836 12.3239 19 12.9091 19 13.5C19 14.0909 18.8836 14.6761 18.6575 15.2221C18.4313 15.768 18.0998 16.2641 17.682 16.682C17.2641 17.0998 16.768 17.4313 16.2221 17.6575C15.6761 17.8836 15.0909 18 14.5 18H11C10.4477 18 10 18.4477 10 19C10 19.5523 10.4477 20 11 20H14.5C15.3536 20 16.1988 19.8319 16.9874 19.5052C17.7761 19.1786 18.4926 18.6998 19.0962 18.0962C19.6998 17.4926 20.1786 16.7761 20.5052 15.9874C20.8319 15.1988 21 14.3536 21 13.5C21 12.6464 20.8319 11.8012 20.5052 11.0126C20.1786 10.2239 19.6998 9.50739 19.0962 8.90381C18.4926 8.30022 17.7761 7.82144 16.9874 7.49478C16.1988 7.16813 15.3536 7 14.5 7H6.41421L9.70711 3.70711Z",fill:"currentColor"})}));Xw.displayName="Undo2Icon";const Qw={undo:"mod+z",redo:"mod+shift+z"},sB={undo:"Undo",redo:"Redo"},lB={undo:Xw,redo:Zw};function d0(t,e){return!t||!t.isEditable||Pr(t,["image"])?!1:e==="undo"?t.can().undo():t.can().redo()}function aB(t,e){if(!t||!t.isEditable||!d0(t,e))return!1;const n=t.chain().focus();return e==="undo"?n.undo().run():n.redo().run()}function cB(t){const{editor:e,hideWhenUnavailable:n,action:r}=t;return!e||!e.isEditable?!1:n&&!e.isActive("code")?d0(e,r):!0}function uB(t){const{editor:e,action:n,hideWhenUnavailable:r=!1,onExecuted:o}=t,{editor:l}=Ke(e),[a,u]=S.useState(!0),f=d0(l,n);S.useEffect(()=>{if(!l)return;const p=()=>{u(cB({editor:l,hideWhenUnavailable:r,action:n}))};return p(),l.on("transaction",p),()=>{l.off("transaction",p)}},[l,r,n]);const h=S.useCallback(()=>{if(!l)return!1;const p=aB(l,n);return p&&o?.(),p},[l,n,o]);return{isVisible:a,handleAction:h,canExecute:f,label:sB[n],shortcutKeys:Qw[n],Icon:lB[n]}}const Ww=S.memo(({className:t,...e})=>w.jsx("svg",{width:"24",height:"24",className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:w.jsx("path",{d:"M12.7071 5.70711C13.0976 5.31658 13.0976 4.68342 12.7071 4.29289C12.3166 3.90237 11.6834 3.90237 11.2929 4.29289L4.29289 11.2929C3.90237 11.6834 3.90237 12.3166 4.29289 12.7071L11.2929 19.7071C11.6834 20.0976 12.3166 20.0976 12.7071 19.7071C13.0976 19.3166 13.0976 18.6834 12.7071 18.2929L7.41421 13L19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11L7.41421 11L12.7071 5.70711Z",fill:"currentColor"})}));Ww.displayName="ArrowLeftIcon";var zm,$x;function fB(){if($x)return zm;$x=1;var t="Expected a function",e=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt,f=typeof au=="object"&&au&&au.Object===Object&&au,h=typeof self=="object"&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),m=Object.prototype,b=m.toString,v=Math.max,C=Math.min,x=function(){return p.Date.now()};function M(j,L,B){var Q,ne,re,fe,ae,W,ie=0,I=!1,q=!1,P=!0;if(typeof j!="function")throw new TypeError(t);L=_(L)||0,k(B)&&(I=!!B.leading,q="maxWait"in B,re=q?v(_(B.maxWait)||0,L):re,P="trailing"in B?!!B.trailing:P);function Y(xe){var De=Q,Ut=ne;return Q=ne=void 0,ie=xe,fe=j.apply(Ut,De),fe}function se(xe){return ie=xe,ae=setTimeout(J,L),I?Y(xe):fe}function N(xe){var De=xe-W,Ut=xe-ie,In=L-De;return q?C(In,re-Ut):In}function $(xe){var De=xe-W,Ut=xe-ie;return W===void 0||De>=L||De<0||q&&Ut>=re}function J(){var xe=x();if($(xe))return oe(xe);ae=setTimeout(J,N(xe))}function oe(xe){return ae=void 0,P&&Q?Y(xe):(Q=ne=void 0,fe)}function ce(){ae!==void 0&&clearTimeout(ae),ie=0,Q=W=ne=ae=void 0}function me(){return ae===void 0?fe:oe(x())}function pe(){var xe=x(),De=$(xe);if(Q=arguments,ne=this,W=xe,De){if(ae===void 0)return se(W);if(q)return ae=setTimeout(J,L),Y(W)}return ae===void 0&&(ae=setTimeout(J,L)),fe}return pe.cancel=ce,pe.flush=me,pe}function T(j,L,B){var Q=!0,ne=!0;if(typeof j!="function")throw new TypeError(t);return k(B)&&(Q="leading"in B?!!B.leading:Q,ne="trailing"in B?!!B.trailing:ne),M(j,L,{leading:Q,maxWait:L,trailing:ne})}function k(j){var L=typeof j;return!!j&&(L=="object"||L=="function")}function R(j){return!!j&&typeof j=="object"}function D(j){return typeof j=="symbol"||R(j)&&b.call(j)==n}function _(j){if(typeof j=="number")return j;if(D(j))return e;if(k(j)){var L=typeof j.valueOf=="function"?j.valueOf():j;j=k(L)?L+"":L}if(typeof j!="string")return j===0?j:+j;j=j.replace(r,"");var B=l.test(j);return B||a.test(j)?u(j.slice(2),B?2:8):o.test(j)?e:+j}return zm=T,zm}var dB=fB();const hB=jf(dB),pB=t=>{const e=S.useRef(t);e.current=t,S.useEffect(()=>()=>{e.current()},[])},mB={leading:!1,trailing:!0};function Jw(t,e=250,n=[],r=mB){const o=S.useMemo(()=>hB(t,e,r),n);return pB(()=>{o.cancel()}),o}function eE(){const[t,e]=S.useState({width:0,height:0,offsetTop:0,offsetLeft:0,scale:0}),n=Jw(()=>{if(typeof window>"u")return;const r=window.visualViewport;if(!r)return;const{width:o=0,height:l=0,offsetTop:a=0,offsetLeft:u=0,scale:f=0}=r;e(h=>o===h.width&&l===h.height&&a===h.offsetTop&&u===h.offsetLeft&&f===h.scale?h:{width:o,height:l,offsetTop:a,offsetLeft:u,scale:f})},200);return S.useEffect(()=>{const r=window.visualViewport;if(r)return r.addEventListener("resize",n),n(),()=>{r.removeEventListener("resize",n)}},[n]),t}const ku={x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0},tE=typeof window>"u",gB=!tE&&typeof ResizeObserver<"u",Hu=()=>!tE;function yB({element:t,enabled:e=!0,throttleMs:n=100,useResizeObserver:r=!0}={}){const[o,l]=S.useState(ku),a=S.useCallback(()=>!e||!Hu()?null:t?typeof t=="string"?document.querySelector(t):"current"in t?t.current:t:document.body,[t,e]),u=Jw(()=>{if(!e||!Hu())return;const f=a();if(!f){l(ku);return}const h=f.getBoundingClientRect();l({x:h.x,y:h.y,width:h.width,height:h.height,top:h.top,right:h.right,bottom:h.bottom,left:h.left})},n,[e,a],{leading:!0,trailing:!0});return S.useEffect(()=>{if(!e||!Hu()){l(ku);return}const f=a();if(!f)return;u();const h=[];if(r&&gB){const m=new ResizeObserver(()=>{window.requestAnimationFrame(u)});m.observe(f),h.push(()=>m.disconnect())}const p=()=>u();return window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),h.push(()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}),()=>{h.forEach(m=>m()),l(ku)}},[e,a,u,r]),o}function vB(t={}){return yB({...t,element:Hu()?document.body:null})}function bB({editor:t,overlayHeight:e=0}){const{height:n}=eE(),r=vB({enabled:!0,throttleMs:100,useResizeObserver:!0});return S.useEffect(()=>{(()=>{if(!t)return;const{state:l,view:a}=t;if(!a.hasFocus())return;const{from:u}=l.selection,f=a.coordsAtPos(u);if(n<r.height&&f&&n-f.top<e){const p=Math.max(n/2,e),m=window.scrollY,v=f.top+m-p;window.scrollTo({top:Math.max(0,v),behavior:"smooth"})}})()},[t,e,n,r.height]),r}const CB="rtbe-root",xB=({onHighlighterClick:t,onLinkClick:e,isMobile:n})=>w.jsxs(w.Fragment,{children:[w.jsx(Ex,{}),w.jsxs(uo,{children:[w.jsx(R1,{action:"undo"}),w.jsx(R1,{action:"redo"})]}),w.jsx(fo,{}),w.jsxs(uo,{children:[w.jsx(q5,{levels:[1,2,3,4],portal:n}),w.jsx(EH,{types:["bulletList","orderedList","taskList"],portal:n}),w.jsx(bw,{})]}),w.jsx(fo,{}),w.jsxs(uo,{children:[w.jsx(ks,{type:"bold"}),w.jsx(ks,{type:"italic"}),w.jsx(ks,{type:"strike"}),w.jsx(ks,{type:"code"}),w.jsx(ks,{type:"underline"}),n?w.jsx(a0,{onClick:t}):w.jsx(BH,{}),n?w.jsx(c0,{onClick:e}):w.jsx(Dw,{})]}),w.jsx(fo,{}),w.jsxs(uo,{children:[w.jsx(Jl,{align:"left"}),w.jsx(Jl,{align:"center"}),w.jsx(Jl,{align:"right"}),w.jsx(Jl,{align:"justify"})]}),w.jsx(fo,{}),w.jsxs(uo,{children:[w.jsx(G5,{text:"Add"}),w.jsx(mw,{})]}),w.jsx(Ex,{}),n&&w.jsx(fo,{})]}),SB=({type:t,onBack:e})=>w.jsxs(w.Fragment,{children:[w.jsx(uo,{children:w.jsxs(We,{"data-style":"ghost",onClick:e,children:[w.jsx(Ww,{className:"tiptap-button-icon"}),t==="highlighter"?w.jsx(dd,{className:"tiptap-button-icon"}):w.jsx(hd,{className:"tiptap-button-icon"})]})}),w.jsx(fo,{}),t==="highlighter"?w.jsx(kw,{}):w.jsx(UH,{})]});function wB(t){const e=$a(),{height:n}=eE(),[r,o]=Rt.useState("main"),l=Rt.useRef(null),[a,u]=S.useState(null),f=S.useCallback(m=>{u(m)},[]),h=iR({content:t.value,immediatelyRender:!1,shouldRerenderOnTransaction:!1,onUpdate:({editor:m})=>{m&&t.onChange(m.getHTML())},editorProps:{attributes:{autocomplete:"off",autocorrect:"off",autocapitalize:"off","aria-label":"Main content area, start typing to enter text.",class:"simple-editor"}},extensions:[Sz,vz,mz.configure({type:"resizableImage",accept:"image/*",maxSize:1*1024*1024*1024,upload:(m,b,v)=>Promise.resolve(t.onUploadImage?.(m,b,v)||"")}),D7,N7,XO.configure({horizontalRule:!1,link:{openOnClick:!1,enableClickSelection:!0}}),gz,QO.configure({types:["heading","paragraph","resizableImage","videoEmbed"]}),w7,S7.configure({nested:!0}),wN.configure({multicolor:!0}),CN,MN,EN,GO,zN.configure({attributeName:"id",generateID:()=>`tiptap-editor-${t.id||yR()}`})]}),p=bB({editor:h,overlayHeight:l.current?.getBoundingClientRect().height??0});return S.useEffect(()=>{!e&&r!=="main"&&o("main")},[e,r]),S.useEffect(()=>()=>{h&&h.commands.clearContent()},[h]),w.jsx("div",{className:`${CB} simple-editor-wrapper`,"data-react-tiptap-base-editor":"",children:w.jsxs(ZL,{container:a,children:[w.jsxs(sg.Provider,{value:{editor:h},children:[w.jsx(d3,{ref:l,style:{...e?{bottom:`calc(100% - ${n-p.y}px)`}:{}},children:r==="main"?w.jsx(xB,{onHighlighterClick:()=>o("highlighter"),onLinkClick:()=>o("link"),isMobile:e}):w.jsx(SB,{type:r==="highlighter"?"highlighter":"link",onBack:()=>o("main")})}),w.jsx(Wk,{editor:h,className:"simple-editor-content"})]}),w.jsx("div",{ref:f,className:"rtbe-portal-host","aria-hidden":!0})]})})}function EB(){return w.jsx(w.Fragment,{children:w.jsx(wB,{})})}zM.createRoot(document.getElementById("root")).render(w.jsx(S.StrictMode,{children:w.jsx(EB,{})}));