datool 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -2
- package/client-dist/assets/index-B5MN-j1l.js +164 -0
- package/client-dist/assets/index-BkIiz0aS.css +1 -0
- package/client-dist/index.html +2 -2
- package/package.json +1 -1
- package/src/client/App.tsx +1 -0
- package/src/client/components/data-table-cell.tsx +25 -2
- package/src/client/components/data-table-header-col.tsx +3 -0
- package/src/client/components/data-table.tsx +40 -3
- package/src/client/components/enum-badge.tsx +133 -0
- package/src/client/lib/data-table-search.ts +0 -1
- package/src/client/lib/filterable-table.ts +3 -1
- package/src/shared/types.ts +28 -0
- package/client-dist/assets/index-BeRNeRUq.css +0 -1
- package/client-dist/assets/index-uoZ4c_I8.js +0 -164
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
function dO(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)}})();function l1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ih={exports:{}},Vl={};var mb;function hO(){if(mb)return Vl;mb=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 c in o)c!=="key"&&(l[c]=o[c])}else l=o;return o=l.ref,{$$typeof:t,type:r,key:a,ref:o!==void 0?o:null,props:l}}return Vl.Fragment=e,Vl.jsx=n,Vl.jsxs=n,Vl}var gb;function pO(){return gb||(gb=1,Ih.exports=hO()),Ih.exports}var T=pO(),Bh={exports:{}},Te={};var yb;function mO(){if(yb)return Te;yb=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"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function E(D,Y,ee){this.props=D,this.context=Y,this.refs=C,this.updater=ee||S}E.prototype.isReactComponent={},E.prototype.setState=function(D,Y){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,Y,"setState")},E.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function A(){}A.prototype=E.prototype;function k(D,Y,ee){this.props=D,this.context=Y,this.refs=C,this.updater=ee||S}var N=k.prototype=new A;N.constructor=k,x(N,E.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function U(){}var _={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function Z(D,Y,ee){var te=ee.ref;return{$$typeof:t,type:D,key:Y,ref:te!==void 0?te:null,props:ee}}function se(D,Y){return Z(D.type,Y,D.props)}function me(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function ue(D){var Y={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ee){return Y[ee]})}var be=/\/+/g;function ne(D,Y){return typeof D=="object"&&D!==null&&D.key!=null?ue(""+D.key):Y.toString(36)}function ye(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(Y){D.status==="pending"&&(D.status="fulfilled",D.value=Y)},function(Y){D.status==="pending"&&(D.status="rejected",D.reason=Y)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function V(D,Y,ee,te,oe){var ae=typeof D;(ae==="undefined"||ae==="boolean")&&(D=null);var he=!1;if(D===null)he=!0;else switch(ae){case"bigint":case"string":case"number":he=!0;break;case"object":switch(D.$$typeof){case t:case e:he=!0;break;case p:return he=D._init,V(he(D._payload),Y,ee,te,oe)}}if(he)return oe=oe(D),he=te===""?"."+ne(D,0):te,j(oe)?(ee="",he!=null&&(ee=he.replace(be,"$&/")+"/"),V(oe,Y,ee,"",function(on){return on})):oe!=null&&(me(oe)&&(oe=se(oe,ee+(oe.key==null||D&&D.key===oe.key?"":(""+oe.key).replace(be,"$&/")+"/")+he)),Y.push(oe)),1;he=0;var Ze=te===""?".":te+":";if(j(D))for(var Ee=0;Ee<D.length;Ee++)te=D[Ee],ae=Ze+ne(te,Ee),he+=V(te,Y,ee,ae,oe);else if(Ee=b(D),typeof Ee=="function")for(D=Ee.call(D),Ee=0;!(te=D.next()).done;)te=te.value,ae=Ze+ne(te,Ee++),he+=V(te,Y,ee,ae,oe);else if(ae==="object"){if(typeof D.then=="function")return V(ye(D),Y,ee,te,oe);throw Y=String(D),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return he}function $(D,Y,ee){if(D==null)return D;var te=[],oe=0;return V(D,te,"","",function(ae){return Y.call(ee,ae,oe++)}),te}function B(D){if(D._status===-1){var Y=D._result;Y=Y(),Y.then(function(ee){(D._status===0||D._status===-1)&&(D._status=1,D._result=ee)},function(ee){(D._status===0||D._status===-1)&&(D._status=2,D._result=ee)}),D._status===-1&&(D._status=0,D._result=Y)}if(D._status===1)return D._result.default;throw D._result}var q=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},K={map:$,forEach:function(D,Y,ee){$(D,function(){Y.apply(this,arguments)},ee)},count:function(D){var Y=0;return $(D,function(){Y++}),Y},toArray:function(D){return $(D,function(Y){return Y})||[]},only:function(D){if(!me(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Te.Activity=g,Te.Children=K,Te.Component=E,Te.Fragment=n,Te.Profiler=o,Te.PureComponent=k,Te.StrictMode=r,Te.Suspense=d,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Te.__COMPILER_RUNTIME={__proto__:null,c:function(D){return _.H.useMemoCache(D)}},Te.cache=function(D){return function(){return D.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(D,Y,ee){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var te=x({},D.props),oe=D.key;if(Y!=null)for(ae in Y.key!==void 0&&(oe=""+Y.key),Y)!I.call(Y,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&Y.ref===void 0||(te[ae]=Y[ae]);var ae=arguments.length-2;if(ae===1)te.children=ee;else if(1<ae){for(var he=Array(ae),Ze=0;Ze<ae;Ze++)he[Ze]=arguments[Ze+2];te.children=he}return Z(D.type,oe,te)},Te.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:l,_context:D},D},Te.createElement=function(D,Y,ee){var te,oe={},ae=null;if(Y!=null)for(te in Y.key!==void 0&&(ae=""+Y.key),Y)I.call(Y,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(oe[te]=Y[te]);var he=arguments.length-2;if(he===1)oe.children=ee;else if(1<he){for(var Ze=Array(he),Ee=0;Ee<he;Ee++)Ze[Ee]=arguments[Ee+2];oe.children=Ze}if(D&&D.defaultProps)for(te in he=D.defaultProps,he)oe[te]===void 0&&(oe[te]=he[te]);return Z(D,ae,oe)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(D){return{$$typeof:c,render:D}},Te.isValidElement=me,Te.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:B}},Te.memo=function(D,Y){return{$$typeof:h,type:D,compare:Y===void 0?null:Y}},Te.startTransition=function(D){var Y=_.T,ee={};_.T=ee;try{var te=D(),oe=_.S;oe!==null&&oe(ee,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(U,q)}catch(ae){q(ae)}finally{Y!==null&&ee.types!==null&&(Y.types=ee.types),_.T=Y}},Te.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Te.use=function(D){return _.H.use(D)},Te.useActionState=function(D,Y,ee){return _.H.useActionState(D,Y,ee)},Te.useCallback=function(D,Y){return _.H.useCallback(D,Y)},Te.useContext=function(D){return _.H.useContext(D)},Te.useDebugValue=function(){},Te.useDeferredValue=function(D,Y){return _.H.useDeferredValue(D,Y)},Te.useEffect=function(D,Y){return _.H.useEffect(D,Y)},Te.useEffectEvent=function(D){return _.H.useEffectEvent(D)},Te.useId=function(){return _.H.useId()},Te.useImperativeHandle=function(D,Y,ee){return _.H.useImperativeHandle(D,Y,ee)},Te.useInsertionEffect=function(D,Y){return _.H.useInsertionEffect(D,Y)},Te.useLayoutEffect=function(D,Y){return _.H.useLayoutEffect(D,Y)},Te.useMemo=function(D,Y){return _.H.useMemo(D,Y)},Te.useOptimistic=function(D,Y){return _.H.useOptimistic(D,Y)},Te.useReducer=function(D,Y,ee){return _.H.useReducer(D,Y,ee)},Te.useRef=function(D){return _.H.useRef(D)},Te.useState=function(D){return _.H.useState(D)},Te.useSyncExternalStore=function(D,Y,ee){return _.H.useSyncExternalStore(D,Y,ee)},Te.useTransition=function(){return _.H.useTransition()},Te.version="19.2.4",Te}var vb;function ba(){return vb||(vb=1,Bh.exports=mO()),Bh.exports}var M=ba();const tn=l1(M),a1=dO({__proto__:null,default:tn},[M]);var Vh={exports:{}},Fl={},Fh={exports:{}},Ph={};var bb;function gO(){return bb||(bb=1,(function(t){function e(V,$){var B=V.length;V.push($);e:for(;0<B;){var q=B-1>>>1,K=V[q];if(0<o(K,$))V[q]=$,V[B]=K,B=q;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var $=V[0],B=V.pop();if(B!==$){V[0]=B;e:for(var q=0,K=V.length,D=K>>>1;q<D;){var Y=2*(q+1)-1,ee=V[Y],te=Y+1,oe=V[te];if(0>o(ee,B))te<K&&0>o(oe,ee)?(V[q]=oe,V[te]=B,q=te):(V[q]=ee,V[Y]=B,q=Y);else if(te<K&&0>o(oe,B))V[q]=oe,V[te]=B,q=te;else break e}}return $}function o(V,$){var B=V.sortIndex-$.sortIndex;return B!==0?B:V.id-$.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,c=a.now();t.unstable_now=function(){return a.now()-c}}var d=[],h=[],p=1,g=null,v=3,b=!1,S=!1,x=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function N(V){for(var $=n(h);$!==null;){if($.callback===null)r(h);else if($.startTime<=V)r(h),$.sortIndex=$.expirationTime,e(d,$);else break;$=n(h)}}function j(V){if(x=!1,N(V),!S)if(n(d)!==null)S=!0,U||(U=!0,ue());else{var $=n(h);$!==null&&ye(j,$.startTime-V)}}var U=!1,_=-1,I=5,Z=-1;function se(){return C?!0:!(t.unstable_now()-Z<I)}function me(){if(C=!1,U){var V=t.unstable_now();Z=V;var $=!0;try{e:{S=!1,x&&(x=!1,A(_),_=-1),b=!0;var B=v;try{t:{for(N(V),g=n(d);g!==null&&!(g.expirationTime>V&&se());){var q=g.callback;if(typeof q=="function"){g.callback=null,v=g.priorityLevel;var K=q(g.expirationTime<=V);if(V=t.unstable_now(),typeof K=="function"){g.callback=K,N(V),$=!0;break t}g===n(d)&&r(d),N(V)}else r(d);g=n(d)}if(g!==null)$=!0;else{var D=n(h);D!==null&&ye(j,D.startTime-V),$=!1}}break e}finally{g=null,v=B,b=!1}$=void 0}}finally{$?ue():U=!1}}}var ue;if(typeof k=="function")ue=function(){k(me)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,ne=be.port2;be.port1.onmessage=me,ue=function(){ne.postMessage(null)}}else ue=function(){E(me,0)};function ye(V,$){_=E(function(){V(t.unstable_now())},$)}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(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(V){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var B=v;v=$;try{return V()}finally{v=B}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(V,$){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var B=v;v=V;try{return $()}finally{v=B}},t.unstable_scheduleCallback=function(V,$,B){var q=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?q+B:q):B=q,V){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=B+K,V={id:p++,callback:$,priorityLevel:V,startTime:B,expirationTime:K,sortIndex:-1},B>q?(V.sortIndex=B,e(h,V),n(d)===null&&V===n(h)&&(x?(A(_),_=-1):x=!0,ye(j,B-q))):(V.sortIndex=K,e(d,V),S||b||(S=!0,U||(U=!0,ue()))),V},t.unstable_shouldYield=se,t.unstable_wrapCallback=function(V){var $=v;return function(){var B=v;v=$;try{return V.apply(this,arguments)}finally{v=B}}}})(Ph)),Ph}var Sb;function yO(){return Sb||(Sb=1,Fh.exports=gO()),Fh.exports}var $h={exports:{}},Ht={};var xb;function vO(){if(xb)return Ht;xb=1;var t=ba();function e(d){var h="https://react.dev/errors/"+d;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 #"+d+"; 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(d,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:d,containerInfo:h,implementation:p}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ht.createPortal=function(d,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(d,h,null,p)},Ht.flushSync=function(d){var h=a.T,p=r.p;try{if(a.T=null,r.p=2,d)return d()}finally{a.T=h,r.p=p,r.d.f()}},Ht.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},Ht.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Ht.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ht.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(d,{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(d)},Ht.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin);r.d.L(d,p,{crossOrigin:g,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})}},Ht.preloadModule=function(d,h){if(typeof d=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(d,{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(d)},Ht.requestFormReset=function(d){r.d.r(d)},Ht.unstable_batchedUpdates=function(d,h){return d(h)},Ht.useFormState=function(d,h,p){return a.H.useFormState(d,h,p)},Ht.useFormStatus=function(){return a.H.useHostTransitionStatus()},Ht.version="19.2.4",Ht}var wb;function u1(){if(wb)return $h.exports;wb=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(),$h.exports=vO(),$h.exports}var Cb;function bO(){if(Cb)return Fl;Cb=1;var t=yO(),e=ba(),n=u1();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}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,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u: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 c(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 d(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 u=i,f=s;;){var m=u.return;if(m===null)break;var y=m.alternate;if(y===null){if(f=m.return,f!==null){u=f;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===u)return d(m),i;if(y===f)return d(m),s;y=y.sibling}throw Error(r(188))}if(u.return!==f.return)u=m,f=y;else{for(var w=!1,R=m.child;R;){if(R===u){w=!0,u=m,f=y;break}if(R===f){w=!0,f=m,u=y;break}R=R.sibling}if(!w){for(R=y.child;R;){if(R===u){w=!0,u=y,f=m;break}if(R===f){w=!0,f=y,u=m;break}R=R.sibling}if(!w)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?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 g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),k=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function ue(i){return i===null||typeof i!="object"?null:(i=me&&i[me]||i["@@iterator"],typeof i=="function"?i:null)}var be=Symbol.for("react.client.reference");function ne(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===be?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case x:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case j:return"Suspense";case U:return"SuspenseList";case Z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case k:return i.displayName||"Context";case A:return(i._context.displayName||"Context")+".Consumer";case N:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case _:return s=i.displayName||null,s!==null?s:ne(i.type)||"Memo";case I:s=i._payload,i=i._init;try{return ne(i(s))}catch{}}return null}var ye=Array.isArray,V=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},q=[],K=-1;function D(i){return{current:i}}function Y(i){0>K||(i.current=q[K],q[K]=null,K--)}function ee(i,s){K++,q[K]=i.current,i.current=s}var te=D(null),oe=D(null),ae=D(null),he=D(null);function Ze(i,s){switch(ee(ae,s),ee(oe,i),ee(te,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Bv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Bv(s),i=Vv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(te),ee(te,i)}function Ee(){Y(te),Y(oe),Y(ae)}function on(i){i.memoizedState!==null&&ee(he,i);var s=te.current,u=Vv(s,i.type);s!==u&&(ee(oe,i),ee(te,u))}function ft(i){oe.current===i&&(Y(te),Y(oe)),he.current===i&&(Y(he),jl._currentValue=B)}var St,Ft;function Pt(i){if(St===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);St=s&&s[1]||"",Ft=-1<u.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+St+i+Ft}var hr=!1;function Ks(i,s){if(!i||hr)return"";hr=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(s){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(G){var H=G}Reflect.construct(i,[],Q)}else{try{Q.call()}catch(G){H=G}i.call(Q.prototype)}}else{try{throw Error()}catch(G){H=G}(Q=i())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(G){if(G&&H&&typeof G.stack=="string")return[G.stack,H.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),w=y[0],R=y[1];if(w&&R){var O=w.split(`
|
|
4
|
+
`),P=R.split(`
|
|
5
|
+
`);for(m=f=0;f<O.length&&!O[f].includes("DetermineComponentFrameRoot");)f++;for(;m<P.length&&!P[m].includes("DetermineComponentFrameRoot");)m++;if(f===O.length||m===P.length)for(f=O.length-1,m=P.length-1;1<=f&&0<=m&&O[f]!==P[m];)m--;for(;1<=f&&0<=m;f--,m--)if(O[f]!==P[m]){if(f!==1||m!==1)do if(f--,m--,0>m||O[f]!==P[m]){var X=`
|
|
6
|
+
`+O[f].replace(" at new "," at ");return i.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",i.displayName)),X}while(1<=f&&0<=m);break}}}finally{hr=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?Pt(u):""}function Ys(i,s){switch(i.tag){case 26:case 27:case 5:return Pt(i.type);case 16:return Pt("Lazy");case 13:return i.child!==s&&s!==null?Pt("Suspense Fallback"):Pt("Suspense");case 19:return Pt("SuspenseList");case 0:case 15:return Ks(i.type,!1);case 11:return Ks(i.type.render,!1);case 1:return Ks(i.type,!0);case 31:return Pt("Activity");default:return""}}function Hn(i){try{var s="",u=null;do s+=Ys(i,u),u=i,i=i.return;while(i);return s}catch(f){return`
|
|
7
|
+
Error generating stack: `+f.message+`
|
|
8
|
+
`+f.stack}}var ko=Object.prototype.hasOwnProperty,No=t.unstable_scheduleCallback,Do=t.unstable_cancelCallback,ka=t.unstable_shouldYield,Rf=t.unstable_requestPaint,$t=t.unstable_now,Tf=t.unstable_getCurrentPriorityLevel,Na=t.unstable_ImmediatePriority,Da=t.unstable_UserBlockingPriority,Tn=t.unstable_NormalPriority,pr=t.unstable_LowPriority,_o=t.unstable_IdlePriority,_a=t.log,za=t.unstable_setDisableYieldValue,Ct=null,Mt=null;function tr(i){if(typeof _a=="function"&&za(i),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(Ct,i)}catch{}}var Wt=Math.clz32?Math.clz32:Xs,Pi=Math.log,ja=Math.LN2;function Xs(i){return i>>>=0,i===0?32:31-(Pi(i)/ja|0)|0}var Un=256,$i=262144,mr=4194304;function gr(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 zo(i,s,u){var f=i.pendingLanes;if(f===0)return 0;var m=0,y=i.suspendedLanes,w=i.pingedLanes;i=i.warmLanes;var R=f&134217727;return R!==0?(f=R&~y,f!==0?m=gr(f):(w&=R,w!==0?m=gr(w):u||(u=R&~i,u!==0&&(m=gr(u))))):(R=f&~y,R!==0?m=gr(R):w!==0?m=gr(w):u||(u=f&~i,u!==0&&(m=gr(u)))),m===0?0:s!==0&&s!==m&&(s&y)===0&&(y=m&-m,u=s&-s,y>=u||y===32&&(u&4194048)!==0)?s:m}function Hi(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function re(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 ie(){var i=mr;return mr<<=1,(mr&62914560)===0&&(mr=4194304),i}function Me(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function ke(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function tt(i,s,u,f,m,y){var w=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var R=i.entanglements,O=i.expirationTimes,P=i.hiddenUpdates;for(u=w&~u;0<u;){var X=31-Wt(u),Q=1<<X;R[X]=0,O[X]=-1;var H=P[X];if(H!==null)for(P[X]=null,X=0;X<H.length;X++){var G=H[X];G!==null&&(G.lane&=-536870913)}u&=~Q}f!==0&&Re(i,f,0),y!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=y&~(w&~s))}function Re(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var f=31-Wt(s);i.entangledLanes|=s,i.entanglements[f]=i.entanglements[f]|1073741824|u&261930}function at(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var f=31-Wt(u),m=1<<f;m&s|i[f]&s&&(i[f]|=s),u&=~m}}function dt(i,s){var u=s&-s;return u=(u&42)!==0?1:Gr(u),(u&(i.suspendedLanes|s))!==0?0:u}function Gr(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 Ui(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function La(){var i=$.p;return i!==0?i:(i=window.event,i===void 0?32:ab(i.type))}function Mg(i,s){var u=$.p;try{return $.p=i,s()}finally{$.p=u}}var Kr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Kr,sn="__reactProps$"+Kr,jo="__reactContainer$"+Kr,Af="__reactEvents$"+Kr,tT="__reactListeners$"+Kr,nT="__reactHandles$"+Kr,Eg="__reactResources$"+Kr,Js="__reactMarker$"+Kr;function Of(i){delete i[Nt],delete i[sn],delete i[Af],delete i[tT],delete i[nT]}function Lo(i){var s=i[Nt];if(s)return s;for(var u=i.parentNode;u;){if(s=u[jo]||u[Nt]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=Gv(i);i!==null;){if(u=i[Nt])return u;i=Gv(i)}return s}i=u,u=i.parentNode}return null}function Io(i){if(i=i[Nt]||i[jo]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Qs(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Bo(i){var s=i[Eg];return s||(s=i[Eg]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Et(i){i[Js]=!0}var Rg=new Set,Tg={};function qi(i,s){Vo(i,s),Vo(i+"Capture",s)}function Vo(i,s){for(Tg[i]=s,i=0;i<s.length;i++)Rg.add(s[i])}var rT=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]*$"),Ag={},Og={};function iT(i){return ko.call(Og,i)?!0:ko.call(Ag,i)?!1:rT.test(i)?Og[i]=!0:(Ag[i]=!0,!1)}function Ia(i,s,u){if(iT(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var f=s.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Ba(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function yr(i,s,u,f){if(f===null)i.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+f)}}function An(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function kg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function oT(i,s,u){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var m=f.get,y=f.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return m.call(this)},set:function(w){u=""+w,y.call(this,w)}}),Object.defineProperty(i,s,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function kf(i){if(!i._valueTracker){var s=kg(i)?"checked":"value";i._valueTracker=oT(i,s,""+i[s])}}function Ng(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),f="";return i&&(f=kg(i)?i.checked?"true":"false":i.value),i=f,i!==u?(s.setValue(i),!0):!1}function Va(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 sT=/[\n"\\]/g;function On(i){return i.replace(sT,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Nf(i,s,u,f,m,y,w,R){i.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.type=w:i.removeAttribute("type"),s!=null?w==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+An(s)):i.value!==""+An(s)&&(i.value=""+An(s)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),s!=null?Df(i,w,An(s)):u!=null?Df(i,w,An(u)):f!=null&&i.removeAttribute("value"),m==null&&y!=null&&(i.defaultChecked=!!y),m!=null&&(i.checked=m&&typeof m!="function"&&typeof m!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?i.name=""+An(R):i.removeAttribute("name")}function Dg(i,s,u,f,m,y,w,R){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),s!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){kf(i);return}u=u!=null?""+An(u):"",s=s!=null?""+An(s):u,R||s===i.value||(i.value=s),i.defaultValue=s}f=f??m,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=R?i.checked:!!f,i.defaultChecked=!!f,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.name=w),kf(i)}function Df(i,s,u){s==="number"&&Va(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Fo(i,s,u,f){if(i=i.options,s){s={};for(var m=0;m<u.length;m++)s["$"+u[m]]=!0;for(u=0;u<i.length;u++)m=s.hasOwnProperty("$"+i[u].value),i[u].selected!==m&&(i[u].selected=m),m&&f&&(i[u].defaultSelected=!0)}else{for(u=""+An(u),s=null,m=0;m<i.length;m++){if(i[m].value===u){i[m].selected=!0,f&&(i[m].defaultSelected=!0);return}s!==null||i[m].disabled||(s=i[m])}s!==null&&(s.selected=!0)}}function _g(i,s,u){if(s!=null&&(s=""+An(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+An(u):""}function zg(i,s,u,f){if(s==null){if(f!=null){if(u!=null)throw Error(r(92));if(ye(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),s=u}u=An(s),i.defaultValue=u,f=i.textContent,f===u&&f!==""&&f!==null&&(i.value=f),kf(i)}function Po(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var lT=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 jg(i,s,u){var f=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":f?i.setProperty(s,u):typeof u!="number"||u===0||lT.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function Lg(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||s!=null&&s.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var m in s)f=s[m],s.hasOwnProperty(m)&&u[m]!==f&&jg(i,m,f)}else for(var y in s)s.hasOwnProperty(y)&&jg(i,y,s[y])}function _f(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 aT=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"]]),uT=/^[\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 Fa(i){return uT.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function vr(){}var zf=null;function jf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var $o=null,Ho=null;function Ig(i){var s=Io(i);if(s&&(i=s.stateNode)){var u=i[sn]||null;e:switch(i=s.stateNode,s.type){case"input":if(Nf(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+On(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var f=u[s];if(f!==i&&f.form===i.form){var m=f[sn]||null;if(!m)throw Error(r(90));Nf(f,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(s=0;s<u.length;s++)f=u[s],f.form===i.form&&Ng(f)}break e;case"textarea":_g(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Fo(i,!!u.multiple,s,!1)}}}var Lf=!1;function Bg(i,s,u){if(Lf)return i(s,u);Lf=!0;try{var f=i(s);return f}finally{if(Lf=!1,($o!==null||Ho!==null)&&(Tu(),$o&&(s=$o,i=Ho,Ho=$o=null,Ig(s),i)))for(s=0;s<i.length;s++)Ig(i[s])}}function Zs(i,s){var u=i.stateNode;if(u===null)return null;var f=u[sn]||null;if(f===null)return null;u=f[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":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),If=!1;if(br)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){If=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{If=!1}var Yr=null,Bf=null,Pa=null;function Vg(){if(Pa)return Pa;var i,s=Bf,u=s.length,f,m="value"in Yr?Yr.value:Yr.textContent,y=m.length;for(i=0;i<u&&s[i]===m[i];i++);var w=u-i;for(f=1;f<=w&&s[u-f]===m[y-f];f++);return Pa=m.slice(i,1<f?1-f:void 0)}function $a(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 Ha(){return!0}function Fg(){return!1}function ln(i){function s(u,f,m,y,w){this._reactName=u,this._targetInst=m,this.type=f,this.nativeEvent=y,this.target=w,this.currentTarget=null;for(var R in i)i.hasOwnProperty(R)&&(u=i[R],this[R]=u?u(y):y[R]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ha:Fg,this.isPropagationStopped=Fg,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ha)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ha)},persist:function(){},isPersistent:Ha}),s}var Gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ua=ln(Gi),el=g({},Gi,{view:0,detail:0}),cT=ln(el),Vf,Ff,tl,qa=g({},el,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$f,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!==tl&&(tl&&i.type==="mousemove"?(Vf=i.screenX-tl.screenX,Ff=i.screenY-tl.screenY):Ff=Vf=0,tl=i),Vf)},movementY:function(i){return"movementY"in i?i.movementY:Ff}}),Pg=ln(qa),fT=g({},qa,{dataTransfer:0}),dT=ln(fT),hT=g({},el,{relatedTarget:0}),Pf=ln(hT),pT=g({},Gi,{animationName:0,elapsedTime:0,pseudoElement:0}),mT=ln(pT),gT=g({},Gi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),yT=ln(gT),vT=g({},Gi,{data:0}),$g=ln(vT),bT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ST={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"},xT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wT(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=xT[i])?!!s[i]:!1}function $f(){return wT}var CT=g({},el,{key:function(i){if(i.key){var s=bT[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=$a(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?ST[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$f,charCode:function(i){return i.type==="keypress"?$a(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?$a(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),MT=ln(CT),ET=g({},qa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hg=ln(ET),RT=g({},el,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$f}),TT=ln(RT),AT=g({},Gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),OT=ln(AT),kT=g({},qa,{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}),NT=ln(kT),DT=g({},Gi,{newState:0,oldState:0}),_T=ln(DT),zT=[9,13,27,32],Hf=br&&"CompositionEvent"in window,nl=null;br&&"documentMode"in document&&(nl=document.documentMode);var jT=br&&"TextEvent"in window&&!nl,Ug=br&&(!Hf||nl&&8<nl&&11>=nl),qg=" ",Gg=!1;function Kg(i,s){switch(i){case"keyup":return zT.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Uo=!1;function LT(i,s){switch(i){case"compositionend":return Yg(s);case"keypress":return s.which!==32?null:(Gg=!0,qg);case"textInput":return i=s.data,i===qg&&Gg?null:i;default:return null}}function IT(i,s){if(Uo)return i==="compositionend"||!Hf&&Kg(i,s)?(i=Vg(),Pa=Bf=Yr=null,Uo=!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 Ug&&s.locale!=="ko"?null:s.data;default:return null}}var BT={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 Xg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!BT[i.type]:s==="textarea"}function Jg(i,s,u,f){$o?Ho?Ho.push(f):Ho=[f]:$o=f,s=zu(s,"onChange"),0<s.length&&(u=new Ua("onChange","change",null,u,f),i.push({event:u,listeners:s}))}var rl=null,il=null;function VT(i){Dv(i,0)}function Ga(i){var s=Qs(i);if(Ng(s))return i}function Qg(i,s){if(i==="change")return s}var Zg=!1;if(br){var Uf;if(br){var qf="oninput"in document;if(!qf){var Wg=document.createElement("div");Wg.setAttribute("oninput","return;"),qf=typeof Wg.oninput=="function"}Uf=qf}else Uf=!1;Zg=Uf&&(!document.documentMode||9<document.documentMode)}function ey(){rl&&(rl.detachEvent("onpropertychange",ty),il=rl=null)}function ty(i){if(i.propertyName==="value"&&Ga(il)){var s=[];Jg(s,il,i,jf(i)),Bg(VT,s)}}function FT(i,s,u){i==="focusin"?(ey(),rl=s,il=u,rl.attachEvent("onpropertychange",ty)):i==="focusout"&&ey()}function PT(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ga(il)}function $T(i,s){if(i==="click")return Ga(s)}function HT(i,s){if(i==="input"||i==="change")return Ga(s)}function UT(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var mn=typeof Object.is=="function"?Object.is:UT;function ol(i,s){if(mn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),f=Object.keys(s);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var m=u[f];if(!ko.call(s,m)||!mn(i[m],s[m]))return!1}return!0}function ny(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ry(i,s){var u=ny(i);i=0;for(var f;u;){if(u.nodeType===3){if(f=i+u.textContent.length,i<=s&&f>=s)return{node:u,offset:s-i};i=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=ny(u)}}function iy(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?iy(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function oy(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Va(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=Va(i.document)}return s}function Gf(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 qT=br&&"documentMode"in document&&11>=document.documentMode,qo=null,Kf=null,sl=null,Yf=!1;function sy(i,s,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Yf||qo==null||qo!==Va(f)||(f=qo,"selectionStart"in f&&Gf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),sl&&ol(sl,f)||(sl=f,f=zu(Kf,"onSelect"),0<f.length&&(s=new Ua("onSelect","select",null,s,u),i.push({event:s,listeners:f}),s.target=qo)))}function Ki(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var Go={animationend:Ki("Animation","AnimationEnd"),animationiteration:Ki("Animation","AnimationIteration"),animationstart:Ki("Animation","AnimationStart"),transitionrun:Ki("Transition","TransitionRun"),transitionstart:Ki("Transition","TransitionStart"),transitioncancel:Ki("Transition","TransitionCancel"),transitionend:Ki("Transition","TransitionEnd")},Xf={},ly={};br&&(ly=document.createElement("div").style,"AnimationEvent"in window||(delete Go.animationend.animation,delete Go.animationiteration.animation,delete Go.animationstart.animation),"TransitionEvent"in window||delete Go.transitionend.transition);function Yi(i){if(Xf[i])return Xf[i];if(!Go[i])return i;var s=Go[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in ly)return Xf[i]=s[u];return i}var ay=Yi("animationend"),uy=Yi("animationiteration"),cy=Yi("animationstart"),GT=Yi("transitionrun"),KT=Yi("transitionstart"),YT=Yi("transitioncancel"),fy=Yi("transitionend"),dy=new Map,Jf="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(" ");Jf.push("scrollEnd");function qn(i,s){dy.set(i,s),qi(s,[i])}var Ka=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)},kn=[],Ko=0,Qf=0;function Ya(){for(var i=Ko,s=Qf=Ko=0;s<i;){var u=kn[s];kn[s++]=null;var f=kn[s];kn[s++]=null;var m=kn[s];kn[s++]=null;var y=kn[s];if(kn[s++]=null,f!==null&&m!==null){var w=f.pending;w===null?m.next=m:(m.next=w.next,w.next=m),f.pending=m}y!==0&&hy(u,m,y)}}function Xa(i,s,u,f){kn[Ko++]=i,kn[Ko++]=s,kn[Ko++]=u,kn[Ko++]=f,Qf|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function Zf(i,s,u,f){return Xa(i,s,u,f),Ja(i)}function Xi(i,s){return Xa(i,null,null,s),Ja(i)}function hy(i,s,u){i.lanes|=u;var f=i.alternate;f!==null&&(f.lanes|=u);for(var m=!1,y=i.return;y!==null;)y.childLanes|=u,f=y.alternate,f!==null&&(f.childLanes|=u),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(m=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,m&&s!==null&&(m=31-Wt(u),i=y.hiddenUpdates,f=i[m],f===null?i[m]=[s]:f.push(s),s.lane=u|536870912),y):null}function Ja(i){if(50<Al)throw Al=0,lh=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Yo={};function XT(i,s,u,f){this.tag=i,this.key=u,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=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(i,s,u,f){return new XT(i,s,u,f)}function Wf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Sr(i,s){var u=i.alternate;return u===null?(u=gn(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function py(i,s){i.flags&=65011714;var u=i.alternate;return u===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=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Qa(i,s,u,f,m,y){var w=0;if(f=i,typeof i=="function")Wf(i)&&(w=1);else if(typeof i=="string")w=eO(i,u,te.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=gn(31,u,s,m),i.elementType=Z,i.lanes=y,i;case x:return Ji(u.children,m,y,s);case C:w=8,m|=24;break;case E:return i=gn(12,u,s,m|2),i.elementType=E,i.lanes=y,i;case j:return i=gn(13,u,s,m),i.elementType=j,i.lanes=y,i;case U:return i=gn(19,u,s,m),i.elementType=U,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:w=10;break e;case A:w=9;break e;case N:w=11;break e;case _:w=14;break e;case I:w=16,f=null;break e}w=29,u=Error(r(130,i===null?"null":typeof i,"")),f=null}return s=gn(w,u,s,m),s.elementType=i,s.type=f,s.lanes=y,s}function Ji(i,s,u,f){return i=gn(7,i,f,s),i.lanes=u,i}function ed(i,s,u){return i=gn(6,i,null,s),i.lanes=u,i}function my(i){var s=gn(18,null,null,0);return s.stateNode=i,s}function td(i,s,u){return s=gn(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var gy=new WeakMap;function Nn(i,s){if(typeof i=="object"&&i!==null){var u=gy.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Hn(s)},gy.set(i,s),s)}return{value:i,source:s,stack:Hn(s)}}var Xo=[],Jo=0,Za=null,ll=0,Dn=[],_n=0,Xr=null,nr=1,rr="";function xr(i,s){Xo[Jo++]=ll,Xo[Jo++]=Za,Za=i,ll=s}function yy(i,s,u){Dn[_n++]=nr,Dn[_n++]=rr,Dn[_n++]=Xr,Xr=i;var f=nr;i=rr;var m=32-Wt(f)-1;f&=~(1<<m),u+=1;var y=32-Wt(s)+m;if(30<y){var w=m-m%5;y=(f&(1<<w)-1).toString(32),f>>=w,m-=w,nr=1<<32-Wt(s)+m|u<<m|f,rr=y+i}else nr=1<<y|u<<m|f,rr=i}function nd(i){i.return!==null&&(xr(i,1),yy(i,1,0))}function rd(i){for(;i===Za;)Za=Xo[--Jo],Xo[Jo]=null,ll=Xo[--Jo],Xo[Jo]=null;for(;i===Xr;)Xr=Dn[--_n],Dn[_n]=null,rr=Dn[--_n],Dn[_n]=null,nr=Dn[--_n],Dn[_n]=null}function vy(i,s){Dn[_n++]=nr,Dn[_n++]=rr,Dn[_n++]=Xr,nr=s.id,rr=s.overflow,Xr=i}var Dt=null,We=null,Fe=!1,Jr=null,zn=!1,id=Error(r(519));function Qr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw al(Nn(s,i)),id}function by(i){var s=i.stateNode,u=i.type,f=i.memoizedProps;switch(s[Nt]=i,s[sn]=f,u){case"dialog":Ie("cancel",s),Ie("close",s);break;case"iframe":case"object":case"embed":Ie("load",s);break;case"video":case"audio":for(u=0;u<kl.length;u++)Ie(kl[u],s);break;case"source":Ie("error",s);break;case"img":case"image":case"link":Ie("error",s),Ie("load",s);break;case"details":Ie("toggle",s);break;case"input":Ie("invalid",s),Dg(s,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Ie("invalid",s);break;case"textarea":Ie("invalid",s),zg(s,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||f.suppressHydrationWarning===!0||Lv(s.textContent,u)?(f.popover!=null&&(Ie("beforetoggle",s),Ie("toggle",s)),f.onScroll!=null&&Ie("scroll",s),f.onScrollEnd!=null&&Ie("scrollend",s),f.onClick!=null&&(s.onclick=vr),s=!0):s=!1,s||Qr(i,!0)}function Sy(i){for(Dt=i.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:zn=!1;return;case 27:case 3:zn=!0;return;default:Dt=Dt.return}}function Qo(i){if(i!==Dt)return!1;if(!Fe)return Sy(i),Fe=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||wh(i.type,i.memoizedProps)),u=!u),u&&We&&Qr(i),Sy(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));We=qv(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));We=qv(i)}else s===27?(s=We,fi(i.type)?(i=Th,Th=null,We=i):We=s):We=Dt?Ln(i.stateNode.nextSibling):null;return!0}function Qi(){We=Dt=null,Fe=!1}function od(){var i=Jr;return i!==null&&(fn===null?fn=i:fn.push.apply(fn,i),Jr=null),i}function al(i){Jr===null?Jr=[i]:Jr.push(i)}var sd=D(null),Zi=null,wr=null;function Zr(i,s,u){ee(sd,s._currentValue),s._currentValue=u}function Cr(i){i._currentValue=sd.current,Y(sd)}function ld(i,s,u){for(;i!==null;){var f=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),i===u)break;i=i.return}}function ad(i,s,u,f){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var y=m.dependencies;if(y!==null){var w=m.child;y=y.firstContext;e:for(;y!==null;){var R=y;y=m;for(var O=0;O<s.length;O++)if(R.context===s[O]){y.lanes|=u,R=y.alternate,R!==null&&(R.lanes|=u),ld(y.return,u,i),f||(w=null);break e}y=R.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=u,y=w.alternate,y!==null&&(y.lanes|=u),ld(w,u,i),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===i){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function Zo(i,s,u,f){i=null;for(var m=s,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var R=m.type;mn(m.pendingProps.value,w.value)||(i!==null?i.push(R):i=[R])}}else if(m===he.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(jl):i=[jl])}m=m.return}i!==null&&ad(s,i,u,f),s.flags|=262144}function Wa(i){for(i=i.firstContext;i!==null;){if(!mn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Wi(i){Zi=i,wr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function _t(i){return xy(Zi,i)}function eu(i,s){return Zi===null&&Wi(i),xy(i,s)}function xy(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},wr===null){if(i===null)throw Error(r(308));wr=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else wr=wr.next=s;return u}var JT=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,f){i.push(f)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},QT=t.unstable_scheduleCallback,ZT=t.unstable_NormalPriority,ht={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ud(){return{controller:new JT,data:new Map,refCount:0}}function ul(i){i.refCount--,i.refCount===0&&QT(ZT,function(){i.controller.abort()})}var cl=null,cd=0,Wo=0,es=null;function WT(i,s){if(cl===null){var u=cl=[];cd=0,Wo=hh(),es={status:"pending",value:void 0,then:function(f){u.push(f)}}}return cd++,s.then(wy,wy),s}function wy(){if(--cd===0&&cl!==null){es!==null&&(es.status="fulfilled");var i=cl;cl=null,Wo=0,es=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function eA(i,s){var u=[],f={status:"pending",value:null,reason:null,then:function(m){u.push(m)}};return i.then(function(){f.status="fulfilled",f.value=s;for(var m=0;m<u.length;m++)(0,u[m])(s)},function(m){for(f.status="rejected",f.reason=m,m=0;m<u.length;m++)(0,u[m])(void 0)}),f}var Cy=V.S;V.S=function(i,s){sv=$t(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&WT(i,s),Cy!==null&&Cy(i,s)};var eo=D(null);function fd(){var i=eo.current;return i!==null?i:Je.pooledCache}function tu(i,s){s===null?ee(eo,eo.current):ee(eo,s.pool)}function My(){var i=fd();return i===null?null:{parent:ht._currentValue,pool:i}}var ts=Error(r(460)),dd=Error(r(474)),nu=Error(r(542)),ru={then:function(){}};function Ey(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Ry(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(vr,vr),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Ay(i),i;default:if(typeof s.status=="string")s.then(vr,vr);else{if(i=Je,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(f){if(s.status==="pending"){var m=s;m.status="fulfilled",m.value=f}},function(f){if(s.status==="pending"){var m=s;m.status="rejected",m.reason=f}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Ay(i),i}throw no=s,ts}}function to(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(no=u,ts):u}}var no=null;function Ty(){if(no===null)throw Error(r(459));var i=no;return no=null,i}function Ay(i){if(i===ts||i===nu)throw Error(r(483))}var ns=null,fl=0;function iu(i){var s=fl;return fl+=1,ns===null&&(ns=[]),Ry(ns,i,s)}function dl(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function ou(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Oy(i){function s(L,z){if(i){var F=L.deletions;F===null?(L.deletions=[z],L.flags|=16):F.push(z)}}function u(L,z){if(!i)return null;for(;z!==null;)s(L,z),z=z.sibling;return null}function f(L){for(var z=new Map;L!==null;)L.key!==null?z.set(L.key,L):z.set(L.index,L),L=L.sibling;return z}function m(L,z){return L=Sr(L,z),L.index=0,L.sibling=null,L}function y(L,z,F){return L.index=F,i?(F=L.alternate,F!==null?(F=F.index,F<z?(L.flags|=67108866,z):F):(L.flags|=67108866,z)):(L.flags|=1048576,z)}function w(L){return i&&L.alternate===null&&(L.flags|=67108866),L}function R(L,z,F,J){return z===null||z.tag!==6?(z=ed(F,L.mode,J),z.return=L,z):(z=m(z,F),z.return=L,z)}function O(L,z,F,J){var ve=F.type;return ve===x?X(L,z,F.props.children,J,F.key):z!==null&&(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===I&&to(ve)===z.type)?(z=m(z,F.props),dl(z,F),z.return=L,z):(z=Qa(F.type,F.key,F.props,null,L.mode,J),dl(z,F),z.return=L,z)}function P(L,z,F,J){return z===null||z.tag!==4||z.stateNode.containerInfo!==F.containerInfo||z.stateNode.implementation!==F.implementation?(z=td(F,L.mode,J),z.return=L,z):(z=m(z,F.children||[]),z.return=L,z)}function X(L,z,F,J,ve){return z===null||z.tag!==7?(z=Ji(F,L.mode,J,ve),z.return=L,z):(z=m(z,F),z.return=L,z)}function Q(L,z,F){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=ed(""+z,L.mode,F),z.return=L,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case b:return F=Qa(z.type,z.key,z.props,null,L.mode,F),dl(F,z),F.return=L,F;case S:return z=td(z,L.mode,F),z.return=L,z;case I:return z=to(z),Q(L,z,F)}if(ye(z)||ue(z))return z=Ji(z,L.mode,F,null),z.return=L,z;if(typeof z.then=="function")return Q(L,iu(z),F);if(z.$$typeof===k)return Q(L,eu(L,z),F);ou(L,z)}return null}function H(L,z,F,J){var ve=z!==null?z.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return ve!==null?null:R(L,z,""+F,J);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case b:return F.key===ve?O(L,z,F,J):null;case S:return F.key===ve?P(L,z,F,J):null;case I:return F=to(F),H(L,z,F,J)}if(ye(F)||ue(F))return ve!==null?null:X(L,z,F,J,null);if(typeof F.then=="function")return H(L,z,iu(F),J);if(F.$$typeof===k)return H(L,z,eu(L,F),J);ou(L,F)}return null}function G(L,z,F,J,ve){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return L=L.get(F)||null,R(z,L,""+J,ve);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return L=L.get(J.key===null?F:J.key)||null,O(z,L,J,ve);case S:return L=L.get(J.key===null?F:J.key)||null,P(z,L,J,ve);case I:return J=to(J),G(L,z,F,J,ve)}if(ye(J)||ue(J))return L=L.get(F)||null,X(z,L,J,ve,null);if(typeof J.then=="function")return G(L,z,F,iu(J),ve);if(J.$$typeof===k)return G(L,z,F,eu(z,J),ve);ou(z,J)}return null}function ce(L,z,F,J){for(var ve=null,Pe=null,pe=z,Ne=z=0,Ve=null;pe!==null&&Ne<F.length;Ne++){pe.index>Ne?(Ve=pe,pe=null):Ve=pe.sibling;var $e=H(L,pe,F[Ne],J);if($e===null){pe===null&&(pe=Ve);break}i&&pe&&$e.alternate===null&&s(L,pe),z=y($e,z,Ne),Pe===null?ve=$e:Pe.sibling=$e,Pe=$e,pe=Ve}if(Ne===F.length)return u(L,pe),Fe&&xr(L,Ne),ve;if(pe===null){for(;Ne<F.length;Ne++)pe=Q(L,F[Ne],J),pe!==null&&(z=y(pe,z,Ne),Pe===null?ve=pe:Pe.sibling=pe,Pe=pe);return Fe&&xr(L,Ne),ve}for(pe=f(pe);Ne<F.length;Ne++)Ve=G(pe,L,Ne,F[Ne],J),Ve!==null&&(i&&Ve.alternate!==null&&pe.delete(Ve.key===null?Ne:Ve.key),z=y(Ve,z,Ne),Pe===null?ve=Ve:Pe.sibling=Ve,Pe=Ve);return i&&pe.forEach(function(gi){return s(L,gi)}),Fe&&xr(L,Ne),ve}function xe(L,z,F,J){if(F==null)throw Error(r(151));for(var ve=null,Pe=null,pe=z,Ne=z=0,Ve=null,$e=F.next();pe!==null&&!$e.done;Ne++,$e=F.next()){pe.index>Ne?(Ve=pe,pe=null):Ve=pe.sibling;var gi=H(L,pe,$e.value,J);if(gi===null){pe===null&&(pe=Ve);break}i&&pe&&gi.alternate===null&&s(L,pe),z=y(gi,z,Ne),Pe===null?ve=gi:Pe.sibling=gi,Pe=gi,pe=Ve}if($e.done)return u(L,pe),Fe&&xr(L,Ne),ve;if(pe===null){for(;!$e.done;Ne++,$e=F.next())$e=Q(L,$e.value,J),$e!==null&&(z=y($e,z,Ne),Pe===null?ve=$e:Pe.sibling=$e,Pe=$e);return Fe&&xr(L,Ne),ve}for(pe=f(pe);!$e.done;Ne++,$e=F.next())$e=G(pe,L,Ne,$e.value,J),$e!==null&&(i&&$e.alternate!==null&&pe.delete($e.key===null?Ne:$e.key),z=y($e,z,Ne),Pe===null?ve=$e:Pe.sibling=$e,Pe=$e);return i&&pe.forEach(function(fO){return s(L,fO)}),Fe&&xr(L,Ne),ve}function Xe(L,z,F,J){if(typeof F=="object"&&F!==null&&F.type===x&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case b:e:{for(var ve=F.key;z!==null;){if(z.key===ve){if(ve=F.type,ve===x){if(z.tag===7){u(L,z.sibling),J=m(z,F.props.children),J.return=L,L=J;break e}}else if(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===I&&to(ve)===z.type){u(L,z.sibling),J=m(z,F.props),dl(J,F),J.return=L,L=J;break e}u(L,z);break}else s(L,z);z=z.sibling}F.type===x?(J=Ji(F.props.children,L.mode,J,F.key),J.return=L,L=J):(J=Qa(F.type,F.key,F.props,null,L.mode,J),dl(J,F),J.return=L,L=J)}return w(L);case S:e:{for(ve=F.key;z!==null;){if(z.key===ve)if(z.tag===4&&z.stateNode.containerInfo===F.containerInfo&&z.stateNode.implementation===F.implementation){u(L,z.sibling),J=m(z,F.children||[]),J.return=L,L=J;break e}else{u(L,z);break}else s(L,z);z=z.sibling}J=td(F,L.mode,J),J.return=L,L=J}return w(L);case I:return F=to(F),Xe(L,z,F,J)}if(ye(F))return ce(L,z,F,J);if(ue(F)){if(ve=ue(F),typeof ve!="function")throw Error(r(150));return F=ve.call(F),xe(L,z,F,J)}if(typeof F.then=="function")return Xe(L,z,iu(F),J);if(F.$$typeof===k)return Xe(L,z,eu(L,F),J);ou(L,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,z!==null&&z.tag===6?(u(L,z.sibling),J=m(z,F),J.return=L,L=J):(u(L,z),J=ed(F,L.mode,J),J.return=L,L=J),w(L)):u(L,z)}return function(L,z,F,J){try{fl=0;var ve=Xe(L,z,F,J);return ns=null,ve}catch(pe){if(pe===ts||pe===nu)throw pe;var Pe=gn(29,pe,null,L.mode);return Pe.lanes=J,Pe.return=L,Pe}}}var ro=Oy(!0),ky=Oy(!1),Wr=!1;function hd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pd(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 ei(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ti(i,s,u){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(He&2)!==0){var m=f.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),f.pending=s,s=Ja(i),hy(i,null,u),s}return Xa(i,f,s,u),Ja(i)}function hl(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var f=s.lanes;f&=i.pendingLanes,u|=f,s.lanes=u,at(i,u)}}function md(i,s){var u=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var m=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,u=u.next}while(u!==null);y===null?m=y=s:y=y.next=s}else m=y=s;u={baseState:f.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var gd=!1;function pl(){if(gd){var i=es;if(i!==null)throw i}}function ml(i,s,u,f){gd=!1;var m=i.updateQueue;Wr=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,R=m.shared.pending;if(R!==null){m.shared.pending=null;var O=R,P=O.next;O.next=null,w===null?y=P:w.next=P,w=O;var X=i.alternate;X!==null&&(X=X.updateQueue,R=X.lastBaseUpdate,R!==w&&(R===null?X.firstBaseUpdate=P:R.next=P,X.lastBaseUpdate=O))}if(y!==null){var Q=m.baseState;w=0,X=P=O=null,R=y;do{var H=R.lane&-536870913,G=H!==R.lane;if(G?(Be&H)===H:(f&H)===H){H!==0&&H===Wo&&(gd=!0),X!==null&&(X=X.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var ce=i,xe=R;H=s;var Xe=u;switch(xe.tag){case 1:if(ce=xe.payload,typeof ce=="function"){Q=ce.call(Xe,Q,H);break e}Q=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=xe.payload,H=typeof ce=="function"?ce.call(Xe,Q,H):ce,H==null)break e;Q=g({},Q,H);break e;case 2:Wr=!0}}H=R.callback,H!==null&&(i.flags|=64,G&&(i.flags|=8192),G=m.callbacks,G===null?m.callbacks=[H]:G.push(H))}else G={lane:H,tag:R.tag,payload:R.payload,callback:R.callback,next:null},X===null?(P=X=G,O=Q):X=X.next=G,w|=H;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;G=R,R=G.next,G.next=null,m.lastBaseUpdate=G,m.shared.pending=null}}while(!0);X===null&&(O=Q),m.baseState=O,m.firstBaseUpdate=P,m.lastBaseUpdate=X,y===null&&(m.shared.lanes=0),si|=w,i.lanes=w,i.memoizedState=Q}}function Ny(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Dy(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Ny(u[i],s)}var rs=D(null),su=D(0);function _y(i,s){i=Dr,ee(su,i),ee(rs,s),Dr=i|s.baseLanes}function yd(){ee(su,Dr),ee(rs,rs.current)}function vd(){Dr=su.current,Y(rs),Y(su)}var yn=D(null),jn=null;function ni(i){var s=i.alternate;ee(ut,ut.current&1),ee(yn,i),jn===null&&(s===null||rs.current!==null||s.memoizedState!==null)&&(jn=i)}function bd(i){ee(ut,ut.current),ee(yn,i),jn===null&&(jn=i)}function zy(i){i.tag===22?(ee(ut,ut.current),ee(yn,i),jn===null&&(jn=i)):ri()}function ri(){ee(ut,ut.current),ee(yn,yn.current)}function vn(i){Y(yn),jn===i&&(jn=null),Y(ut)}var ut=D(0);function lu(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Eh(u)||Rh(u)))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,Ae=null,Ke=null,pt=null,au=!1,is=!1,io=!1,uu=0,gl=0,ss=null,tA=0;function ot(){throw Error(r(321))}function Sd(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!mn(i[u],s[u]))return!1;return!0}function xd(i,s,u,f,m,y){return Mr=y,Ae=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,V.H=i===null||i.memoizedState===null?y0:Ld,io=!1,y=u(f,m),io=!1,is&&(y=Ly(s,u,f,m)),jy(i),y}function jy(i){V.H=bl;var s=Ke!==null&&Ke.next!==null;if(Mr=0,pt=Ke=Ae=null,au=!1,gl=0,ss=null,s)throw Error(r(300));i===null||mt||(i=i.dependencies,i!==null&&Wa(i)&&(mt=!0))}function Ly(i,s,u,f){Ae=i;var m=0;do{if(is&&(ss=null),gl=0,is=!1,25<=m)throw Error(r(301));if(m+=1,pt=Ke=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}V.H=v0,y=s(u,f)}while(is);return y}function nA(){var i=V.H,s=i.useState()[0];return s=typeof s.then=="function"?yl(s):s,i=i.useState()[0],(Ke!==null?Ke.memoizedState:null)!==i&&(Ae.flags|=1024),s}function wd(){var i=uu!==0;return uu=0,i}function Cd(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Md(i){if(au){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}au=!1}Mr=0,pt=Ke=Ae=null,is=!1,gl=uu=0,ss=null}function en(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ae.memoizedState=pt=i:pt=pt.next=i,pt}function ct(){if(Ke===null){var i=Ae.alternate;i=i!==null?i.memoizedState:null}else i=Ke.next;var s=pt===null?Ae.memoizedState:pt.next;if(s!==null)pt=s,Ke=i;else{if(i===null)throw Ae.alternate===null?Error(r(467)):Error(r(310));Ke=i,i={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},pt===null?Ae.memoizedState=pt=i:pt=pt.next=i}return pt}function cu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yl(i){var s=gl;return gl+=1,ss===null&&(ss=[]),i=Ry(ss,i,s),s=Ae,(pt===null?s.memoizedState:pt.next)===null&&(s=s.alternate,V.H=s===null||s.memoizedState===null?y0:Ld),i}function fu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return yl(i);if(i.$$typeof===k)return _t(i)}throw Error(r(438,String(i)))}function Ed(i){var s=null,u=Ae.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var f=Ae.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(s={data:f.data.map(function(m){return m.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=cu(),Ae.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),f=0;f<i;f++)u[f]=se;return s.index++,u}function Er(i,s){return typeof s=="function"?s(i):s}function du(i){var s=ct();return Rd(s,Ke,i)}function Rd(i,s,u){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var m=i.baseQueue,y=f.pending;if(y!==null){if(m!==null){var w=m.next;m.next=y.next,y.next=w}s.baseQueue=m=y,f.pending=null}if(y=i.baseState,m===null)i.memoizedState=y;else{s=m.next;var R=w=null,O=null,P=s,X=!1;do{var Q=P.lane&-536870913;if(Q!==P.lane?(Be&Q)===Q:(Mr&Q)===Q){var H=P.revertLane;if(H===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),Q===Wo&&(X=!0);else if((Mr&H)===H){P=P.next,H===Wo&&(X=!0);continue}else Q={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(R=O=Q,w=y):O=O.next=Q,Ae.lanes|=H,si|=H;Q=P.action,io&&u(y,Q),y=P.hasEagerState?P.eagerState:u(y,Q)}else H={lane:Q,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(R=O=H,w=y):O=O.next=H,Ae.lanes|=Q,si|=Q;P=P.next}while(P!==null&&P!==s);if(O===null?w=y:O.next=R,!mn(y,i.memoizedState)&&(mt=!0,X&&(u=es,u!==null)))throw u;i.memoizedState=y,i.baseState=w,i.baseQueue=O,f.lastRenderedState=y}return m===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Td(i){var s=ct(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var f=u.dispatch,m=u.pending,y=s.memoizedState;if(m!==null){u.pending=null;var w=m=m.next;do y=i(y,w.action),w=w.next;while(w!==m);mn(y,s.memoizedState)||(mt=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,f]}function Iy(i,s,u){var f=Ae,m=ct(),y=Fe;if(y){if(u===void 0)throw Error(r(407));u=u()}else u=s();var w=!mn((Ke||m).memoizedState,u);if(w&&(m.memoizedState=u,mt=!0),m=m.queue,kd(Fy.bind(null,f,m,i),[i]),m.getSnapshot!==s||w||pt!==null&&pt.memoizedState.tag&1){if(f.flags|=2048,ls(9,{destroy:void 0},Vy.bind(null,f,m,u,s),null),Je===null)throw Error(r(349));y||(Mr&127)!==0||By(f,s,u)}return u}function By(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=Ae.updateQueue,s===null?(s=cu(),Ae.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function Vy(i,s,u,f){s.value=u,s.getSnapshot=f,Py(s)&&$y(i)}function Fy(i,s,u){return u(function(){Py(s)&&$y(i)})}function Py(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!mn(i,u)}catch{return!0}}function $y(i){var s=Xi(i,2);s!==null&&dn(s,i,2)}function Ad(i){var s=en();if(typeof i=="function"){var u=i;if(i=u(),io){tr(!0);try{u()}finally{tr(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:i},s}function Hy(i,s,u,f){return i.baseState=u,Rd(i,Ke,typeof f=="function"?f:Er)}function rA(i,s,u,f,m){if(mu(i))throw Error(r(485));if(i=s.action,i!==null){var y={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){y.listeners.push(w)}};V.T!==null?u(!0):y.isTransition=!1,f(y),u=s.pending,u===null?(y.next=s.pending=y,Uy(s,y)):(y.next=u.next,s.pending=u.next=y)}}function Uy(i,s){var u=s.action,f=s.payload,m=i.state;if(s.isTransition){var y=V.T,w={};V.T=w;try{var R=u(m,f),O=V.S;O!==null&&O(w,R),qy(i,s,R)}catch(P){Od(i,s,P)}finally{y!==null&&w.types!==null&&(y.types=w.types),V.T=y}}else try{y=u(m,f),qy(i,s,y)}catch(P){Od(i,s,P)}}function qy(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){Gy(i,s,f)},function(f){return Od(i,s,f)}):Gy(i,s,u)}function Gy(i,s,u){s.status="fulfilled",s.value=u,Ky(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,Uy(i,u)))}function Od(i,s,u){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do s.status="rejected",s.reason=u,Ky(s),s=s.next;while(s!==f)}i.action=null}function Ky(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Yy(i,s){return s}function Xy(i,s){if(Fe){var u=Je.formState;if(u!==null){e:{var f=Ae;if(Fe){if(We){t:{for(var m=We,y=zn;m.nodeType!==8;){if(!y){m=null;break t}if(m=Ln(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){We=Ln(m.nextSibling),f=m.data==="F!";break e}}Qr(f)}f=!1}f&&(s=u[0])}}return u=en(),u.memoizedState=u.baseState=s,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yy,lastRenderedState:s},u.queue=f,u=p0.bind(null,Ae,f),f.dispatch=u,f=Ad(!1),y=jd.bind(null,Ae,!1,f.queue),f=en(),m={state:s,dispatch:null,action:i,pending:null},f.queue=m,u=rA.bind(null,Ae,m,y,u),m.dispatch=u,f.memoizedState=i,[s,u,!1]}function Jy(i){var s=ct();return Qy(s,Ke,i)}function Qy(i,s,u){if(s=Rd(i,s,Yy)[0],i=du(Er)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var f=yl(s)}catch(w){throw w===ts?nu:w}else f=s;s=ct();var m=s.queue,y=m.dispatch;return u!==s.memoizedState&&(Ae.flags|=2048,ls(9,{destroy:void 0},iA.bind(null,m,u),null)),[f,y,i]}function iA(i,s){i.action=s}function Zy(i){var s=ct(),u=Ke;if(u!==null)return Qy(s,u,i);ct(),s=s.memoizedState,u=ct();var f=u.queue.dispatch;return u.memoizedState=i,[s,f,!1]}function ls(i,s,u,f){return i={tag:i,create:u,deps:f,inst:s,next:null},s=Ae.updateQueue,s===null&&(s=cu(),Ae.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(f=u.next,u.next=i,i.next=f,s.lastEffect=i),i}function Wy(){return ct().memoizedState}function hu(i,s,u,f){var m=en();Ae.flags|=i,m.memoizedState=ls(1|s,{destroy:void 0},u,f===void 0?null:f)}function pu(i,s,u,f){var m=ct();f=f===void 0?null:f;var y=m.memoizedState.inst;Ke!==null&&f!==null&&Sd(f,Ke.memoizedState.deps)?m.memoizedState=ls(s,y,u,f):(Ae.flags|=i,m.memoizedState=ls(1|s,y,u,f))}function e0(i,s){hu(8390656,8,i,s)}function kd(i,s){pu(2048,8,i,s)}function oA(i){Ae.flags|=4;var s=Ae.updateQueue;if(s===null)s=cu(),Ae.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function t0(i){var s=ct().memoizedState;return oA({ref:s,nextImpl:i}),function(){if((He&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function n0(i,s){return pu(4,2,i,s)}function r0(i,s){return pu(4,4,i,s)}function i0(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function o0(i,s,u){u=u!=null?u.concat([i]):null,pu(4,4,i0.bind(null,s,i),u)}function Nd(){}function s0(i,s){var u=ct();s=s===void 0?null:s;var f=u.memoizedState;return s!==null&&Sd(s,f[1])?f[0]:(u.memoizedState=[i,s],i)}function l0(i,s){var u=ct();s=s===void 0?null:s;var f=u.memoizedState;if(s!==null&&Sd(s,f[1]))return f[0];if(f=i(),io){tr(!0);try{i()}finally{tr(!1)}}return u.memoizedState=[f,s],f}function Dd(i,s,u){return u===void 0||(Mr&1073741824)!==0&&(Be&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=av(),Ae.lanes|=i,si|=i,u)}function a0(i,s,u,f){return mn(u,s)?u:rs.current!==null?(i=Dd(i,u,f),mn(i,s)||(mt=!0),i):(Mr&42)===0||(Mr&1073741824)!==0&&(Be&261930)===0?(mt=!0,i.memoizedState=u):(i=av(),Ae.lanes|=i,si|=i,s)}function u0(i,s,u,f,m){var y=$.p;$.p=y!==0&&8>y?y:8;var w=V.T,R={};V.T=R,jd(i,!1,s,u);try{var O=m(),P=V.S;if(P!==null&&P(R,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var X=eA(O,f);vl(i,s,X,xn(i))}else vl(i,s,f,xn(i))}catch(Q){vl(i,s,{then:function(){},status:"rejected",reason:Q},xn())}finally{$.p=y,w!==null&&R.types!==null&&(w.types=R.types),V.T=w}}function sA(){}function _d(i,s,u,f){if(i.tag!==5)throw Error(r(476));var m=c0(i).queue;u0(i,m,s,B,u===null?sA:function(){return f0(i),u(f)})}function c0(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:B},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function f0(i){var s=c0(i);s.next===null&&(s=i.alternate.memoizedState),vl(i,s.next.queue,{},xn())}function zd(){return _t(jl)}function d0(){return ct().memoizedState}function h0(){return ct().memoizedState}function lA(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=xn();i=ei(u);var f=ti(s,i,u);f!==null&&(dn(f,s,u),hl(f,s,u)),s={cache:ud()},i.payload=s;return}s=s.return}}function aA(i,s,u){var f=xn();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},mu(i)?m0(s,u):(u=Zf(i,s,u,f),u!==null&&(dn(u,i,f),g0(u,s,f)))}function p0(i,s,u){var f=xn();vl(i,s,u,f)}function vl(i,s,u,f){var m={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(mu(i))m0(s,m);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var w=s.lastRenderedState,R=y(w,u);if(m.hasEagerState=!0,m.eagerState=R,mn(R,w))return Xa(i,s,m,0),Je===null&&Ya(),!1}catch{}if(u=Zf(i,s,m,f),u!==null)return dn(u,i,f),g0(u,s,f),!0}return!1}function jd(i,s,u,f){if(f={lane:2,revertLane:hh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},mu(i)){if(s)throw Error(r(479))}else s=Zf(i,u,f,2),s!==null&&dn(s,i,2)}function mu(i){var s=i.alternate;return i===Ae||s!==null&&s===Ae}function m0(i,s){is=au=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function g0(i,s,u){if((u&4194048)!==0){var f=s.lanes;f&=i.pendingLanes,u|=f,s.lanes=u,at(i,u)}}var bl={readContext:_t,use:fu,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};bl.useEffectEvent=ot;var y0={readContext:_t,use:fu,useCallback:function(i,s){return en().memoizedState=[i,s===void 0?null:s],i},useContext:_t,useEffect:e0,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,hu(4194308,4,i0.bind(null,s,i),u)},useLayoutEffect:function(i,s){return hu(4194308,4,i,s)},useInsertionEffect:function(i,s){hu(4,2,i,s)},useMemo:function(i,s){var u=en();s=s===void 0?null:s;var f=i();if(io){tr(!0);try{i()}finally{tr(!1)}}return u.memoizedState=[f,s],f},useReducer:function(i,s,u){var f=en();if(u!==void 0){var m=u(s);if(io){tr(!0);try{u(s)}finally{tr(!1)}}}else m=s;return f.memoizedState=f.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},f.queue=i,i=i.dispatch=aA.bind(null,Ae,i),[f.memoizedState,i]},useRef:function(i){var s=en();return i={current:i},s.memoizedState=i},useState:function(i){i=Ad(i);var s=i.queue,u=p0.bind(null,Ae,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Nd,useDeferredValue:function(i,s){var u=en();return Dd(u,i,s)},useTransition:function(){var i=Ad(!1);return i=u0.bind(null,Ae,i.queue,!0,!1),en().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var f=Ae,m=en();if(Fe){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),Je===null)throw Error(r(349));(Be&127)!==0||By(f,s,u)}m.memoizedState=u;var y={value:u,getSnapshot:s};return m.queue=y,e0(Fy.bind(null,f,y,i),[i]),f.flags|=2048,ls(9,{destroy:void 0},Vy.bind(null,f,y,u,s),null),u},useId:function(){var i=en(),s=Je.identifierPrefix;if(Fe){var u=rr,f=nr;u=(f&~(1<<32-Wt(f)-1)).toString(32)+u,s="_"+s+"R_"+u,u=uu++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=tA++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:zd,useFormState:Xy,useActionState:Xy,useOptimistic:function(i){var s=en();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=jd.bind(null,Ae,!0,u),u.dispatch=s,[i,s]},useMemoCache:Ed,useCacheRefresh:function(){return en().memoizedState=lA.bind(null,Ae)},useEffectEvent:function(i){var s=en(),u={impl:i};return s.memoizedState=u,function(){if((He&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Ld={readContext:_t,use:fu,useCallback:s0,useContext:_t,useEffect:kd,useImperativeHandle:o0,useInsertionEffect:n0,useLayoutEffect:r0,useMemo:l0,useReducer:du,useRef:Wy,useState:function(){return du(Er)},useDebugValue:Nd,useDeferredValue:function(i,s){var u=ct();return a0(u,Ke.memoizedState,i,s)},useTransition:function(){var i=du(Er)[0],s=ct().memoizedState;return[typeof i=="boolean"?i:yl(i),s]},useSyncExternalStore:Iy,useId:d0,useHostTransitionStatus:zd,useFormState:Jy,useActionState:Jy,useOptimistic:function(i,s){var u=ct();return Hy(u,Ke,i,s)},useMemoCache:Ed,useCacheRefresh:h0};Ld.useEffectEvent=t0;var v0={readContext:_t,use:fu,useCallback:s0,useContext:_t,useEffect:kd,useImperativeHandle:o0,useInsertionEffect:n0,useLayoutEffect:r0,useMemo:l0,useReducer:Td,useRef:Wy,useState:function(){return Td(Er)},useDebugValue:Nd,useDeferredValue:function(i,s){var u=ct();return Ke===null?Dd(u,i,s):a0(u,Ke.memoizedState,i,s)},useTransition:function(){var i=Td(Er)[0],s=ct().memoizedState;return[typeof i=="boolean"?i:yl(i),s]},useSyncExternalStore:Iy,useId:d0,useHostTransitionStatus:zd,useFormState:Zy,useActionState:Zy,useOptimistic:function(i,s){var u=ct();return Ke!==null?Hy(u,Ke,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Ed,useCacheRefresh:h0};v0.useEffectEvent=t0;function Id(i,s,u,f){s=i.memoizedState,u=u(f,s),u=u==null?s:g({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Bd={enqueueSetState:function(i,s,u){i=i._reactInternals;var f=xn(),m=ei(f);m.payload=s,u!=null&&(m.callback=u),s=ti(i,m,f),s!==null&&(dn(s,i,f),hl(s,i,f))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var f=xn(),m=ei(f);m.tag=1,m.payload=s,u!=null&&(m.callback=u),s=ti(i,m,f),s!==null&&(dn(s,i,f),hl(s,i,f))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=xn(),f=ei(u);f.tag=2,s!=null&&(f.callback=s),s=ti(i,f,u),s!==null&&(dn(s,i,u),hl(s,i,u))}};function b0(i,s,u,f,m,y,w){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,y,w):s.prototype&&s.prototype.isPureReactComponent?!ol(u,f)||!ol(m,y):!0}function S0(i,s,u,f){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,f),s.state!==i&&Bd.enqueueReplaceState(s,s.state,null)}function oo(i,s){var u=s;if("ref"in s){u={};for(var f in s)f!=="ref"&&(u[f]=s[f])}if(i=i.defaultProps){u===s&&(u=g({},u));for(var m in i)u[m]===void 0&&(u[m]=i[m])}return u}function x0(i){Ka(i)}function w0(i){console.error(i)}function C0(i){Ka(i)}function gu(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(f){setTimeout(function(){throw f})}}function M0(i,s,u){try{var f=i.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Vd(i,s,u){return u=ei(u),u.tag=3,u.payload={element:null},u.callback=function(){gu(i,s)},u}function E0(i){return i=ei(i),i.tag=3,i}function R0(i,s,u,f){var m=u.type.getDerivedStateFromError;if(typeof m=="function"){var y=f.value;i.payload=function(){return m(y)},i.callback=function(){M0(s,u,f)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){M0(s,u,f),typeof m!="function"&&(li===null?li=new Set([this]):li.add(this));var R=f.stack;this.componentDidCatch(f.value,{componentStack:R!==null?R:""})})}function uA(i,s,u,f,m){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(s=u.alternate,s!==null&&Zo(s,u,m,!0),u=yn.current,u!==null){switch(u.tag){case 31:case 13:return jn===null?Au():u.alternate===null&&st===0&&(st=3),u.flags&=-257,u.flags|=65536,u.lanes=m,f===ru?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([f]):s.add(f),ch(i,f,m)),!1;case 22:return u.flags|=65536,f===ru?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([f]):u.add(f)),ch(i,f,m)),!1}throw Error(r(435,u.tag))}return ch(i,f,m),Au(),!1}if(Fe)return s=yn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=m,f!==id&&(i=Error(r(422),{cause:f}),al(Nn(i,u)))):(f!==id&&(s=Error(r(423),{cause:f}),al(Nn(s,u))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,f=Nn(f,u),m=Vd(i.stateNode,f,m),md(i,m),st!==4&&(st=2)),!1;var y=Error(r(520),{cause:f});if(y=Nn(y,u),Tl===null?Tl=[y]:Tl.push(y),st!==4&&(st=2),s===null)return!0;f=Nn(f,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=m&-m,u.lanes|=i,i=Vd(u.stateNode,f,i),md(u,i),!1;case 1:if(s=u.type,y=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(li===null||!li.has(y))))return u.flags|=65536,m&=-m,u.lanes|=m,m=E0(m),R0(m,i,u,f),md(u,m),!1}u=u.return}while(u!==null);return!1}var Fd=Error(r(461)),mt=!1;function zt(i,s,u,f){s.child=i===null?ky(s,null,u,f):ro(s,i.child,u,f)}function T0(i,s,u,f,m){u=u.render;var y=s.ref;if("ref"in f){var w={};for(var R in f)R!=="ref"&&(w[R]=f[R])}else w=f;return Wi(s),f=xd(i,s,u,w,y,m),R=wd(),i!==null&&!mt?(Cd(i,s,m),Rr(i,s,m)):(Fe&&R&&nd(s),s.flags|=1,zt(i,s,f,m),s.child)}function A0(i,s,u,f,m){if(i===null){var y=u.type;return typeof y=="function"&&!Wf(y)&&y.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=y,O0(i,s,y,f,m)):(i=Qa(u.type,null,f,s,s.mode,m),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!Yd(i,m)){var w=y.memoizedProps;if(u=u.compare,u=u!==null?u:ol,u(w,f)&&i.ref===s.ref)return Rr(i,s,m)}return s.flags|=1,i=Sr(y,f),i.ref=s.ref,i.return=s,s.child=i}function O0(i,s,u,f,m){if(i!==null){var y=i.memoizedProps;if(ol(y,f)&&i.ref===s.ref)if(mt=!1,s.pendingProps=f=y,Yd(i,m))(i.flags&131072)!==0&&(mt=!0);else return s.lanes=i.lanes,Rr(i,s,m)}return Pd(i,s,u,f,m)}function k0(i,s,u,f){var m=f.children,y=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|u:u,i!==null){for(f=s.child=i.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;f=m&~y}else f=0,s.child=null;return N0(i,s,y,u,f)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&tu(s,y!==null?y.cachePool:null),y!==null?_y(s,y):yd(),zy(s);else return f=s.lanes=536870912,N0(i,s,y!==null?y.baseLanes|u:u,u,f)}else y!==null?(tu(s,y.cachePool),_y(s,y),ri(),s.memoizedState=null):(i!==null&&tu(s,null),yd(),ri());return zt(i,s,m,u),s.child}function Sl(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function N0(i,s,u,f,m){var y=fd();return y=y===null?null:{parent:ht._currentValue,pool:y},s.memoizedState={baseLanes:u,cachePool:y},i!==null&&tu(s,null),yd(),zy(s),i!==null&&Zo(i,s,f,!0),s.childLanes=m,null}function yu(i,s){return s=bu({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function D0(i,s,u){return ro(s,i.child,null,u),i=yu(s,s.pendingProps),i.flags|=2,vn(s),s.memoizedState=null,i}function cA(i,s,u){var f=s.pendingProps,m=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Fe){if(f.mode==="hidden")return i=yu(s,f),s.lanes=536870912,Sl(null,i);if(bd(s),(i=We)?(i=Uv(i,zn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xr!==null?{id:nr,overflow:rr}:null,retryLane:536870912,hydrationErrors:null},u=my(i),u.return=s,s.child=u,Dt=s,We=null)):i=null,i===null)throw Qr(s);return s.lanes=536870912,null}return yu(s,f)}var y=i.memoizedState;if(y!==null){var w=y.dehydrated;if(bd(s),m)if(s.flags&256)s.flags&=-257,s=D0(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(mt||Zo(i,s,u,!1),m=(u&i.childLanes)!==0,mt||m){if(f=Je,f!==null&&(w=dt(f,u),w!==0&&w!==y.retryLane))throw y.retryLane=w,Xi(i,w),dn(f,i,w),Fd;Au(),s=D0(i,s,u)}else i=y.treeContext,We=Ln(w.nextSibling),Dt=s,Fe=!0,Jr=null,zn=!1,i!==null&&vy(s,i),s=yu(s,f),s.flags|=4096;return s}return i=Sr(i.child,{mode:f.mode,children:f.children}),i.ref=s.ref,s.child=i,i.return=s,i}function vu(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function Pd(i,s,u,f,m){return Wi(s),u=xd(i,s,u,f,void 0,m),f=wd(),i!==null&&!mt?(Cd(i,s,m),Rr(i,s,m)):(Fe&&f&&nd(s),s.flags|=1,zt(i,s,u,m),s.child)}function _0(i,s,u,f,m,y){return Wi(s),s.updateQueue=null,u=Ly(s,f,u,m),jy(i),f=wd(),i!==null&&!mt?(Cd(i,s,y),Rr(i,s,y)):(Fe&&f&&nd(s),s.flags|=1,zt(i,s,u,y),s.child)}function z0(i,s,u,f,m){if(Wi(s),s.stateNode===null){var y=Yo,w=u.contextType;typeof w=="object"&&w!==null&&(y=_t(w)),y=new u(f,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Bd,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=f,y.state=s.memoizedState,y.refs={},hd(s),w=u.contextType,y.context=typeof w=="object"&&w!==null?_t(w):Yo,y.state=s.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(Id(s,u,w,f),y.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(w=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),w!==y.state&&Bd.enqueueReplaceState(y,y.state,null),ml(s,f,y,m),pl(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),f=!0}else if(i===null){y=s.stateNode;var R=s.memoizedProps,O=oo(u,R);y.props=O;var P=y.context,X=u.contextType;w=Yo,typeof X=="object"&&X!==null&&(w=_t(X));var Q=u.getDerivedStateFromProps;X=typeof Q=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=s.pendingProps!==R,X||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||P!==w)&&S0(s,y,f,w),Wr=!1;var H=s.memoizedState;y.state=H,ml(s,f,y,m),pl(),P=s.memoizedState,R||H!==P||Wr?(typeof Q=="function"&&(Id(s,u,Q,f),P=s.memoizedState),(O=Wr||b0(s,u,O,f,H,P,w))?(X||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=f,s.memoizedState=P),y.props=f,y.state=P,y.context=w,f=O):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{y=s.stateNode,pd(i,s),w=s.memoizedProps,X=oo(u,w),y.props=X,Q=s.pendingProps,H=y.context,P=u.contextType,O=Yo,typeof P=="object"&&P!==null&&(O=_t(P)),R=u.getDerivedStateFromProps,(P=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==Q||H!==O)&&S0(s,y,f,O),Wr=!1,H=s.memoizedState,y.state=H,ml(s,f,y,m),pl();var G=s.memoizedState;w!==Q||H!==G||Wr||i!==null&&i.dependencies!==null&&Wa(i.dependencies)?(typeof R=="function"&&(Id(s,u,R,f),G=s.memoizedState),(X=Wr||b0(s,u,X,f,H,G,O)||i!==null&&i.dependencies!==null&&Wa(i.dependencies))?(P||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,G,O),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,G,O)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=G),y.props=f,y.state=G,y.context=O,f=X):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=1024),f=!1)}return y=f,vu(i,s),f=(s.flags&128)!==0,y||f?(y=s.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,i!==null&&f?(s.child=ro(s,i.child,null,m),s.child=ro(s,null,u,m)):zt(i,s,u,m),s.memoizedState=y.state,i=s.child):i=Rr(i,s,m),i}function j0(i,s,u,f){return Qi(),s.flags|=256,zt(i,s,u,f),s.child}var $d={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hd(i){return{baseLanes:i,cachePool:My()}}function Ud(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Sn),i}function L0(i,s,u){var f=s.pendingProps,m=!1,y=(s.flags&128)!==0,w;if((w=y)||(w=i!==null&&i.memoizedState===null?!1:(ut.current&2)!==0),w&&(m=!0,s.flags&=-129),w=(s.flags&32)!==0,s.flags&=-33,i===null){if(Fe){if(m?ni(s):ri(),(i=We)?(i=Uv(i,zn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xr!==null?{id:nr,overflow:rr}:null,retryLane:536870912,hydrationErrors:null},u=my(i),u.return=s,s.child=u,Dt=s,We=null)):i=null,i===null)throw Qr(s);return Rh(i)?s.lanes=32:s.lanes=536870912,null}var R=f.children;return f=f.fallback,m?(ri(),m=s.mode,R=bu({mode:"hidden",children:R},m),f=Ji(f,m,u,null),R.return=s,f.return=s,R.sibling=f,s.child=R,f=s.child,f.memoizedState=Hd(u),f.childLanes=Ud(i,w,u),s.memoizedState=$d,Sl(null,f)):(ni(s),qd(s,R))}var O=i.memoizedState;if(O!==null&&(R=O.dehydrated,R!==null)){if(y)s.flags&256?(ni(s),s.flags&=-257,s=Gd(i,s,u)):s.memoizedState!==null?(ri(),s.child=i.child,s.flags|=128,s=null):(ri(),R=f.fallback,m=s.mode,f=bu({mode:"visible",children:f.children},m),R=Ji(R,m,u,null),R.flags|=2,f.return=s,R.return=s,f.sibling=R,s.child=f,ro(s,i.child,null,u),f=s.child,f.memoizedState=Hd(u),f.childLanes=Ud(i,w,u),s.memoizedState=$d,s=Sl(null,f));else if(ni(s),Rh(R)){if(w=R.nextSibling&&R.nextSibling.dataset,w)var P=w.dgst;w=P,f=Error(r(419)),f.stack="",f.digest=w,al({value:f,source:null,stack:null}),s=Gd(i,s,u)}else if(mt||Zo(i,s,u,!1),w=(u&i.childLanes)!==0,mt||w){if(w=Je,w!==null&&(f=dt(w,u),f!==0&&f!==O.retryLane))throw O.retryLane=f,Xi(i,f),dn(w,i,f),Fd;Eh(R)||Au(),s=Gd(i,s,u)}else Eh(R)?(s.flags|=192,s.child=i.child,s=null):(i=O.treeContext,We=Ln(R.nextSibling),Dt=s,Fe=!0,Jr=null,zn=!1,i!==null&&vy(s,i),s=qd(s,f.children),s.flags|=4096);return s}return m?(ri(),R=f.fallback,m=s.mode,O=i.child,P=O.sibling,f=Sr(O,{mode:"hidden",children:f.children}),f.subtreeFlags=O.subtreeFlags&65011712,P!==null?R=Sr(P,R):(R=Ji(R,m,u,null),R.flags|=2),R.return=s,f.return=s,f.sibling=R,s.child=f,Sl(null,f),f=s.child,R=i.child.memoizedState,R===null?R=Hd(u):(m=R.cachePool,m!==null?(O=ht._currentValue,m=m.parent!==O?{parent:O,pool:O}:m):m=My(),R={baseLanes:R.baseLanes|u,cachePool:m}),f.memoizedState=R,f.childLanes=Ud(i,w,u),s.memoizedState=$d,Sl(i.child,f)):(ni(s),u=i.child,i=u.sibling,u=Sr(u,{mode:"visible",children:f.children}),u.return=s,u.sibling=null,i!==null&&(w=s.deletions,w===null?(s.deletions=[i],s.flags|=16):w.push(i)),s.child=u,s.memoizedState=null,u)}function qd(i,s){return s=bu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function bu(i,s){return i=gn(22,i,null,s),i.lanes=0,i}function Gd(i,s,u){return ro(s,i.child,null,u),i=qd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function I0(i,s,u){i.lanes|=s;var f=i.alternate;f!==null&&(f.lanes|=s),ld(i.return,s,u)}function Kd(i,s,u,f,m,y){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:m,treeForkCount:y}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=u,w.tailMode=m,w.treeForkCount=y)}function B0(i,s,u){var f=s.pendingProps,m=f.revealOrder,y=f.tail;f=f.children;var w=ut.current,R=(w&2)!==0;if(R?(w=w&1|2,s.flags|=128):w&=1,ee(ut,w),zt(i,s,f,u),f=Fe?ll:0,!R&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&I0(i,u,s);else if(i.tag===19)I0(i,u,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(m){case"forwards":for(u=s.child,m=null;u!==null;)i=u.alternate,i!==null&&lu(i)===null&&(m=u),u=u.sibling;u=m,u===null?(m=s.child,s.child=null):(m=u.sibling,u.sibling=null),Kd(s,!1,m,u,y,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,m=s.child,s.child=null;m!==null;){if(i=m.alternate,i!==null&&lu(i)===null){s.child=m;break}i=m.sibling,m.sibling=u,u=m,m=i}Kd(s,!0,u,null,y,f);break;case"together":Kd(s,!1,null,null,void 0,f);break;default:s.memoizedState=null}return s.child}function Rr(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),si|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Zo(i,s,u,!1),(u&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,u=Sr(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=Sr(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function Yd(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Wa(i)))}function fA(i,s,u){switch(s.tag){case 3:Ze(s,s.stateNode.containerInfo),Zr(s,ht,i.memoizedState.cache),Qi();break;case 27:case 5:on(s);break;case 4:Ze(s,s.stateNode.containerInfo);break;case 10:Zr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,bd(s),null;break;case 13:var f=s.memoizedState;if(f!==null)return f.dehydrated!==null?(ni(s),s.flags|=128,null):(u&s.child.childLanes)!==0?L0(i,s,u):(ni(s),i=Rr(i,s,u),i!==null?i.sibling:null);ni(s);break;case 19:var m=(i.flags&128)!==0;if(f=(u&s.childLanes)!==0,f||(Zo(i,s,u,!1),f=(u&s.childLanes)!==0),m){if(f)return B0(i,s,u);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ee(ut,ut.current),f)break;return null;case 22:return s.lanes=0,k0(i,s,u,s.pendingProps);case 24:Zr(s,ht,i.memoizedState.cache)}return Rr(i,s,u)}function V0(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)mt=!0;else{if(!Yd(i,u)&&(s.flags&128)===0)return mt=!1,fA(i,s,u);mt=(i.flags&131072)!==0}else mt=!1,Fe&&(s.flags&1048576)!==0&&yy(s,ll,s.index);switch(s.lanes=0,s.tag){case 16:e:{var f=s.pendingProps;if(i=to(s.elementType),s.type=i,typeof i=="function")Wf(i)?(f=oo(i,f),s.tag=1,s=z0(null,s,i,f,u)):(s.tag=0,s=Pd(null,s,i,f,u));else{if(i!=null){var m=i.$$typeof;if(m===N){s.tag=11,s=T0(null,s,i,f,u);break e}else if(m===_){s.tag=14,s=A0(null,s,i,f,u);break e}}throw s=ne(i)||i,Error(r(306,s,""))}}return s;case 0:return Pd(i,s,s.type,s.pendingProps,u);case 1:return f=s.type,m=oo(f,s.pendingProps),z0(i,s,f,m,u);case 3:e:{if(Ze(s,s.stateNode.containerInfo),i===null)throw Error(r(387));f=s.pendingProps;var y=s.memoizedState;m=y.element,pd(i,s),ml(s,f,null,u);var w=s.memoizedState;if(f=w.cache,Zr(s,ht,f),f!==y.cache&&ad(s,[ht],u,!0),pl(),f=w.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:w.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=j0(i,s,f,u);break e}else if(f!==m){m=Nn(Error(r(424)),s),al(m),s=j0(i,s,f,u);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,We=Ln(i.firstChild),Dt=s,Fe=!0,Jr=null,zn=!0,u=ky(s,null,f,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Qi(),f===m){s=Rr(i,s,u);break e}zt(i,s,f,u)}s=s.child}return s;case 26:return vu(i,s),i===null?(u=Jv(s.type,null,s.pendingProps,null))?s.memoizedState=u:Fe||(u=s.type,i=s.pendingProps,f=ju(ae.current).createElement(u),f[Nt]=s,f[sn]=i,jt(f,u,i),Et(f),s.stateNode=f):s.memoizedState=Jv(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return on(s),i===null&&Fe&&(f=s.stateNode=Kv(s.type,s.pendingProps,ae.current),Dt=s,zn=!0,m=We,fi(s.type)?(Th=m,We=Ln(f.firstChild)):We=m),zt(i,s,s.pendingProps.children,u),vu(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Fe&&((m=f=We)&&(f=PA(f,s.type,s.pendingProps,zn),f!==null?(s.stateNode=f,Dt=s,We=Ln(f.firstChild),zn=!1,m=!0):m=!1),m||Qr(s)),on(s),m=s.type,y=s.pendingProps,w=i!==null?i.memoizedProps:null,f=y.children,wh(m,y)?f=null:w!==null&&wh(m,w)&&(s.flags|=32),s.memoizedState!==null&&(m=xd(i,s,nA,null,null,u),jl._currentValue=m),vu(i,s),zt(i,s,f,u),s.child;case 6:return i===null&&Fe&&((i=u=We)&&(u=$A(u,s.pendingProps,zn),u!==null?(s.stateNode=u,Dt=s,We=null,i=!0):i=!1),i||Qr(s)),null;case 13:return L0(i,s,u);case 4:return Ze(s,s.stateNode.containerInfo),f=s.pendingProps,i===null?s.child=ro(s,null,f,u):zt(i,s,f,u),s.child;case 11:return T0(i,s,s.type,s.pendingProps,u);case 7:return zt(i,s,s.pendingProps,u),s.child;case 8:return zt(i,s,s.pendingProps.children,u),s.child;case 12:return zt(i,s,s.pendingProps.children,u),s.child;case 10:return f=s.pendingProps,Zr(s,s.type,f.value),zt(i,s,f.children,u),s.child;case 9:return m=s.type._context,f=s.pendingProps.children,Wi(s),m=_t(m),f=f(m),s.flags|=1,zt(i,s,f,u),s.child;case 14:return A0(i,s,s.type,s.pendingProps,u);case 15:return O0(i,s,s.type,s.pendingProps,u);case 19:return B0(i,s,u);case 31:return cA(i,s,u);case 22:return k0(i,s,u,s.pendingProps);case 24:return Wi(s),f=_t(ht),i===null?(m=fd(),m===null&&(m=Je,y=ud(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=u),m=y),s.memoizedState={parent:f,cache:m},hd(s),Zr(s,ht,m)):((i.lanes&u)!==0&&(pd(i,s),ml(s,null,null,u),pl()),m=i.memoizedState,y=s.memoizedState,m.parent!==f?(m={parent:f,cache:f},s.memoizedState=m,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=m),Zr(s,ht,f)):(f=y.cache,Zr(s,ht,f),f!==m.cache&&ad(s,[ht],u,!0))),zt(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Tr(i){i.flags|=4}function Xd(i,s,u,f,m){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(dv())i.flags|=8192;else throw no=ru,dd}else i.flags&=-16777217}function F0(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!tb(s))if(dv())i.flags|=8192;else throw no=ru,dd}function Su(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?ie():536870912,i.lanes|=s,fs|=s)}function xl(i,s){if(!Fe)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function et(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,f=0;if(s)for(var m=i.child;m!==null;)u|=m.lanes|m.childLanes,f|=m.subtreeFlags&65011712,f|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)u|=m.lanes|m.childLanes,f|=m.subtreeFlags,f|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=f,i.childLanes=u,s}function dA(i,s,u){var f=s.pendingProps;switch(rd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(s),null;case 1:return et(s),null;case 3:return u=s.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),s.memoizedState.cache!==f&&(s.flags|=2048),Cr(ht),Ee(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Qo(s)?Tr(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,od())),et(s),null;case 26:var m=s.type,y=s.memoizedState;return i===null?(Tr(s),y!==null?(et(s),F0(s,y)):(et(s),Xd(s,m,null,f,u))):y?y!==i.memoizedState?(Tr(s),et(s),F0(s,y)):(et(s),s.flags&=-16777217):(i=i.memoizedProps,i!==f&&Tr(s),et(s),Xd(s,m,i,f,u)),null;case 27:if(ft(s),u=ae.current,m=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==f&&Tr(s);else{if(!f){if(s.stateNode===null)throw Error(r(166));return et(s),null}i=te.current,Qo(s)?by(s):(i=Kv(m,f,u),s.stateNode=i,Tr(s))}return et(s),null;case 5:if(ft(s),m=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==f&&Tr(s);else{if(!f){if(s.stateNode===null)throw Error(r(166));return et(s),null}if(y=te.current,Qo(s))by(s);else{var w=ju(ae.current);switch(y){case 1:y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=w.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?w.createElement("select",{is:f.is}):w.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?w.createElement(m,{is:f.is}):w.createElement(m)}}y[Nt]=s,y[sn]=f;e:for(w=s.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===s)break e;for(;w.sibling===null;){if(w.return===null||w.return===s)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}s.stateNode=y;e:switch(jt(y,m,f),m){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Tr(s)}}return et(s),Xd(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==f&&Tr(s);else{if(typeof f!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,Qo(s)){if(i=s.stateNode,u=s.memoizedProps,f=null,m=Dt,m!==null)switch(m.tag){case 27:case 5:f=m.memoizedProps}i[Nt]=s,i=!!(i.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||Lv(i.nodeValue,u)),i||Qr(s,!0)}else i=ju(i).createTextNode(f),i[Nt]=s,s.stateNode=i}return et(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(f=Qo(s),u!==null){if(i===null){if(!f)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Nt]=s}else Qi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;et(s),i=!1}else u=od(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(vn(s),s):(vn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return et(s),null;case 13:if(f=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Qo(s),f!==null&&f.dehydrated!==null){if(i===null){if(!m)throw Error(r(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[Nt]=s}else Qi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;et(s),m=!1}else m=od(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return s.flags&256?(vn(s),s):(vn(s),null)}return vn(s),(s.flags&128)!==0?(s.lanes=u,s):(u=f!==null,i=i!==null&&i.memoizedState!==null,u&&(f=s.child,m=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(m=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==m&&(f.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Su(s,s.updateQueue),et(s),null);case 4:return Ee(),i===null&&yh(s.stateNode.containerInfo),et(s),null;case 10:return Cr(s.type),et(s),null;case 19:if(Y(ut),f=s.memoizedState,f===null)return et(s),null;if(m=(s.flags&128)!==0,y=f.rendering,y===null)if(m)xl(f,!1);else{if(st!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(y=lu(i),y!==null){for(s.flags|=128,xl(f,!1),i=y.updateQueue,s.updateQueue=i,Su(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)py(u,i),u=u.sibling;return ee(ut,ut.current&1|2),Fe&&xr(s,f.treeForkCount),s.child}i=i.sibling}f.tail!==null&&$t()>Eu&&(s.flags|=128,m=!0,xl(f,!1),s.lanes=4194304)}else{if(!m)if(i=lu(y),i!==null){if(s.flags|=128,m=!0,i=i.updateQueue,s.updateQueue=i,Su(s,i),xl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Fe)return et(s),null}else 2*$t()-f.renderingStartTime>Eu&&u!==536870912&&(s.flags|=128,m=!0,xl(f,!1),s.lanes=4194304);f.isBackwards?(y.sibling=s.child,s.child=y):(i=f.last,i!==null?i.sibling=y:s.child=y,f.last=y)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=$t(),i.sibling=null,u=ut.current,ee(ut,m?u&1|2:u&1),Fe&&xr(s,f.treeForkCount),i):(et(s),null);case 22:case 23:return vn(s),vd(),f=s.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(s.flags|=8192):f&&(s.flags|=8192),f?(u&536870912)!==0&&(s.flags&128)===0&&(et(s),s.subtreeFlags&6&&(s.flags|=8192)):et(s),u=s.updateQueue,u!==null&&Su(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048),i!==null&&Y(eo),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Cr(ht),et(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function hA(i,s){switch(rd(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Cr(ht),Ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ft(s),null;case 31:if(s.memoizedState!==null){if(vn(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(vn(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 Y(ut),null;case 4:return Ee(),null;case 10:return Cr(s.type),null;case 22:case 23:return vn(s),vd(),i!==null&&Y(eo),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Cr(ht),null;case 25:return null;default:return null}}function P0(i,s){switch(rd(s),s.tag){case 3:Cr(ht),Ee();break;case 26:case 27:case 5:ft(s);break;case 4:Ee();break;case 31:s.memoizedState!==null&&vn(s);break;case 13:vn(s);break;case 19:Y(ut);break;case 10:Cr(s.type);break;case 22:case 23:vn(s),vd(),i!==null&&Y(eo);break;case 24:Cr(ht)}}function wl(i,s){try{var u=s.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var m=f.next;u=m;do{if((u.tag&i)===i){f=void 0;var y=u.create,w=u.inst;f=y(),w.destroy=f}u=u.next}while(u!==m)}}catch(R){Ge(s,s.return,R)}}function ii(i,s,u){try{var f=s.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var y=m.next;f=y;do{if((f.tag&i)===i){var w=f.inst,R=w.destroy;if(R!==void 0){w.destroy=void 0,m=s;var O=u,P=R;try{P()}catch(X){Ge(m,O,X)}}}f=f.next}while(f!==y)}}catch(X){Ge(s,s.return,X)}}function $0(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{Dy(s,u)}catch(f){Ge(i,i.return,f)}}}function H0(i,s,u){u.props=oo(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(f){Ge(i,s,f)}}function Cl(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof u=="function"?i.refCleanup=u(f):u.current=f}}catch(m){Ge(i,s,m)}}function ir(i,s){var u=i.ref,f=i.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(m){Ge(i,s,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(m){Ge(i,s,m)}else u.current=null}function U0(i){var s=i.type,u=i.memoizedProps,f=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(m){Ge(i,i.return,m)}}function Jd(i,s,u){try{var f=i.stateNode;jA(f,i.type,u,s),f[sn]=s}catch(m){Ge(i,i.return,m)}}function q0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&fi(i.type)||i.tag===4}function Qd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||q0(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&&fi(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 Zd(i,s,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=vr));else if(f!==4&&(f===27&&fi(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(Zd(i,s,u),i=i.sibling;i!==null;)Zd(i,s,u),i=i.sibling}function xu(i,s,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(f!==4&&(f===27&&fi(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(xu(i,s,u),i=i.sibling;i!==null;)xu(i,s,u),i=i.sibling}function G0(i){var s=i.stateNode,u=i.memoizedProps;try{for(var f=i.type,m=s.attributes;m.length;)s.removeAttributeNode(m[0]);jt(s,f,u),s[Nt]=i,s[sn]=u}catch(y){Ge(i,i.return,y)}}var Ar=!1,gt=!1,Wd=!1,K0=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function pA(i,s){if(i=i.containerInfo,Sh=$u,i=oy(i),Gf(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var m=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var w=0,R=-1,O=-1,P=0,X=0,Q=i,H=null;t:for(;;){for(var G;Q!==u||m!==0&&Q.nodeType!==3||(R=w+m),Q!==y||f!==0&&Q.nodeType!==3||(O=w+f),Q.nodeType===3&&(w+=Q.nodeValue.length),(G=Q.firstChild)!==null;)H=Q,Q=G;for(;;){if(Q===i)break t;if(H===u&&++P===m&&(R=w),H===y&&++X===f&&(O=w),(G=Q.nextSibling)!==null)break;Q=H,H=Q.parentNode}Q=G}u=R===-1||O===-1?null:{start:R,end:O}}else u=null}u=u||{start:0,end:0}}else u=null;for(xh={focusedElem:i,selectionRange:u},$u=!1,Rt=s;Rt!==null;)if(s=Rt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Rt=i;else for(;Rt!==null;){switch(s=Rt,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(u=0;u<i.length;u++)m=i[u],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,u=s,m=y.memoizedProps,y=y.memoizedState,f=u.stateNode;try{var ce=oo(u.type,m);i=f.getSnapshotBeforeUpdate(ce,y),f.__reactInternalSnapshotBeforeUpdate=i}catch(xe){Ge(u,u.return,xe)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Mh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Mh(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,Rt=i;break}Rt=s.return}}function Y0(i,s,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:kr(i,u),f&4&&wl(5,u);break;case 1:if(kr(i,u),f&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(w){Ge(u,u.return,w)}else{var m=oo(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(m,s,i.__reactInternalSnapshotBeforeUpdate)}catch(w){Ge(u,u.return,w)}}f&64&&$0(u),f&512&&Cl(u,u.return);break;case 3:if(kr(i,u),f&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{Dy(i,s)}catch(w){Ge(u,u.return,w)}}break;case 27:s===null&&f&4&&G0(u);case 26:case 5:kr(i,u),s===null&&f&4&&U0(u),f&512&&Cl(u,u.return);break;case 12:kr(i,u);break;case 31:kr(i,u),f&4&&Q0(i,u);break;case 13:kr(i,u),f&4&&Z0(i,u),f&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=CA.bind(null,u),HA(i,u))));break;case 22:if(f=u.memoizedState!==null||Ar,!f){s=s!==null&&s.memoizedState!==null||gt,m=Ar;var y=gt;Ar=f,(gt=s)&&!y?Nr(i,u,(u.subtreeFlags&8772)!==0):kr(i,u),Ar=m,gt=y}break;case 30:break;default:kr(i,u)}}function X0(i){var s=i.alternate;s!==null&&(i.alternate=null,X0(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Of(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 nt=null,an=!1;function Or(i,s,u){for(u=u.child;u!==null;)J0(i,s,u),u=u.sibling}function J0(i,s,u){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Ct,u)}catch{}switch(u.tag){case 26:gt||ir(u,s),Or(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:gt||ir(u,s);var f=nt,m=an;fi(u.type)&&(nt=u.stateNode,an=!1),Or(i,s,u),Dl(u.stateNode),nt=f,an=m;break;case 5:gt||ir(u,s);case 6:if(f=nt,m=an,nt=null,Or(i,s,u),nt=f,an=m,nt!==null)if(an)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(u.stateNode)}catch(y){Ge(u,s,y)}else try{nt.removeChild(u.stateNode)}catch(y){Ge(u,s,y)}break;case 18:nt!==null&&(an?(i=nt,$v(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),bs(i)):$v(nt,u.stateNode));break;case 4:f=nt,m=an,nt=u.stateNode.containerInfo,an=!0,Or(i,s,u),nt=f,an=m;break;case 0:case 11:case 14:case 15:ii(2,u,s),gt||ii(4,u,s),Or(i,s,u);break;case 1:gt||(ir(u,s),f=u.stateNode,typeof f.componentWillUnmount=="function"&&H0(u,s,f)),Or(i,s,u);break;case 21:Or(i,s,u);break;case 22:gt=(f=gt)||u.memoizedState!==null,Or(i,s,u),gt=f;break;default:Or(i,s,u)}}function Q0(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{bs(i)}catch(u){Ge(s,s.return,u)}}}function Z0(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{bs(i)}catch(u){Ge(s,s.return,u)}}function mA(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new K0),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new K0),s;default:throw Error(r(435,i.tag))}}function wu(i,s){var u=mA(i);s.forEach(function(f){if(!u.has(f)){u.add(f);var m=MA.bind(null,i,f);f.then(m,m)}})}function un(i,s){var u=s.deletions;if(u!==null)for(var f=0;f<u.length;f++){var m=u[f],y=i,w=s,R=w;e:for(;R!==null;){switch(R.tag){case 27:if(fi(R.type)){nt=R.stateNode,an=!1;break e}break;case 5:nt=R.stateNode,an=!1;break e;case 3:case 4:nt=R.stateNode.containerInfo,an=!0;break e}R=R.return}if(nt===null)throw Error(r(160));J0(y,w,m),nt=null,an=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)W0(s,i),s=s.sibling}var Gn=null;function W0(i,s){var u=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),cn(i),f&4&&(ii(3,i,i.return),wl(3,i),ii(5,i,i.return));break;case 1:un(s,i),cn(i),f&512&&(gt||u===null||ir(u,u.return)),f&64&&Ar&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var m=Gn;if(un(s,i),cn(i),f&512&&(gt||u===null||ir(u,u.return)),f&4){var y=u!==null?u.memoizedState:null;if(f=i.memoizedState,u===null)if(f===null)if(i.stateNode===null){e:{f=i.type,u=i.memoizedProps,m=m.ownerDocument||m;t:switch(f){case"title":y=m.getElementsByTagName("title")[0],(!y||y[Js]||y[Nt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(f),m.head.insertBefore(y,m.querySelector("head > title"))),jt(y,f,u),y[Nt]=i,Et(y),f=y;break e;case"link":var w=Wv("link","href",m).get(f+(u.href||""));if(w){for(var R=0;R<w.length;R++)if(y=w[R],y.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&y.getAttribute("rel")===(u.rel==null?null:u.rel)&&y.getAttribute("title")===(u.title==null?null:u.title)&&y.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){w.splice(R,1);break t}}y=m.createElement(f),jt(y,f,u),m.head.appendChild(y);break;case"meta":if(w=Wv("meta","content",m).get(f+(u.content||""))){for(R=0;R<w.length;R++)if(y=w[R],y.getAttribute("content")===(u.content==null?null:""+u.content)&&y.getAttribute("name")===(u.name==null?null:u.name)&&y.getAttribute("property")===(u.property==null?null:u.property)&&y.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&y.getAttribute("charset")===(u.charSet==null?null:u.charSet)){w.splice(R,1);break t}}y=m.createElement(f),jt(y,f,u),m.head.appendChild(y);break;default:throw Error(r(468,f))}y[Nt]=i,Et(y),f=y}i.stateNode=f}else eb(m,i.type,i.stateNode);else i.stateNode=Zv(m,f,i.memoizedProps);else y!==f?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,f===null?eb(m,i.type,i.stateNode):Zv(m,f,i.memoizedProps)):f===null&&i.stateNode!==null&&Jd(i,i.memoizedProps,u.memoizedProps)}break;case 27:un(s,i),cn(i),f&512&&(gt||u===null||ir(u,u.return)),u!==null&&f&4&&Jd(i,i.memoizedProps,u.memoizedProps);break;case 5:if(un(s,i),cn(i),f&512&&(gt||u===null||ir(u,u.return)),i.flags&32){m=i.stateNode;try{Po(m,"")}catch(ce){Ge(i,i.return,ce)}}f&4&&i.stateNode!=null&&(m=i.memoizedProps,Jd(i,m,u!==null?u.memoizedProps:m)),f&1024&&(Wd=!0);break;case 6:if(un(s,i),cn(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,u=i.stateNode;try{u.nodeValue=f}catch(ce){Ge(i,i.return,ce)}}break;case 3:if(Bu=null,m=Gn,Gn=Lu(s.containerInfo),un(s,i),Gn=m,cn(i),f&4&&u!==null&&u.memoizedState.isDehydrated)try{bs(s.containerInfo)}catch(ce){Ge(i,i.return,ce)}Wd&&(Wd=!1,ev(i));break;case 4:f=Gn,Gn=Lu(i.stateNode.containerInfo),un(s,i),cn(i),Gn=f;break;case 12:un(s,i),cn(i);break;case 31:un(s,i),cn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,wu(i,f)));break;case 13:un(s,i),cn(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Mu=$t()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,wu(i,f)));break;case 22:m=i.memoizedState!==null;var O=u!==null&&u.memoizedState!==null,P=Ar,X=gt;if(Ar=P||m,gt=X||O,un(s,i),gt=X,Ar=P,cn(i),f&8192)e:for(s=i.stateNode,s._visibility=m?s._visibility&-2:s._visibility|1,m&&(u===null||O||Ar||gt||so(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){O=u=s;try{if(y=O.stateNode,m)w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{R=O.stateNode;var Q=O.memoizedProps.style,H=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;R.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(ce){Ge(O,O.return,ce)}}}else if(s.tag===6){if(u===null){O=s;try{O.stateNode.nodeValue=m?"":O.memoizedProps}catch(ce){Ge(O,O.return,ce)}}}else if(s.tag===18){if(u===null){O=s;try{var G=O.stateNode;m?Hv(G,!0):Hv(O.stateNode,!1)}catch(ce){Ge(O,O.return,ce)}}}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;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}f&4&&(f=i.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,wu(i,u))));break;case 19:un(s,i),cn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,wu(i,f)));break;case 30:break;case 21:break;default:un(s,i),cn(i)}}function cn(i){var s=i.flags;if(s&2){try{for(var u,f=i.return;f!==null;){if(q0(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var m=u.stateNode,y=Qd(i);xu(i,y,m);break;case 5:var w=u.stateNode;u.flags&32&&(Po(w,""),u.flags&=-33);var R=Qd(i);xu(i,R,w);break;case 3:case 4:var O=u.stateNode.containerInfo,P=Qd(i);Zd(i,P,O);break;default:throw Error(r(161))}}catch(X){Ge(i,i.return,X)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function ev(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;ev(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function kr(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Y0(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:ii(4,s,s.return),so(s);break;case 1:ir(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&H0(s,s.return,u),so(s);break;case 27:Dl(s.stateNode);case 26:case 5:ir(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 Nr(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var f=s.alternate,m=i,y=s,w=y.flags;switch(y.tag){case 0:case 11:case 15:Nr(m,y,u),wl(4,y);break;case 1:if(Nr(m,y,u),f=y,m=f.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(P){Ge(f,f.return,P)}if(f=y,m=f.updateQueue,m!==null){var R=f.stateNode;try{var O=m.shared.hiddenCallbacks;if(O!==null)for(m.shared.hiddenCallbacks=null,m=0;m<O.length;m++)Ny(O[m],R)}catch(P){Ge(f,f.return,P)}}u&&w&64&&$0(y),Cl(y,y.return);break;case 27:G0(y);case 26:case 5:Nr(m,y,u),u&&f===null&&w&4&&U0(y),Cl(y,y.return);break;case 12:Nr(m,y,u);break;case 31:Nr(m,y,u),u&&w&4&&Q0(m,y);break;case 13:Nr(m,y,u),u&&w&4&&Z0(m,y);break;case 22:y.memoizedState===null&&Nr(m,y,u),Cl(y,y.return);break;case 30:break;default:Nr(m,y,u)}s=s.sibling}}function eh(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&ul(u))}function th(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ul(i))}function Kn(i,s,u,f){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)tv(i,s,u,f),s=s.sibling}function tv(i,s,u,f){var m=s.flags;switch(s.tag){case 0:case 11:case 15:Kn(i,s,u,f),m&2048&&wl(9,s);break;case 1:Kn(i,s,u,f);break;case 3:Kn(i,s,u,f),m&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ul(i)));break;case 12:if(m&2048){Kn(i,s,u,f),i=s.stateNode;try{var y=s.memoizedProps,w=y.id,R=y.onPostCommit;typeof R=="function"&&R(w,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(O){Ge(s,s.return,O)}}else Kn(i,s,u,f);break;case 31:Kn(i,s,u,f);break;case 13:Kn(i,s,u,f);break;case 23:break;case 22:y=s.stateNode,w=s.alternate,s.memoizedState!==null?y._visibility&2?Kn(i,s,u,f):Ml(i,s):y._visibility&2?Kn(i,s,u,f):(y._visibility|=2,as(i,s,u,f,(s.subtreeFlags&10256)!==0||!1)),m&2048&&eh(w,s);break;case 24:Kn(i,s,u,f),m&2048&&th(s.alternate,s);break;default:Kn(i,s,u,f)}}function as(i,s,u,f,m){for(m=m&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=i,w=s,R=u,O=f,P=w.flags;switch(w.tag){case 0:case 11:case 15:as(y,w,R,O,m),wl(8,w);break;case 23:break;case 22:var X=w.stateNode;w.memoizedState!==null?X._visibility&2?as(y,w,R,O,m):Ml(y,w):(X._visibility|=2,as(y,w,R,O,m)),m&&P&2048&&eh(w.alternate,w);break;case 24:as(y,w,R,O,m),m&&P&2048&&th(w.alternate,w);break;default:as(y,w,R,O,m)}s=s.sibling}}function Ml(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,f=s,m=f.flags;switch(f.tag){case 22:Ml(u,f),m&2048&&eh(f.alternate,f);break;case 24:Ml(u,f),m&2048&&th(f.alternate,f);break;default:Ml(u,f)}s=s.sibling}}var El=8192;function us(i,s,u){if(i.subtreeFlags&El)for(i=i.child;i!==null;)nv(i,s,u),i=i.sibling}function nv(i,s,u){switch(i.tag){case 26:us(i,s,u),i.flags&El&&i.memoizedState!==null&&tO(u,Gn,i.memoizedState,i.memoizedProps);break;case 5:us(i,s,u);break;case 3:case 4:var f=Gn;Gn=Lu(i.stateNode.containerInfo),us(i,s,u),Gn=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=El,El=16777216,us(i,s,u),El=f):us(i,s,u));break;default:us(i,s,u)}}function rv(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 u=0;u<s.length;u++){var f=s[u];Rt=f,ov(f,i)}rv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)iv(i),i=i.sibling}function iv(i){switch(i.tag){case 0:case 11:case 15:Rl(i),i.flags&2048&&ii(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,Cu(i)):Rl(i);break;default:Rl(i)}}function Cu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var f=s[u];Rt=f,ov(f,i)}rv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ii(8,s,s.return),Cu(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Cu(s));break;default:Cu(s)}i=i.sibling}}function ov(i,s){for(;Rt!==null;){var u=Rt;switch(u.tag){case 0:case 11:case 15:ii(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:ul(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Rt=f;else e:for(u=i;Rt!==null;){f=Rt;var m=f.sibling,y=f.return;if(X0(f),f===u){Rt=null;break e}if(m!==null){m.return=y,Rt=m;break e}Rt=y}}}var gA={getCacheForType:function(i){var s=_t(ht),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return _t(ht).controller.signal}},yA=typeof WeakMap=="function"?WeakMap:Map,He=0,Je=null,Le=null,Be=0,qe=0,bn=null,oi=!1,cs=!1,nh=!1,Dr=0,st=0,si=0,lo=0,rh=0,Sn=0,fs=0,Tl=null,fn=null,ih=!1,Mu=0,sv=0,Eu=1/0,Ru=null,li=null,xt=0,ai=null,ds=null,_r=0,oh=0,sh=null,lv=null,Al=0,lh=null;function xn(){return(He&2)!==0&&Be!==0?Be&-Be:V.T!==null?hh():La()}function av(){if(Sn===0)if((Be&536870912)===0||Fe){var i=$i;$i<<=1,($i&3932160)===0&&($i=262144),Sn=i}else Sn=536870912;return i=yn.current,i!==null&&(i.flags|=32),Sn}function dn(i,s,u){(i===Je&&(qe===2||qe===9)||i.cancelPendingCommit!==null)&&(hs(i,0),ui(i,Be,Sn,!1)),ke(i,u),((He&2)===0||i!==Je)&&(i===Je&&((He&2)===0&&(lo|=u),st===4&&ui(i,Be,Sn,!1)),or(i))}function uv(i,s,u){if((He&6)!==0)throw Error(r(327));var f=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Hi(i,s),m=f?SA(i,s):uh(i,s,!0),y=f;do{if(m===0){cs&&!f&&ui(i,s,0,!1);break}else{if(u=i.current.alternate,y&&!vA(u)){m=uh(i,s,!1),y=!1;continue}if(m===2){if(y=s,i.errorRecoveryDisabledLanes&y)var w=0;else w=i.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){s=w;e:{var R=i;m=Tl;var O=R.current.memoizedState.isDehydrated;if(O&&(hs(R,w).flags|=256),w=uh(R,w,!1),w!==2){if(nh&&!O){R.errorRecoveryDisabledLanes|=y,lo|=y,m=4;break e}y=fn,fn=m,y!==null&&(fn===null?fn=y:fn.push.apply(fn,y))}m=w}if(y=!1,m!==2)continue}}if(m===1){hs(i,0),ui(i,s,0,!0);break}e:{switch(f=i,y=m,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ui(f,s,Sn,!oi);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(m=Mu+300-$t(),10<m)){if(ui(f,s,Sn,!oi),zo(f,0,!0)!==0)break e;_r=s,f.timeoutHandle=Fv(cv.bind(null,f,u,fn,Ru,ih,s,Sn,lo,fs,oi,y,"Throttled",-0,0),m);break e}cv(f,u,fn,Ru,ih,s,Sn,lo,fs,oi,y,null,-0,0)}}break}while(!0);or(i)}function cv(i,s,u,f,m,y,w,R,O,P,X,Q,H,G){if(i.timeoutHandle=-1,Q=s.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vr},nv(s,y,Q);var ce=(y&62914560)===y?Mu-$t():(y&4194048)===y?sv-$t():0;if(ce=nO(Q,ce),ce!==null){_r=y,i.cancelPendingCommit=ce(vv.bind(null,i,s,y,u,f,m,w,R,O,X,Q,null,H,G)),ui(i,y,w,!P);return}}vv(i,s,y,u,f,m,w,R,O)}function vA(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var m=u[f],y=m.getSnapshot;m=m.value;try{if(!mn(y(),m))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;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 ui(i,s,u,f){s&=~rh,s&=~lo,i.suspendedLanes|=s,i.pingedLanes&=~s,f&&(i.warmLanes|=s),f=i.expirationTimes;for(var m=s;0<m;){var y=31-Wt(m),w=1<<y;f[y]=-1,m&=~w}u!==0&&Re(i,u,s)}function Tu(){return(He&6)===0?(Ol(0),!1):!0}function ah(){if(Le!==null){if(qe===0)var i=Le.return;else i=Le,wr=Zi=null,Md(i),ns=null,fl=0,i=Le;for(;i!==null;)P0(i.alternate,i),i=i.return;Le=null}}function hs(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,BA(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),_r=0,ah(),Je=i,Le=u=Sr(i.current,null),Be=s,qe=0,bn=null,oi=!1,cs=Hi(i,s),nh=!1,fs=Sn=rh=lo=si=st=0,fn=Tl=null,ih=!1,(s&8)!==0&&(s|=s&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=s;0<f;){var m=31-Wt(f),y=1<<m;s|=i[m],f&=~y}return Dr=s,Ya(),u}function fv(i,s){Ae=null,V.H=bl,s===ts||s===nu?(s=Ty(),qe=3):s===dd?(s=Ty(),qe=4):qe=s===Fd?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,bn=s,Le===null&&(st=1,gu(i,Nn(s,i.current)))}function dv(){var i=yn.current;return i===null?!0:(Be&4194048)===Be?jn===null:(Be&62914560)===Be||(Be&536870912)!==0?i===jn:!1}function hv(){var i=V.H;return V.H=bl,i===null?bl:i}function pv(){var i=V.A;return V.A=gA,i}function Au(){st=4,oi||(Be&4194048)!==Be&&yn.current!==null||(cs=!0),(si&134217727)===0&&(lo&134217727)===0||Je===null||ui(Je,Be,Sn,!1)}function uh(i,s,u){var f=He;He|=2;var m=hv(),y=pv();(Je!==i||Be!==s)&&(Ru=null,hs(i,s)),s=!1;var w=st;e:do try{if(qe!==0&&Le!==null){var R=Le,O=bn;switch(qe){case 8:ah(),w=6;break e;case 3:case 2:case 9:case 6:yn.current===null&&(s=!0);var P=qe;if(qe=0,bn=null,ps(i,R,O,P),u&&cs){w=0;break e}break;default:P=qe,qe=0,bn=null,ps(i,R,O,P)}}bA(),w=st;break}catch(X){fv(i,X)}while(!0);return s&&i.shellSuspendCounter++,wr=Zi=null,He=f,V.H=m,V.A=y,Le===null&&(Je=null,Be=0,Ya()),w}function bA(){for(;Le!==null;)mv(Le)}function SA(i,s){var u=He;He|=2;var f=hv(),m=pv();Je!==i||Be!==s?(Ru=null,Eu=$t()+500,hs(i,s)):cs=Hi(i,s);e:do try{if(qe!==0&&Le!==null){s=Le;var y=bn;t:switch(qe){case 1:qe=0,bn=null,ps(i,s,y,1);break;case 2:case 9:if(Ey(y)){qe=0,bn=null,gv(s);break}s=function(){qe!==2&&qe!==9||Je!==i||(qe=7),or(i)},y.then(s,s);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Ey(y)?(qe=0,bn=null,gv(s)):(qe=0,bn=null,ps(i,s,y,7));break;case 5:var w=null;switch(Le.tag){case 26:w=Le.memoizedState;case 5:case 27:var R=Le;if(w?tb(w):R.stateNode.complete){qe=0,bn=null;var O=R.sibling;if(O!==null)Le=O;else{var P=R.return;P!==null?(Le=P,Ou(P)):Le=null}break t}}qe=0,bn=null,ps(i,s,y,5);break;case 6:qe=0,bn=null,ps(i,s,y,6);break;case 8:ah(),st=6;break e;default:throw Error(r(462))}}xA();break}catch(X){fv(i,X)}while(!0);return wr=Zi=null,V.H=f,V.A=m,He=u,Le!==null?0:(Je=null,Be=0,Ya(),st)}function xA(){for(;Le!==null&&!ka();)mv(Le)}function mv(i){var s=V0(i.alternate,i,Dr);i.memoizedProps=i.pendingProps,s===null?Ou(i):Le=s}function gv(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=_0(u,s,s.pendingProps,s.type,void 0,Be);break;case 11:s=_0(u,s,s.pendingProps,s.type.render,s.ref,Be);break;case 5:Md(s);default:P0(u,s),s=Le=py(s,Dr),s=V0(u,s,Dr)}i.memoizedProps=i.pendingProps,s===null?Ou(i):Le=s}function ps(i,s,u,f){wr=Zi=null,Md(s),ns=null,fl=0;var m=s.return;try{if(uA(i,m,s,u,Be)){st=1,gu(i,Nn(u,i.current)),Le=null;return}}catch(y){if(m!==null)throw Le=m,y;st=1,gu(i,Nn(u,i.current)),Le=null;return}s.flags&32768?(Fe||f===1?i=!0:cs||(Be&536870912)!==0?i=!1:(oi=i=!0,(f===2||f===9||f===3||f===6)&&(f=yn.current,f!==null&&f.tag===13&&(f.flags|=16384))),yv(s,i)):Ou(s)}function Ou(i){var s=i;do{if((s.flags&32768)!==0){yv(s,oi);return}i=s.return;var u=dA(s.alternate,s,Dr);if(u!==null){Le=u;return}if(s=s.sibling,s!==null){Le=s;return}Le=s=i}while(s!==null);st===0&&(st=5)}function yv(i,s){do{var u=hA(i.alternate,i);if(u!==null){u.flags&=32767,Le=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Le=i;return}Le=i=u}while(i!==null);st=6,Le=null}function vv(i,s,u,f,m,y,w,R,O){i.cancelPendingCommit=null;do ku();while(xt!==0);if((He&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=Qf,tt(i,u,y,w,R,O),i===Je&&(Le=Je=null,Be=0),ds=s,ai=i,_r=u,oh=y,sh=m,lv=f,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,EA(Tn,function(){return Cv(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||f){f=V.T,V.T=null,m=$.p,$.p=2,w=He,He|=4;try{pA(i,s,u)}finally{He=w,$.p=m,V.T=f}}xt=1,bv(),Sv(),xv()}}function bv(){if(xt===1){xt=0;var i=ai,s=ds,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=V.T,V.T=null;var f=$.p;$.p=2;var m=He;He|=4;try{W0(s,i);var y=xh,w=oy(i.containerInfo),R=y.focusedElem,O=y.selectionRange;if(w!==R&&R&&R.ownerDocument&&iy(R.ownerDocument.documentElement,R)){if(O!==null&&Gf(R)){var P=O.start,X=O.end;if(X===void 0&&(X=P),"selectionStart"in R)R.selectionStart=P,R.selectionEnd=Math.min(X,R.value.length);else{var Q=R.ownerDocument||document,H=Q&&Q.defaultView||window;if(H.getSelection){var G=H.getSelection(),ce=R.textContent.length,xe=Math.min(O.start,ce),Xe=O.end===void 0?xe:Math.min(O.end,ce);!G.extend&&xe>Xe&&(w=Xe,Xe=xe,xe=w);var L=ry(R,xe),z=ry(R,Xe);if(L&&z&&(G.rangeCount!==1||G.anchorNode!==L.node||G.anchorOffset!==L.offset||G.focusNode!==z.node||G.focusOffset!==z.offset)){var F=Q.createRange();F.setStart(L.node,L.offset),G.removeAllRanges(),xe>Xe?(G.addRange(F),G.extend(z.node,z.offset)):(F.setEnd(z.node,z.offset),G.addRange(F))}}}}for(Q=[],G=R;G=G.parentNode;)G.nodeType===1&&Q.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<Q.length;R++){var J=Q[R];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}$u=!!Sh,xh=Sh=null}finally{He=m,$.p=f,V.T=u}}i.current=s,xt=2}}function Sv(){if(xt===2){xt=0;var i=ai,s=ds,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=V.T,V.T=null;var f=$.p;$.p=2;var m=He;He|=4;try{Y0(i,s.alternate,s)}finally{He=m,$.p=f,V.T=u}}xt=3}}function xv(){if(xt===4||xt===3){xt=0,Rf();var i=ai,s=ds,u=_r,f=lv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?xt=5:(xt=0,ds=ai=null,wv(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(li=null),Ui(u),s=s.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(Ct,s,void 0,(s.current.flags&128)===128)}catch{}if(f!==null){s=V.T,m=$.p,$.p=2,V.T=null;try{for(var y=i.onRecoverableError,w=0;w<f.length;w++){var R=f[w];y(R.value,{componentStack:R.stack})}}finally{V.T=s,$.p=m}}(_r&3)!==0&&ku(),or(i),m=i.pendingLanes,(u&261930)!==0&&(m&42)!==0?i===lh?Al++:(Al=0,lh=i):Al=0,Ol(0)}}function wv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,ul(s)))}function ku(){return bv(),Sv(),xv(),Cv()}function Cv(){if(xt!==5)return!1;var i=ai,s=oh;oh=0;var u=Ui(_r),f=V.T,m=$.p;try{$.p=32>u?32:u,V.T=null,u=sh,sh=null;var y=ai,w=_r;if(xt=0,ds=ai=null,_r=0,(He&6)!==0)throw Error(r(331));var R=He;if(He|=4,iv(y.current),tv(y,y.current,w,u),He=R,Ol(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Ct,y)}catch{}return!0}finally{$.p=m,V.T=f,wv(i,s)}}function Mv(i,s,u){s=Nn(u,s),s=Vd(i.stateNode,s,2),i=ti(i,s,2),i!==null&&(ke(i,2),or(i))}function Ge(i,s,u){if(i.tag===3)Mv(i,i,u);else for(;s!==null;){if(s.tag===3){Mv(s,i,u);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(li===null||!li.has(f))){i=Nn(u,i),u=E0(2),f=ti(s,u,2),f!==null&&(R0(u,f,s,i),ke(f,2),or(f));break}}s=s.return}}function ch(i,s,u){var f=i.pingCache;if(f===null){f=i.pingCache=new yA;var m=new Set;f.set(s,m)}else m=f.get(s),m===void 0&&(m=new Set,f.set(s,m));m.has(u)||(nh=!0,m.add(u),i=wA.bind(null,i,s,u),s.then(i,i))}function wA(i,s,u){var f=i.pingCache;f!==null&&f.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Je===i&&(Be&u)===u&&(st===4||st===3&&(Be&62914560)===Be&&300>$t()-Mu?(He&2)===0&&hs(i,0):rh|=u,fs===Be&&(fs=0)),or(i)}function Ev(i,s){s===0&&(s=ie()),i=Xi(i,s),i!==null&&(ke(i,s),or(i))}function CA(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),Ev(i,u)}function MA(i,s){var u=0;switch(i.tag){case 31:case 13:var f=i.stateNode,m=i.memoizedState;m!==null&&(u=m.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(s),Ev(i,u)}function EA(i,s){return No(i,s)}var Nu=null,ms=null,fh=!1,Du=!1,dh=!1,ci=0;function or(i){i!==ms&&i.next===null&&(ms===null?Nu=ms=i:ms=ms.next=i),Du=!0,fh||(fh=!0,TA())}function Ol(i,s){if(!dh&&Du){dh=!0;do for(var u=!1,f=Nu;f!==null;){if(i!==0){var m=f.pendingLanes;if(m===0)var y=0;else{var w=f.suspendedLanes,R=f.pingedLanes;y=(1<<31-Wt(42|i)+1)-1,y&=m&~(w&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,Ov(f,y))}else y=Be,y=zo(f,f===Je?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||Hi(f,y)||(u=!0,Ov(f,y));f=f.next}while(u);dh=!1}}function RA(){Rv()}function Rv(){Du=fh=!1;var i=0;ci!==0&&IA()&&(i=ci);for(var s=$t(),u=null,f=Nu;f!==null;){var m=f.next,y=Tv(f,s);y===0?(f.next=null,u===null?Nu=m:u.next=m,m===null&&(ms=u)):(u=f,(i!==0||(y&3)!==0)&&(Du=!0)),f=m}xt!==0&&xt!==5||Ol(i),ci!==0&&(ci=0)}function Tv(i,s){for(var u=i.suspendedLanes,f=i.pingedLanes,m=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var w=31-Wt(y),R=1<<w,O=m[w];O===-1?((R&u)===0||(R&f)!==0)&&(m[w]=re(R,s)):O<=s&&(i.expiredLanes|=R),y&=~R}if(s=Je,u=Be,u=zo(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,u===0||i===s&&(qe===2||qe===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&Do(f),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Hi(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(f!==null&&Do(f),Ui(u)){case 2:case 8:u=Da;break;case 32:u=Tn;break;case 268435456:u=_o;break;default:u=Tn}return f=Av.bind(null,i),u=No(u,f),i.callbackPriority=s,i.callbackNode=u,s}return f!==null&&f!==null&&Do(f),i.callbackPriority=2,i.callbackNode=null,2}function Av(i,s){if(xt!==0&&xt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(ku()&&i.callbackNode!==u)return null;var f=Be;return f=zo(i,i===Je?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(uv(i,f,s),Tv(i,$t()),i.callbackNode!=null&&i.callbackNode===u?Av.bind(null,i):null)}function Ov(i,s){if(ku())return null;uv(i,s,!0)}function TA(){VA(function(){(He&6)!==0?No(Na,RA):Rv()})}function hh(){if(ci===0){var i=Wo;i===0&&(i=Un,Un<<=1,(Un&261888)===0&&(Un=256)),ci=i}return ci}function kv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Fa(""+i)}function Nv(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function AA(i,s,u,f,m){if(s==="submit"&&u&&u.stateNode===m){var y=kv((m[sn]||null).action),w=f.submitter;w&&(s=(s=w[sn]||null)?kv(s.formAction):w.getAttribute("formAction"),s!==null&&(y=s,w=null));var R=new Ua("action","action",null,f,m);i.push({event:R,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(ci!==0){var O=w?Nv(m,w):new FormData(m);_d(u,{pending:!0,data:O,method:m.method,action:y},null,O)}}else typeof y=="function"&&(R.preventDefault(),O=w?Nv(m,w):new FormData(m),_d(u,{pending:!0,data:O,method:m.method,action:y},y,O))},currentTarget:m}]})}}for(var ph=0;ph<Jf.length;ph++){var mh=Jf[ph],OA=mh.toLowerCase(),kA=mh[0].toUpperCase()+mh.slice(1);qn(OA,"on"+kA)}qn(ay,"onAnimationEnd"),qn(uy,"onAnimationIteration"),qn(cy,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(GT,"onTransitionRun"),qn(KT,"onTransitionStart"),qn(YT,"onTransitionCancel"),qn(fy,"onTransitionEnd"),Vo("onMouseEnter",["mouseout","mouseover"]),Vo("onMouseLeave",["mouseout","mouseover"]),Vo("onPointerEnter",["pointerout","pointerover"]),Vo("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 kl="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(" "),NA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kl));function Dv(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var f=i[u],m=f.event;f=f.listeners;e:{var y=void 0;if(s)for(var w=f.length-1;0<=w;w--){var R=f[w],O=R.instance,P=R.currentTarget;if(R=R.listener,O!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=P;try{y(m)}catch(X){Ka(X)}m.currentTarget=null,y=O}else for(w=0;w<f.length;w++){if(R=f[w],O=R.instance,P=R.currentTarget,R=R.listener,O!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=P;try{y(m)}catch(X){Ka(X)}m.currentTarget=null,y=O}}}}function Ie(i,s){var u=s[Af];u===void 0&&(u=s[Af]=new Set);var f=i+"__bubble";u.has(f)||(_v(s,i,2,!1),u.add(f))}function gh(i,s,u){var f=0;s&&(f|=4),_v(u,i,f,s)}var _u="_reactListening"+Math.random().toString(36).slice(2);function yh(i){if(!i[_u]){i[_u]=!0,Rg.forEach(function(u){u!=="selectionchange"&&(NA.has(u)||gh(u,!1,i),gh(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[_u]||(s[_u]=!0,gh("selectionchange",!1,s))}}function _v(i,s,u,f){switch(ab(s)){case 2:var m=oO;break;case 8:m=sO;break;default:m=Dh}u=m.bind(null,s,u,i),m=void 0,!If||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(m=!0),f?m!==void 0?i.addEventListener(s,u,{capture:!0,passive:m}):i.addEventListener(s,u,!0):m!==void 0?i.addEventListener(s,u,{passive:m}):i.addEventListener(s,u,!1)}function vh(i,s,u,f,m){var y=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var w=f.tag;if(w===3||w===4){var R=f.stateNode.containerInfo;if(R===m)break;if(w===4)for(w=f.return;w!==null;){var O=w.tag;if((O===3||O===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;R!==null;){if(w=Lo(R),w===null)return;if(O=w.tag,O===5||O===6||O===26||O===27){f=y=w;continue e}R=R.parentNode}}f=f.return}Bg(function(){var P=y,X=jf(u),Q=[];e:{var H=dy.get(i);if(H!==void 0){var G=Ua,ce=i;switch(i){case"keypress":if($a(u)===0)break e;case"keydown":case"keyup":G=MT;break;case"focusin":ce="focus",G=Pf;break;case"focusout":ce="blur",G=Pf;break;case"beforeblur":case"afterblur":G=Pf;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=Pg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=dT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=TT;break;case ay:case uy:case cy:G=mT;break;case fy:G=OT;break;case"scroll":case"scrollend":G=cT;break;case"wheel":G=NT;break;case"copy":case"cut":case"paste":G=yT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=Hg;break;case"toggle":case"beforetoggle":G=_T}var xe=(s&4)!==0,Xe=!xe&&(i==="scroll"||i==="scrollend"),L=xe?H!==null?H+"Capture":null:H;xe=[];for(var z=P,F;z!==null;){var J=z;if(F=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||F===null||L===null||(J=Zs(z,L),J!=null&&xe.push(Nl(z,J,F))),Xe)break;z=z.return}0<xe.length&&(H=new G(H,ce,null,u,X),Q.push({event:H,listeners:xe}))}}if((s&7)===0){e:{if(H=i==="mouseover"||i==="pointerover",G=i==="mouseout"||i==="pointerout",H&&u!==zf&&(ce=u.relatedTarget||u.fromElement)&&(Lo(ce)||ce[jo]))break e;if((G||H)&&(H=X.window===X?X:(H=X.ownerDocument)?H.defaultView||H.parentWindow:window,G?(ce=u.relatedTarget||u.toElement,G=P,ce=ce?Lo(ce):null,ce!==null&&(Xe=l(ce),xe=ce.tag,ce!==Xe||xe!==5&&xe!==27&&xe!==6)&&(ce=null)):(G=null,ce=P),G!==ce)){if(xe=Pg,J="onMouseLeave",L="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(xe=Hg,J="onPointerLeave",L="onPointerEnter",z="pointer"),Xe=G==null?H:Qs(G),F=ce==null?H:Qs(ce),H=new xe(J,z+"leave",G,u,X),H.target=Xe,H.relatedTarget=F,J=null,Lo(X)===P&&(xe=new xe(L,z+"enter",ce,u,X),xe.target=F,xe.relatedTarget=Xe,J=xe),Xe=J,G&&ce)t:{for(xe=DA,L=G,z=ce,F=0,J=L;J;J=xe(J))F++;J=0;for(var ve=z;ve;ve=xe(ve))J++;for(;0<F-J;)L=xe(L),F--;for(;0<J-F;)z=xe(z),J--;for(;F--;){if(L===z||z!==null&&L===z.alternate){xe=L;break t}L=xe(L),z=xe(z)}xe=null}else xe=null;G!==null&&zv(Q,H,G,xe,!1),ce!==null&&Xe!==null&&zv(Q,Xe,ce,xe,!0)}}e:{if(H=P?Qs(P):window,G=H.nodeName&&H.nodeName.toLowerCase(),G==="select"||G==="input"&&H.type==="file")var Pe=Qg;else if(Xg(H))if(Zg)Pe=HT;else{Pe=PT;var pe=FT}else G=H.nodeName,!G||G.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?P&&_f(P.elementType)&&(Pe=Qg):Pe=$T;if(Pe&&(Pe=Pe(i,P))){Jg(Q,Pe,u,X);break e}pe&&pe(i,H,P),i==="focusout"&&P&&H.type==="number"&&P.memoizedProps.value!=null&&Df(H,"number",H.value)}switch(pe=P?Qs(P):window,i){case"focusin":(Xg(pe)||pe.contentEditable==="true")&&(qo=pe,Kf=P,sl=null);break;case"focusout":sl=Kf=qo=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,sy(Q,u,X);break;case"selectionchange":if(qT)break;case"keydown":case"keyup":sy(Q,u,X)}var Ne;if(Hf)e:{switch(i){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Uo?Kg(i,u)&&(Ve="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Ve="onCompositionStart");Ve&&(Ug&&u.locale!=="ko"&&(Uo||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Uo&&(Ne=Vg()):(Yr=X,Bf="value"in Yr?Yr.value:Yr.textContent,Uo=!0)),pe=zu(P,Ve),0<pe.length&&(Ve=new $g(Ve,i,null,u,X),Q.push({event:Ve,listeners:pe}),Ne?Ve.data=Ne:(Ne=Yg(u),Ne!==null&&(Ve.data=Ne)))),(Ne=jT?LT(i,u):IT(i,u))&&(Ve=zu(P,"onBeforeInput"),0<Ve.length&&(pe=new $g("onBeforeInput","beforeinput",null,u,X),Q.push({event:pe,listeners:Ve}),pe.data=Ne)),AA(Q,i,P,u,X)}Dv(Q,s)})}function Nl(i,s,u){return{instance:i,listener:s,currentTarget:u}}function zu(i,s){for(var u=s+"Capture",f=[];i!==null;){var m=i,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=Zs(i,u),m!=null&&f.unshift(Nl(i,m,y)),m=Zs(i,s),m!=null&&f.push(Nl(i,m,y))),i.tag===3)return f;i=i.return}return[]}function DA(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function zv(i,s,u,f,m){for(var y=s._reactName,w=[];u!==null&&u!==f;){var R=u,O=R.alternate,P=R.stateNode;if(R=R.tag,O!==null&&O===f)break;R!==5&&R!==26&&R!==27||P===null||(O=P,m?(P=Zs(u,y),P!=null&&w.unshift(Nl(u,P,O))):m||(P=Zs(u,y),P!=null&&w.push(Nl(u,P,O)))),u=u.return}w.length!==0&&i.push({event:s,listeners:w})}var _A=/\r\n?/g,zA=/\u0000|\uFFFD/g;function jv(i){return(typeof i=="string"?i:""+i).replace(_A,`
|
|
9
|
+
`).replace(zA,"")}function Lv(i,s){return s=jv(s),jv(i)===s}function Ye(i,s,u,f,m,y){switch(u){case"children":typeof f=="string"?s==="body"||s==="textarea"&&f===""||Po(i,f):(typeof f=="number"||typeof f=="bigint")&&s!=="body"&&Po(i,""+f);break;case"className":Ba(i,"class",f);break;case"tabIndex":Ba(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Ba(i,u,f);break;case"style":Lg(i,f,y);break;case"data":if(s!=="object"){Ba(i,"data",f);break}case"src":case"href":if(f===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(u);break}f=Fa(""+f),i.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(u,"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"&&(u==="formAction"?(s!=="input"&&Ye(i,s,"name",m.name,m,null),Ye(i,s,"formEncType",m.formEncType,m,null),Ye(i,s,"formMethod",m.formMethod,m,null),Ye(i,s,"formTarget",m.formTarget,m,null)):(Ye(i,s,"encType",m.encType,m,null),Ye(i,s,"method",m.method,m,null),Ye(i,s,"target",m.target,m,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(u);break}f=Fa(""+f),i.setAttribute(u,f);break;case"onClick":f!=null&&(i.onclick=vr);break;case"onScroll":f!=null&&Ie("scroll",i);break;case"onScrollEnd":f!=null&&Ie("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}u=Fa(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,""+f):i.removeAttribute(u);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":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":f===!0?i.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,f):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(u,f):i.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(u):i.setAttribute(u,f);break;case"popover":Ie("beforetoggle",i),Ie("toggle",i),Ia(i,"popover",f);break;case"xlinkActuate":yr(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":yr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":yr(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":yr(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":yr(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":yr(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":yr(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":yr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":yr(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Ia(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=aT.get(u)||u,Ia(i,u,f))}}function bh(i,s,u,f,m,y){switch(u){case"style":Lg(i,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof f=="string"?Po(i,f):(typeof f=="number"||typeof f=="bigint")&&Po(i,""+f);break;case"onScroll":f!=null&&Ie("scroll",i);break;case"onScrollEnd":f!=null&&Ie("scrollend",i);break;case"onClick":f!=null&&(i.onclick=vr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Tg.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(m=u.endsWith("Capture"),s=u.slice(2,m?u.length-7:void 0),y=i[sn]||null,y=y!=null?y[u]:null,typeof y=="function"&&i.removeEventListener(s,y,m),typeof f=="function")){typeof y!="function"&&y!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,f,m);break e}u in i?i[u]=f:f===!0?i.setAttribute(u,""):Ia(i,u,f)}}}function jt(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",i),Ie("load",i);var f=!1,m=!1,y;for(y in u)if(u.hasOwnProperty(y)){var w=u[y];if(w!=null)switch(y){case"src":f=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ye(i,s,y,w,u,null)}}m&&Ye(i,s,"srcSet",u.srcSet,u,null),f&&Ye(i,s,"src",u.src,u,null);return;case"input":Ie("invalid",i);var R=y=w=m=null,O=null,P=null;for(f in u)if(u.hasOwnProperty(f)){var X=u[f];if(X!=null)switch(f){case"name":m=X;break;case"type":w=X;break;case"checked":O=X;break;case"defaultChecked":P=X;break;case"value":y=X;break;case"defaultValue":R=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,s));break;default:Ye(i,s,f,X,u,null)}}Dg(i,y,R,O,P,w,m,!1);return;case"select":Ie("invalid",i),f=w=y=null;for(m in u)if(u.hasOwnProperty(m)&&(R=u[m],R!=null))switch(m){case"value":y=R;break;case"defaultValue":w=R;break;case"multiple":f=R;default:Ye(i,s,m,R,u,null)}s=y,u=w,i.multiple=!!f,s!=null?Fo(i,!!f,s,!1):u!=null&&Fo(i,!!f,u,!0);return;case"textarea":Ie("invalid",i),y=m=f=null;for(w in u)if(u.hasOwnProperty(w)&&(R=u[w],R!=null))switch(w){case"value":f=R;break;case"defaultValue":m=R;break;case"children":y=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:Ye(i,s,w,R,u,null)}zg(i,f,m,y);return;case"option":for(O in u)u.hasOwnProperty(O)&&(f=u[O],f!=null)&&(O==="selected"?i.selected=f&&typeof f!="function"&&typeof f!="symbol":Ye(i,s,O,f,u,null));return;case"dialog":Ie("beforetoggle",i),Ie("toggle",i),Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":Ie("load",i);break;case"video":case"audio":for(f=0;f<kl.length;f++)Ie(kl[f],i);break;case"image":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"embed":case"source":case"link":Ie("error",i),Ie("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(P in u)if(u.hasOwnProperty(P)&&(f=u[P],f!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ye(i,s,P,f,u,null)}return;default:if(_f(s)){for(X in u)u.hasOwnProperty(X)&&(f=u[X],f!==void 0&&bh(i,s,X,f,u,void 0));return}}for(R in u)u.hasOwnProperty(R)&&(f=u[R],f!=null&&Ye(i,s,R,f,u,null))}function jA(i,s,u,f){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,w=null,R=null,O=null,P=null,X=null;for(G in u){var Q=u[G];if(u.hasOwnProperty(G)&&Q!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":O=Q;default:f.hasOwnProperty(G)||Ye(i,s,G,null,f,Q)}}for(var H in f){var G=f[H];if(Q=u[H],f.hasOwnProperty(H)&&(G!=null||Q!=null))switch(H){case"type":y=G;break;case"name":m=G;break;case"checked":P=G;break;case"defaultChecked":X=G;break;case"value":w=G;break;case"defaultValue":R=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,s));break;default:G!==Q&&Ye(i,s,H,G,f,Q)}}Nf(i,w,R,O,P,X,y,m);return;case"select":G=w=R=H=null;for(y in u)if(O=u[y],u.hasOwnProperty(y)&&O!=null)switch(y){case"value":break;case"multiple":G=O;default:f.hasOwnProperty(y)||Ye(i,s,y,null,f,O)}for(m in f)if(y=f[m],O=u[m],f.hasOwnProperty(m)&&(y!=null||O!=null))switch(m){case"value":H=y;break;case"defaultValue":R=y;break;case"multiple":w=y;default:y!==O&&Ye(i,s,m,y,f,O)}s=R,u=w,f=G,H!=null?Fo(i,!!u,H,!1):!!f!=!!u&&(s!=null?Fo(i,!!u,s,!0):Fo(i,!!u,u?[]:"",!1));return;case"textarea":G=H=null;for(R in u)if(m=u[R],u.hasOwnProperty(R)&&m!=null&&!f.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Ye(i,s,R,null,f,m)}for(w in f)if(m=f[w],y=u[w],f.hasOwnProperty(w)&&(m!=null||y!=null))switch(w){case"value":H=m;break;case"defaultValue":G=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==y&&Ye(i,s,w,m,f,y)}_g(i,H,G);return;case"option":for(var ce in u)H=u[ce],u.hasOwnProperty(ce)&&H!=null&&!f.hasOwnProperty(ce)&&(ce==="selected"?i.selected=!1:Ye(i,s,ce,null,f,H));for(O in f)H=f[O],G=u[O],f.hasOwnProperty(O)&&H!==G&&(H!=null||G!=null)&&(O==="selected"?i.selected=H&&typeof H!="function"&&typeof H!="symbol":Ye(i,s,O,H,f,G));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 xe in u)H=u[xe],u.hasOwnProperty(xe)&&H!=null&&!f.hasOwnProperty(xe)&&Ye(i,s,xe,null,f,H);for(P in f)if(H=f[P],G=u[P],f.hasOwnProperty(P)&&H!==G&&(H!=null||G!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(137,s));break;default:Ye(i,s,P,H,f,G)}return;default:if(_f(s)){for(var Xe in u)H=u[Xe],u.hasOwnProperty(Xe)&&H!==void 0&&!f.hasOwnProperty(Xe)&&bh(i,s,Xe,void 0,f,H);for(X in f)H=f[X],G=u[X],!f.hasOwnProperty(X)||H===G||H===void 0&&G===void 0||bh(i,s,X,H,f,G);return}}for(var L in u)H=u[L],u.hasOwnProperty(L)&&H!=null&&!f.hasOwnProperty(L)&&Ye(i,s,L,null,f,H);for(Q in f)H=f[Q],G=u[Q],!f.hasOwnProperty(Q)||H===G||H==null&&G==null||Ye(i,s,Q,H,f,G)}function Iv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function LA(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var m=u[f],y=m.transferSize,w=m.initiatorType,R=m.duration;if(y&&R&&Iv(w)){for(w=0,R=m.responseEnd,f+=1;f<u.length;f++){var O=u[f],P=O.startTime;if(P>R)break;var X=O.transferSize,Q=O.initiatorType;X&&Iv(Q)&&(O=O.responseEnd,w+=X*(O<R?1:(R-P)/(O-P)))}if(--f,s+=8*(y+w)/(m.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 Sh=null,xh=null;function ju(i){return i.nodeType===9?i:i.ownerDocument}function Bv(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 Vv(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 wh(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 Ch=null;function IA(){var i=window.event;return i&&i.type==="popstate"?i===Ch?!1:(Ch=i,!0):(Ch=null,!1)}var Fv=typeof setTimeout=="function"?setTimeout:void 0,BA=typeof clearTimeout=="function"?clearTimeout:void 0,Pv=typeof Promise=="function"?Promise:void 0,VA=typeof queueMicrotask=="function"?queueMicrotask:typeof Pv<"u"?function(i){return Pv.resolve(null).then(i).catch(FA)}:Fv;function FA(i){setTimeout(function(){throw i})}function fi(i){return i==="head"}function $v(i,s){var u=s,f=0;do{var m=u.nextSibling;if(i.removeChild(u),m&&m.nodeType===8)if(u=m.data,u==="/$"||u==="/&"){if(f===0){i.removeChild(m),bs(s);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")Dl(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Dl(u);for(var y=u.firstChild;y;){var w=y.nextSibling,R=y.nodeName;y[Js]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||u.removeChild(y),y=w}}else u==="body"&&Dl(i.ownerDocument.body);u=m}while(u);bs(s)}function Hv(i,s){var u=i;i=0;do{var f=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=f}while(u)}function Mh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Mh(u),Of(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function PA(i,s,u,f){for(;i.nodeType===1;){var m=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){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!==m.rel||i.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||i.getAttribute("title")!==(m.title==null?null:m.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(m.src==null?null:m.src)||i.getAttribute("type")!==(m.type==null?null:m.type)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Ln(i.nextSibling),i===null)break}return null}function $A(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Ln(i.nextSibling),i===null))return null;return i}function Uv(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Ln(i.nextSibling),i===null))return null;return i}function Eh(i){return i.data==="$?"||i.data==="$~"}function Rh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function HA(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var f=function(){s(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function Ln(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 Th=null;function qv(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return Ln(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function Gv(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function Kv(i,s,u){switch(s=ju(u),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 Dl(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Of(i)}var In=new Map,Yv=new Set;function Lu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var zr=$.d;$.d={f:UA,r:qA,D:GA,C:KA,L:YA,m:XA,X:QA,S:JA,M:ZA};function UA(){var i=zr.f(),s=Tu();return i||s}function qA(i){var s=Io(i);s!==null&&s.tag===5&&s.type==="form"?f0(s):zr.r(i)}var gs=typeof document>"u"?null:document;function Xv(i,s,u){var f=gs;if(f&&typeof s=="string"&&s){var m=On(s);m='link[rel="'+i+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),Yv.has(m)||(Yv.add(m),i={rel:i,crossOrigin:u,href:s},f.querySelector(m)===null&&(s=f.createElement("link"),jt(s,"link",i),Et(s),f.head.appendChild(s)))}}function GA(i){zr.D(i),Xv("dns-prefetch",i,null)}function KA(i,s){zr.C(i,s),Xv("preconnect",i,s)}function YA(i,s,u){zr.L(i,s,u);var f=gs;if(f&&i&&s){var m='link[rel="preload"][as="'+On(s)+'"]';s==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+On(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+On(u.imageSizes)+'"]')):m+='[href="'+On(i)+'"]';var y=m;switch(s){case"style":y=ys(i);break;case"script":y=vs(i)}In.has(y)||(i=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),In.set(y,i),f.querySelector(m)!==null||s==="style"&&f.querySelector(_l(y))||s==="script"&&f.querySelector(zl(y))||(s=f.createElement("link"),jt(s,"link",i),Et(s),f.head.appendChild(s)))}}function XA(i,s){zr.m(i,s);var u=gs;if(u&&i){var f=s&&typeof s.as=="string"?s.as:"script",m='link[rel="modulepreload"][as="'+On(f)+'"][href="'+On(i)+'"]',y=m;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=vs(i)}if(!In.has(y)&&(i=g({rel:"modulepreload",href:i},s),In.set(y,i),u.querySelector(m)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(zl(y)))return}f=u.createElement("link"),jt(f,"link",i),Et(f),u.head.appendChild(f)}}}function JA(i,s,u){zr.S(i,s,u);var f=gs;if(f&&i){var m=Bo(f).hoistableStyles,y=ys(i);s=s||"default";var w=m.get(y);if(!w){var R={loading:0,preload:null};if(w=f.querySelector(_l(y)))R.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=In.get(y))&&Ah(i,u);var O=w=f.createElement("link");Et(O),jt(O,"link",i),O._p=new Promise(function(P,X){O.onload=P,O.onerror=X}),O.addEventListener("load",function(){R.loading|=1}),O.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Iu(w,s,f)}w={type:"stylesheet",instance:w,count:1,state:R},m.set(y,w)}}}function QA(i,s){zr.X(i,s);var u=gs;if(u&&i){var f=Bo(u).hoistableScripts,m=vs(i),y=f.get(m);y||(y=u.querySelector(zl(m)),y||(i=g({src:i,async:!0},s),(s=In.get(m))&&Oh(i,s),y=u.createElement("script"),Et(y),jt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function ZA(i,s){zr.M(i,s);var u=gs;if(u&&i){var f=Bo(u).hoistableScripts,m=vs(i),y=f.get(m);y||(y=u.querySelector(zl(m)),y||(i=g({src:i,async:!0,type:"module"},s),(s=In.get(m))&&Oh(i,s),y=u.createElement("script"),Et(y),jt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function Jv(i,s,u,f){var m=(m=ae.current)?Lu(m):null;if(!m)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=ys(u.href),u=Bo(m).hoistableStyles,f=u.get(s),f||(f={type:"style",instance:null,count:0,state:null},u.set(s,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=ys(u.href);var y=Bo(m).hoistableStyles,w=y.get(i);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,w),(y=m.querySelector(_l(i)))&&!y._p&&(w.instance=y,w.state.loading=5),In.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},In.set(i,u),y||WA(m,i,u,w.state))),s&&f===null)throw Error(r(528,""));return w}if(s&&f!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=vs(u),u=Bo(m).hoistableScripts,f=u.get(s),f||(f={type:"script",instance:null,count:0,state:null},u.set(s,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ys(i){return'href="'+On(i)+'"'}function _l(i){return'link[rel="stylesheet"]['+i+"]"}function Qv(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function WA(i,s,u,f){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?f.loading=1:(s=i.createElement("link"),f.preload=s,s.addEventListener("load",function(){return f.loading|=1}),s.addEventListener("error",function(){return f.loading|=2}),jt(s,"link",u),Et(s),i.head.appendChild(s))}function vs(i){return'[src="'+On(i)+'"]'}function zl(i){return"script[async]"+i}function Zv(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var f=i.querySelector('style[data-href~="'+On(u.href)+'"]');if(f)return s.instance=f,Et(f),f;var m=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),Et(f),jt(f,"style",m),Iu(f,u.precedence,i),s.instance=f;case"stylesheet":m=ys(u.href);var y=i.querySelector(_l(m));if(y)return s.state.loading|=4,s.instance=y,Et(y),y;f=Qv(u),(m=In.get(m))&&Ah(f,m),y=(i.ownerDocument||i).createElement("link"),Et(y);var w=y;return w._p=new Promise(function(R,O){w.onload=R,w.onerror=O}),jt(y,"link",f),s.state.loading|=4,Iu(y,u.precedence,i),s.instance=y;case"script":return y=vs(u.src),(m=i.querySelector(zl(y)))?(s.instance=m,Et(m),m):(f=u,(m=In.get(y))&&(f=g({},u),Oh(f,m)),i=i.ownerDocument||i,m=i.createElement("script"),Et(m),jt(m,"link",f),i.head.appendChild(m),s.instance=m);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(f=s.instance,s.state.loading|=4,Iu(f,u.precedence,i));return s.instance}function Iu(i,s,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=f.length?f[f.length-1]:null,y=m,w=0;w<f.length;w++){var R=f[w];if(R.dataset.precedence===s)y=R;else if(y!==m)break}y?y.parentNode.insertBefore(i,y.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Ah(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Oh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Bu=null;function Wv(i,s,u){if(Bu===null){var f=new Map,m=Bu=new Map;m.set(u,f)}else m=Bu,f=m.get(u),f||(f=new Map,m.set(u,f));if(f.has(i))return f;for(f.set(i,null),u=u.getElementsByTagName(i),m=0;m<u.length;m++){var y=u[m];if(!(y[Js]||y[Nt]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var w=y.getAttribute(s)||"";w=i+w;var R=f.get(w);R?R.push(y):f.set(w,[y])}}return f}function eb(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function eO(i,s,u){if(u===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;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!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 tb(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function tO(i,s,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var m=ys(f.href),y=s.querySelector(_l(m));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Vu.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=y,Et(y);return}y=s.ownerDocument||s,f=Qv(f),(m=In.get(m))&&Ah(f,m),y=y.createElement("link"),Et(y);var w=y;w._p=new Promise(function(R,O){w.onload=R,w.onerror=O}),jt(y,"link",f),u.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=Vu.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var kh=0;function nO(i,s){return i.stylesheets&&i.count===0&&Pu(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var f=setTimeout(function(){if(i.stylesheets&&Pu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&kh===0&&(kh=62500*LA());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Pu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>kh?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(m)}}:null}function Vu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Fu=null;function Pu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Fu=new Map,s.forEach(rO,i),Fu=null,Vu.call(i))}function rO(i,s){if(!(s.state.loading&4)){var u=Fu.get(i);if(u)var f=u.get(null);else{u=new Map,Fu.set(i,u);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var w=m[y];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(u.set(w.dataset.precedence,w),f=w)}f&&u.set(null,f)}m=s.instance,w=m.getAttribute("data-precedence"),y=u.get(w)||f,y===f&&u.set(null,m),u.set(w,m),this.count++,f=Vu.bind(this),m.addEventListener("load",f),m.addEventListener("error",f),y?y.parentNode.insertBefore(m,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),s.state.loading|=4}}var jl={$$typeof:k,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function iO(i,s,u,f,m,y,w,R,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=Me(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Me(0),this.hiddenUpdates=Me(null),this.identifierPrefix=f,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function nb(i,s,u,f,m,y,w,R,O,P,X,Q){return i=new iO(i,s,u,w,O,P,X,Q,R),s=1,y===!0&&(s|=24),y=gn(3,null,null,s),i.current=y,y.stateNode=i,s=ud(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:f,isDehydrated:u,cache:s},hd(y),i}function rb(i){return i?(i=Yo,i):Yo}function ib(i,s,u,f,m,y){m=rb(m),f.context===null?f.context=m:f.pendingContext=m,f=ei(s),f.payload={element:u},y=y===void 0?null:y,y!==null&&(f.callback=y),u=ti(i,f,s),u!==null&&(dn(u,i,s),hl(u,i,s))}function ob(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Nh(i,s){ob(i,s),(i=i.alternate)&&ob(i,s)}function sb(i){if(i.tag===13||i.tag===31){var s=Xi(i,67108864);s!==null&&dn(s,i,67108864),Nh(i,67108864)}}function lb(i){if(i.tag===13||i.tag===31){var s=xn();s=Gr(s);var u=Xi(i,s);u!==null&&dn(u,i,s),Nh(i,s)}}var $u=!0;function oO(i,s,u,f){var m=V.T;V.T=null;var y=$.p;try{$.p=2,Dh(i,s,u,f)}finally{$.p=y,V.T=m}}function sO(i,s,u,f){var m=V.T;V.T=null;var y=$.p;try{$.p=8,Dh(i,s,u,f)}finally{$.p=y,V.T=m}}function Dh(i,s,u,f){if($u){var m=_h(f);if(m===null)vh(i,s,f,Hu,u),ub(i,f);else if(aO(m,i,s,u,f))f.stopPropagation();else if(ub(i,f),s&4&&-1<lO.indexOf(i)){for(;m!==null;){var y=Io(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var w=gr(y.pendingLanes);if(w!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;w;){var O=1<<31-Wt(w);R.entanglements[1]|=O,w&=~O}or(y),(He&6)===0&&(Eu=$t()+500,Ol(0))}}break;case 31:case 13:R=Xi(y,2),R!==null&&dn(R,y,2),Tu(),Nh(y,2)}if(y=_h(f),y===null&&vh(i,s,f,Hu,u),y===m)break;m=y}m!==null&&f.stopPropagation()}else vh(i,s,f,null,u)}}function _h(i){return i=jf(i),zh(i)}var Hu=null;function zh(i){if(Hu=null,i=Lo(i),i!==null){var s=l(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=a(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Hu=i,null}function ab(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(Tf()){case Na:return 2;case Da:return 8;case Tn:case pr:return 32;case _o:return 268435456;default:return 32}default:return 32}}var jh=!1,di=null,hi=null,pi=null,Ll=new Map,Il=new Map,mi=[],lO="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 ub(i,s){switch(i){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":hi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":Ll.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(s.pointerId)}}function Bl(i,s,u,f,m,y){return i===null||i.nativeEvent!==y?(i={blockedOn:s,domEventName:u,eventSystemFlags:f,nativeEvent:y,targetContainers:[m]},s!==null&&(s=Io(s),s!==null&&sb(s)),i):(i.eventSystemFlags|=f,s=i.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),i)}function aO(i,s,u,f,m){switch(s){case"focusin":return di=Bl(di,i,s,u,f,m),!0;case"dragenter":return hi=Bl(hi,i,s,u,f,m),!0;case"mouseover":return pi=Bl(pi,i,s,u,f,m),!0;case"pointerover":var y=m.pointerId;return Ll.set(y,Bl(Ll.get(y)||null,i,s,u,f,m)),!0;case"gotpointercapture":return y=m.pointerId,Il.set(y,Bl(Il.get(y)||null,i,s,u,f,m)),!0}return!1}function cb(i){var s=Lo(i.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=a(u),s!==null){i.blockedOn=s,Mg(i.priority,function(){lb(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,Mg(i.priority,function(){lb(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Uu(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=_h(i.nativeEvent);if(u===null){u=i.nativeEvent;var f=new u.constructor(u.type,u);zf=f,u.target.dispatchEvent(f),zf=null}else return s=Io(u),s!==null&&sb(s),i.blockedOn=u,!1;s.shift()}return!0}function fb(i,s,u){Uu(i)&&u.delete(s)}function uO(){jh=!1,di!==null&&Uu(di)&&(di=null),hi!==null&&Uu(hi)&&(hi=null),pi!==null&&Uu(pi)&&(pi=null),Ll.forEach(fb),Il.forEach(fb)}function qu(i,s){i.blockedOn===s&&(i.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,uO)))}var Gu=null;function db(i){Gu!==i&&(Gu=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gu===i&&(Gu=null);for(var s=0;s<i.length;s+=3){var u=i[s],f=i[s+1],m=i[s+2];if(typeof f!="function"){if(zh(f||u)===null)continue;break}var y=Io(u);y!==null&&(i.splice(s,3),s-=3,_d(y,{pending:!0,data:m,method:u.method,action:f},f,m))}}))}function bs(i){function s(O){return qu(O,i)}di!==null&&qu(di,i),hi!==null&&qu(hi,i),pi!==null&&qu(pi,i),Ll.forEach(s),Il.forEach(s);for(var u=0;u<mi.length;u++){var f=mi[u];f.blockedOn===i&&(f.blockedOn=null)}for(;0<mi.length&&(u=mi[0],u.blockedOn===null);)cb(u),u.blockedOn===null&&mi.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var m=u[f],y=u[f+1],w=m[sn]||null;if(typeof y=="function")w||db(u);else if(w){var R=null;if(y&&y.hasAttribute("formAction")){if(m=y,w=y[sn]||null)R=w.formAction;else if(zh(m)!==null)continue}else R=w.action;typeof R=="function"?u[f+1]=R:(u.splice(f,3),f-=3),db(u)}}}function hb(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function s(){m!==null&&(m(),m=null),f||setTimeout(u,20)}function u(){if(!f&&!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 f=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),m!==null&&(m(),m=null)}}}function Lh(i){this._internalRoot=i}Ku.prototype.render=Lh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,f=xn();ib(u,f,i,s,null,null)},Ku.prototype.unmount=Lh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;ib(i.current,2,null,i,null,null),Tu(),s[jo]=null}};function Ku(i){this._internalRoot=i}Ku.prototype.unstable_scheduleHydration=function(i){if(i){var s=La();i={blockedOn:null,target:i,priority:s};for(var u=0;u<mi.length&&s!==0&&s<mi[u].priority;u++);mi.splice(u,0,i),u===0&&cb(i)}};var pb=e.version;if(pb!=="19.2.4")throw Error(r(527,pb,"19.2.4"));$.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 cO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yu.isDisabled&&Yu.supportsFiber)try{Ct=Yu.inject(cO),Mt=Yu}catch{}}return Fl.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,f="",m=x0,y=w0,w=C0;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError)),s=nb(i,1,!1,null,null,u,f,null,m,y,w,hb),i[jo]=s.current,yh(i),new Lh(s)},Fl.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var f=!1,m="",y=x0,w=w0,R=C0,O=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(w=u.onCaughtError),u.onRecoverableError!==void 0&&(R=u.onRecoverableError),u.formState!==void 0&&(O=u.formState)),s=nb(i,1,!0,s,u??null,f,m,O,y,w,R,hb),s.context=rb(null),u=s.current,f=xn(),f=Gr(f),m=ei(f),m.callback=null,ti(u,m,f),u=f,s.current.lanes=u,ke(s,u),or(s),i[jo]=s.current,yh(i),new Ku(s)},Fl.version="19.2.4",Fl}var Mb;function SO(){if(Mb)return Vh.exports;Mb=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(),Vh.exports=bO(),Vh.exports}var xO=SO();const c1=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();const wO=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const CO=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());const Eb=t=>{const e=CO(t);return e.charAt(0).toUpperCase()+e.slice(1)};var MO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const EO=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const RO=M.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:a,...c},d)=>M.createElement("svg",{ref:d,...MO,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:c1("lucide",o),...!l&&!EO(c)&&{"aria-hidden":"true"},...c},[...a.map(([h,p])=>M.createElement(h,p)),...Array.isArray(l)?l:[l]]));const Ue=(t,e)=>{const n=M.forwardRef(({className:r,...o},l)=>M.createElement(RO,{ref:l,iconNode:e,className:c1(`lucide-${wO(Eb(t))}`,`lucide-${t}`,r),...o}));return n.displayName=Eb(t),n};const TO=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],AO=Ue("arrow-down",TO);const OO=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],kO=Ue("arrow-up",OO);const NO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],DO=Ue("ban",NO);const _O=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],zO=Ue("braces",_O);const jO=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],LO=Ue("calendar-days",jO);const IO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],$s=Ue("check",IO);const BO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],VO=Ue("chevron-down",BO);const FO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],f1=Ue("chevron-right",FO);const PO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],bm=Ue("circle-alert",PO);const $O=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],HO=Ue("circle-play",$O);const UO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],qO=Ue("circle-stop",UO);const GO=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],d1=Ue("copy",GO);const KO=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Lp=Ue("download",KO);const YO=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],XO=Ue("ellipsis",YO);const JO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],QO=Ue("external-link",JO);const ZO=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],h1=Ue("funnel",ZO);const WO=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],ek=Ue("hash",WO);const tk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],nk=Ue("info",tk);const rk=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],ik=Ue("list-filter",rk);const ok=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ef=Ue("loader-circle",ok);const sk=[["path",{d:"M5 12h14",key:"1ays0h"}]],lk=Ue("minus",sk);const ak=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],p1=Ue("moon",ak);const uk=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ck=Ue("play",uk);const fk=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],dk=Ue("refresh-ccw",fk);const hk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Sm=Ue("search",hk);const pk=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],m1=Ue("settings-2",pk);const mk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Rb=Ue("square-check",mk);const gk=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],g1=Ue("sun",gk);const yk=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],vk=Ue("trash-2",yk);const bk=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Sk=Ue("type",bk);const xk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xm=Ue("x",xk);function Xn(t,e){return typeof t=="function"?t(e):t}function Rn(t,e){return n=>{e.setState(r=>({...r,[t]:Xn(n,r[t])}))}}function tf(t){return t instanceof Function}function wk(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Ck(t,e){const n=[],r=o=>{o.forEach(l=>{n.push(l);const a=e(l);a!=null&&a.length&&r(a)})};return r(t),n}function we(t,e,n){let r=[],o;return l=>{let a;n.key&&n.debug&&(a=Date.now());const c=t(l);if(!(c.length!==r.length||c.some((p,g)=>r[g]!==p)))return o;r=c;let h;if(n.key&&n.debug&&(h=Date.now()),o=e(...c),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-h)*100)/100,v=g/16,b=(S,x)=>{for(S=String(S);S.length<x;)S=" "+S;return S};console.info(`%c⏱ ${b(g,5)} /${b(p,5)} ms`,`
|
|
10
|
+
font-size: .6rem;
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return o}}function Ce(t,e,n,r){return{debug:()=>{var o;return(o=t?.debugAll)!=null?o:t[e]},key:!1,onChange:r}}function Mk(t,e,n,r){const o=()=>{var a;return(a=l.getValue())!=null?a:t.options.renderFallbackValue},l={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:o,getContext:we(()=>[t,n,e,l],(a,c,d,h)=>({table:a,column:c,row:d,cell:h,getValue:h.getValue,renderValue:h.renderValue}),Ce(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(l,n,e,t)},{}),l}function Ek(t,e,n,r){var o,l;const c={...t._getDefaultColumnDef(),...e},d=c.accessorKey;let h=(o=(l=c.id)!=null?l:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?o:typeof c.header=="string"?c.header:void 0,p;if(c.accessorFn?p=c.accessorFn:d&&(d.includes(".")?p=v=>{let b=v;for(const x of d.split(".")){var S;b=(S=b)==null?void 0:S[x]}return b}:p=v=>v[c.accessorKey]),!h)throw new Error;let g={id:`${String(h)}`,accessorFn:p,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:we(()=>[!0],()=>{var v;return[g,...(v=g.columns)==null?void 0:v.flatMap(b=>b.getFlatColumns())]},Ce(t.options,"debugColumns")),getLeafColumns:we(()=>[t._getOrderColumnsFn()],v=>{var b;if((b=g.columns)!=null&&b.length){let S=g.columns.flatMap(x=>x.getLeafColumns());return v(S)}return[g]},Ce(t.options,"debugColumns"))};for(const v of t._features)v.createColumn==null||v.createColumn(g,t);return g}const Ut="debugHeaders";function Tb(t,e,n){var r;let l={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),a.push(d)};return c(l),a},getContext:()=>({table:t,header:l,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(l,t)}),l}const Rk={createTable:t=>{t.getHeaderGroups=we(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>{var l,a;const c=(l=r?.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?l:[],d=(a=o?.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?a:[],h=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Xu(e,[...c,...h,...d],t)},Ce(t.options,Ut)),t.getCenterHeaderGroups=we(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(o!=null&&o.includes(l.id))),Xu(e,n,t,"center")),Ce(t.options,Ut)),t.getLeftHeaderGroups=we(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var o;const l=(o=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return Xu(e,l,t,"left")},Ce(t.options,Ut)),t.getRightHeaderGroups=we(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var o;const l=(o=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return Xu(e,l,t,"right")},Ce(t.options,Ut)),t.getFooterGroups=we(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Ut)),t.getLeftFooterGroups=we(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Ut)),t.getCenterFooterGroups=we(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Ut)),t.getRightFooterGroups=we(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Ut)),t.getFlatHeaders=we(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Ut)),t.getLeftFlatHeaders=we(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Ut)),t.getCenterFlatHeaders=we(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Ut)),t.getRightFlatHeaders=we(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Ut)),t.getCenterLeafHeaders=we(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ce(t.options,Ut)),t.getLeftLeafHeaders=we(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ce(t.options,Ut)),t.getRightLeafHeaders=we(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ce(t.options,Ut)),t.getLeafHeaders=we(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var o,l,a,c,d,h;return[...(o=(l=e[0])==null?void 0:l.headers)!=null?o:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(d=(h=r[0])==null?void 0:h.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},Ce(t.options,Ut))}};function Xu(t,e,n,r){var o,l;let a=0;const c=function(v,b){b===void 0&&(b=1),a=Math.max(a,b),v.filter(S=>S.getIsVisible()).forEach(S=>{var x;(x=S.columns)!=null&&x.length&&c(S.columns,b+1)},0)};c(t);let d=[];const h=(v,b)=>{const S={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},x=[];v.forEach(C=>{const E=[...x].reverse()[0],A=C.column.depth===S.depth;let k,N=!1;if(A&&C.column.parent?k=C.column.parent:(k=C.column,N=!0),E&&E?.column===k)E.subHeaders.push(C);else{const j=Tb(n,k,{id:[r,b,k.id,C?.id].filter(Boolean).join("_"),isPlaceholder:N,placeholderId:N?`${x.filter(U=>U.column===k).length}`:void 0,depth:b,index:x.length});j.subHeaders.push(C),x.push(j)}S.headers.push(C),C.headerGroup=S}),d.push(S),b>0&&h(x,b-1)},p=e.map((v,b)=>Tb(n,v,{depth:a,index:b}));h(p,a-1),d.reverse();const g=v=>v.filter(S=>S.column.getIsVisible()).map(S=>{let x=0,C=0,E=[0];S.subHeaders&&S.subHeaders.length?(E=[],g(S.subHeaders).forEach(k=>{let{colSpan:N,rowSpan:j}=k;x+=N,E.push(j)})):x=1;const A=Math.min(...E);return C=C+A,S.colSpan=x,S.rowSpan=C,{colSpan:x,rowSpan:C}});return g((o=(l=d[0])==null?void 0:l.headers)!=null?o:[]),d}const wm=(t,e,n,r,o,l,a)=>{let c={id:e,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const h=t.getColumn(d);if(h!=null&&h.accessorFn)return c._valuesCache[d]=h.accessorFn(c.original,r),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const h=t.getColumn(d);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=h.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var h;return(h=c.getValue(d))!=null?h:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>Ck(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?t.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],h=c;for(;;){const p=h.getParentRow();if(!p)break;d.push(p),h=p}return d.reverse()},getAllCells:we(()=>[t.getAllLeafColumns()],d=>d.map(h=>Mk(t,c,h,h.id)),Ce(t.options,"debugRows")),_getAllCellsByColumnId:we(()=>[c.getAllCells()],d=>d.reduce((h,p)=>(h[p.column.id]=p,h),{}),Ce(t.options,"debugRows"))};for(let d=0;d<t._features.length;d++){const h=t._features[d];h==null||h.createRow==null||h.createRow(c,t)}return c},Tk={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},y1=(t,e,n)=>{var r,o;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=t.getValue(e))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};y1.autoRemove=t=>Qn(t);const v1=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};v1.autoRemove=t=>Qn(t);const b1=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};b1.autoRemove=t=>Qn(t);const S1=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};S1.autoRemove=t=>Qn(t);const x1=(t,e,n)=>!n.some(r=>{var o;return!((o=t.getValue(e))!=null&&o.includes(r))});x1.autoRemove=t=>Qn(t)||!(t!=null&&t.length);const w1=(t,e,n)=>n.some(r=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(r)});w1.autoRemove=t=>Qn(t)||!(t!=null&&t.length);const C1=(t,e,n)=>t.getValue(e)===n;C1.autoRemove=t=>Qn(t);const M1=(t,e,n)=>t.getValue(e)==n;M1.autoRemove=t=>Qn(t);const Cm=(t,e,n)=>{let[r,o]=n;const l=t.getValue(e);return l>=r&&l<=o};Cm.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,o=typeof n!="number"?parseFloat(n):n,l=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(l>a){const c=l;l=a,a=c}return[l,a]};Cm.autoRemove=t=>Qn(t)||Qn(t[0])&&Qn(t[1]);const Ir={includesString:y1,includesStringSensitive:v1,equalsString:b1,arrIncludes:S1,arrIncludesAll:x1,arrIncludesSome:w1,equals:C1,weakEquals:M1,inNumberRange:Cm};function Qn(t){return t==null||t===""}const Ak={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Rn("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);return typeof r=="string"?Ir.includesString:typeof r=="number"?Ir.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ir.equals:Array.isArray(r)?Ir.arrIncludes:Ir.weakEquals},t.getFilterFn=()=>{var n,r;return tf(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:Ir[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,o;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const o=t.getFilterFn(),l=r?.find(p=>p.id===t.id),a=Xn(n,l?l.value:void 0);if(Ab(o,a,t)){var c;return(c=r?.filter(p=>p.id!==t.id))!=null?c:[]}const d={id:t.id,value:a};if(l){var h;return(h=r?.map(p=>p.id===t.id?d:p))!=null?h:[]}return r!=null&&r.length?[...r,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=o=>{var l;return(l=Xn(e,o))==null?void 0:l.filter(a=>{const c=n.find(d=>d.id===a.id);if(c){const d=c.getFilterFn();if(Ab(d,a.value,c))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function Ab(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const Ok=(t,e,n)=>n.reduce((r,o)=>{const l=o.getValue(t);return r+(typeof l=="number"?l:0)},0),kk=(t,e,n)=>{let r;return n.forEach(o=>{const l=o.getValue(t);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},Nk=(t,e,n)=>{let r;return n.forEach(o=>{const l=o.getValue(t);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},Dk=(t,e,n)=>{let r,o;return n.forEach(l=>{const a=l.getValue(t);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},_k=(t,e)=>{let n=0,r=0;if(e.forEach(o=>{let l=o.getValue(t);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},zk=(t,e)=>{if(!e.length)return;const n=e.map(l=>l.getValue(t));if(!wk(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((l,a)=>l-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},jk=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Lk=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,Ik=(t,e)=>e.length,Hh={sum:Ok,min:kk,max:Nk,extent:Dk,mean:_k,median:zk,unique:jk,uniqueCount:Lk,count:Ik},Bk={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Rn("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);if(typeof r=="number")return Hh.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Hh.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return tf(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:Hh[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var o;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Vk(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(l=>!e.includes(l.id));return n==="remove"?r:[...e.map(l=>t.find(a=>a.id===l)).filter(Boolean),...r]}const Fk={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Rn("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=we(n=>[Zl(e,n)],n=>n.findIndex(r=>r.id===t.id),Ce(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=Zl(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const o=Zl(e,n);return((r=o[o.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=we(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>o=>{let l=[];if(!(e!=null&&e.length))l=o;else{const a=[...e],c=[...o];for(;c.length&&a.length;){const d=a.shift(),h=c.findIndex(p=>p.id===d);h>-1&&l.push(c.splice(h,1)[0])}l=[...l,...c]}return Vk(l,n,r)},Ce(t.options,"debugTable"))}},Uh=()=>({left:[],right:[]}),Pk={getInitialState:t=>({columnPinning:Uh(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Rn("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(o=>o.id).filter(Boolean);e.setColumnPinning(o=>{var l,a;if(n==="right"){var c,d;return{left:((c=o?.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((d=o?.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var h,p;return{left:[...((h=o?.left)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((p=o?.right)!=null?p:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((l=o?.left)!=null?l:[]).filter(g=>!(r!=null&&r.includes(g))),right:((a=o?.right)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var o,l,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((l=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?l:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(c=>c.id),{left:r,right:o}=e.getState().columnPinning,l=n.some(c=>r?.includes(c)),a=n.some(c=>o?.includes(c));return l?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();return o?(n=(r=e.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=we(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const l=[...r??[],...o??[]];return n.filter(a=>!l.includes(a.column.id))},Ce(e.options,"debugRows")),t.getLeftVisibleCells=we(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(a=>a.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),Ce(e.options,"debugRows")),t.getRightVisibleCells=we(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(a=>a.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),Ce(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Uh():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Uh())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var o,l;return!!((o=r.left)!=null&&o.length||(l=r.right)!=null&&l.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=we(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ce(t.options,"debugColumns")),t.getRightLeafColumns=we(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ce(t.options,"debugColumns")),t.getCenterLeafColumns=we(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const o=[...n??[],...r??[]];return e.filter(l=>!o.includes(l.id))},Ce(t.options,"debugColumns"))}};function $k(t){return t||(typeof document<"u"?document:null)}const Ju={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},qh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Hk={getDefaultColumnDef:()=>Ju,getInitialState:t=>({columnSizing:{},columnSizingInfo:qh(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Rn("columnSizing",t),onColumnSizingInfoChange:Rn("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,o;const l=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Ju.minSize,(r=l??t.columnDef.size)!=null?r:Ju.size),(o=t.columnDef.maxSize)!=null?o:Ju.maxSize)},t.getStart=we(n=>[n,Zl(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((o,l)=>o+l.getSize(),0),Ce(e.options,"debugColumns")),t.getAfter=we(n=>[n,Zl(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((o,l)=>o+l.getSize(),0),Ce(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...o}=n;return o})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var l;n+=(l=o.column.getSize())!=null?l:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),o=r?.getCanResize();return l=>{if(!r||!o||(l.persist==null||l.persist(),Gh(l)&&l.touches&&l.touches.length>1))return;const a=t.getSize(),c=t?t.getLeafHeaders().map(E=>[E.column.id,E.column.getSize()]):[[r.id,r.getSize()]],d=Gh(l)?Math.round(l.touches[0].clientX):l.clientX,h={},p=(E,A)=>{typeof A=="number"&&(e.setColumnSizingInfo(k=>{var N,j;const U=e.options.columnResizeDirection==="rtl"?-1:1,_=(A-((N=k?.startOffset)!=null?N:0))*U,I=Math.max(_/((j=k?.startSize)!=null?j:0),-.999999);return k.columnSizingStart.forEach(Z=>{let[se,me]=Z;h[se]=Math.round(Math.max(me+me*I,0)*100)/100}),{...k,deltaOffset:_,deltaPercentage:I}}),(e.options.columnResizeMode==="onChange"||E==="end")&&e.setColumnSizing(k=>({...k,...h})))},g=E=>p("move",E),v=E=>{p("end",E),e.setColumnSizingInfo(A=>({...A,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=$k(n),S={moveHandler:E=>g(E.clientX),upHandler:E=>{b?.removeEventListener("mousemove",S.moveHandler),b?.removeEventListener("mouseup",S.upHandler),v(E.clientX)}},x={moveHandler:E=>(E.cancelable&&(E.preventDefault(),E.stopPropagation()),g(E.touches[0].clientX),!1),upHandler:E=>{var A;b?.removeEventListener("touchmove",x.moveHandler),b?.removeEventListener("touchend",x.upHandler),E.cancelable&&(E.preventDefault(),E.stopPropagation()),v((A=E.touches[0])==null?void 0:A.clientX)}},C=Uk()?{passive:!1}:!1;Gh(l)?(b?.addEventListener("touchmove",x.moveHandler,C),b?.addEventListener("touchend",x.upHandler,C)):(b?.addEventListener("mousemove",S.moveHandler,C),b?.addEventListener("mouseup",S.upHandler,C)),e.setColumnSizingInfo(E=>({...E,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?qh():(n=t.initialState.columnSizingInfo)!=null?n:qh())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0}}};let Qu=null;function Uk(){if(typeof Qu=="boolean")return Qu;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Qu=t,Qu}function Gh(t){return t.type==="touchstart"}const qk={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Rn("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const o=t.columns;return(n=o.length?o.some(l=>l.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=we(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ce(e.options,"debugRows")),t.getVisibleCells=we(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Ce(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>we(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),Ce(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((o,l)=>({...o,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Zl(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const Gk={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},Kk={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Rn("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,o,l;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&((l=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?l:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Ir.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return tf(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:Ir[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Yk={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Rn("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var o,l;t.setExpanded(r?{}:(o=(l=t.initialState)==null?void 0:l.expanded)!=null?o:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(l=>{const a=l.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var o;const l=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(o=n)!=null?o:!l,!l&&n)return{...a,[t.id]:!0};if(l&&!n){const{[t.id]:c,...d}=a;return d}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r?.[t.id])},t.getCanExpand=()=>{var n,r,o;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((o=t.subRows)!=null&&o.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Ip=0,Bp=10,Kh=()=>({pageIndex:Ip,pageSize:Bp}),Xk={getInitialState:t=>({...t,pagination:{...Kh(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Rn("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const o=l=>Xn(r,l);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(o)},t.resetPagination=r=>{var o;t.setPagination(r?Kh():(o=t.initialState.pagination)!=null?o:Kh())},t.setPageIndex=r=>{t.setPagination(o=>{let l=Xn(r,o.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return l=Math.max(0,Math.min(l,a)),{...o,pageIndex:l}})},t.resetPageIndex=r=>{var o,l;t.setPageIndex(r?Ip:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:Ip)},t.resetPageSize=r=>{var o,l;t.setPageSize(r?Bp:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:Bp)},t.setPageSize=r=>{t.setPagination(o=>{const l=Math.max(1,Xn(r,o.pageSize)),a=o.pageSize*o.pageIndex,c=Math.floor(a/l);return{...o,pageIndex:c,pageSize:l}})},t.setPageCount=r=>t.setPagination(o=>{var l;let a=Xn(r,(l=t.options.pageCount)!=null?l:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),t.getPageOptions=we(()=>[t.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((l,a)=>a)),o},Ce(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,o=t.getPageCount();return o===-1?!0:o===0?!1:r<o-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},Yh=()=>({top:[],bottom:[]}),Jk={getInitialState:t=>({rowPinning:Yh(),...t}),getDefaultOptions:t=>({onRowPinningChange:Rn("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,o)=>{const l=r?t.getLeafRows().map(d=>{let{id:h}=d;return h}):[],a=o?t.getParentRows().map(d=>{let{id:h}=d;return h}):[],c=new Set([...a,t.id,...l]);e.setRowPinning(d=>{var h,p;if(n==="bottom"){var g,v;return{top:((g=d?.top)!=null?g:[]).filter(x=>!(c!=null&&c.has(x))),bottom:[...((v=d?.bottom)!=null?v:[]).filter(x=>!(c!=null&&c.has(x))),...Array.from(c)]}}if(n==="top"){var b,S;return{top:[...((b=d?.top)!=null?b:[]).filter(x=>!(c!=null&&c.has(x))),...Array.from(c)],bottom:((S=d?.bottom)!=null?S:[]).filter(x=>!(c!=null&&c.has(x)))}}return{top:((h=d?.top)!=null?h:[]).filter(x=>!(c!=null&&c.has(x))),bottom:((p=d?.bottom)!=null?p:[]).filter(x=>!(c!=null&&c.has(x)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=e.options;return typeof r=="function"?r(t):(n=r??o)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:o}=e.getState().rowPinning,l=n.some(c=>r?.includes(c)),a=n.some(c=>o?.includes(c));return l?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();if(!o)return-1;const l=(n=o==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=l?.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?Yh():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Yh())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var o,l;return!!((o=r.top)!=null&&o.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var o;return((o=t.options.keepPinnedRows)==null||o?(n??[]).map(a=>{const c=t.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>e.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=we(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),Ce(t.options,"debugRows")),t.getBottomRows=we(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),Ce(t.options,"debugRows")),t.getCenterRows=we(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const o=new Set([...n??[],...r??[]]);return e.filter(l=>!o.has(l.id))},Ce(t.options,"debugRows"))}},Qk={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Rn("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},o=t.getPreGroupedRowModel().flatRows;return e?o.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):o.forEach(l=>{delete r[l.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),o={...n};return t.getRowModel().rows.forEach(l=>{Vp(o,l.id,r,!0,t)}),o}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=we(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Xh(t,n):{rows:[],flatRows:[],rowsById:{}},Ce(t.options,"debugTable")),t.getFilteredSelectedRowModel=we(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Xh(t,n):{rows:[],flatRows:[],rowsById:{}},Ce(t.options,"debugTable")),t.getGroupedSelectedRowModel=we(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Xh(t,n):{rows:[],flatRows:[],rowsById:{}},Ce(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(o=>!n[o.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const o=t.getIsSelected();e.setRowSelection(l=>{var a;if(n=typeof n<"u"?n:!o,t.getCanSelect()&&o===n)return l;const c={...l};return Vp(c,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),c})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Mm(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Fp(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Fp(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var o;n&&t.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Vp=(t,e,n,r,o)=>{var l;const a=o.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(c=>delete t[c]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(l=a.subRows)!=null&&l.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>Vp(t,c.id,n,r,o))};function Xh(t,e){const n=t.getState().rowSelection,r=[],o={},l=function(a,c){return a.map(d=>{var h;const p=Mm(d,n);if(p&&(r.push(d),o[d.id]=d),(h=d.subRows)!=null&&h.length&&(d={...d,subRows:l(d.subRows)}),p)return d}).filter(Boolean)};return{rows:l(e.rows),flatRows:r,rowsById:o}}function Mm(t,e){var n;return(n=e[t.id])!=null?n:!1}function Fp(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let o=!0,l=!1;return t.subRows.forEach(a=>{if(!(l&&!o)&&(a.getCanSelect()&&(Mm(a,e)?l=!0:o=!1),a.subRows&&a.subRows.length)){const c=Fp(a,e);c==="all"?l=!0:(c==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Pp=/([0-9]+)/gm,Zk=(t,e,n)=>E1(Di(t.getValue(n)).toLowerCase(),Di(e.getValue(n)).toLowerCase()),Wk=(t,e,n)=>E1(Di(t.getValue(n)),Di(e.getValue(n))),eN=(t,e,n)=>Em(Di(t.getValue(n)).toLowerCase(),Di(e.getValue(n)).toLowerCase()),tN=(t,e,n)=>Em(Di(t.getValue(n)),Di(e.getValue(n))),nN=(t,e,n)=>{const r=t.getValue(n),o=e.getValue(n);return r>o?1:r<o?-1:0},rN=(t,e,n)=>Em(t.getValue(n),e.getValue(n));function Em(t,e){return t===e?0:t>e?1:-1}function Di(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function E1(t,e){const n=t.split(Pp).filter(Boolean),r=e.split(Pp).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),l=r.shift(),a=parseInt(o,10),c=parseInt(l,10),d=[a,c].sort();if(isNaN(d[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const Pl={alphanumeric:Zk,alphanumericCaseSensitive:Wk,text:eN,textCaseSensitive:tN,datetime:nN,basic:rN},iN={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Rn("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const l=o?.getValue(t.id);if(Object.prototype.toString.call(l)==="[object Date]")return Pl.datetime;if(typeof l=="string"&&(r=!0,l.split(Pp).length>1))return Pl.alphanumeric}return r?Pl.text:Pl.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return tf(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Pl[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const o=t.getNextSortingOrder(),l=typeof n<"u"&&n!==null;e.setSorting(a=>{const c=a?.find(b=>b.id===t.id),d=a?.findIndex(b=>b.id===t.id);let h=[],p,g=l?n:o==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?c?p="toggle":p="add":a!=null&&a.length&&d!==a.length-1?p="replace":c?p="toggle":p="replace",p==="toggle"&&(l||o||(p="remove")),p==="add"){var v;h=[...a,{id:t.id,desc:g}],h.splice(0,h.length-((v=e.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else p==="toggle"?h=a.map(b=>b.id===t.id?{...b,desc:g}:b):p==="remove"?h=a.filter(b=>b.id!==t.id):h=[{id:t.id,desc:g}];return h})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,o;const l=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==l&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(o=e.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":l},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(o=>o.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},oN=[Rk,qk,Fk,Pk,Tk,Ak,Gk,Kk,iN,Bk,Yk,Xk,Jk,Qk,Hk];function sN(t){var e,n;const r=[...oN,...(e=t._features)!=null?e:[]];let o={_features:r};const l=o._features.reduce((v,b)=>Object.assign(v,b.getDefaultOptions==null?void 0:b.getDefaultOptions(o)),{}),a=v=>o.options.mergeOptions?o.options.mergeOptions(l,v):{...l,...v};let d={...{},...(n=t.initialState)!=null?n:{}};o._features.forEach(v=>{var b;d=(b=v.getInitialState==null?void 0:v.getInitialState(d))!=null?b:d});const h=[];let p=!1;const g={_features:r,options:{...l,...t},initialState:d,_queue:v=>{h.push(v),p||(p=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();p=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{o.setState(o.initialState)},setOptions:v=>{const b=Xn(v,o.options);o.options=a(b)},getState:()=>o.options.state,setState:v=>{o.options.onStateChange==null||o.options.onStateChange(v)},_getRowId:(v,b,S)=>{var x;return(x=o.options.getRowId==null?void 0:o.options.getRowId(v,b,S))!=null?x:`${S?[S.id,b].join("."):b}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(v,b)=>{let S=(b?o.getPrePaginationRowModel():o.getRowModel()).rowsById[v];if(!S&&(S=o.getCoreRowModel().rowsById[v],!S))throw new Error;return S},_getDefaultColumnDef:we(()=>[o.options.defaultColumn],v=>{var b;return v=(b=v)!=null?b:{},{header:S=>{const x=S.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:S=>{var x,C;return(x=(C=S.renderValue())==null||C.toString==null?void 0:C.toString())!=null?x:null},...o._features.reduce((S,x)=>Object.assign(S,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...v}},Ce(t,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:we(()=>[o._getColumnDefs()],v=>{const b=function(S,x,C){return C===void 0&&(C=0),S.map(E=>{const A=Ek(o,E,C,x),k=E;return A.columns=k.columns?b(k.columns,A,C+1):[],A})};return b(v)},Ce(t,"debugColumns")),getAllFlatColumns:we(()=>[o.getAllColumns()],v=>v.flatMap(b=>b.getFlatColumns()),Ce(t,"debugColumns")),_getAllFlatColumnsById:we(()=>[o.getAllFlatColumns()],v=>v.reduce((b,S)=>(b[S.id]=S,b),{}),Ce(t,"debugColumns")),getAllLeafColumns:we(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(v,b)=>{let S=v.flatMap(x=>x.getLeafColumns());return b(S)},Ce(t,"debugColumns")),getColumn:v=>o._getAllFlatColumnsById()[v]};Object.assign(o,g);for(let v=0;v<o._features.length;v++){const b=o._features[v];b==null||b.createTable==null||b.createTable(o)}return o}function lN(){return t=>we(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,l,a){l===void 0&&(l=0);const c=[];for(let h=0;h<o.length;h++){const p=wm(t,t._getRowId(o[h],h,a),o[h],h,l,void 0,a?.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,c.push(p),t.options.getSubRows){var d;p.originalSubRows=t.options.getSubRows(o[h],h),(d=p.originalSubRows)!=null&&d.length&&(p.subRows=r(p.originalSubRows,l+1,p))}}return c};return n.rows=r(e),n},Ce(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function aN(t,e,n){return n.options.filterFromLeafRows?uN(t,e,n):cN(t,e,n)}function uN(t,e,n){var r;const o=[],l={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const p=[];for(let v=0;v<d.length;v++){var g;let b=d[v];const S=wm(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(S.columnFilters=b.columnFilters,(g=b.subRows)!=null&&g.length&&h<a){if(S.subRows=c(b.subRows,h+1),b=S,e(b)&&!S.subRows.length){p.push(b),l[b.id]=b,o.push(b);continue}if(e(b)||S.subRows.length){p.push(b),l[b.id]=b,o.push(b);continue}}else b=S,e(b)&&(p.push(b),l[b.id]=b,o.push(b))}return p};return{rows:c(t),flatRows:o,rowsById:l}}function cN(t,e,n){var r;const o=[],l={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const p=[];for(let v=0;v<d.length;v++){let b=d[v];if(e(b)){var g;if((g=b.subRows)!=null&&g.length&&h<a){const x=wm(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);x.subRows=c(b.subRows,h+1),b=x}p.push(b),o.push(b),l[b.id]=b}}return p};return{rows:c(t),flatRows:o,rowsById:l}}function fN(){return t=>we(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let v=0;v<e.flatRows.length;v++)e.flatRows[v].columnFilters={},e.flatRows[v].columnFiltersMeta={};return e}const o=[],l=[];(n??[]).forEach(v=>{var b;const S=t.getColumn(v.id);if(!S)return;const x=S.getFilterFn();x&&o.push({id:v.id,filterFn:x,resolvedValue:(b=x.resolveFilterValue==null?void 0:x.resolveFilterValue(v.value))!=null?b:v.value})});const a=(n??[]).map(v=>v.id),c=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(v=>v.getCanGlobalFilter());r&&c&&d.length&&(a.push("__global__"),d.forEach(v=>{var b;l.push({id:v.id,filterFn:c,resolvedValue:(b=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?b:r})}));let h,p;for(let v=0;v<e.flatRows.length;v++){const b=e.flatRows[v];if(b.columnFilters={},o.length)for(let S=0;S<o.length;S++){h=o[S];const x=h.id;b.columnFilters[x]=h.filterFn(b,x,h.resolvedValue,C=>{b.columnFiltersMeta[x]=C})}if(l.length){for(let S=0;S<l.length;S++){p=l[S];const x=p.id;if(p.filterFn(b,x,p.resolvedValue,C=>{b.columnFiltersMeta[x]=C})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const g=v=>{for(let b=0;b<a.length;b++)if(v.columnFilters[a[b]]===!1)return!1;return!0};return aN(e.rows,g,t)},Ce(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function dN(){return t=>we(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,o=[],l=r.filter(d=>{var h;return(h=t.getColumn(d.id))==null?void 0:h.getCanSort()}),a={};l.forEach(d=>{const h=t.getColumn(d.id);h&&(a[d.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const c=d=>{const h=d.map(p=>({...p}));return h.sort((p,g)=>{for(let b=0;b<l.length;b+=1){var v;const S=l[b],x=a[S.id],C=x.sortUndefined,E=(v=S?.desc)!=null?v:!1;let A=0;if(C){const k=p.getValue(S.id),N=g.getValue(S.id),j=k===void 0,U=N===void 0;if(j||U){if(C==="first")return j?-1:1;if(C==="last")return j?1:-1;A=j&&U?0:j?C:-C}}if(A===0&&(A=x.sortingFn(p,g,S.id)),A!==0)return E&&(A*=-1),x.invertSorting&&(A*=-1),A}return p.index-g.index}),h.forEach(p=>{var g;o.push(p),(g=p.subRows)!=null&&g.length&&(p.subRows=c(p.subRows))}),h};return{rows:c(n.rows),flatRows:o,rowsById:n.rowsById}},Ce(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function $p(t,e){return t?hN(t)?M.createElement(t,e):t:null}function hN(t){return pN(t)||typeof t=="function"||mN(t)}function pN(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function mN(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function gN(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=M.useState(()=>({current:sN(e)})),[r,o]=M.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...t,state:{...r,...t.state},onStateChange:a=>{o(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}var Sa=u1();const R1=l1(Sa);function Ss(t,e,n){let r=n.initialDeps??[],o,l=!0;function a(){var c,d,h;let p;n.key&&((c=n.debug)!=null&&c.call(n))&&(p=Date.now());const g=t();if(!(g.length!==r.length||g.some((S,x)=>r[x]!==S)))return o;r=g;let b;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(b=Date.now()),o=e(...g),n.key&&((h=n.debug)!=null&&h.call(n))){const S=Math.round((Date.now()-p)*100)/100,x=Math.round((Date.now()-b)*100)/100,C=x/16,E=(A,k)=>{for(A=String(A);A.length<k;)A=" "+A;return A};console.info(`%c⏱ ${E(x,5)} /${E(S,5)} ms`,`
|
|
13
|
+
font-size: .6rem;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(l&&n.skipInitialOnChange)&&n.onChange(o),l=!1,o}return a.updateDeps=c=>{r=c},a}function Ob(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const yN=(t,e)=>Math.abs(t-e)<1.01,vN=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},kb=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},bN=t=>t,SN=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let o=e;o<=n;o++)r.push(o);return r},xN=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const o=a=>{const{width:c,height:d}=a;e({width:Math.round(c),height:Math.round(d)})};if(o(kb(n)),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(a=>{const c=()=>{const d=a[0];if(d?.borderBoxSize){const h=d.borderBoxSize[0];if(h){o({width:h.inlineSize,height:h.blockSize});return}}o(kb(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},Nb={passive:!0},Db=typeof window>"u"?!0:"onscrollend"in window,wN=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const l=t.options.useScrollendEvent&&Db?()=>{}:vN(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),a=p=>()=>{const{horizontal:g,isRtl:v}=t.options;o=g?n.scrollLeft*(v&&-1||1):n.scrollTop,l(),e(o,p)},c=a(!0),d=a(!1);n.addEventListener("scroll",c,Nb);const h=t.options.useScrollendEvent&&Db;return h&&n.addEventListener("scrollend",d,Nb),()=>{n.removeEventListener("scroll",c),h&&n.removeEventListener("scrollend",d)}},CN=(t,e,n)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},MN=(t,{adjustments:e=0,behavior:n},r)=>{var o,l;const a=t+e;(l=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class EN{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const a=()=>{const c=l.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var l;return(l=r())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=r())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bN,rangeExtractor:SN,onChange:()=>{},measureElement:CN,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Ss(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,l=new Map;for(let a=r-1;a>=0;a--){const c=n[a];if(o.has(c.lane))continue;const d=l.get(c.lane);if(d==null||c.end>d.end?l.set(c.lane,c):c.end<d.end&&o.set(c.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=Ss(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,l,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:a,lanes:c}),{key:!1}),this.getMeasurements=Ss(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:a,lanes:c},d)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const v of this.laneAssignments.keys())v>=n&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const h=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,h),g=new Array(c).fill(void 0);for(let v=0;v<h;v++){const b=p[v];b&&(g[b.lane]=v)}for(let v=h;v<n;v++){const b=l(v),S=this.laneAssignments.get(v);let x,C;if(S!==void 0&&this.options.lanes>1){x=S;const N=g[x],j=N!==void 0?p[N]:void 0;C=j?j.end+this.options.gap:r+o}else{const N=this.options.lanes===1?p[v-1]:this.getFurthestMeasurement(p,v);C=N?N.end+this.options.gap:r+o,x=N?N.lane:v%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(v,x)}const E=d.get(b),A=typeof E=="number"?E:this.options.estimateSize(v),k=C+A;p[v]={index:v,start:C,size:A,end:k,key:b,lane:x},g[x]=v}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ss(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,l)=>this.range=n.length>0&&r>0?RN({measurements:n,outerSize:r,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ss(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,l,a)=>l===null||a===null?[]:n({startIndex:l,endIndex:a,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,o-l),c=Math.min(this.options.count-1,o+l);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),l=this.elementsCache.get(o);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o;const l=this.measurementsCache[n];if(!l)return;const a=this.itemSizeCache.get(l.key)??l.size,c=r-a;c!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,c,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.getVirtualItems=Ss(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let l=0,a=n.length;l<a;l++){const c=n[l],d=r[c];o.push(d)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Ob(r[T1(0,r.length-1,o=>Ob(r[o]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+l?"end":"start"),r==="center"?n+=(o-l)/2:r==="end"&&(n-=l);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=l+o-this.options.scrollPaddingEnd)r="end";else if(a.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const c=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:a,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.getOffsetForIndex(n,r);if(!l)return;const[a,c]=l,d=this.now();this.scrollState={index:n,align:c,behavior:o,startedAt:d,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,l=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const l=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&l.some(c=>c===null);){const c=r[a];l[c.lane]===null&&(l[c.lane]=c.end),a--}o=Math.max(...l.filter(c=>c!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,l=1,a=o!==this.scrollState.lastTargetOffset;if(!a&&yN(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const T1=(t,e,n,r)=>{for(;t<=e;){const o=(t+e)/2|0,l=n(o);if(l<r)t=o+1;else if(l>r)e=o-1;else return o}return t>0?t-1:0};function RN({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const o=t.length-1,l=d=>t[d].start;if(t.length<=r)return{startIndex:0,endIndex:o};let a=T1(0,o,l,n),c=a;if(r===1)for(;c<o&&t[c].end<n+e;)c++;else if(r>1){const d=Array(r).fill(0);for(;c<o&&d.some(p=>p<n+e);){const p=t[c];d[p.lane]=p.end,c++}const h=Array(r).fill(n+e);for(;a>=0&&h.some(p=>p>=n);){const p=t[a];h[p.lane]=p.start,a--}a=Math.max(0,a-a%r),c=Math.min(o,c+(r-1-c%r))}return{startIndex:a,endIndex:c}}const _b=typeof document<"u"?M.useLayoutEffect:M.useEffect;function TN({useFlushSync:t=!0,...e}){const n=M.useReducer(()=>({}),{})[1],r={...e,onChange:(l,a)=>{var c;t&&a?Sa.flushSync(n):n(),(c=e.onChange)==null||c.call(e,l,a)}},[o]=M.useState(()=>new EN(r));return o.setOptions(r),_b(()=>o._didMount(),[]),_b(()=>o._willUpdate()),o}function AN(t){return TN({observeElementRect:xN,observeElementOffset:wN,scrollToFn:MN,...t})}const gc=["emerald","purple","sky","pink","red","zinc","lime","violet","fuchsia","teal","amber","rose","orange","cyan","indigo","yellow","green","coral","blue","stone"];function A1(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=A1(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function O1(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=A1(t))&&(r&&(r+=" "),r+=e);return r}const ON=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},kN=(t,e)=>({classGroupId:t,validator:e}),k1=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Mc="-",zb=[],NN="arbitrary..",DN=t=>{const e=zN(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return _N(a);const c=a.split(Mc),d=c[0]===""&&c.length>1?1:0;return N1(c,d,e)},getConflictingClassGroupIds:(a,c)=>{if(c){const d=r[a],h=n[a];return d?h?ON(h,d):d:h||zb}return n[a]||zb}}},N1=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const h=N1(t,e+1,l);if(h)return h}const a=n.validators;if(a===null)return;const c=e===0?t.join(Mc):t.slice(e).join(Mc),d=a.length;for(let h=0;h<d;h++){const p=a[h];if(p.validator(c))return p.classGroupId}},_N=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?NN+r:void 0})(),zN=t=>{const{theme:e,classGroups:n}=t;return jN(n,e)},jN=(t,e)=>{const n=k1();for(const r in t){const o=t[r];Rm(o,n,r,e)}return n},Rm=(t,e,n,r)=>{const o=t.length;for(let l=0;l<o;l++){const a=t[l];LN(a,e,n,r)}},LN=(t,e,n,r)=>{if(typeof t=="string"){IN(t,e,n);return}if(typeof t=="function"){BN(t,e,n,r);return}VN(t,e,n,r)},IN=(t,e,n)=>{const r=t===""?e:D1(e,t);r.classGroupId=n},BN=(t,e,n,r)=>{if(FN(t)){Rm(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(kN(n,t))},VN=(t,e,n,r)=>{const o=Object.entries(t),l=o.length;for(let a=0;a<l;a++){const[c,d]=o[a];Rm(d,D1(e,c),n,r)}},D1=(t,e)=>{let n=t;const r=e.split(Mc),o=r.length;for(let l=0;l<o;l++){const a=r[l];let c=n.nextPart.get(a);c||(c=k1(),n.nextPart.set(a,c)),n=c}return n},FN=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,PN=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(l,a)=>{n[l]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=r[l])!==void 0)return o(l,a),a},set(l,a){l in n?n[l]=a:o(l,a)}}},Hp="!",jb=":",$N=[],Lb=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),HN=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const l=[];let a=0,c=0,d=0,h;const p=o.length;for(let x=0;x<p;x++){const C=o[x];if(a===0&&c===0){if(C===jb){l.push(o.slice(d,x)),d=x+1;continue}if(C==="/"){h=x;continue}}C==="["?a++:C==="]"?a--:C==="("?c++:C===")"&&c--}const g=l.length===0?o:o.slice(d);let v=g,b=!1;g.endsWith(Hp)?(v=g.slice(0,-1),b=!0):g.startsWith(Hp)&&(v=g.slice(1),b=!0);const S=h&&h>d?h-d:void 0;return Lb(l,b,v,S)};if(e){const o=e+jb,l=r;r=a=>a.startsWith(o)?l(a.slice(o.length)):Lb($N,!1,a,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},UN=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l<n.length;l++){const a=n[l],c=a[0]==="[",d=e.has(a);c||d?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},qN=t=>({cache:PN(t.cacheSize),parseClassName:HN(t),sortModifiers:UN(t),...DN(t)}),GN=/\s+/,KN=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=e,a=[],c=t.trim().split(GN);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:x}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let C=!!x,E=r(C?S.substring(0,x):S);if(!E){if(!C){d=p+(d.length>0?" "+d:d);continue}if(E=r(S),!E){d=p+(d.length>0?" "+d:d);continue}C=!1}const A=v.length===0?"":v.length===1?v[0]:l(v).join(":"),k=b?A+Hp:A,N=k+E;if(a.indexOf(N)>-1)continue;a.push(N);const j=o(E,C);for(let U=0;U<j.length;++U){const _=j[U];a.push(k+_)}d=p+(d.length>0?" "+d:d)}return d},YN=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=_1(n))&&(o&&(o+=" "),o+=r);return o},_1=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=_1(t[r]))&&(n&&(n+=" "),n+=e);return n},XN=(t,...e)=>{let n,r,o,l;const a=d=>{const h=e.reduce((p,g)=>g(p),t());return n=qN(h),r=n.cache.get,o=n.cache.set,l=c,c(d)},c=d=>{const h=r(d);if(h)return h;const p=KN(d,n);return o(d,p),p};return l=a,(...d)=>l(YN(...d))},JN=[],wt=t=>{const e=n=>n[t]||JN;return e.isThemeGetter=!0,e},z1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,j1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QN=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ZN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yi=t=>QN.test(t),_e=t=>!!t&&!Number.isNaN(Number(t)),vi=t=>!!t&&Number.isInteger(Number(t)),Jh=t=>t.endsWith("%")&&_e(t.slice(0,-1)),jr=t=>ZN.test(t),L1=()=>!0,rD=t=>WN.test(t)&&!eD.test(t),Tm=()=>!1,iD=t=>tD.test(t),oD=t=>nD.test(t),sD=t=>!fe(t)&&!de(t),lD=t=>Ii(t,V1,Tm),fe=t=>z1.test(t),ao=t=>Ii(t,F1,rD),Ib=t=>Ii(t,mD,_e),aD=t=>Ii(t,$1,L1),uD=t=>Ii(t,P1,Tm),Bb=t=>Ii(t,I1,Tm),cD=t=>Ii(t,B1,oD),Zu=t=>Ii(t,H1,iD),de=t=>j1.test(t),$l=t=>Eo(t,F1),fD=t=>Eo(t,P1),Vb=t=>Eo(t,I1),dD=t=>Eo(t,V1),hD=t=>Eo(t,B1),Wu=t=>Eo(t,H1,!0),pD=t=>Eo(t,$1,!0),Ii=(t,e,n)=>{const r=z1.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Eo=(t,e,n=!1)=>{const r=j1.exec(t);return r?r[1]?e(r[1]):n:!1},I1=t=>t==="position"||t==="percentage",B1=t=>t==="image"||t==="url",V1=t=>t==="length"||t==="size"||t==="bg-size",F1=t=>t==="length",mD=t=>t==="number",P1=t=>t==="family-name",$1=t=>t==="number"||t==="weight",H1=t=>t==="shadow",gD=()=>{const t=wt("color"),e=wt("font"),n=wt("text"),r=wt("font-weight"),o=wt("tracking"),l=wt("leading"),a=wt("breakpoint"),c=wt("container"),d=wt("spacing"),h=wt("radius"),p=wt("shadow"),g=wt("inset-shadow"),v=wt("text-shadow"),b=wt("drop-shadow"),S=wt("blur"),x=wt("perspective"),C=wt("aspect"),E=wt("ease"),A=wt("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...N(),de,fe],U=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[de,fe,d],Z=()=>[yi,"full","auto",...I()],se=()=>[vi,"none","subgrid",de,fe],me=()=>["auto",{span:["full",vi,de,fe]},vi,de,fe],ue=()=>[vi,"auto",de,fe],be=()=>["auto","min","max","fr",de,fe],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ye=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...I()],$=()=>[yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],B=()=>[yi,"screen","full","dvw","lvw","svw","min","max","fit",...I()],q=()=>[yi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],K=()=>[t,de,fe],D=()=>[...N(),Vb,Bb,{position:[de,fe]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ee=()=>["auto","cover","contain",dD,lD,{size:[de,fe]}],te=()=>[Jh,$l,ao],oe=()=>["","none","full",h,de,fe],ae=()=>["",_e,$l,ao],he=()=>["solid","dashed","dotted","double"],Ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[_e,Jh,Vb,Bb],on=()=>["","none",S,de,fe],ft=()=>["none",_e,de,fe],St=()=>["none",_e,de,fe],Ft=()=>[_e,de,fe],Pt=()=>[yi,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[jr],breakpoint:[jr],color:[L1],container:[jr],"drop-shadow":[jr],ease:["in","out","in-out"],font:[sD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[jr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[jr],shadow:[jr],spacing:["px",_e],text:[jr],"text-shadow":[jr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yi,fe,de,C]}],container:["container"],columns:[{columns:[_e,fe,de,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[vi,"auto",de,fe]}],basis:[{basis:[yi,"full","auto",c,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,yi,"auto","initial","none",fe]}],grow:[{grow:["",_e,de,fe]}],shrink:[{shrink:["",_e,de,fe]}],order:[{order:[vi,"first","last","none",de,fe]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...ye(),"normal"]}],"justify-self":[{"justify-self":["auto",...ye()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...ye(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ye(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...ye(),"baseline"]}],"place-self":[{"place-self":["auto",...ye()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[c,"screen",...$()]}],"min-w":[{"min-w":[c,"screen","none",...$()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,$l,ao]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pD,aD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jh,fe]}],"font-family":[{font:[fD,uD,e]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,de,fe]}],"line-clamp":[{"line-clamp":[_e,"none",de,Ib]}],leading:[{leading:[l,...I()]}],"list-image":[{"list-image":["none",de,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",de,ao]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[_e,"auto",de,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vi,de,fe],radial:["",de,fe],conic:[vi,de,fe]},hD,cD]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-bs":[{"border-bs":K()}],"border-color-be":[{"border-be":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,de,fe]}],"outline-w":[{outline:["",_e,$l,ao]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",p,Wu,Zu]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",g,Wu,Zu]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[_e,ao]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",v,Wu,Zu]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[_e,de,fe]}],"mix-blend":[{"mix-blend":[...Ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[de,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,fe]}],filter:[{filter:["","none",de,fe]}],blur:[{blur:on()}],brightness:[{brightness:[_e,de,fe]}],contrast:[{contrast:[_e,de,fe]}],"drop-shadow":[{"drop-shadow":["","none",b,Wu,Zu]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",_e,de,fe]}],"hue-rotate":[{"hue-rotate":[_e,de,fe]}],invert:[{invert:["",_e,de,fe]}],saturate:[{saturate:[_e,de,fe]}],sepia:[{sepia:["",_e,de,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",de,fe]}],"backdrop-blur":[{"backdrop-blur":on()}],"backdrop-brightness":[{"backdrop-brightness":[_e,de,fe]}],"backdrop-contrast":[{"backdrop-contrast":[_e,de,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,de,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,de,fe]}],"backdrop-invert":[{"backdrop-invert":["",_e,de,fe]}],"backdrop-opacity":[{"backdrop-opacity":[_e,de,fe]}],"backdrop-saturate":[{"backdrop-saturate":[_e,de,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,de,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",de,fe]}],ease:[{ease:["linear","initial",E,de,fe]}],delay:[{delay:[_e,de,fe]}],animate:[{animate:["none",A,de,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,de,fe]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:ft()}],"rotate-x":[{"rotate-x":ft()}],"rotate-y":[{"rotate-y":ft()}],"rotate-z":[{"rotate-z":ft()}],scale:[{scale:St()}],"scale-x":[{"scale-x":St()}],"scale-y":[{"scale-y":St()}],"scale-z":[{"scale-z":St()}],"scale-3d":["scale-3d"],skew:[{skew:Ft()}],"skew-x":[{"skew-x":Ft()}],"skew-y":[{"skew-y":Ft()}],transform:[{transform:[de,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pt()}],"translate-x":[{"translate-x":Pt()}],"translate-y":[{"translate-y":Pt()}],"translate-z":[{"translate-z":Pt()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,fe]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[_e,$l,ao,Ib]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},yD=XN(gD);function De(...t){return yD(O1(t))}const Qh={amber:"bg-amber-50/90 text-amber-700 dark:bg-amber-400/10 dark:text-amber-200",blue:"bg-blue-50/90 text-blue-700 dark:bg-blue-400/10 dark:text-blue-200",coral:"bg-rose-50/90 text-rose-700 dark:bg-rose-400/10 dark:text-rose-200",cyan:"bg-cyan-50/90 text-cyan-700 dark:bg-cyan-400/10 dark:text-cyan-200",emerald:"bg-emerald-50/90 text-emerald-700 dark:bg-emerald-400/10 dark:text-emerald-200",fuchsia:"bg-fuchsia-50/90 text-fuchsia-700 dark:bg-fuchsia-400/10 dark:text-fuchsia-200",green:"bg-green-50/90 text-green-700 dark:bg-green-400/10 dark:text-green-200",indigo:"bg-indigo-50/90 text-indigo-700 dark:bg-indigo-400/10 dark:text-indigo-200",lime:"bg-lime-50/90 text-lime-700 dark:bg-lime-400/10 dark:text-lime-200",orange:"bg-orange-50/90 text-orange-700 dark:bg-orange-400/10 dark:text-orange-200",pink:"bg-pink-50/90 text-pink-700 dark:bg-pink-400/10 dark:text-pink-200",purple:"bg-purple-50/90 text-purple-700 dark:bg-purple-400/10 dark:text-purple-200",red:"bg-red-50/90 text-red-700 dark:bg-red-400/10 dark:text-red-200",rose:"bg-rose-50/90 text-rose-700 dark:bg-rose-400/10 dark:text-rose-200",sky:"bg-sky-50/90 text-sky-700 dark:bg-sky-400/10 dark:text-sky-200",stone:"bg-stone-50/95 text-stone-700 dark:bg-white/5 dark:text-stone-100",teal:"bg-teal-50/90 text-teal-700 dark:bg-teal-400/10 dark:text-teal-200",violet:"bg-violet-50/90 text-violet-700 dark:bg-violet-400/10 dark:text-violet-200",yellow:"bg-yellow-50/90 text-yellow-700 dark:bg-yellow-400/10 dark:text-yellow-200",zinc:"bg-zinc-50/95 text-zinc-700 dark:bg-white/5 dark:text-zinc-100"};function Ec(t){return t.trim().toUpperCase()}function vD(t){let e=0;for(const n of t)e=e*31+n.charCodeAt(0)>>>0;return e%gc.length}function bD(t,e){if(!e)return null;const n=Ec(t);for(const[r,o]of Object.entries(e))if(o&&Ec(r)===n)return o;return null}function SD(t,e,n){const r=Ec(t),o=bD(t,n);if(o)return Qh[o];const l=e?.findIndex(a=>Ec(a)===r)??-1;return l>=0?Qh[gc[l%gc.length]]:Qh[gc[vD(r)]]}function xD({className:t,colors:e,options:n,value:r}){return T.jsx("span",{className:De("inline-flex max-w-full items-center rounded-md px-2 py-1 text-sm leading-none font-medium whitespace-nowrap shadow-[0_1px_2px_rgba(15,23,42,0.04)] dark:shadow-none",SD(r,n,e),t),title:r,children:T.jsx("span",{className:"truncate",children:r})})}function wD(t="left"){switch(t){case"center":return"justify-center text-center";case"right":return"justify-end text-right";default:return"justify-start text-left"}}function CD(t){const e=t instanceof Date?t:new Date(t);return Number.isNaN(e.getTime())?String(t):new Intl.DateTimeFormat(void 0,{dateStyle:"medium"}).format(e)}function MD(t){return new Intl.NumberFormat(void 0,{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function U1(t,e,n){return t==null||t===""?T.jsx("span",{className:"text-muted-foreground",children:"-"}):e==="enum"?T.jsx(xD,{colors:n?.enumColors,options:n?.enumOptions,value:String(t)}):e==="boolean"||typeof t=="boolean"?T.jsx("span",{className:De("inline-flex min-w-16 items-center justify-center rounded-full border px-2 py-1 text-[11px] font-medium",t?"border-border bg-accent text-accent-foreground":"border-border bg-muted text-muted-foreground"),children:t?"True":"False"}):e==="number"||typeof t=="number"?MD(Number(t)):e==="date"||t instanceof Date?CD(t):Array.isArray(t)||typeof t=="object"?T.jsx("code",{className:"rounded bg-muted px-1.5 py-1 font-mono text-[11px] text-muted-foreground",children:JSON.stringify(t)}):String(t)}function ED(t,e){const n=Array.from(new Set(e.map(l=>l.trim()).filter(Boolean))).sort((l,a)=>a.length-l.length);if(n.length===0)return[t];const r=new RegExp(`(${n.map(l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"gi");return t.split(r).map((l,a)=>n.some(d=>l.toLowerCase()===d.toLowerCase())?T.jsx("mark",{className:"rounded-sm bg-primary/20 ring-2 ring-primary/20 dark:bg-primary/50 dark:text-white dark:ring-primary/80",children:l},`${l}-${a}`):T.jsx(M.Fragment,{children:l},`${l}-${a}`))}function RD(t,e,n){const r=ED(t,e);if(M.isValidElement(n)){const o=n;if(typeof o.props.children=="string")return M.cloneElement(o,void 0,r)}return T.jsx("span",{className:"whitespace-pre-wrap",children:r})}function Fb({checked:t,indeterminate:e,onCheckedChange:n,ariaLabel:r}){const o=M.useRef(null);return M.useEffect(()=>{o.current&&(o.current.indeterminate=!!e&&!t)},[t,e]),T.jsxs("label",{className:"inline-flex cursor-pointer items-center justify-center",children:[T.jsx("input",{ref:o,"aria-label":r,checked:t,className:"peer sr-only",onChange:l=>n(l.target.checked),type:"checkbox"}),T.jsxs("span",{className:De("flex size-5 items-center justify-center rounded-[6px] border border-border bg-background text-primary-foreground shadow-xs transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring/50",(t||e)&&"border-primary bg-primary"),children:[e&&!t?T.jsx(lk,{className:"size-3.5"}):null,t?T.jsx($s,{className:"size-3.5"}):null]})]})}function TD({cell:t,highlightTerms:e=[],paddingLeft:n,paddingRight:r}){const o=t.column.columnDef.meta??{},l=t.getValue(),a=$p(t.column.columnDef.cell,t.getContext()),c=o.sticky==="left",d=o.kind==="selection",h=o.truncate??!0,g=o.kind==="text"&&o.highlightMatches!==!1&&typeof l=="string"&&e.length>0?RD(l,e,a):a??U1(l,o.kind,{enumColors:o.enumColors,enumOptions:o.enumOptions});return T.jsx("td",{"data-sticky-cell":c?"true":"false",className:De("flex shrink-0 border-b border-border px-2 py-1.5 align-middle text-sm text-foreground",wD(o.align),c&&"sticky left-0 z-10 border-r border-r-border bg-card",o.cellClassName),style:{paddingLeft:n,paddingRight:r,width:t.column.getSize()},children:T.jsx("div",{className:De(d?"flex w-full items-center justify-center":h?"min-w-0 truncate":"w-full min-w-0 break-words whitespace-normal"),children:g})})}const AD={text:Sk,enum:ik,number:ek,boolean:Rb,date:LO,json:zO,selection:Rb};function Rc({kind:t,...e}){const n=AD[t];return T.jsx(n,{...e})}function OD(t){return/\d{4}-\d{2}-\d{2}/.test(t)?!Number.isNaN(Date.parse(t)):!1}function kD(t){const e=t.find(n=>n!=null);return e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="number"?"number":typeof e=="string"&&OD(e)?"date":e&&typeof e=="object"?"json":"text"}function ND(t="left"){switch(t){case"center":return"justify-center text-center";case"right":return"justify-end text-right";default:return"justify-start text-left"}}function DD({sorted:t}){return t==="asc"?T.jsx(kO,{className:"size-3.5 text-foreground"}):t==="desc"?T.jsx(AO,{className:"size-3.5 text-foreground"}):null}function _D({header:t,highlightEnabled:e=!1,onToggleHighlight:n,paddingLeft:r,paddingRight:o,scrollContainerRef:l}){const a=t.column.columnDef.meta??{},c=t.column.getIsSorted(),d=t.column.getCanSort(),h=ND(a.align),p=a.sticky==="left";return T.jsxs("th",{className:De("relative flex shrink-0 border-b border-gray-300 bg-background py-2 align-middle text-xs font-medium tracking-wide text-muted-foreground uppercase dark:border-border",p&&"sticky left-0 z-20 border-r border-r-border bg-background",a.headerClassName),style:{width:t.getSize()},children:[t.isPlaceholder?null:d?T.jsx("div",{className:"flex w-full min-w-0 items-center gap-2",children:T.jsxs("button",{className:De("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1 transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none",h),onClick:t.column.getToggleSortingHandler(),style:{paddingLeft:r,paddingRight:o},type:"button",children:[a.kind&&a.kind!=="selection"?T.jsx(Rc,{className:"size-3.5 shrink-0 text-muted-foreground",kind:a.kind}):null,T.jsx("span",{className:"truncate font-medium text-foreground normal-case",children:$p(t.column.columnDef.header,t.getContext())}),T.jsx(DD,{sorted:c})]})}):T.jsxs("div",{className:De("flex w-full min-w-0 items-center gap-1 px-0.5 py-1",h),style:{paddingLeft:r,paddingRight:o},children:[a.kind&&a.kind!=="selection"?T.jsx(Rc,{className:"size-3.5 shrink-0 text-muted-foreground",kind:a.kind}):null,T.jsx("span",{className:"truncate font-medium text-foreground normal-case",children:$p(t.column.columnDef.header,t.getContext())}),a.kind==="text"&&n?T.jsx("button",{className:De("inline-flex size-5 items-center justify-center rounded-sm border",e?"border-border bg-accent text-accent-foreground":"border-transparent text-muted-foreground"),onClick:n,type:"button",children:T.jsx(Sm,{className:"size-3"})}):null]}),t.column.getCanResize()?T.jsx(zD,{header:t,scrollContainerRef:l}):null]})}function zD({header:t,scrollContainerRef:e}){const n=t.column.getIsResizing(),r=M.useRef(null),[o,l]=M.useState(null),a=n?`translateX(${t.getContext().table.getState().columnSizingInfo.deltaOffset??0}px)`:"";return M.useLayoutEffect(()=>{if(!n||!r.current||!e.current){l(null);return}const c=()=>{if(!r.current||!e.current)return;const d=r.current.getBoundingClientRect(),h=e.current.getBoundingClientRect();l({bottom:Math.max(window.innerHeight-h.bottom,0),left:d.left,top:h.top})};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n,e]),T.jsxs(T.Fragment,{children:[n&&o?Sa.createPortal(T.jsx("div",{className:"pointer-events-none fixed z-[100] w-1 animate-in cursor-col-resize bg-border transition-colors duration-75 zoom-in-50",style:{bottom:o.bottom,left:o.left,top:o.top,transform:a}}),document.body):null,T.jsx("div",{ref:r,className:De("absolute top-0 right-[-2px] z-[100] h-full w-1 cursor-col-resize touch-none rounded-full bg-border opacity-0 transition-opacity select-none hover:opacity-100",n&&"opacity-100"),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler()})]})}const Pb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$b=O1,Am=(t,e)=>n=>{var r;if(e?.variants==null)return $b(t,n?.class,n?.className);const{variants:o,defaultVariants:l}=e,a=Object.keys(o).map(h=>{const p=n?.[h],g=l?.[h];if(p===null)return null;const v=Pb(p)||Pb(g);return o[h][v]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,v]=p;return v===void 0||(h[g]=v),h},{}),d=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:v,...b}=p;return Object.entries(b).every(S=>{let[x,C]=S;return Array.isArray(C)?C.includes({...l,...c}[x]):{...l,...c}[x]===C})?[...h,g,v]:h},[]);return $b(t,a,d,n?.class,n?.className)};function Hb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function nf(...t){return e=>{let n=!1;const r=t.map(o=>{const l=Hb(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():Hb(t[o],null)}}}}function pn(...t){return M.useCallback(nf(...t),t)}function oa(t){const e=LD(t),n=M.forwardRef((r,o)=>{const{children:l,...a}=r,c=M.Children.toArray(l),d=c.find(BD);if(d){const h=d.props.children,p=c.map(g=>g===d?M.Children.count(h)>1?M.Children.only(null):M.isValidElement(h)?h.props.children:null:g);return T.jsx(e,{...a,ref:o,children:M.isValidElement(h)?M.cloneElement(h,void 0,p):null})}return T.jsx(e,{...a,ref:o,children:l})});return n.displayName=`${t}.Slot`,n}var jD=oa("Slot");function LD(t){const e=M.forwardRef((n,r)=>{const{children:o,...l}=n;if(M.isValidElement(o)){const a=FD(o),c=VD(l,o.props);return o.type!==M.Fragment&&(c.ref=r?nf(r,a):a),M.cloneElement(o,c)}return M.Children.count(o)>1?M.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var ID=Symbol("radix.slottable");function BD(t){return M.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ID}function VD(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]=(...c)=>{const d=l(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...t,...n}}function FD(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 PD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yt=PD.reduce((t,e)=>{const n=oa(`Primitive.${e}`),r=M.forwardRef((o,l)=>{const{asChild:a,...c}=o,d=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(d,{...c,ref:l})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function q1(t,e){t&&Sa.flushSync(()=>t.dispatchEvent(e))}function Hs(t,e=[]){let n=[];function r(l,a){const c=M.createContext(a),d=n.length;n=[...n,a];const h=g=>{const{scope:v,children:b,...S}=g,x=v?.[t]?.[d]||c,C=M.useMemo(()=>S,Object.values(S));return T.jsx(x.Provider,{value:C,children:b})};h.displayName=l+"Provider";function p(g,v){const b=v?.[t]?.[d]||c,S=M.useContext(b);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${l}\``)}return[h,p]}const o=()=>{const l=n.map(a=>M.createContext(a));return function(c){const d=c?.[t]||l;return M.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return o.scopeName=t,[r,$D(o,...e)]}function $D(...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((c,{useScope:d,scopeName:h})=>{const g=d(l)[`__scope${h}`];return{...c,...g}},{});return M.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function G1(t){const e=t+"CollectionProvider",[n,r]=Hs(e),[o,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:C,children:E}=x,A=tn.useRef(null),k=tn.useRef(new Map).current;return T.jsx(o,{scope:C,itemMap:k,collectionRef:A,children:E})};a.displayName=e;const c=t+"CollectionSlot",d=oa(c),h=tn.forwardRef((x,C)=>{const{scope:E,children:A}=x,k=l(c,E),N=pn(C,k.collectionRef);return T.jsx(d,{ref:N,children:A})});h.displayName=c;const p=t+"CollectionItemSlot",g="data-radix-collection-item",v=oa(p),b=tn.forwardRef((x,C)=>{const{scope:E,children:A,...k}=x,N=tn.useRef(null),j=pn(C,N),U=l(p,E);return tn.useEffect(()=>(U.itemMap.set(N,{ref:N,...k}),()=>{U.itemMap.delete(N)})),T.jsx(v,{[g]:"",ref:j,children:A})});b.displayName=p;function S(x){const C=l(t+"CollectionConsumer",x);return tn.useCallback(()=>{const A=C.collectionRef.current;if(!A)return[];const k=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((U,_)=>k.indexOf(U.ref.current)-k.indexOf(_.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:h,ItemSlot:b},S,r]}function je(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}var _i=globalThis?.document?M.useLayoutEffect:()=>{},HD=a1[" useInsertionEffect ".trim().toString()]||_i;function rf({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,l,a]=UD({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:o;{const p=M.useRef(t!==void 0);M.useEffect(()=>{const g=p.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"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=c},[c,r])}const h=M.useCallback(p=>{if(c){const g=qD(p)?p(t):p;g!==t&&a.current?.(g)}else l(p)},[c,t,l,a]);return[d,h]}function UD({defaultProp:t,onChange:e}){const[n,r]=M.useState(t),o=M.useRef(n),l=M.useRef(e);return HD(()=>{l.current=e},[e]),M.useEffect(()=>{o.current!==n&&(l.current?.(n),o.current=n)},[n,o]),[n,r,l]}function qD(t){return typeof t=="function"}function GD(t,e){return M.useReducer((n,r)=>e[n][r]??n,t)}var xa=t=>{const{present:e,children:n}=t,r=KD(e),o=typeof n=="function"?n({present:r.isPresent}):M.Children.only(n),l=pn(r.ref,YD(o));return typeof n=="function"||r.isPresent?M.cloneElement(o,{ref:l}):null};xa.displayName="Presence";function KD(t){const[e,n]=M.useState(),r=M.useRef(null),o=M.useRef(t),l=M.useRef("none"),a=t?"mounted":"unmounted",[c,d]=GD(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const h=ec(r.current);l.current=c==="mounted"?h:"none"},[c]),_i(()=>{const h=r.current,p=o.current;if(p!==t){const v=l.current,b=ec(h);t?d("MOUNT"):b==="none"||h?.display==="none"?d("UNMOUNT"):d(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),_i(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,g=b=>{const x=ec(r.current).includes(CSS.escape(b.animationName));if(b.target===e&&x&&(d("ANIMATION_END"),!o.current)){const C=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=C)})}},v=b=>{b.target===e&&(l.current=ec(r.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:M.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function ec(t){return t?.animationName||"none"}function YD(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 XD=a1[" useId ".trim().toString()]||(()=>{}),JD=0;function sa(t){const[e,n]=M.useState(XD());return _i(()=>{n(r=>r??String(JD++))},[t]),t||(e?`radix-${e}`:"")}var QD=M.createContext(void 0);function K1(t){const e=M.useContext(QD);return t||e||"ltr"}function Zn(t){const e=M.useRef(t);return M.useEffect(()=>{e.current=t}),M.useMemo(()=>(...n)=>e.current?.(...n),[])}function ZD(t,e=globalThis?.document){const n=Zn(t);M.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 WD="DismissableLayer",Up="dismissableLayer.update",e_="dismissableLayer.pointerDownOutside",t_="dismissableLayer.focusOutside",Ub,Y1=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),X1=M.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:a,onDismiss:c,...d}=t,h=M.useContext(Y1),[p,g]=M.useState(null),v=p?.ownerDocument??globalThis?.document,[,b]=M.useState({}),S=pn(e,_=>g(_)),x=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=x.indexOf(C),A=p?x.indexOf(p):-1,k=h.layersWithOutsidePointerEventsDisabled.size>0,N=A>=E,j=i_(_=>{const I=_.target,Z=[...h.branches].some(se=>se.contains(I));!N||Z||(o?.(_),a?.(_),_.defaultPrevented||c?.())},v),U=o_(_=>{const I=_.target;[...h.branches].some(se=>se.contains(I))||(l?.(_),a?.(_),_.defaultPrevented||c?.())},v);return ZD(_=>{A===h.layers.size-1&&(r?.(_),!_.defaultPrevented&&c&&(_.preventDefault(),c()))},v),M.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Ub=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),qb(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Ub)}},[p,v,n,h]),M.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),qb())},[p,h]),M.useEffect(()=>{const _=()=>b({});return document.addEventListener(Up,_),()=>document.removeEventListener(Up,_)},[]),T.jsx(Yt.div,{...d,ref:S,style:{pointerEvents:k?N?"auto":"none":void 0,...t.style},onFocusCapture:je(t.onFocusCapture,U.onFocusCapture),onBlurCapture:je(t.onBlurCapture,U.onBlurCapture),onPointerDownCapture:je(t.onPointerDownCapture,j.onPointerDownCapture)})});X1.displayName=WD;var n_="DismissableLayerBranch",r_=M.forwardRef((t,e)=>{const n=M.useContext(Y1),r=M.useRef(null),o=pn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),T.jsx(Yt.div,{...t,ref:o})});r_.displayName=n_;function i_(t,e=globalThis?.document){const n=Zn(t),r=M.useRef(!1),o=M.useRef(()=>{});return M.useEffect(()=>{const l=c=>{if(c.target&&!r.current){let d=function(){J1(e_,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=d,e.addEventListener("click",o.current,{once:!0})):d()}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 o_(t,e=globalThis?.document){const n=Zn(t),r=M.useRef(!1);return M.useEffect(()=>{const o=l=>{l.target&&!r.current&&J1(t_,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 qb(){const t=new CustomEvent(Up);document.dispatchEvent(t)}function J1(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?q1(o,l):o.dispatchEvent(l)}var Zh="focusScope.autoFocusOnMount",Wh="focusScope.autoFocusOnUnmount",Gb={bubbles:!1,cancelable:!0},s_="FocusScope",Q1=M.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...a}=t,[c,d]=M.useState(null),h=Zn(o),p=Zn(l),g=M.useRef(null),v=pn(e,x=>d(x)),b=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let x=function(k){if(b.paused||!c)return;const N=k.target;c.contains(N)?g.current=N:bi(g.current,{select:!0})},C=function(k){if(b.paused||!c)return;const N=k.relatedTarget;N!==null&&(c.contains(N)||bi(g.current,{select:!0}))},E=function(k){if(document.activeElement===document.body)for(const j of k)j.removedNodes.length>0&&bi(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const A=new MutationObserver(E);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),A.disconnect()}}},[r,c,b.paused]),M.useEffect(()=>{if(c){Yb.add(b);const x=document.activeElement;if(!c.contains(x)){const E=new CustomEvent(Zh,Gb);c.addEventListener(Zh,h),c.dispatchEvent(E),E.defaultPrevented||(l_(d_(Z1(c)),{select:!0}),document.activeElement===x&&bi(c))}return()=>{c.removeEventListener(Zh,h),setTimeout(()=>{const E=new CustomEvent(Wh,Gb);c.addEventListener(Wh,p),c.dispatchEvent(E),E.defaultPrevented||bi(x??document.body,{select:!0}),c.removeEventListener(Wh,p),Yb.remove(b)},0)}}},[c,h,p,b]);const S=M.useCallback(x=>{if(!n&&!r||b.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(C&&E){const A=x.currentTarget,[k,N]=a_(A);k&&N?!x.shiftKey&&E===N?(x.preventDefault(),n&&bi(k,{select:!0})):x.shiftKey&&E===k&&(x.preventDefault(),n&&bi(N,{select:!0})):E===A&&x.preventDefault()}},[n,r,b.paused]);return T.jsx(Yt.div,{tabIndex:-1,...a,ref:v,onKeyDown:S})});Q1.displayName=s_;function l_(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(bi(r,{select:e}),document.activeElement!==n)return}function a_(t){const e=Z1(t),n=Kb(e,t),r=Kb(e.reverse(),t);return[n,r]}function Z1(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 Kb(t,e){for(const n of t)if(!u_(n,{upTo:e}))return n}function u_(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 c_(t){return t instanceof HTMLInputElement&&"select"in t}function bi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&c_(t)&&e&&t.select()}}var Yb=f_();function f_(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=Xb(t,e),t.unshift(e)},remove(e){t=Xb(t,e),t[0]?.resume()}}}function Xb(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function d_(t){return t.filter(e=>e.tagName!=="A")}var h_="Portal",W1=M.forwardRef((t,e)=>{const{container:n,...r}=t,[o,l]=M.useState(!1);_i(()=>l(!0),[]);const a=n||o&&globalThis?.document?.body;return a?R1.createPortal(T.jsx(Yt.div,{...r,ref:e}),a):null});W1.displayName=h_;var ep=0;function p_(){M.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Jb()),document.body.insertAdjacentElement("beforeend",t[1]??Jb()),ep++,()=>{ep===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ep--}},[])}function Jb(){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 lr=function(){return lr=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},lr.apply(this,arguments)};function ew(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 m_(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 yc="right-scroll-bar-position",vc="width-before-scroll-bar",g_="with-scroll-bars-hidden",y_="--removed-body-scroll-bar-size";function tp(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function v_(t,e){var n=M.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 b_=typeof window<"u"?M.useLayoutEffect:M.useEffect,Qb=new WeakMap;function S_(t,e){var n=v_(null,function(r){return t.forEach(function(o){return tp(o,r)})});return b_(function(){var r=Qb.get(n);if(r){var o=new Set(r),l=new Set(t),a=n.current;o.forEach(function(c){l.has(c)||tp(c,null)}),l.forEach(function(c){o.has(c)||tp(c,a)})}Qb.set(n,t)},[t]),n}function x_(t){return t}function w_(t,e){e===void 0&&(e=x_);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(c){return c!==a})}},assignSyncMedium:function(l){for(r=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(l),a=n}var d=function(){var p=a;a=[],p.forEach(l)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(p){a.push(p),h()},filter:function(p){return a=a.filter(p),n}}}};return o}function C_(t){t===void 0&&(t={});var e=w_(null);return e.options=lr({async:!0,ssr:!1},t),e}var tw=function(t){var e=t.sideCar,n=ew(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 M.createElement(r,lr({},n))};tw.isSideCarExport=!0;function M_(t,e){return t.useMedium(e),tw}var nw=C_(),np=function(){},of=M.forwardRef(function(t,e){var n=M.useRef(null),r=M.useState({onScrollCapture:np,onWheelCapture:np,onTouchMoveCapture:np}),o=r[0],l=r[1],a=t.forwardProps,c=t.children,d=t.className,h=t.removeScrollBar,p=t.enabled,g=t.shards,v=t.sideCar,b=t.noRelative,S=t.noIsolation,x=t.inert,C=t.allowPinchZoom,E=t.as,A=E===void 0?"div":E,k=t.gapMode,N=ew(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=v,U=S_([n,e]),_=lr(lr({},N),o);return M.createElement(M.Fragment,null,p&&M.createElement(j,{sideCar:nw,removeScrollBar:h,shards:g,noRelative:b,noIsolation:S,inert:x,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:k}),a?M.cloneElement(M.Children.only(c),lr(lr({},_),{ref:U})):M.createElement(A,lr({},_,{className:d,ref:U}),c))});of.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};of.classNames={fullWidth:vc,zeroRight:yc};var E_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function R_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=E_();return e&&t.setAttribute("nonce",e),t}function T_(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function A_(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var O_=function(){var t=0,e=null;return{add:function(n){t==0&&(e=R_())&&(T_(e,n),A_(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},k_=function(){var t=O_();return function(e,n){M.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},rw=function(){var t=k_(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},N_={left:0,top:0,right:0,gap:0},rp=function(t){return parseInt(t||"",10)||0},D_=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[rp(n),rp(r),rp(o)]},__=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return N_;var e=D_(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])}},z_=rw(),Ns="data-scroll-locked",j_=function(t,e,n,r){var o=t.left,l=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
|
|
16
|
+
.`.concat(g_,` {
|
|
17
|
+
overflow: hidden `).concat(r,`;
|
|
18
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
19
|
+
}
|
|
20
|
+
body[`).concat(Ns,`] {
|
|
21
|
+
overflow: hidden `).concat(r,`;
|
|
22
|
+
overscroll-behavior: contain;
|
|
23
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
24
|
+
padding-left: `.concat(o,`px;
|
|
25
|
+
padding-top: `).concat(l,`px;
|
|
26
|
+
padding-right: `).concat(a,`px;
|
|
27
|
+
margin-left:0;
|
|
28
|
+
margin-top:0;
|
|
29
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
30
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(yc,` {
|
|
34
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(vc,` {
|
|
38
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(yc," .").concat(yc,` {
|
|
42
|
+
right: 0 `).concat(r,`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.`).concat(vc," .").concat(vc,` {
|
|
46
|
+
margin-right: 0 `).concat(r,`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
body[`).concat(Ns,`] {
|
|
50
|
+
`).concat(y_,": ").concat(c,`px;
|
|
51
|
+
}
|
|
52
|
+
`)},Zb=function(){var t=parseInt(document.body.getAttribute(Ns)||"0",10);return isFinite(t)?t:0},L_=function(){M.useEffect(function(){return document.body.setAttribute(Ns,(Zb()+1).toString()),function(){var t=Zb()-1;t<=0?document.body.removeAttribute(Ns):document.body.setAttribute(Ns,t.toString())}},[])},I_=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;L_();var l=M.useMemo(function(){return __(o)},[o]);return M.createElement(z_,{styles:j_(l,!e,o,n?"":"!important")})},qp=!1;if(typeof window<"u")try{var tc=Object.defineProperty({},"passive",{get:function(){return qp=!0,!0}});window.addEventListener("test",tc,tc),window.removeEventListener("test",tc,tc)}catch{qp=!1}var xs=qp?{passive:!1}:!1,B_=function(t){return t.tagName==="TEXTAREA"},iw=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!B_(t)&&n[e]==="visible")},V_=function(t){return iw(t,"overflowY")},F_=function(t){return iw(t,"overflowX")},Wb=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ow(t,r);if(o){var l=sw(t,r),a=l[1],c=l[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},P_=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},$_=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},ow=function(t,e){return t==="v"?V_(e):F_(e)},sw=function(t,e){return t==="v"?P_(e):$_(e)},H_=function(t,e){return t==="h"&&e==="rtl"?-1:1},U_=function(t,e,n,r,o){var l=H_(t,window.getComputedStyle(e).direction),a=l*r,c=n.target,d=e.contains(c),h=!1,p=a>0,g=0,v=0;do{if(!c)break;var b=sw(t,c),S=b[0],x=b[1],C=b[2],E=x-C-l*S;(S||E)&&ow(t,c)&&(g+=E,v+=S);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},nc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},eS=function(t){return[t.deltaX,t.deltaY]},tS=function(t){return t&&"current"in t?t.current:t},q_=function(t,e){return t[0]===e[0]&&t[1]===e[1]},G_=function(t){return`
|
|
53
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
54
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
55
|
+
`)},K_=0,ws=[];function Y_(t){var e=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),o=M.useState(K_++)[0],l=M.useState(rw)[0],a=M.useRef(t);M.useEffect(function(){a.current=t},[t]),M.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var x=m_([t.lockRef.current],(t.shards||[]).map(tS),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=M.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var E=nc(x),A=n.current,k="deltaX"in x?x.deltaX:A[0]-E[0],N="deltaY"in x?x.deltaY:A[1]-E[1],j,U=x.target,_=Math.abs(k)>Math.abs(N)?"h":"v";if("touches"in x&&_==="h"&&U.type==="range")return!1;var I=window.getSelection(),Z=I&&I.anchorNode,se=Z?Z===U||Z.contains(U):!1;if(se)return!1;var me=Wb(_,U);if(!me)return!0;if(me?j=_:(j=_==="v"?"h":"v",me=Wb(_,U)),!me)return!1;if(!r.current&&"changedTouches"in x&&(k||N)&&(r.current=j),!j)return!0;var ue=r.current||j;return U_(ue,C,x,ue==="h"?k:N)},[]),d=M.useCallback(function(x){var C=x;if(!(!ws.length||ws[ws.length-1]!==l)){var E="deltaY"in C?eS(C):nc(C),A=e.current.filter(function(j){return j.name===C.type&&(j.target===C.target||C.target===j.shadowParent)&&q_(j.delta,E)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var k=(a.current.shards||[]).map(tS).filter(Boolean).filter(function(j){return j.contains(C.target)}),N=k.length>0?c(C,k[0]):!a.current.noIsolation;N&&C.cancelable&&C.preventDefault()}}},[]),h=M.useCallback(function(x,C,E,A){var k={name:x,delta:C,target:E,should:A,shadowParent:X_(E)};e.current.push(k),setTimeout(function(){e.current=e.current.filter(function(N){return N!==k})},1)},[]),p=M.useCallback(function(x){n.current=nc(x),r.current=void 0},[]),g=M.useCallback(function(x){h(x.type,eS(x),x.target,c(x,t.lockRef.current))},[]),v=M.useCallback(function(x){h(x.type,nc(x),x.target,c(x,t.lockRef.current))},[]);M.useEffect(function(){return ws.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",d,xs),document.addEventListener("touchmove",d,xs),document.addEventListener("touchstart",p,xs),function(){ws=ws.filter(function(x){return x!==l}),document.removeEventListener("wheel",d,xs),document.removeEventListener("touchmove",d,xs),document.removeEventListener("touchstart",p,xs)}},[]);var b=t.removeScrollBar,S=t.inert;return M.createElement(M.Fragment,null,S?M.createElement(l,{styles:G_(o)}):null,b?M.createElement(I_,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function X_(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const J_=M_(nw,Y_);var lw=M.forwardRef(function(t,e){return M.createElement(of,lr({},t,{ref:e,sideCar:J_}))});lw.classNames=of.classNames;var Q_=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Cs=new WeakMap,rc=new WeakMap,ic={},ip=0,aw=function(t){return t&&(t.host||aw(t.parentNode))},Z_=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=aw(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})},W_=function(t,e,n,r){var o=Z_(e,Array.isArray(t)?t:[t]);ic[n]||(ic[n]=new WeakMap);var l=ic[n],a=[],c=new Set,d=new Set(o),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};o.forEach(h);var p=function(g){!g||d.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))p(v);else try{var b=v.getAttribute(r),S=b!==null&&b!=="false",x=(Cs.get(v)||0)+1,C=(l.get(v)||0)+1;Cs.set(v,x),l.set(v,C),a.push(v),x===1&&S&&rc.set(v,!0),C===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return p(e),c.clear(),ip++,function(){a.forEach(function(g){var v=Cs.get(g)-1,b=l.get(g)-1;Cs.set(g,v),l.set(g,b),v||(rc.has(g)||g.removeAttribute(r),rc.delete(g)),b||g.removeAttribute(n)}),ip--,ip||(Cs=new WeakMap,Cs=new WeakMap,rc=new WeakMap,ic={})}},e2=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=Q_(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),W_(r,o,n,"aria-hidden")):function(){return null}},op={exports:{}},sp={};var nS;function t2(){if(nS)return sp;nS=1;var t=ba();function e(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,l=t.useLayoutEffect,a=t.useDebugValue;function c(g,v){var b=v(),S=r({inst:{value:b,getSnapshot:v}}),x=S[0].inst,C=S[1];return l(function(){x.value=b,x.getSnapshot=v,d(x)&&C({inst:x})},[g,b,v]),o(function(){return d(x)&&C({inst:x}),g(function(){d(x)&&C({inst:x})})},[g]),a(b),b}function d(g){var v=g.getSnapshot;g=g.value;try{var b=v();return!n(g,b)}catch{return!0}}function h(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return sp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,sp}var rS;function uw(){return rS||(rS=1,op.exports=t2()),op.exports}var cw=uw();function n2(t){const[e,n]=M.useState(void 0);return _i(()=>{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,c;if("borderBoxSize"in l){const d=l.borderBoxSize,h=Array.isArray(d)?d[0]:d;a=h.inlineSize,c=h.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const r2=["top","right","bottom","left"],zi=Math.min,wn=Math.max,Tc=Math.round,oc=Math.floor,ur=t=>({x:t,y:t}),i2={left:"right",right:"left",bottom:"top",top:"bottom"};function Gp(t,e,n){return wn(t,zi(e,n))}function $r(t,e){return typeof t=="function"?t(e):t}function Hr(t){return t.split("-")[0]}function Us(t){return t.split("-")[1]}function Om(t){return t==="x"?"y":"x"}function km(t){return t==="y"?"height":"width"}function ar(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Nm(t){return Om(ar(t))}function o2(t,e,n){n===void 0&&(n=!1);const r=Us(t),o=Nm(t),l=km(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(a=Ac(a)),[a,Ac(a)]}function s2(t){const e=Ac(t);return[Kp(t),e,Kp(e)]}function Kp(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const iS=["left","right"],oS=["right","left"],l2=["top","bottom"],a2=["bottom","top"];function u2(t,e,n){switch(t){case"top":case"bottom":return n?e?oS:iS:e?iS:oS;case"left":case"right":return e?l2:a2;default:return[]}}function c2(t,e,n,r){const o=Us(t);let l=u2(Hr(t),n==="start",r);return o&&(l=l.map(a=>a+"-"+o),e&&(l=l.concat(l.map(Kp)))),l}function Ac(t){const e=Hr(t);return i2[e]+t.slice(e.length)}function f2(t){return{top:0,right:0,bottom:0,left:0,...t}}function fw(t){return typeof t!="number"?f2(t):{top:t,right:t,bottom:t,left:t}}function Oc(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}}function sS(t,e,n){let{reference:r,floating:o}=t;const l=ar(e),a=Nm(e),c=km(a),d=Hr(e),h=l==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,v=r[c]/2-o[c]/2;let b;switch(d){case"top":b={x:p,y:r.y-o.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Us(e)){case"start":b[a]-=v*(n&&h?-1:1);break;case"end":b[a]+=v*(n&&h?-1:1);break}return b}async function d2(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:l,rects:a,elements:c,strategy:d}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=$r(e,t),S=fw(b),C=c[v?g==="floating"?"reference":"floating":g],E=Oc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(c.floating)),boundary:h,rootBoundary:p,strategy:d})),A=g==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c.floating)),N=await(l.isElement==null?void 0:l.isElement(k))?await(l.getScale==null?void 0:l.getScale(k))||{x:1,y:1}:{x:1,y:1},j=Oc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:k,strategy:d}):A);return{top:(E.top-j.top+S.top)/N.y,bottom:(j.bottom-E.bottom+S.bottom)/N.y,left:(E.left-j.left+S.left)/N.x,right:(j.right-E.right+S.right)/N.x}}const h2=50,p2=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:d2},d=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=sS(h,r,d),v=r,b=0;const S={};for(let x=0;x<l.length;x++){const C=l[x];if(!C)continue;const{name:E,fn:A}=C,{x:k,y:N,data:j,reset:U}=await A({x:p,y:g,initialPlacement:r,placement:v,strategy:o,middlewareData:S,rects:h,platform:c,elements:{reference:t,floating:e}});p=k??p,g=N??g,S[E]={...S[E],...j},U&&b<h2&&(b++,typeof U=="object"&&(U.placement&&(v=U.placement),U.rects&&(h=U.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):U.rects),{x:p,y:g}=sS(h,v,d)),x=-1)}return{x:p,y:g,placement:v,strategy:o,middlewareData:S}},m2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:l,platform:a,elements:c,middlewareData:d}=e,{element:h,padding:p=0}=$r(t,e)||{};if(h==null)return{};const g=fw(p),v={x:n,y:r},b=Nm(o),S=km(b),x=await a.getDimensions(h),C=b==="y",E=C?"top":"left",A=C?"bottom":"right",k=C?"clientHeight":"clientWidth",N=l.reference[S]+l.reference[b]-v[b]-l.floating[S],j=v[b]-l.reference[b],U=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let _=U?U[k]:0;(!_||!await(a.isElement==null?void 0:a.isElement(U)))&&(_=c.floating[k]||l.floating[S]);const I=N/2-j/2,Z=_/2-x[S]/2-1,se=zi(g[E],Z),me=zi(g[A],Z),ue=se,be=_-x[S]-me,ne=_/2-x[S]/2+I,ye=Gp(ue,ne,be),V=!d.arrow&&Us(o)!=null&&ne!==ye&&l.reference[S]/2-(ne<ue?se:me)-x[S]/2<0,$=V?ne<ue?ne-ue:ne-be:0;return{[b]:v[b]+$,data:{[b]:ye,centerOffset:ne-ye-$,...V&&{alignmentOffset:$}},reset:V}}}),g2=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:c,platform:d,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...C}=$r(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const E=Hr(o),A=ar(c),k=Hr(c)===c,N=await(d.isRTL==null?void 0:d.isRTL(h.floating)),j=v||(k||!x?[Ac(c)]:s2(c)),U=S!=="none";!v&&U&&j.push(...c2(c,x,S,N));const _=[c,...j],I=await d.detectOverflow(e,C),Z=[];let se=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&Z.push(I[E]),g){const ne=o2(o,a,N);Z.push(I[ne[0]],I[ne[1]])}if(se=[...se,{placement:o,overflows:Z}],!Z.every(ne=>ne<=0)){var me,ue;const ne=(((me=l.flip)==null?void 0:me.index)||0)+1,ye=_[ne];if(ye&&(!(g==="alignment"?A!==ar(ye):!1)||se.every(B=>ar(B.placement)===A?B.overflows[0]>0:!0)))return{data:{index:ne,overflows:se},reset:{placement:ye}};let V=(ue=se.filter($=>$.overflows[0]<=0).sort(($,B)=>$.overflows[1]-B.overflows[1])[0])==null?void 0:ue.placement;if(!V)switch(b){case"bestFit":{var be;const $=(be=se.filter(B=>{if(U){const q=ar(B.placement);return q===A||q==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(q=>q>0).reduce((q,K)=>q+K,0)]).sort((B,q)=>B[1]-q[1])[0])==null?void 0:be[0];$&&(V=$);break}case"initialPlacement":V=c;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function lS(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function aS(t){return r2.some(e=>t[e]>=0)}const y2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...l}=$r(t,e);switch(o){case"referenceHidden":{const a=await r.detectOverflow(e,{...l,elementContext:"reference"}),c=lS(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:aS(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...l,altBoundary:!0}),c=lS(a,n.floating);return{data:{escapedOffsets:c,escaped:aS(c)}}}default:return{}}}}},dw=new Set(["left","top"]);async function v2(t,e){const{placement:n,platform:r,elements:o}=t,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Hr(n),c=Us(n),d=ar(n)==="y",h=dw.has(a)?-1:1,p=l&&d?-1:1,g=$r(e,t);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof S=="number"&&(b=c==="end"?S*-1:S),d?{x:b*p,y:v*h}:{x:v*h,y:b*p}}const b2=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:c}=e,d=await v2(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:l+d.y,data:{...d,placement:a}}}}},S2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:l}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:d={fn:E=>{let{x:A,y:k}=E;return{x:A,y:k}}},...h}=$r(t,e),p={x:n,y:r},g=await l.detectOverflow(e,h),v=ar(Hr(o)),b=Om(v);let S=p[b],x=p[v];if(a){const E=b==="y"?"top":"left",A=b==="y"?"bottom":"right",k=S+g[E],N=S-g[A];S=Gp(k,S,N)}if(c){const E=v==="y"?"top":"left",A=v==="y"?"bottom":"right",k=x+g[E],N=x-g[A];x=Gp(k,x,N)}const C=d.fn({...e,[b]:S,[v]:x});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:a,[v]:c}}}}}},x2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:l,middlewareData:a}=e,{offset:c=0,mainAxis:d=!0,crossAxis:h=!0}=$r(t,e),p={x:n,y:r},g=ar(o),v=Om(g);let b=p[v],S=p[g];const x=$r(c,e),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(d){const k=v==="y"?"height":"width",N=l.reference[v]-l.floating[k]+C.mainAxis,j=l.reference[v]+l.reference[k]-C.mainAxis;b<N?b=N:b>j&&(b=j)}if(h){var E,A;const k=v==="y"?"width":"height",N=dw.has(Hr(o)),j=l.reference[g]-l.floating[k]+(N&&((E=a.offset)==null?void 0:E[g])||0)+(N?0:C.crossAxis),U=l.reference[g]+l.reference[k]+(N?0:((A=a.offset)==null?void 0:A[g])||0)-(N?C.crossAxis:0);S<j?S=j:S>U&&(S=U)}return{[v]:b,[g]:S}}}},w2=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:c}=e,{apply:d=()=>{},...h}=$r(t,e),p=await a.detectOverflow(e,h),g=Hr(o),v=Us(o),b=ar(o)==="y",{width:S,height:x}=l.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=g,C=v==="end"?"top":"bottom");const A=x-p.top-p.bottom,k=S-p.left-p.right,N=zi(x-p[C],A),j=zi(S-p[E],k),U=!e.middlewareData.shift;let _=N,I=j;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=k),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=A),U&&!v){const se=wn(p.left,0),me=wn(p.right,0),ue=wn(p.top,0),be=wn(p.bottom,0);b?I=S-2*(se!==0||me!==0?se+me:wn(p.left,p.right)):_=x-2*(ue!==0||be!==0?ue+be:wn(p.top,p.bottom))}await d({...e,availableWidth:I,availableHeight:_});const Z=await a.getDimensions(c.floating);return S!==Z.width||x!==Z.height?{reset:{rects:!0}}:{}}}};function sf(){return typeof window<"u"}function qs(t){return hw(t)?(t.nodeName||"").toLowerCase():"#document"}function Mn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function dr(t){var e;return(e=(hw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hw(t){return sf()?t instanceof Node||t instanceof Mn(t).Node:!1}function Wn(t){return sf()?t instanceof Element||t instanceof Mn(t).Element:!1}function Ur(t){return sf()?t instanceof HTMLElement||t instanceof Mn(t).HTMLElement:!1}function uS(t){return!sf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Mn(t).ShadowRoot}function wa(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=er(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function C2(t){return/^(table|td|th)$/.test(qs(t))}function lf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const M2=/transform|translate|scale|rotate|perspective|filter/,E2=/paint|layout|strict|content/,uo=t=>!!t&&t!=="none";let lp;function Dm(t){const e=Wn(t)?er(t):t;return uo(e.transform)||uo(e.translate)||uo(e.scale)||uo(e.rotate)||uo(e.perspective)||!_m()&&(uo(e.backdropFilter)||uo(e.filter))||M2.test(e.willChange||"")||E2.test(e.contain||"")}function R2(t){let e=ji(t);for(;Ur(e)&&!Ls(e);){if(Dm(e))return e;if(lf(e))return null;e=ji(e)}return null}function _m(){return lp==null&&(lp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),lp}function Ls(t){return/^(html|body|#document)$/.test(qs(t))}function er(t){return Mn(t).getComputedStyle(t)}function af(t){return Wn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ji(t){if(qs(t)==="html")return t;const e=t.assignedSlot||t.parentNode||uS(t)&&t.host||dr(t);return uS(e)?e.host:e}function pw(t){const e=ji(t);return Ls(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ur(e)&&wa(e)?e:pw(e)}function la(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=pw(t),l=o===((r=t.ownerDocument)==null?void 0:r.body),a=Mn(o);if(l){const c=Yp(a);return e.concat(a,a.visualViewport||[],wa(o)?o:[],c&&n?la(c):[])}else return e.concat(o,la(o,[],n))}function Yp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function mw(t){const e=er(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Ur(t),l=o?t.offsetWidth:n,a=o?t.offsetHeight:r,c=Tc(n)!==l||Tc(r)!==a;return c&&(n=l,r=a),{width:n,height:r,$:c}}function zm(t){return Wn(t)?t:t.contextElement}function Ds(t){const e=zm(t);if(!Ur(e))return ur(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:l}=mw(e);let a=(l?Tc(n.width):n.width)/r,c=(l?Tc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const T2=ur(0);function gw(t){const e=Mn(t);return!_m()||!e.visualViewport?T2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function A2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Mn(t)?!1:e}function So(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),l=zm(t);let a=ur(1);e&&(r?Wn(r)&&(a=Ds(r)):a=Ds(t));const c=A2(l,n,r)?gw(l):ur(0);let d=(o.left+c.x)/a.x,h=(o.top+c.y)/a.y,p=o.width/a.x,g=o.height/a.y;if(l){const v=Mn(l),b=r&&Wn(r)?Mn(r):r;let S=v,x=Yp(S);for(;x&&r&&b!==S;){const C=Ds(x),E=x.getBoundingClientRect(),A=er(x),k=E.left+(x.clientLeft+parseFloat(A.paddingLeft))*C.x,N=E.top+(x.clientTop+parseFloat(A.paddingTop))*C.y;d*=C.x,h*=C.y,p*=C.x,g*=C.y,d+=k,h+=N,S=Mn(x),x=Yp(S)}}return Oc({width:p,height:g,x:d,y:h})}function uf(t,e){const n=af(t).scrollLeft;return e?e.left+n:So(dr(t)).left+n}function yw(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-uf(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function O2(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const l=o==="fixed",a=dr(r),c=e?lf(e.floating):!1;if(r===a||c&&l)return n;let d={scrollLeft:0,scrollTop:0},h=ur(1);const p=ur(0),g=Ur(r);if((g||!g&&!l)&&((qs(r)!=="body"||wa(a))&&(d=af(r)),g)){const b=So(r);h=Ds(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const v=a&&!g&&!l?yw(a,d):ur(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+v.x,y:n.y*h.y-d.scrollTop*h.y+p.y+v.y}}function k2(t){return Array.from(t.getClientRects())}function N2(t){const e=dr(t),n=af(t),r=t.ownerDocument.body,o=wn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=wn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+uf(t);const c=-n.scrollTop;return er(r).direction==="rtl"&&(a+=wn(e.clientWidth,r.clientWidth)-o),{width:o,height:l,x:a,y:c}}const cS=25;function D2(t,e){const n=Mn(t),r=dr(t),o=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,c=0,d=0;if(o){l=o.width,a=o.height;const p=_m();(!p||p&&e==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}const h=uf(r);if(h<=0){const p=r.ownerDocument,g=p.body,v=getComputedStyle(g),b=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-b);S<=cS&&(l-=S)}else h<=cS&&(l+=h);return{width:l,height:a,x:c,y:d}}function _2(t,e){const n=So(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,l=Ur(t)?Ds(t):ur(1),a=t.clientWidth*l.x,c=t.clientHeight*l.y,d=o*l.x,h=r*l.y;return{width:a,height:c,x:d,y:h}}function fS(t,e,n){let r;if(e==="viewport")r=D2(t,n);else if(e==="document")r=N2(dr(t));else if(Wn(e))r=_2(e,n);else{const o=gw(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Oc(r)}function vw(t,e){const n=ji(t);return n===e||!Wn(n)||Ls(n)?!1:er(n).position==="fixed"||vw(n,e)}function z2(t,e){const n=e.get(t);if(n)return n;let r=la(t,[],!1).filter(c=>Wn(c)&&qs(c)!=="body"),o=null;const l=er(t).position==="fixed";let a=l?ji(t):t;for(;Wn(a)&&!Ls(a);){const c=er(a),d=Dm(a);!d&&c.position==="fixed"&&(o=null),(l?!d&&!o:!d&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||wa(a)&&!d&&vw(t,a))?r=r.filter(p=>p!==a):o=c,a=ji(a)}return e.set(t,r),r}function j2(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const a=[...n==="clippingAncestors"?lf(e)?[]:z2(e,this._c):[].concat(n),r],c=fS(e,a[0],o);let d=c.top,h=c.right,p=c.bottom,g=c.left;for(let v=1;v<a.length;v++){const b=fS(e,a[v],o);d=wn(b.top,d),h=zi(b.right,h),p=zi(b.bottom,p),g=wn(b.left,g)}return{width:h-g,height:p-d,x:g,y:d}}function L2(t){const{width:e,height:n}=mw(t);return{width:e,height:n}}function I2(t,e,n){const r=Ur(e),o=dr(e),l=n==="fixed",a=So(t,!0,l,e);let c={scrollLeft:0,scrollTop:0};const d=ur(0);function h(){d.x=uf(o)}if(r||!r&&!l)if((qs(e)!=="body"||wa(o))&&(c=af(e)),r){const b=So(e,!0,l,e);d.x=b.x+e.clientLeft,d.y=b.y+e.clientTop}else o&&h();l&&!r&&o&&h();const p=o&&!r&&!l?yw(o,c):ur(0),g=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:g,y:v,width:a.width,height:a.height}}function ap(t){return er(t).position==="static"}function dS(t,e){if(!Ur(t)||er(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return dr(t)===n&&(n=n.ownerDocument.body),n}function bw(t,e){const n=Mn(t);if(lf(t))return n;if(!Ur(t)){let o=ji(t);for(;o&&!Ls(o);){if(Wn(o)&&!ap(o))return o;o=ji(o)}return n}let r=dS(t,e);for(;r&&C2(r)&&ap(r);)r=dS(r,e);return r&&Ls(r)&&ap(r)&&!Dm(r)?n:r||R2(t)||n}const B2=async function(t){const e=this.getOffsetParent||bw,n=this.getDimensions,r=await n(t.floating);return{reference:I2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function V2(t){return er(t).direction==="rtl"}const F2={convertOffsetParentRelativeRectToViewportRelativeRect:O2,getDocumentElement:dr,getClippingRect:j2,getOffsetParent:bw,getElementRects:B2,getClientRects:k2,getDimensions:L2,getScale:Ds,isElement:Wn,isRTL:V2};function Sw(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function P2(t,e){let n=null,r;const o=dr(t);function l(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),l();const h=t.getBoundingClientRect(),{left:p,top:g,width:v,height:b}=h;if(c||e(),!v||!b)return;const S=oc(g),x=oc(o.clientWidth-(p+v)),C=oc(o.clientHeight-(g+b)),E=oc(p),k={rootMargin:-S+"px "+-x+"px "+-C+"px "+-E+"px",threshold:wn(0,zi(1,d))||1};let N=!0;function j(U){const _=U[0].intersectionRatio;if(_!==d){if(!N)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!Sw(h,t.getBoundingClientRect())&&a(),N=!1}try{n=new IntersectionObserver(j,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,k)}n.observe(t)}return a(!0),l}function $2(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=zm(t),p=o||l?[...h?la(h):[],...e?la(e):[]]:[];p.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),l&&E.addEventListener("resize",n)});const g=h&&c?P2(h,n):null;let v=-1,b=null;a&&(b=new ResizeObserver(E=>{let[A]=E;A&&A.target===h&&b&&e&&(b.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var k;(k=b)==null||k.observe(e)})),n()}),h&&!d&&b.observe(h),e&&b.observe(e));let S,x=d?So(t):null;d&&C();function C(){const E=So(t);x&&!Sw(x,E)&&n(),x=E,S=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(A=>{o&&A.removeEventListener("scroll",n),l&&A.removeEventListener("resize",n)}),g?.(),(E=b)==null||E.disconnect(),b=null,d&&cancelAnimationFrame(S)}}const H2=b2,U2=S2,q2=g2,G2=w2,K2=y2,hS=m2,Y2=x2,X2=(t,e,n)=>{const r=new Map,o={platform:F2,...n},l={...o.platform,_c:r};return p2(t,e,{...o,platform:l})};var J2=typeof document<"u",Q2=function(){},bc=J2?M.useLayoutEffect:Q2;function kc(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(!kc(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)&&!kc(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function xw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function pS(t,e){const n=xw(t);return Math.round(e*n)/n}function up(t){const e=M.useRef(t);return bc(()=>{e.current=t}),e}function Z2(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:a}={},transform:c=!0,whileElementsMounted:d,open:h}=t,[p,g]=M.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,b]=M.useState(r);kc(v,r)||b(r);const[S,x]=M.useState(null),[C,E]=M.useState(null),A=M.useCallback(B=>{B!==U.current&&(U.current=B,x(B))},[]),k=M.useCallback(B=>{B!==_.current&&(_.current=B,E(B))},[]),N=l||S,j=a||C,U=M.useRef(null),_=M.useRef(null),I=M.useRef(p),Z=d!=null,se=up(d),me=up(o),ue=up(h),be=M.useCallback(()=>{if(!U.current||!_.current)return;const B={placement:e,strategy:n,middleware:v};me.current&&(B.platform=me.current),X2(U.current,_.current,B).then(q=>{const K={...q,isPositioned:ue.current!==!1};ne.current&&!kc(I.current,K)&&(I.current=K,Sa.flushSync(()=>{g(K)}))})},[v,e,n,me,ue]);bc(()=>{h===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(B=>({...B,isPositioned:!1})))},[h]);const ne=M.useRef(!1);bc(()=>(ne.current=!0,()=>{ne.current=!1}),[]),bc(()=>{if(N&&(U.current=N),j&&(_.current=j),N&&j){if(se.current)return se.current(N,j,be);be()}},[N,j,be,se,Z]);const ye=M.useMemo(()=>({reference:U,floating:_,setReference:A,setFloating:k}),[A,k]),V=M.useMemo(()=>({reference:N,floating:j}),[N,j]),$=M.useMemo(()=>{const B={position:n,left:0,top:0};if(!V.floating)return B;const q=pS(V.floating,p.x),K=pS(V.floating,p.y);return c?{...B,transform:"translate("+q+"px, "+K+"px)",...xw(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:K}},[n,c,V.floating,p.x,p.y]);return M.useMemo(()=>({...p,update:be,refs:ye,elements:V,floatingStyles:$}),[p,be,ye,V,$])}const W2=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?hS({element:r.current,padding:o}).fn(n):{}:r?hS({element:r,padding:o}).fn(n):{}}}},ez=(t,e)=>{const n=H2(t);return{name:n.name,fn:n.fn,options:[t,e]}},tz=(t,e)=>{const n=U2(t);return{name:n.name,fn:n.fn,options:[t,e]}},nz=(t,e)=>({fn:Y2(t).fn,options:[t,e]}),rz=(t,e)=>{const n=q2(t);return{name:n.name,fn:n.fn,options:[t,e]}},iz=(t,e)=>{const n=G2(t);return{name:n.name,fn:n.fn,options:[t,e]}},oz=(t,e)=>{const n=K2(t);return{name:n.name,fn:n.fn,options:[t,e]}},sz=(t,e)=>{const n=W2(t);return{name:n.name,fn:n.fn,options:[t,e]}};var lz="Arrow",ww=M.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...l}=t;return T.jsx(Yt.svg,{...l,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});ww.displayName=lz;var az=ww,jm="Popper",[Cw,Mw]=Hs(jm),[uz,Ew]=Cw(jm),Rw=t=>{const{__scopePopper:e,children:n}=t,[r,o]=M.useState(null);return T.jsx(uz,{scope:e,anchor:r,onAnchorChange:o,children:n})};Rw.displayName=jm;var Tw="PopperAnchor",Aw=M.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,l=Ew(Tw,n),a=M.useRef(null),c=pn(e,a),d=M.useRef(null);return M.useEffect(()=>{const h=d.current;d.current=r?.current||a.current,h!==d.current&&l.onAnchorChange(d.current)}),r?null:T.jsx(Yt.div,{...o,ref:c})});Aw.displayName=Tw;var Lm="PopperContent",[cz,fz]=Cw(Lm),Ow=M.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:S,...x}=t,C=Ew(Lm,n),[E,A]=M.useState(null),k=pn(e,he=>A(he)),[N,j]=M.useState(null),U=n2(N),_=U?.width??0,I=U?.height??0,Z=r+(l!=="center"?"-"+l:""),se=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},me=Array.isArray(h)?h:[h],ue=me.length>0,be={padding:se,boundary:me.filter(hz),altBoundary:ue},{refs:ne,floatingStyles:ye,placement:V,isPositioned:$,middlewareData:B}=Z2({strategy:"fixed",placement:Z,whileElementsMounted:(...he)=>$2(...he,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[ez({mainAxis:o+I,alignmentAxis:a}),d&&tz({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?nz():void 0,...be}),d&&rz({...be}),iz({...be,apply:({elements:he,rects:Ze,availableWidth:Ee,availableHeight:on})=>{const{width:ft,height:St}=Ze.reference,Ft=he.floating.style;Ft.setProperty("--radix-popper-available-width",`${Ee}px`),Ft.setProperty("--radix-popper-available-height",`${on}px`),Ft.setProperty("--radix-popper-anchor-width",`${ft}px`),Ft.setProperty("--radix-popper-anchor-height",`${St}px`)}}),N&&sz({element:N,padding:c}),pz({arrowWidth:_,arrowHeight:I}),v&&oz({strategy:"referenceHidden",...be})]}),[q,K]=Dw(V),D=Zn(S);_i(()=>{$&&D?.()},[$,D]);const Y=B.arrow?.x,ee=B.arrow?.y,te=B.arrow?.centerOffset!==0,[oe,ae]=M.useState();return _i(()=>{E&&ae(window.getComputedStyle(E).zIndex)},[E]),T.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...ye,transform:$?ye.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:T.jsx(cz,{scope:n,placedSide:q,onArrowChange:j,arrowX:Y,arrowY:ee,shouldHideArrow:te,children:T.jsx(Yt.div,{"data-side":q,"data-align":K,...x,ref:k,style:{...x.style,animation:$?void 0:"none"}})})})});Ow.displayName=Lm;var kw="PopperArrow",dz={top:"bottom",right:"left",bottom:"top",left:"right"},Nw=M.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,l=fz(kw,r),a=dz[l.placedSide];return T.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:T.jsx(az,{...o,ref:n,style:{...o.style,display:"block"}})})});Nw.displayName=kw;function hz(t){return t!==null}var pz=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:o}=e,a=o.arrow?.centerOffset!==0,c=a?0:t.arrowWidth,d=a?0:t.arrowHeight,[h,p]=Dw(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(o.arrow?.x??0)+c/2,b=(o.arrow?.y??0)+d/2;let S="",x="";return h==="bottom"?(S=a?g:`${v}px`,x=`${-d}px`):h==="top"?(S=a?g:`${v}px`,x=`${r.floating.height+d}px`):h==="right"?(S=`${-d}px`,x=a?g:`${b}px`):h==="left"&&(S=`${r.floating.width+d}px`,x=a?g:`${b}px`),{data:{x:S,y:x}}}});function Dw(t){const[e,n="center"]=t.split("-");return[e,n]}var _w=Rw,mz=Aw,gz=Ow,yz=Nw,cp="rovingFocusGroup.onEntryFocus",vz={bubbles:!1,cancelable:!0},Ca="RovingFocusGroup",[Xp,zw,bz]=G1(Ca),[Sz,jw]=Hs(Ca,[bz]),[xz,wz]=Sz(Ca),Lw=M.forwardRef((t,e)=>T.jsx(Xp.Provider,{scope:t.__scopeRovingFocusGroup,children:T.jsx(Xp.Slot,{scope:t.__scopeRovingFocusGroup,children:T.jsx(Cz,{...t,ref:e})})}));Lw.displayName=Ca;var Cz=M.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:l,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...g}=t,v=M.useRef(null),b=pn(e,v),S=K1(l),[x,C]=rf({prop:a,defaultProp:c??null,onChange:d,caller:Ca}),[E,A]=M.useState(!1),k=Zn(h),N=zw(n),j=M.useRef(!1),[U,_]=M.useState(0);return M.useEffect(()=>{const I=v.current;if(I)return I.addEventListener(cp,k),()=>I.removeEventListener(cp,k)},[k]),T.jsx(xz,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:x,onItemFocus:M.useCallback(I=>C(I),[C]),onItemShiftTab:M.useCallback(()=>A(!0),[]),onFocusableItemAdd:M.useCallback(()=>_(I=>I+1),[]),onFocusableItemRemove:M.useCallback(()=>_(I=>I-1),[]),children:T.jsx(Yt.div,{tabIndex:E||U===0?-1:0,"data-orientation":r,...g,ref:b,style:{outline:"none",...t.style},onMouseDown:je(t.onMouseDown,()=>{j.current=!0}),onFocus:je(t.onFocus,I=>{const Z=!j.current;if(I.target===I.currentTarget&&Z&&!E){const se=new CustomEvent(cp,vz);if(I.currentTarget.dispatchEvent(se),!se.defaultPrevented){const me=N().filter(V=>V.focusable),ue=me.find(V=>V.active),be=me.find(V=>V.id===x),ye=[ue,be,...me].filter(Boolean).map(V=>V.ref.current);Vw(ye,p)}}j.current=!1}),onBlur:je(t.onBlur,()=>A(!1))})})}),Iw="RovingFocusGroupItem",Bw=M.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:a,...c}=t,d=sa(),h=l||d,p=wz(Iw,n),g=p.currentTabStopId===h,v=zw(n),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:x}=p;return M.useEffect(()=>{if(r)return b(),()=>S()},[r,b,S]),T.jsx(Xp.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:T.jsx(Yt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:je(t.onMouseDown,C=>{r?p.onItemFocus(h):C.preventDefault()}),onFocus:je(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:je(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=Rz(C,p.orientation,p.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let k=v().filter(N=>N.focusable).map(N=>N.ref.current);if(E==="last")k.reverse();else if(E==="prev"||E==="next"){E==="prev"&&k.reverse();const N=k.indexOf(C.currentTarget);k=p.loop?Tz(k,N+1):k.slice(N+1)}setTimeout(()=>Vw(k))}}),children:typeof a=="function"?a({isCurrentTabStop:g,hasTabStop:x!=null}):a})})});Bw.displayName=Iw;var Mz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ez(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Rz(t,e,n){const r=Ez(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Mz[r]}function Vw(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Tz(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Az=Lw,Oz=Bw,Jp=["Enter"," "],kz=["ArrowDown","PageUp","Home"],Fw=["ArrowUp","PageDown","End"],Nz=[...kz,...Fw],Dz={ltr:[...Jp,"ArrowRight"],rtl:[...Jp,"ArrowLeft"]},_z={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ma="Menu",[aa,zz,jz]=G1(Ma),[Ro,cf]=Hs(Ma,[jz,Mw,jw]),Ea=Mw(),Pw=jw(),[$w,Bi]=Ro(Ma),[Lz,Ra]=Ro(Ma),Hw=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:l,modal:a=!0}=t,c=Ea(e),[d,h]=M.useState(null),p=M.useRef(!1),g=Zn(l),v=K1(o);return M.useEffect(()=>{const b=()=>{p.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>p.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),T.jsx(_w,{...c,children:T.jsx($w,{scope:e,open:n,onOpenChange:g,content:d,onContentChange:h,children:T.jsx(Lz,{scope:e,onClose:M.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:v,modal:a,children:r})})})};Hw.displayName=Ma;var Iz="MenuAnchor",Im=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ea(n);return T.jsx(mz,{...o,...r,ref:e})});Im.displayName=Iz;var Bm="MenuPortal",[Bz,Uw]=Ro(Bm,{forceMount:void 0}),qw=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,l=Bi(Bm,e);return T.jsx(Bz,{scope:e,forceMount:n,children:T.jsx(xa,{present:n||l.open,children:T.jsx(W1,{asChild:!0,container:o,children:r})})})};qw.displayName=Bm;var Fn="MenuContent",[Vz,Vm]=Ro(Fn),Gw=M.forwardRef((t,e)=>{const n=Uw(Fn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Bi(Fn,t.__scopeMenu),a=Ra(Fn,t.__scopeMenu);return T.jsx(aa.Provider,{scope:t.__scopeMenu,children:T.jsx(xa,{present:r||l.open,children:T.jsx(aa.Slot,{scope:t.__scopeMenu,children:a.modal?T.jsx(Fz,{...o,ref:e}):T.jsx(Pz,{...o,ref:e})})})})}),Fz=M.forwardRef((t,e)=>{const n=Bi(Fn,t.__scopeMenu),r=M.useRef(null),o=pn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return e2(l)},[]),T.jsx(Fm,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:je(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Pz=M.forwardRef((t,e)=>{const n=Bi(Fn,t.__scopeMenu);return T.jsx(Fm,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$z=oa("MenuContent.ScrollLock"),Fm=M.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:b,disableOutsideScroll:S,...x}=t,C=Bi(Fn,n),E=Ra(Fn,n),A=Ea(n),k=Pw(n),N=zz(n),[j,U]=M.useState(null),_=M.useRef(null),I=pn(e,_,C.onContentChange),Z=M.useRef(0),se=M.useRef(""),me=M.useRef(0),ue=M.useRef(null),be=M.useRef("right"),ne=M.useRef(0),ye=S?lw:M.Fragment,V=S?{as:$z,allowPinchZoom:!0}:void 0,$=q=>{const K=se.current+q,D=N().filter(he=>!he.disabled),Y=document.activeElement,ee=D.find(he=>he.ref.current===Y)?.textValue,te=D.map(he=>he.textValue),oe=ej(te,K,ee),ae=D.find(he=>he.textValue===oe)?.ref.current;(function he(Ze){se.current=Ze,window.clearTimeout(Z.current),Ze!==""&&(Z.current=window.setTimeout(()=>he(""),1e3))})(K),ae&&setTimeout(()=>ae.focus())};M.useEffect(()=>()=>window.clearTimeout(Z.current),[]),p_();const B=M.useCallback(q=>be.current===ue.current?.side&&nj(q,ue.current?.area),[]);return T.jsx(Vz,{scope:n,searchRef:se,onItemEnter:M.useCallback(q=>{B(q)&&q.preventDefault()},[B]),onItemLeave:M.useCallback(q=>{B(q)||(_.current?.focus(),U(null))},[B]),onTriggerLeave:M.useCallback(q=>{B(q)&&q.preventDefault()},[B]),pointerGraceTimerRef:me,onPointerGraceIntentChange:M.useCallback(q=>{ue.current=q},[]),children:T.jsx(ye,{...V,children:T.jsx(Q1,{asChild:!0,trapped:o,onMountAutoFocus:je(l,q=>{q.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:T.jsx(X1,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:b,children:T.jsx(Az,{asChild:!0,...k,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:U,onEntryFocus:je(d,q=>{E.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:T.jsx(gz,{role:"menu","aria-orientation":"vertical","data-state":uC(C.open),"data-radix-menu-content":"",dir:E.dir,...A,...x,ref:I,style:{outline:"none",...x.style},onKeyDown:je(x.onKeyDown,q=>{const D=q.target.closest("[data-radix-menu-content]")===q.currentTarget,Y=q.ctrlKey||q.altKey||q.metaKey,ee=q.key.length===1;D&&(q.key==="Tab"&&q.preventDefault(),!Y&&ee&&$(q.key));const te=_.current;if(q.target!==te||!Nz.includes(q.key))return;q.preventDefault();const ae=N().filter(he=>!he.disabled).map(he=>he.ref.current);Fw.includes(q.key)&&ae.reverse(),Zz(ae)}),onBlur:je(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(Z.current),se.current="")}),onPointerMove:je(t.onPointerMove,ua(q=>{const K=q.target,D=ne.current!==q.clientX;if(q.currentTarget.contains(K)&&D){const Y=q.clientX>ne.current?"right":"left";be.current=Y,ne.current=q.clientX}}))})})})})})})});Gw.displayName=Fn;var Hz="MenuGroup",Pm=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(Yt.div,{role:"group",...r,ref:e})});Pm.displayName=Hz;var Uz="MenuLabel",Kw=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(Yt.div,{...r,ref:e})});Kw.displayName=Uz;var Nc="MenuItem",mS="menu.itemSelect",ff=M.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,l=M.useRef(null),a=Ra(Nc,t.__scopeMenu),c=Vm(Nc,t.__scopeMenu),d=pn(e,l),h=M.useRef(!1),p=()=>{const g=l.current;if(!n&&g){const v=new CustomEvent(mS,{bubbles:!0,cancelable:!0});g.addEventListener(mS,b=>r?.(b),{once:!0}),q1(g,v),v.defaultPrevented?h.current=!1:a.onClose()}};return T.jsx(Yw,{...o,ref:d,disabled:n,onClick:je(t.onClick,p),onPointerDown:g=>{t.onPointerDown?.(g),h.current=!0},onPointerUp:je(t.onPointerUp,g=>{h.current||g.currentTarget?.click()}),onKeyDown:je(t.onKeyDown,g=>{const v=c.searchRef.current!=="";n||v&&g.key===" "||Jp.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});ff.displayName=Nc;var Yw=M.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=t,a=Vm(Nc,n),c=Pw(n),d=M.useRef(null),h=pn(e,d),[p,g]=M.useState(!1),[v,b]=M.useState("");return M.useEffect(()=>{const S=d.current;S&&b((S.textContent??"").trim())},[l.children]),T.jsx(aa.ItemSlot,{scope:n,disabled:r,textValue:o??v,children:T.jsx(Oz,{asChild:!0,...c,focusable:!r,children:T.jsx(Yt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:h,onPointerMove:je(t.onPointerMove,ua(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(t.onPointerLeave,ua(S=>a.onItemLeave(S))),onFocus:je(t.onFocus,()=>g(!0)),onBlur:je(t.onBlur,()=>g(!1))})})})}),qz="MenuCheckboxItem",Xw=M.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return T.jsx(eC,{scope:t.__scopeMenu,checked:n,children:T.jsx(ff,{role:"menuitemcheckbox","aria-checked":Dc(n)?"mixed":n,...o,ref:e,"data-state":Um(n),onSelect:je(o.onSelect,()=>r?.(Dc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xw.displayName=qz;var Jw="MenuRadioGroup",[Gz,Kz]=Ro(Jw,{value:void 0,onValueChange:()=>{}}),Qw=M.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,l=Zn(r);return T.jsx(Gz,{scope:t.__scopeMenu,value:n,onValueChange:l,children:T.jsx(Pm,{...o,ref:e})})});Qw.displayName=Jw;var Zw="MenuRadioItem",Ww=M.forwardRef((t,e)=>{const{value:n,...r}=t,o=Kz(Zw,t.__scopeMenu),l=n===o.value;return T.jsx(eC,{scope:t.__scopeMenu,checked:l,children:T.jsx(ff,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":Um(l),onSelect:je(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ww.displayName=Zw;var $m="MenuItemIndicator",[eC,Yz]=Ro($m,{checked:!1}),tC=M.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,l=Yz($m,n);return T.jsx(xa,{present:r||Dc(l.checked)||l.checked===!0,children:T.jsx(Yt.span,{...o,ref:e,"data-state":Um(l.checked)})})});tC.displayName=$m;var Xz="MenuSeparator",nC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(Yt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});nC.displayName=Xz;var Jz="MenuArrow",rC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ea(n);return T.jsx(yz,{...o,...r,ref:e})});rC.displayName=Jz;var Hm="MenuSub",[Qz,iC]=Ro(Hm),oC=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,l=Bi(Hm,e),a=Ea(e),[c,d]=M.useState(null),[h,p]=M.useState(null),g=Zn(o);return M.useEffect(()=>(l.open===!1&&g(!1),()=>g(!1)),[l.open,g]),T.jsx(_w,{...a,children:T.jsx($w,{scope:e,open:r,onOpenChange:g,content:h,onContentChange:p,children:T.jsx(Qz,{scope:e,contentId:sa(),triggerId:sa(),trigger:c,onTriggerChange:d,children:n})})})};oC.displayName=Hm;var Gl="MenuSubTrigger",sC=M.forwardRef((t,e)=>{const n=Bi(Gl,t.__scopeMenu),r=Ra(Gl,t.__scopeMenu),o=iC(Gl,t.__scopeMenu),l=Vm(Gl,t.__scopeMenu),a=M.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=l,h={__scopeMenu:t.__scopeMenu},p=M.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return M.useEffect(()=>p,[p]),M.useEffect(()=>{const g=c.current;return()=>{window.clearTimeout(g),d(null)}},[c,d]),T.jsx(Im,{asChild:!0,...h,children:T.jsx(Yw,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":uC(n.open),...t,ref:nf(e,o.onTriggerChange),onClick:g=>{t.onClick?.(g),!(t.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:je(t.onPointerMove,ua(g=>{l.onItemEnter(g),!g.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(l.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:je(t.onPointerLeave,ua(g=>{p();const v=n.content?.getBoundingClientRect();if(v){const b=n.content?.dataset.side,S=b==="right",x=S?-5:5,C=v[S?"left":"right"],E=v[S?"right":"left"];l.onPointerGraceIntentChange({area:[{x:g.clientX+x,y:g.clientY},{x:C,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(g),g.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:je(t.onKeyDown,g=>{const v=l.searchRef.current!=="";t.disabled||v&&g.key===" "||Dz[r.dir].includes(g.key)&&(n.onOpenChange(!0),n.content?.focus(),g.preventDefault())})})})});sC.displayName=Gl;var lC="MenuSubContent",aC=M.forwardRef((t,e)=>{const n=Uw(Fn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Bi(Fn,t.__scopeMenu),a=Ra(Fn,t.__scopeMenu),c=iC(lC,t.__scopeMenu),d=M.useRef(null),h=pn(e,d);return T.jsx(aa.Provider,{scope:t.__scopeMenu,children:T.jsx(xa,{present:r||l.open,children:T.jsx(aa.Slot,{scope:t.__scopeMenu,children:T.jsx(Fm,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:h,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{a.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:je(t.onFocusOutside,p=>{p.target!==c.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:je(t.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:je(t.onKeyDown,p=>{const g=p.currentTarget.contains(p.target),v=_z[a.dir].includes(p.key);g&&v&&(l.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});aC.displayName=lC;function uC(t){return t?"open":"closed"}function Dc(t){return t==="indeterminate"}function Um(t){return Dc(t)?"indeterminate":t?"checked":"unchecked"}function Zz(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Wz(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function ej(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=Wz(t,Math.max(l,0));o.length===1&&(a=a.filter(h=>h!==n));const d=a.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function tj(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 c=e[l],d=e[a],h=c.x,p=c.y,g=d.x,v=d.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(o=!o)}return o}function nj(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return tj(n,e)}function ua(t){return e=>e.pointerType==="mouse"?t(e):void 0}var cC=Hw,fC=Im,dC=qw,hC=Gw,pC=Pm,mC=Kw,gC=ff,yC=Xw,vC=Qw,bC=Ww,SC=tC,xC=nC,wC=rC,CC=oC,MC=sC,EC=aC,qm="ContextMenu",[rj]=Hs(qm,[cf]),Xt=cf(),[ij,RC]=rj(qm),TC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:l=!0}=t,[a,c]=M.useState(!1),d=Xt(e),h=Zn(r),p=M.useCallback(g=>{c(g),h(g)},[h]);return T.jsx(ij,{scope:e,open:a,onOpenChange:p,modal:l,children:T.jsx(cC,{...d,dir:o,open:a,onOpenChange:p,modal:l,children:n})})};TC.displayName=qm;var AC="ContextMenuTrigger",OC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,l=RC(AC,n),a=Xt(n),c=M.useRef({x:0,y:0}),d=M.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),h=M.useRef(0),p=M.useCallback(()=>window.clearTimeout(h.current),[]),g=v=>{c.current={x:v.clientX,y:v.clientY},l.onOpenChange(!0)};return M.useEffect(()=>p,[p]),M.useEffect(()=>{r&&p()},[r,p]),T.jsxs(T.Fragment,{children:[T.jsx(fC,{...a,virtualRef:d}),T.jsx(Yt.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:je(t.onContextMenu,v=>{p(),g(v),v.preventDefault()}),onPointerDown:r?t.onPointerDown:je(t.onPointerDown,sc(v=>{p(),h.current=window.setTimeout(()=>g(v),700)})),onPointerMove:r?t.onPointerMove:je(t.onPointerMove,sc(p)),onPointerCancel:r?t.onPointerCancel:je(t.onPointerCancel,sc(p)),onPointerUp:r?t.onPointerUp:je(t.onPointerUp,sc(p))})]})});OC.displayName=AC;var oj="ContextMenuPortal",kC=t=>{const{__scopeContextMenu:e,...n}=t,r=Xt(e);return T.jsx(dC,{...r,...n})};kC.displayName=oj;var NC="ContextMenuContent",DC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=RC(NC,n),l=Xt(n),a=M.useRef(!1);return T.jsx(hC,{...l,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),!c.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});DC.displayName=NC;var sj="ContextMenuGroup",lj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(pC,{...o,...r,ref:e})});lj.displayName=sj;var aj="ContextMenuLabel",_C=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(mC,{...o,...r,ref:e})});_C.displayName=aj;var uj="ContextMenuItem",zC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(gC,{...o,...r,ref:e})});zC.displayName=uj;var cj="ContextMenuCheckboxItem",fj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(yC,{...o,...r,ref:e})});fj.displayName=cj;var dj="ContextMenuRadioGroup",hj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(vC,{...o,...r,ref:e})});hj.displayName=dj;var pj="ContextMenuRadioItem",mj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(bC,{...o,...r,ref:e})});mj.displayName=pj;var gj="ContextMenuItemIndicator",yj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(SC,{...o,...r,ref:e})});yj.displayName=gj;var vj="ContextMenuSeparator",jC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(xC,{...o,...r,ref:e})});jC.displayName=vj;var bj="ContextMenuArrow",Sj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(wC,{...o,...r,ref:e})});Sj.displayName=bj;var LC="ContextMenuSub",IC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:l}=t,a=Xt(e),[c,d]=rf({prop:o,defaultProp:l??!1,onChange:r,caller:LC});return T.jsx(CC,{...a,open:c,onOpenChange:d,children:n})};IC.displayName=LC;var xj="ContextMenuSubTrigger",BC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(MC,{...o,...r,ref:e})});BC.displayName=xj;var wj="ContextMenuSubContent",VC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Xt(n);return T.jsx(EC,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});VC.displayName=wj;function sc(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Cj=TC,Mj=OC,Ej=kC,Rj=DC,Tj=_C,Aj=zC,Oj=jC,kj=IC,Nj=BC,Dj=VC,df="DropdownMenu",[_j]=Hs(df,[cf]),Jt=cf(),[zj,FC]=_j(df),PC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:a,modal:c=!0}=t,d=Jt(e),h=M.useRef(null),[p,g]=rf({prop:o,defaultProp:l??!1,onChange:a,caller:df});return T.jsx(zj,{scope:e,triggerId:sa(),triggerRef:h,contentId:sa(),open:p,onOpenChange:g,onOpenToggle:M.useCallback(()=>g(v=>!v),[g]),modal:c,children:T.jsx(cC,{...d,open:p,onOpenChange:g,dir:r,modal:c,children:n})})};PC.displayName=df;var $C="DropdownMenuTrigger",HC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,l=FC($C,n),a=Jt(n);return T.jsx(fC,{asChild:!0,...a,children:T.jsx(Yt.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:nf(e,l.triggerRef),onPointerDown:je(t.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(l.onOpenToggle(),l.open||c.preventDefault())}),onKeyDown:je(t.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&l.onOpenToggle(),c.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});HC.displayName=$C;var jj="DropdownMenuPortal",UC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Jt(e);return T.jsx(dC,{...r,...n})};UC.displayName=jj;var qC="DropdownMenuContent",GC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=FC(qC,n),l=Jt(n),a=M.useRef(!1);return T.jsx(hC,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:e,onCloseAutoFocus:je(t.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:je(t.onInteractOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,p=d.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)"}})});GC.displayName=qC;var Lj="DropdownMenuGroup",Ij=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(pC,{...o,...r,ref:e})});Ij.displayName=Lj;var Bj="DropdownMenuLabel",KC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(mC,{...o,...r,ref:e})});KC.displayName=Bj;var Vj="DropdownMenuItem",YC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(gC,{...o,...r,ref:e})});YC.displayName=Vj;var Fj="DropdownMenuCheckboxItem",XC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(yC,{...o,...r,ref:e})});XC.displayName=Fj;var Pj="DropdownMenuRadioGroup",JC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(vC,{...o,...r,ref:e})});JC.displayName=Pj;var $j="DropdownMenuRadioItem",QC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(bC,{...o,...r,ref:e})});QC.displayName=$j;var Hj="DropdownMenuItemIndicator",ZC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(SC,{...o,...r,ref:e})});ZC.displayName=Hj;var Uj="DropdownMenuSeparator",WC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(xC,{...o,...r,ref:e})});WC.displayName=Uj;var qj="DropdownMenuArrow",Gj=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(wC,{...o,...r,ref:e})});Gj.displayName=qj;var Kj=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:l}=t,a=Jt(e),[c,d]=rf({prop:r,defaultProp:l??!1,onChange:o,caller:"DropdownMenuSub"});return T.jsx(CC,{...a,open:c,onOpenChange:d,children:n})},Yj="DropdownMenuSubTrigger",eM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(MC,{...o,...r,ref:e})});eM.displayName=Yj;var Xj="DropdownMenuSubContent",tM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Jt(n);return T.jsx(EC,{...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)"}})});tM.displayName=Xj;var Jj=PC,Qj=HC,Zj=UC,Wj=GC,e3=KC,t3=YC,n3=XC,r3=JC,i3=QC,nM=ZC,o3=WC,s3=Kj,l3=eM,a3=tM;const u3=Am("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800",outline:"border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",xl:"h-10 gap-1 px-3 text-sm/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-5",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4","icon-xl":"size-10 [&_svg:not([class*='size-'])]:size-5"}},defaultVariants:{variant:"default",size:"default"}});function _s({className:t,variant:e="default",size:n="default",asChild:r=!1,...o}){const l=r?jD:"button";return T.jsx(l,{"data-slot":"button","data-variant":e,"data-size":n,className:De(u3({variant:e,size:n,className:t})),...o})}function c3({...t}){return T.jsx(Cj,{"data-slot":"context-menu",...t})}function f3({className:t,...e}){return T.jsx(Mj,{"data-slot":"context-menu-trigger",className:De("select-none",t),...e})}function d3({...t}){return T.jsx(kj,{"data-slot":"context-menu-sub",...t})}function h3({className:t,...e}){return T.jsx(Ej,{children:T.jsx(Rj,{"data-slot":"context-menu-content",className:De("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})})}function p3({className:t,inset:e,variant:n="default",...r}){return T.jsx(Aj,{"data-slot":"context-menu-item","data-inset":e,"data-variant":n,className:De("group/context-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function m3({className:t,inset:e,children:n,...r}){return T.jsxs(Nj,{"data-slot":"context-menu-sub-trigger","data-inset":e,className:De("flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[n,T.jsx(f1,{className:"ml-auto"})]})}function g3({className:t,...e}){return T.jsx(Dj,{"data-slot":"context-menu-sub-content",className:De("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})}function y3({className:t,inset:e,...n}){return T.jsx(Tj,{"data-slot":"context-menu-label","data-inset":e,className:De("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",t),...n})}function v3({className:t,...e}){return T.jsx(Oj,{"data-slot":"context-menu-separator",className:De("-mx-1 my-1 h-px bg-border/50",t),...e})}function b3({className:t,...e}){return T.jsx("span",{"data-slot":"context-menu-shortcut",className:De("ml-auto text-[0.625rem] tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",t),...e})}function S3(t,e){return{...t,mode:e}}function rM(t,e){const n=t.match(/^([a-zA-Z0-9_.-]+)(:|>|<|\.)(.*)$/);if(!n)return null;const[,r,o,l]=n;return{field:e.find(a=>a.id===r),fieldId:r,fragment:l,operator:o}}function x3(t,e){switch(t.kind){case"date":case"number":return e===":"||e===">"||e==="<";case"json":return e===":"||e===".";default:return e===":"}}function iM(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function Gm(t){const e=[];let n=-1,r=!1,o=!1;for(let l=0;l<t.length;l+=1){const a=t[l];if(n===-1){if(/\s/.test(a))continue;n=l}if(o){o=!1;continue}if(a==="\\"){o=!0;continue}if(a==='"'){r=!r;continue}!r&&/\s/.test(a)&&(e.push({end:l,start:n,token:t.slice(n,l)}),n=-1)}return n!==-1&&e.push({end:t.length,start:n,token:t.slice(n)}),e}function oM(t){return Gm(t).map(e=>e.token)}function gS(t){return t.replace(/\\(["\\])/g,"$1")}function sM(t){const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?gS(e.slice(1,-1)):gS(e)}function lM(t){return!t||/[\s"]/u.test(t)?`"${t.replace(/["\\]/g,"\\$&")}"`:t}function yS(t){const e=t.trim().toLowerCase();if(!e)return null;if(e==="today"){const o=new Date;return new Date(o.getFullYear(),o.getMonth(),o.getDate())}const n=e.match(/^-(\d+)d$/);if(n){const o=Number(n[1]);return new Date(Date.now()-o*24*60*60*1e3)}const r=Date.parse(t);return Number.isNaN(r)?null:new Date(r)}function w3(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function C3(t,e,n,r){const o=e.getValue(t),l=iM(o);if(!r.trim())return!0;if(e.kind==="enum")return l.toLowerCase()===r.trim().toLowerCase();if(e.kind==="number"){const a=Number(o),c=Number(r);return Number.isNaN(a)||Number.isNaN(c)?l.toLowerCase().includes(r.trim().toLowerCase()):n===">"?a>c:n==="<"?a<c:a===c}if(e.kind==="date"){const a=n===":"?r.match(/^([<>])(.*)$/):null,c=a?a[1]:n,d=a?a[2]:r,h=yS(l),p=yS(d);return!h||!p?l.toLowerCase().includes(r.trim().toLowerCase()):c===">"?h>p:c==="<"?h<p:w3(h,p)}return l.toLowerCase().includes(r.trim().toLowerCase())}function M3(t,e,n){return n.every(r=>C3(t,e,r.operator,r.value))}function vS(t){return t.flatMap(e=>{switch(e.kind){case"date":return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"},{id:`${e.id}-gt`,group:"filters",insertText:`${e.id}>`,keepOpen:!0,label:`${e.id}>`,mode:"append"},{id:`${e.id}-lt`,group:"filters",insertText:`${e.id}<`,keepOpen:!0,label:`${e.id}<`,mode:"append"}];case"number":return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"},{id:`${e.id}-gt`,group:"filters",insertText:`${e.id}>`,keepOpen:!0,label:`${e.id}>`,mode:"append"},{id:`${e.id}-lt`,group:"filters",insertText:`${e.id}<`,keepOpen:!0,label:`${e.id}<`,mode:"append"}];case"json":return[{id:`${e.id}-dot`,group:"filters",insertText:`${e.id}.`,keepOpen:!0,label:`${e.id}.`,mode:"append"},{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"}];default:return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"}]}})}function aM(t,e,n){const r=Gm(t).find(d=>e>=d.start&&e<=d.end),o=r?.start??e,l=r?.end??e,a=r?.token??"",c=rM(a,n);return c?{end:l,field:c.field,fragment:c.fragment,operator:c.operator,start:o,token:a}:{end:l,fragment:a,start:o,token:a}}function E3(t,e){const n=[];for(const{end:r,start:o,token:l}of Gm(t)){const a=rM(l,e);a?.field&&x3(a.field,a.operator)&&n.push({end:r,fieldId:a.field.id,operator:a.operator,start:o,token:l})}return n}function R3(t,e,n){const r=aM(t,e,n),o=r.fragment.trim().length>0,l=t?[{group:"input",id:"input-value",insertText:t,label:t,mode:"replace-whole"}]:[];if(!r.field||!r.operator){const c=vS(n),d=r.fragment.trim()?c.filter(h=>h.label.toLowerCase().includes(r.fragment.trim().toLowerCase())):c;return o?[...l,...d.map(h=>S3(h,"replace-token"))]:[...l,...d]}if(r.field.kind==="enum"&&r.operator===":"){const c=sM(r.fragment).toLowerCase();if(c&&(r.field.options??[]).some(h=>h.toLowerCase()===c))return l;const d=(r.field.options??[]).filter(h=>h.toLowerCase().includes(c)).map(h=>({group:"values",id:`${r.field?.id}-${h}`,insertText:`${r.field?.id}:${lM(h)}`,label:h,mode:"replace-token"}));return[...l,...d]}if(r.field.kind==="date"){const c=r.field.sample??new Date().toISOString(),d=[{group:"values",id:`${r.field.id}-today`,insertText:`${r.field.id}${r.operator}today`,label:"today",mode:"replace-token"},{group:"values",id:`${r.field.id}-7d`,insertText:`${r.field.id}${r.operator}-7d`,label:"-7d",mode:"replace-token"},{group:"values",id:`${r.field.id}-sample`,insertText:`${r.field.id}${r.operator}${c}`,label:c,mode:"replace-token"}];r.operator===":"&&(d[1]={group:"values",id:`${r.field.id}-7d`,insertText:`${r.field.id}:>-7d`,label:">-7d",mode:"replace-token"},d[2]={group:"values",id:`${r.field.id}-sample`,insertText:`${r.field.id}:>${c}`,label:`>${c}`,mode:"replace-token"});const h=r.fragment.trim()?d.filter(p=>p.label.toLowerCase().includes(r.fragment.trim().toLowerCase())):d;return[...l,...h]}const a=vS([r.field]).filter(c=>c.label.toLowerCase().includes(r.token.trim().toLowerCase()));return[...l,...a]}function T3(t,e,n,r){const o=aM(t,e,n),l=r.mode==="replace-whole"?r.insertText:r.mode==="append"?`${t.trimEnd()}${t.trim()?" ":""}${r.insertText}`:`${t.slice(0,o.start)}${r.insertText}${t.slice(o.end)}`,a=r.mode==="append"?l.length:r.mode==="replace-whole"?r.insertText.length:o.start+r.insertText.length;return{keepOpen:!!r.keepOpen,value:l,selectionStart:a}}function uM(t,e){const n=t.trim();if(!n)return{columnFilters:[],globalFilter:""};const r=oM(n),o=new Map,l=[];return r.forEach(a=>{const c=a.match(/^([a-zA-Z0-9_.-]+)(:|>|<)(.*)$/);if(!c){l.push(a);return}const[,d,h,p]=c,g=e.find(b=>b.id===d);if(!g){l.push(a);return}const v=o.get(g.id)??[];v.push({operator:h,value:sM(p)}),o.set(g.id,v)}),{columnFilters:Array.from(o.entries()).map(([a,c])=>({id:a,value:c})),globalFilter:l.join(" ")}}function A3(t,e,n){const r=uM(t,n),o=n.find(c=>c.id===e),l=r.globalFilter.split(/\s+/).filter(Boolean);if(!o||o.kind!=="text")return l;const a=r.columnFilters.find(c=>c.id===e)?.value.filter(c=>c.operator===":"&&c.value.trim()).map(c=>c.value.trim())??[];return[...l,...a]}function O3(t,e){return Array.from(new Set(t.map(n=>iM(e(n)).trim()).filter(Boolean)))}function k3(t){return t==null?new Date().toISOString():t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function N3(t){return e=>{if(t.accessorFn)return t.accessorFn(e);if(t.accessorKey)return e[t.accessorKey]}}function D3(t){switch(t.kind){case"date":return"date";case"enum":return"enum";case"json":return"json";case"number":return"number";default:return"text"}}function cM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function _3(t,e,n={}){const r=e.at(-1);return t.map((o,l)=>{const a=cM(o,l),c=N3(o),d=D3(o);return d==="enum"?{getValue:c,id:a,kind:d,options:o.enumOptions??n.fieldOptions?.[a]??O3(e,c)}:d==="date"?{getValue:c,id:a,kind:d,sample:k3(r?c(r):new Date().toISOString())}:{getValue:c,id:a,kind:d}})}function z3(t,e){const n=new Map(e.map(r=>[r.id,r]));return t.map((r,o)=>{const l=cM(r,o),a=n.get(l);return!a||r.filterFn?r:{...r,filterFn:((c,d,h)=>{const p=Array.isArray(h)?h:[];return M3(c.original,a,p)})}})}function Qp(t){return`${t}:search`}function Zp(t){return`${t}-search`}function bS(t,e){return typeof window>"u"?"":e==="url"?new URL(window.location.href).searchParams.get(Zp(t))??"":window.localStorage.getItem(Qp(t))??""}function j3(t,e,n){if(!(typeof window>"u")){if(e==="url"){const r=new URL(window.location.href);n.trim()?r.searchParams.set(Zp(t),n):r.searchParams.delete(Zp(t)),window.history.replaceState(window.history.state,"",r);return}if(n){window.localStorage.setItem(Qp(t),n);return}window.localStorage.removeItem(Qp(t))}}const fM="datatable:",L3="datatable-",dM=M.createContext(null);function hf(){return M.useContext(dM)}function I3(){const t=hf();if(!t)throw new Error("useDataTableContext must be used inside DataTableProvider.");return t}function B3({children:t,columns:e,data:n,fieldOptions:r,id:o,onSearchChange:l,persistSearch:a=!1,search:c,searchPersistence:d,statePersistence:h,...p}){const g=d??(a?"localStorage":"none"),v=c!==void 0,[b,S]=M.useState(()=>g==="none"?"":bS(o,g)),x=c??b,C=M.useCallback(U=>{v||S(U),l?.(U)},[v,l]);M.useEffect(()=>{if(v||g==="none"){S("");return}S(bS(o,g))},[o,v,g]),M.useEffect(()=>{v||g==="none"||j3(o,g,b)},[o,v,g,b]);const E=M.useMemo(()=>_3(e,n,{fieldOptions:r}),[e,n,r]),A=M.useMemo(()=>uM(x,E),[x,E]),k=M.useMemo(()=>z3(e,E),[e,E]),N=M.useMemo(()=>({...p,columnFilters:A.columnFilters,columns:k,data:n,globalFilter:A.globalFilter,highlightQuery:x,id:o,resolveColumnHighlightTerms:(U,_)=>A3(_,U,E),statePersistence:h??(g==="none"?"none":g)}),[n,o,A.columnFilters,A.globalFilter,k,g,x,E,h,p]),j=M.useMemo(()=>({search:x,searchFields:E,setSearch:C,tableProps:N}),[C,x,N,E]);return T.jsx(dM.Provider,{value:j,children:t})}function SS(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function V3(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function Wp(t){return`${L3}${t}`}function F3(t){return(t.sorting?.length??0)===0&&(t.columnFilters?.length??0)===0&&Object.keys(t.highlightedColumns??{}).length===0&&Object.keys(t.columnVisibility??{}).length===0&&Object.keys(t.columnSizing??{}).length===0&&!t.globalFilter}function fp(t,e){if(typeof window>"u")return{};try{if(e==="none")return{};const n=e==="url"?new URL(window.location.href).searchParams.get(Wp(t)):window.localStorage.getItem(`${fM}${t}`);return n?JSON.parse(n):{}}catch{return{}}}function P3(t,e,n){if(!(typeof window>"u")&&e!=="none"){if(e==="url"){const r=new URL(window.location.href);F3(n)?r.searchParams.delete(Wp(t)):r.searchParams.set(Wp(t),JSON.stringify(n)),window.history.replaceState(window.history.state,"",r);return}window.localStorage.setItem(`${fM}${t}`,JSON.stringify(n))}}function $3(t){return t==="number"?"right":t==="boolean"||t==="selection"?"center":"left"}function xS(t){switch(t){case"boolean":case"selection":return 76;case"number":return 132;case"date":return 168;case"json":return 240;default:return 220}}function hM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function H3(t,e,n,r,o){const l=Object.keys(t[0]??{}).map(h=>({accessorKey:h,header:SS(h)})),c=(e&&e.length>0?e:l).map((h,p)=>{const g=hM(h,p),v=t.slice(0,25).map(x=>h.accessorFn?h.accessorFn(x):h.accessorKey?x[h.accessorKey]:void 0),b=h.kind??kD(v),S={align:h.align??$3(b),cellClassName:h.cellClassName,enumColors:b==="enum"?h.enumColors:void 0,enumOptions:b==="enum"?h.enumOptions:void 0,headerClassName:h.headerClassName,highlightMatches:h.highlightMatches??b==="text",kind:b,truncate:h.truncate??!0};return{accessorFn:h.accessorFn,accessorKey:h.accessorKey,cell:({getValue:x,row:C})=>h.cell?h.cell({row:C.original,value:x()}):U1(x(),b,{enumColors:b==="enum"?h.enumColors:void 0,enumOptions:b==="enum"?h.enumOptions:void 0}),enableGlobalFilter:h.enableFiltering??!0,filterFn:h.filterFn,enableHiding:h.enableHiding??!0,enableResizing:h.enableResizing??!0,enableSorting:h.enableSorting??!0,header:h.header??SS(g),id:g,maxSize:h.maxWidth??420,meta:S,minSize:h.minWidth??Math.min(xS(b),120),size:h.width??xS(b)}});if(!n)return r?[...c,{cell:()=>null,enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:"Actions",id:"__actions",maxSize:o??280,meta:{align:"right",truncate:!1},minSize:Math.min(o??180,180),size:o??220}]:c;const d=[{cell:({row:h})=>T.jsx("div",{className:"flex items-center justify-center",children:T.jsx(Fb,{ariaLabel:`Select row ${h.index+1}`,checked:h.getIsSelected(),onCheckedChange:p=>h.toggleSelected(p)})}),enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:({table:h})=>T.jsx("div",{className:"flex items-center justify-center",children:T.jsx(Fb,{ariaLabel:"Select all visible rows",checked:h.getIsAllPageRowsSelected(),indeterminate:h.getIsSomePageRowsSelected(),onCheckedChange:p=>h.toggleAllPageRowsSelected(p)})}),id:"__select",maxSize:56,meta:{align:"center",kind:"selection",sticky:"left",truncate:!1},minSize:56,size:56},...c];return r?[...d,{cell:()=>null,enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:"Actions",id:"__actions",maxSize:o??280,meta:{align:"right",truncate:!1},minSize:Math.min(o??180,180),size:o??220}]:d}const U3=(t,e,n)=>{const r=String(n??"").trim().toLowerCase();return r?V3(t.getValue(e)).toLowerCase().includes(r):!0};function wS(t){return t instanceof Element&&!!t.closest(["a","button","input","label","select","summary","textarea","[contenteditable=true]","[data-no-row-select=true]",'[role="button"]','[role="link"]','[role="menuitem"]'].join(","))}function q3(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.original):[e.original]:[e.original]}function G3(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.id):[e.id]:[e.id]}function K3(t,e,n){return{actionRowIds:G3(t,e,n),actionRows:q3(t,e,n),anchorRow:e.original,anchorRowId:e.id,selectedRowIds:n.map(r=>r.id),selectedRows:n.map(r=>r.original)}}function Km(t,e){return typeof t=="function"?t(e):!!t}function pM(t,e){return typeof t.label=="function"?t.label(e):t.label}function _c(t){return t.button===void 0||t.button===!1?null:t.button}function mM(t,e){return`${t.id}:${e.actionRowIds.join(",")}`}function gM(t){if(typeof t=="string")return t;if(t&&typeof t=="object"&&"message"in t&&(typeof t.message=="string"||t.message===void 0))return t.message}function yM(t){return t.some(e=>{if(e.scope==="selection")return!0;const n=Array.isArray(e.items)?e.items:void 0;return n?yM(n):!1})}function vM(t){return t.reduce((e,n)=>{const r=_c(n)!==null?e+1:e,o=Array.isArray(n.items)?n.items:void 0;return o?r+vM(o):r},0)}function Y3(t,e,n,r){const o=typeof t.items=="function"?t.items(e):t.items;return bM(o??[],n,r)}function bM(t,e,n){return t.flatMap(r=>{const o=K3(r,e,n);if(Km(r.hidden,o))return[];const l=Y3(r,o,e,n);return r.items&&l.length===0?[]:[{action:r,context:o,items:l}]})}function SM({resolvedAction:t,setStatus:e,statuses:n}){const{action:r,context:o,items:l}=t,a=pM(r,o),c=Km(r.disabled,o),d=mM(r,o),h=n[d],p=_c(r),g=M.useCallback(async()=>{if(r.onSelect){e(d,{state:"loading"});try{const S=await r.onSelect(o);e(d,{message:gM(S),state:"success"},2500)}catch(S){e(d,{message:S instanceof Error?S.message:String(S),state:"error"},4e3)}}},[r,o,e,d]),v=h?.state==="loading"?ef:h?.state==="success"?$s:h?.state==="error"?bm:r.icon,b=h?.state==="loading";return l.length>0?T.jsxs(d3,{children:[T.jsxs(m3,{disabled:c||b,children:[v?T.jsx(v,{className:"size-3.5"}):null,T.jsx("span",{className:"truncate",children:a})]}),T.jsx(g3,{className:"w-72",children:l.map(S=>T.jsx(SM,{resolvedAction:S,setStatus:e,statuses:n},S.action.id))})]}):T.jsxs(p3,{disabled:c||b,onSelect:()=>{g()},title:h?.message,variant:r.variant??(p==="destructive"||typeof p=="object"&&p?.variant==="destructive"?"destructive":"default"),children:[v?T.jsx(v,{className:De("size-3.5",b&&"animate-spin")}):null,T.jsx("span",{className:"truncate",children:a}),r.shortcut?T.jsx(b3,{children:r.shortcut}):null]})}function X3({resolvedActions:t,setStatus:e,statuses:n}){const r=t.filter(o=>o.items.length===0&&_c(o.action)!==null);return r.length===0?null:T.jsx("div",{className:"flex w-full justify-end gap-1.5","data-no-row-select":"true",children:r.map(o=>{const{action:l,context:a}=o,c=_c(l),d=pM(l,a),h=mM(l,a),p=n[h],g=Km(l.disabled,a)||p?.state==="loading",v=p?.state==="loading"?ef:p?.state==="success"?$s:p?.state==="error"?bm:l.icon,b=c&&typeof c=="object"&&c.label?c.label:d,S=p?.state==="error"?"destructive":typeof c=="string"?c:c&&typeof c=="object"?c.variant??"outline":"outline",x=c&&typeof c=="object"&&c.size?c.size:"sm",C=c&&typeof c=="object"?c.className:void 0;return T.jsxs(_s,{"aria-busy":p?.state==="loading",className:C,disabled:g,onClick:()=>{const E=l.onSelect;E&&(async()=>{e(h,{state:"loading"});try{const A=await E(a);e(h,{message:gM(A),state:"success"},2500)}catch(A){e(h,{message:A instanceof Error?A.message:String(A),state:"error"},4e3)}})()},size:x,title:p?.message,type:"button",variant:S,children:[v?T.jsx(v,{className:De("size-3.5",p?.state==="loading"&&"animate-spin")}):null,b]},h)})})}function J3({autoScrollToBottom:t=!1,autoScrollToBottomThreshold:e=96,columnFilters:n,columnVisibility:r,columns:o,data:l,edgeHorizontalPadding:a="16px",enableRowSelection:c=!1,filterPlaceholder:d="Search across visible columns",globalFilter:h,getRowId:p,height:g=620,highlightQuery:v="",id:b,onColumnFiltersChange:S,onColumnVisibilityChange:x,onGlobalFilterChange:C,resolveColumnHighlightTerms:E,rowActions:A,rowClassName:k,rowHeight:N=48,statePersistence:j="localStorage"}){const U=hf(),_=M.useMemo(()=>fp(b,j),[b,j]),[I,Z]=M.useState(()=>_.sorting??[]),[se,me]=M.useState(()=>_.columnSizing??{}),[ue,be]=M.useState(()=>_.columnVisibility??{}),[ne,ye]=M.useState(()=>_.highlightedColumns??{}),[V,$]=M.useState(()=>_.columnFilters??[]),[B,q]=M.useState({}),[K,D]=M.useState({}),Y=M.useRef({}),ee=M.useRef(null),te=M.useRef(null),oe=M.useRef(null),[ae,he]=M.useState(!1),[Ze,Ee]=M.useState(()=>_.globalFilter??""),on=M.useDeferredValue(Ze),ft=n!==void 0,St=r!==void 0,Ft=h!==void 0,Pt=n??V,hr=r??ue,Ks=A?yM(A):!1,Ys=A?vM(A):0,Hn=c||Ks,ko=c,No=Ys>0,Do=M.useMemo(()=>Math.max(160,Math.min(320,Ys*96)),[Ys]),ka=M.useMemo(()=>{if(!o||o.length===0)return o;const re=new Map((U?.searchFields??[]).filter(ie=>ie.kind==="enum").map(ie=>[ie.id,ie.options??[]]));return o.map((ie,Me)=>{if(ie.kind!=="enum"||ie.enumOptions?.length)return ie;const ke=re.get(hM(ie,Me));return!ke||ke.length===0?ie:{...ie,enumOptions:ke}})},[o,U?.searchFields]),Rf=M.useMemo(()=>H3(l,ka,ko,No,Do),[ka,l,Do,No,ko]),$t=M.useCallback((re,ie,Me)=>{const ke=Y.current[re];ke&&(window.clearTimeout(ke),delete Y.current[re]),D(tt=>({...tt,[re]:ie})),Me&&(Y.current[re]=window.setTimeout(()=>{D(tt=>{const Re={...tt};return delete Re[re],Re}),delete Y.current[re]},Me))},[]),Tf=M.useCallback(re=>{me(ie=>Xn(re,ie))},[]),Na=M.useCallback(re=>{const ie=Xn(re,Pt);ft||$(ie),S?.(ie)},[ft,S,Pt]),Da=M.useCallback(re=>{const ie=Xn(re,hr);St||be(ie),x?.(ie)},[St,x,hr]),Tn=gN({columnResizeMode:"onChange",columns:Rf,data:l,enableColumnResizing:!0,enableRowSelection:Hn,getCoreRowModel:lN(),getFilteredRowModel:fN(),getRowId:p,getSortedRowModel:dN(),globalFilterFn:U3,onColumnFiltersChange:Na,onColumnSizingChange:Tf,onColumnVisibilityChange:Da,onRowSelectionChange:q,onSortingChange:Z,state:{columnFilters:Pt,columnSizing:se,columnVisibility:hr,globalFilter:on.trim(),rowSelection:B,sorting:I}}),pr=M.useRef(null),_o=M.useRef(!0),_a=M.useRef(!1),za=M.useRef(0),Ct=Tn.getRowModel().rows,Mt=Tn.getSelectedRowModel().rows,tr=typeof g=="number"?g:0,Wt=M.useRef(t?Math.max(Ct.length*N-tr,0):0),Pi=AN({count:Ct.length,estimateSize:()=>N,getScrollElement:()=>pr.current,initialOffset:Wt.current,overscan:12}),ja=Pi.getVirtualItems();l.length,Ct.length,Mt.length,M.useEffect(()=>()=>{for(const re of Object.values(Y.current))window.clearTimeout(re)},[]),M.useEffect(()=>{if(ft)return;const re=fp(b,j);Z(re.sorting??[]),me(re.columnSizing??{}),St||be(re.columnVisibility??{}),ye(re.highlightedColumns??{}),$(re.columnFilters??[]),Ee(re.globalFilter??""),q({}),te.current=null,oe.current=null,he(!1),ee.current=null;for(const ie of Object.values(Y.current))window.clearTimeout(ie);Y.current={},D({})},[b,ft,St,j]),M.useEffect(()=>{ft&&$(n)},[n,ft]),M.useEffect(()=>{St&&be(r)},[r,St]),M.useEffect(()=>{Ft&&Ee(h)},[h,Ft]),M.useEffect(()=>{if(typeof window>"u"||j!=="url")return;const re=()=>{const ie=fp(b,"url");Z(ie.sorting??[]),me(ie.columnSizing??{}),St||be(ie.columnVisibility??{}),ye(ie.highlightedColumns??{}),$(ie.columnFilters??[]),Ee(ie.globalFilter??""),q({}),te.current=null,oe.current=null,he(!1),ee.current=null};return window.addEventListener("popstate",re),()=>window.removeEventListener("popstate",re)},[b,St,j]),M.useEffect(()=>{Ft||ft||P3(b,j,{columnFilters:V,columnSizing:se,highlightedColumns:ne,columnVisibility:hr,globalFilter:on.trim(),sorting:I})},[V,se,on,ne,b,ft,Ft,hr,I,j]),M.useEffect(()=>{const re=pr.current;if(!t||!re)return;const ie=()=>{const Me=re.scrollHeight-re.scrollTop-re.clientHeight;_o.current=Me<=e};return ie(),re.addEventListener("scroll",ie,{passive:!0}),()=>{re.removeEventListener("scroll",ie)}},[t,e]),M.useLayoutEffect(()=>{const re=pr.current,ie=za.current;za.current=l.length;const Me=()=>{Ct.length!==0&&(Pi.scrollToIndex(Ct.length-1,{align:"end"}),re?.scrollTo({top:re.scrollHeight}))},ke=()=>{const tt=[],Re=at=>{if(Me(),at<=0)return;const dt=window.requestAnimationFrame(()=>Re(at-1));tt.push(dt)};return Re(4),()=>{for(const at of tt)window.cancelAnimationFrame(at)}};if(t&&re&&!_a.current&&Ct.length>0)return _a.current=!0,_o.current=!0,ke();if(!(!t||!re||l.length<=ie||!_o.current))return ke()},[t,l.length,Pi,Ct.length]);const Xs=M.useCallback((re,ie)=>ne[re]??!!ie.highlightMatches,[ne]),Un=M.useCallback((re,ie,Me={})=>{const ke=Ct.findIndex(dt=>dt.id===re),tt=Ct.findIndex(dt=>dt.id===ie);if(ke===-1||tt===-1)return;const[Re,at]=ke<=tt?[ke,tt]:[tt,ke];q({...Me,...Object.fromEntries(Ct.slice(Re,at+1).map(dt=>[dt.id,!0]))})},[Ct]),$i=M.useCallback(re=>{ee.current=re,q({[re]:!0})},[]),mr=M.useCallback((re,ie)=>{if(!te.current)return;const Me=pr.current;if(!Me)return;const ke=document.elementFromPoint(re,ie)?.closest("tr[data-row-id]"),tt=Array.from(Me.querySelectorAll("tr[data-row-id]")),Re=ke?.dataset.rowId??(ie<Me.getBoundingClientRect().top?tt[0]?.dataset.rowId:ie>Me.getBoundingClientRect().bottom?tt.at(-1)?.dataset.rowId:void 0);if(!Re)return;const{anchorId:at,baseSelection:dt}=te.current;Un(at,Re,dt)},[Un]),gr=M.useCallback((re,ie)=>{if(re.button!==0||!Hn||wS(re.target))return;re.preventDefault(),oe.current={clientX:re.clientX,clientY:re.clientY};const Me=ie.id,ke=re.metaKey||re.ctrlKey,tt=Tn.getState().rowSelection;if(re.shiftKey){const Re=ee.current??Me;ee.current=Re,te.current={anchorId:Re,baseSelection:{}},he(!0),Un(Re,Me);return}if(ke){const Re={...tt};Re[Me]?delete Re[Me]:Re[Me]=!0,ee.current=Me,te.current={anchorId:Me,baseSelection:Re},he(!0),q(Re);return}ee.current=Me,te.current={anchorId:Me,baseSelection:{}},he(!0),q({[Me]:!0})},[Hn,Un,Tn]),zo=M.useCallback((re,ie)=>{if(!Hn||re.buttons!==1||wS(re.target)||!te.current)return;const{anchorId:Me,baseSelection:ke}=te.current;Un(Me,ie.id,ke)},[Hn,Un]),Hi=M.useCallback(re=>{if(Hn){if(re.getIsSelected()){ee.current=re.id;return}$i(re.id)}},[Hn,$i]);return M.useEffect(()=>{if(!ae)return;const re=Me=>{oe.current={clientX:Me.clientX,clientY:Me.clientY},mr(Me.clientX,Me.clientY)},ie=()=>{te.current=null,oe.current=null,he(!1)};return window.addEventListener("mousemove",re),window.addEventListener("mouseup",ie),()=>{window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",ie)}},[ae,mr]),M.useEffect(()=>{if(!ae)return;let re=0;const ie=()=>{const Me=pr.current,ke=oe.current;if(Me&&ke){const{top:tt,bottom:Re}=Me.getBoundingClientRect(),at=48;let dt=0;if(ke.clientY<tt+at?dt=-Math.ceil((tt+at-ke.clientY)/6):ke.clientY>Re-at&&(dt=Math.ceil((ke.clientY-(Re-at))/6)),dt!==0){const Ui=Math.max(-28,Math.min(28,dt));Me.scrollTop+=Ui,mr(ke.clientX,ke.clientY)}}re=window.requestAnimationFrame(ie)};return re=window.requestAnimationFrame(ie),()=>{window.cancelAnimationFrame(re)}},[ae,mr]),T.jsx("section",{className:"flex min-h-0 flex-col overflow-hidden border-t border-border bg-card text-card-foreground shadow-sm",style:{height:g},children:T.jsx("div",{className:De("min-h-0 flex-1 overflow-auto pb-4",ae&&"select-none"),ref:pr,style:{scrollbarGutter:"stable"},children:T.jsxs("table",{className:"grid w-full border-separate border-spacing-0",role:"grid",children:[T.jsx("thead",{className:"sticky top-0 z-20 grid",children:Tn.getHeaderGroups().map(re=>T.jsx("tr",{className:"flex w-full",style:{width:Tn.getTotalSize()},children:re.headers.map((ie,Me)=>T.jsx(_D,{header:ie,highlightEnabled:Xs(ie.column.id,ie.column.columnDef.meta??{}),onToggleHighlight:()=>ye(ke=>({...ke,[ie.column.id]:!Xs(ie.column.id,ie.column.columnDef.meta??{})})),paddingLeft:Me===0?a:void 0,paddingRight:Me===re.headers.length-1?a:void 0,scrollContainerRef:pr},ie.id))},re.id))}),T.jsx("tbody",{className:"relative grid",style:{height:Pi.getTotalSize()},children:ja.length===0?T.jsx("tr",{className:"absolute inset-x-0 top-0 flex h-full items-center justify-center",children:T.jsx("td",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:"No rows match the current filters."})}):ja.map(re=>{const ie=Ct[re.index],Me=bM(A??[],ie,Mt),ke=ie.getIsSelected(),tt=T.jsx("tr",{"aria-selected":ke,className:De("absolute left-0 flex w-full bg-card transition-colors",Hn&&"cursor-pointer",k?.(ie.original),ke&&"bg-primary/10 before:absolute before:-top-px before:left-0 before:h-px before:w-full before:bg-primary before:content-[''] after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-primary after:content-['']"),"data-index":re.index,"data-row-id":ie.id,"data-state":ke?"selected":void 0,onContextMenu:()=>Hi(ie),onMouseDown:Re=>gr(Re,ie),onMouseEnter:Re=>zo(Re,ie),ref:Re=>{Re&&Pi.measureElement(Re)},style:{minHeight:N,transform:`translateY(${re.start}px)`,width:Tn.getTotalSize()},children:ie.getVisibleCells().map((Re,at,dt)=>{const Gr=Re.column.columnDef.meta??{},Ui=Re.column.id==="__actions",La=Gr.kind==="text"&&E&&Xs(Re.column.id,Gr)?E(Re.column.id,v):[];return Ui?T.jsx("td",{className:De("flex shrink-0 border-b border-border px-2 py-1.5 align-middle text-sm text-foreground justify-end text-right",Gr.cellClassName),style:{paddingLeft:at===0?a:void 0,paddingRight:at===dt.length-1?a:void 0,width:Re.column.getSize()},children:T.jsx("div",{className:"w-full min-w-0",children:T.jsx(X3,{resolvedActions:Me,setStatus:$t,statuses:K})})},Re.id):T.jsx(TD,{cell:Re,highlightTerms:La,paddingLeft:at===0?a:void 0,paddingRight:at===dt.length-1?a:void 0},Re.id)})},ie.id);return Me.length===0?tt:T.jsxs(c3,{children:[T.jsx(f3,{asChild:!0,children:tt}),T.jsxs(h3,{className:"w-64",children:[Me.map(Re=>T.jsx(SM,{resolvedAction:Re,setStatus:$t,statuses:K},Re.action.id)),T.jsx(v3,{}),T.jsx(y3,{children:ke&&Mt.length>1?`${Mt.length} selected rows`:"Row actions"})]})]},ie.id)})})]})})})}function Q3(t={}){const e=hf(),n=e?{...e.tableProps,...t}:t;if(n.data===void 0||n.id===void 0)throw new Error("DataTable must be used inside DataTableProvider or receive data and id props.");return T.jsx(J3,{...n})}function xM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function Ym(t,e){return e.includes(".")?e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t):t[e]}function Z3(t){return t.includes(".")}function Lt(t){this.content=t}Lt.prototype={constructor:Lt,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 Lt(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 Lt(n)},addToStart:function(t,e){return new Lt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Lt(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 Lt(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=Lt.from(t),t.size?new Lt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Lt.from(t),t.size?new Lt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Lt.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}};Lt.from=function(t){if(t instanceof Lt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Lt(e)};function wM(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=wM(o.content,l.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function CM(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),c=e.child(--l),d=a.nodeSize;if(a==c){n-=d,r-=d;continue}if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){let h=0,p=Math.min(a.text.length,c.text.length);for(;h<p&&a.text[a.text.length-h-1]==c.text[c.text.length-h-1];)h++,n--,r--;return{a:n,b:r}}if(a.content.size||c.content.size){let h=CM(a.content,c.content,n-1,r-1);if(h)return h}n-=d,r-=d}}class W{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,c=0;c<n;a++){let d=this.content[a],h=c+d.nodeSize;if(h>e&&r(d,o+c,l||null,a)!==!1&&d.content.size){let p=c+1;d.nodesBetween(Math.max(0,e-p),Math.min(d.content.size,n-p),r,o+p)}c=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let l="",a=!0;return this.nodesBetween(e,n,(c,d)=>{let h=c.isText?c.text.slice(Math.max(e,d)-d,n-d):c.isLeaf?o?typeof o=="function"?o(c):o:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&h||c.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 W(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 c=this.content[l],d=a+c.nodeSize;d>e&&((a<e||d>n)&&(c.isText?c=c.cut(Math.max(0,e-a),Math.min(c.text.length,n-a)):c=c.cut(Math.max(0,e-a-1),Math.min(c.content.size,n-a-1))),r.push(c),o+=c.nodeSize),a=d}return new W(r,o)}cutByIndex(e,n){return e==n?W.empty:e==0&&n==this.content.length?this:new W(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 W(o,l)}addToStart(e){return new W([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new W(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 wM(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return CM(this,e,n,r)}findIndex(e){if(e==0)return lc(0,e);if(e==this.size)return lc(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?lc(n+1,l):lc(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 W.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new W(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return W.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 W(n||e,r)}static from(e){if(!e)return W.empty;if(e instanceof W)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new W([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}W.empty=new W([],0);const dp={index:0,offset:0};function lc(t,e){return dp.index=t,dp.offset=e,dp}function zc(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(!zc(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!zc(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Qe=class em{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&&zc(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 em.none;if(e instanceof em)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Qe.none=[];class jc 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=EM(this.content,e+this.openStart,n);return r&&new le(r,this.openStart,this.openEnd)}removeBetween(e,n){return new le(MM(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(W.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(W.empty,0,0);function MM(t,e,n){let{index:r,offset:o}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:c}=t.findIndex(n);if(o==e||l.isText){if(c!=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(MM(l.content,e-o-1,n-o-1)))}function EM(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 c=EM(a.content,e-l-1,n,a);return c&&t.replaceChild(o,a.copy(c))}function W3(t,e,n){if(n.openStart>t.depth)throw new jc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new jc("Inconsistent open depths");return RM(t,e,n,0)}function RM(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=RM(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,c=a.content;return go(a,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=eL(n,t);return go(l,AM(t,a,c,e,r))}else return go(l,Lc(t,e,r))}function TM(t,e){if(!e.type.compatibleContent(t.type))throw new jc("Cannot join "+e.type.name+" onto "+t.type.name)}function tm(t,e,n){let r=t.node(n);return TM(r,e.node(n)),r}function mo(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 Wl(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&&(mo(t.nodeAfter,r),l++));for(let c=l;c<a;c++)mo(o.child(c),r);e&&e.depth==n&&e.textOffset&&mo(e.nodeBefore,r)}function go(t,e){return t.type.checkContent(e),t.copy(e)}function AM(t,e,n,r,o){let l=t.depth>o&&tm(t,e,o+1),a=r.depth>o&&tm(n,r,o+1),c=[];return Wl(null,t,o,c),l&&a&&e.index(o)==n.index(o)?(TM(l,a),mo(go(l,AM(t,e,n,r,o+1)),c)):(l&&mo(go(l,Lc(t,e,o+1)),c),Wl(e,n,o,c),a&&mo(go(a,Lc(n,r,o+1)),c)),Wl(r,null,o,c),new W(c)}function Lc(t,e,n){let r=[];if(Wl(null,t,n,r),t.depth>n){let o=tm(t,e,n+1);mo(go(o,Lc(t,e,n+1)),r)}return Wl(e,null,n,r),new W(r)}function eL(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(W.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class ca{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 c=r;r=o,o=c}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 Ic(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:c,offset:d}=a.content.findIndex(l),h=l-d;if(r.push(a,c,o+d),!h||(a=a.child(c),a.isText))break;l=h-1,o+=d+1}return new ca(n,r,l)}static resolveCached(e,n){let r=CS.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 CS.set(e,r=new tL);let o=r.elts[r.i]=ca.resolve(e,n);return r.i=(r.i+1)%nL,o}}class tL{constructor(){this.elts=[],this.i=0}}const nL=12,CS=new WeakMap;class Ic{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 rL=Object.create(null);let Ti=class nm{constructor(e,n,r,o=Qe.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||W.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&&zc(this.attrs,n||e.defaultAttrs||rL)&&Qe.sameSet(this.marks,r||Qe.none)}copy(e=null){return e==this.content?this:new nm(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new nm(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),c=o.start(a),h=o.node(a).content.cut(o.pos-c,l.pos-c);return new le(h,o.depth-a,l.depth-a)}replace(e,n,r){return W3(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 ca.resolveCached(this,e)}resolveNoCache(e){return ca.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()+")"),OM(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=W.empty,o=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,l),c=a&&a.matchFragment(this.content,n);if(!c||!c.validEnd)return!1;for(let d=o;d<l;d++)if(!this.type.allowsMarks(r.child(d).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=W.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,o,r);return l.type.checkAttrs(l.attrs),l}};Ti.prototype.text=void 0;class Bc extends Ti{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):OM(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 Bc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Bc(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 OM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class xo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new iL(e,n);if(r.next==null)return xo.empty;let o=kM(r);r.next&&r.err("Unexpected trailing text");let l=fL(cL(o));return dL(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,c){let d=a.matchFragment(e,r);if(d&&(!n||d.validEnd))return W.from(c.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:p,next:g}=a.next[h];if(!(p.isText||p.hasRequiredAttrs())&&o.indexOf(g)==-1){o.push(g);let v=l(g,c.concat(p));if(v)return v}}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 c=o;c.type;c=c.via)a.push(c.type);return a.reverse()}for(let a=0;a<l.next.length;a++){let{type:c,next:d}=l.next[a];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in n)&&(!o.type||d.validEnd)&&(r.push({match:c.contentMatch,type:c,via:o}),n[c.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(`
|
|
56
|
+
`)}}xo.empty=new xo(!0);class iL{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 kM(t){let e=[];do e.push(oL(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function oL(t){let e=[];do e.push(sL(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function sL(t){let e=uL(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=lL(t,e);else break;return e}function MS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function lL(t,e){let n=MS(t),r=n;return t.eat(",")&&(t.next!="}"?r=MS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function aL(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 uL(t){if(t.eat("(")){let e=kM(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=aL(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 cL(t){let e=[[]];return o(l(t,0),n()),e;function n(){return e.push([])-1}function r(a,c,d){let h={term:d,to:c};return e[a].push(h),h}function o(a,c){a.forEach(d=>d.to=c)}function l(a,c){if(a.type=="choice")return a.exprs.reduce((d,h)=>d.concat(l(h,c)),[]);if(a.type=="seq")for(let d=0;;d++){let h=l(a.exprs[d],c);if(d==a.exprs.length-1)return h;o(h,c=n())}else if(a.type=="star"){let d=n();return r(c,d),o(l(a.expr,d),d),[r(d)]}else if(a.type=="plus"){let d=n();return o(l(a.expr,c),d),o(l(a.expr,d),d),[r(d)]}else{if(a.type=="opt")return[r(c)].concat(l(a.expr,c));if(a.type=="range"){let d=c;for(let h=0;h<a.min;h++){let p=n();o(l(a.expr,d),p),d=p}if(a.max==-1)o(l(a.expr,d),d);else for(let h=a.min;h<a.max;h++){let p=n();r(d,p),o(l(a.expr,d),p),d=p}return[r(d)]}else{if(a.type=="name")return[r(c,void 0,a.value)];throw new Error("Unknown expr type")}}}}function NM(t,e){return e-t}function ES(t,e){let n=[];return r(e),n.sort(NM);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:c,to:d}=l[a];!c&&n.indexOf(d)==-1&&r(d)}}}function fL(t){let e=Object.create(null);return n(ES(t,0));function n(r){let o=[];r.forEach(a=>{t[a].forEach(({term:c,to:d})=>{if(!c)return;let h;for(let p=0;p<o.length;p++)o[p][0]==c&&(h=o[p][1]);ES(t,d).forEach(p=>{h||o.push([c,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let l=e[r.join(",")]=new xo(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let c=o[a][1].sort(NM);l.next.push({type:o[a][0],next:e[c.join(",")]||n(c)})}return l}}function dL(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],l=!o.validEnd,a=[];for(let c=0;c<o.next.length;c++){let{type:d,next:h}=o.next[c];a.push(d.name),l&&!(d.isText||d.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 DM(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 _M(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 zM(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 jM(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new pL(t,r,e[r]);return n}let RS=class LM{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=jM(e,r.attrs),this.defaultAttrs=DM(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==xo.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:_M(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ti(this,this.computeAttrs(e),W.from(n),Qe.setFrom(r))}createChecked(e=null,n,r){return n=W.from(n),this.checkContent(n),new Ti(this,this.computeAttrs(e),n,Qe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=W.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(W.empty,!0);return l?new Ti(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){zM(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 LM(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 hL(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 pL{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?hL(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class pf{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=jM(e,o.attrs),this.excluded=null;let l=DM(this.attrs);this.instance=l?new Qe(this,l):null}create(e=null){return!e&&this.instance?this.instance:new Qe(this,_M(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((l,a)=>r[l]=new pf(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){zM(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class IM{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=Lt.from(e.nodes),n.marks=Lt.from(e.marks||{}),this.nodes=RS.compile(this.spec.nodes,this),this.marks=pf.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||"",c=l.spec.marks;if(l.contentMatch=r[a]||(r[a]=xo.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=c=="_"?null:c?TS(this,c.split(" ")):c==""||!l.inlineContent?[]:null}for(let o in this.marks){let l=this.marks[o],a=l.spec.excludes;l.excluded=a==null?[l]:a==""?[]:TS(this,a.split(" "))}this.nodeFromJSON=o=>Ti.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 RS){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 Bc(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 TS(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 c in t.marks){let d=t.marks[c];(o=="_"||d.spec.group&&d.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=d)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function mL(t){return t.tag!=null}function gL(t){return t.style!=null}class Ai{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(mL(o))this.tags.push(o);else if(gL(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 OS(this,n,!1);return r.addAll(e,Qe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new OS(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(bL(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],c=a.style;if(!(c.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||c.length>e.length&&(c.charCodeAt(e.length)!=61||c.slice(e.length+1)!=n))){if(a.getAttrs){let d=a.getAttrs(n);if(d===!1)continue;a.attrs=d||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 c=n[a];if((c.priority==null?50:c.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=kS(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=kS(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ai(e,Ai.schemaRules(e)))}}const BM={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},yL={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},VM={ol:!0,ul:!0},fa=1,rm=2,ea=4;function AS(t,e,n){return e!=null?(e?fa:0)|(e==="full"?rm:0):t&&t.whitespace=="pre"?fa|rm:n&~ea}class ac{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&ea?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(W.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&fa)){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=W.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(W.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&&!BM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class OS{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=AS(null,n.preserveWhitespace,0)|(r?ea:0);o?l=new ac(o.type,o.attrs,Qe.none,!0,n.topMatch||o.type.contentMatch,a):r?l=new ac(null,null,Qe.none,!0,null,a):l=new ac(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&rm?"full":this.localPreserveWS||(o.options&fa)>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,`
|
|
57
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let c=r.split(/\r?\n|\r/);for(let d=0;d<c.length;d++)d&&this.insertNode(a.linebreakReplacement.create(),n,!0),c[d]&&this.insertNode(a.text(c[d]),n,!/\S/.test(c[d]));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 c=o.content[o.content.length-1],d=e.previousSibling;(!c||d&&d.nodeName=="BR"||c.isText&&/[ \t\r\n\u000c]$/.test(c.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(),c;VM.hasOwnProperty(a)&&this.parser.normalizeLists&&vL(e);let d=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,r));e:if(d?d.ignore:yL.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!d||d.skip||d.closeParent){d&&d.closeParent?this.open=Math.max(0,this.open-1):d&&d.skip.nodeType&&(e=d.skip);let h,p=this.needsBlock;if(BM.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 g=d&&d.skip?n:this.readStyles(e,n);g&&this.addAll(e,g),h&&this.sync(l),this.needsBlock=p}else{let h=this.readStyles(e,n);h&&this.addElementByRule(e,d,h,d.consuming===!1?c:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
58
|
+
`),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 c=void 0;;){let d=this.parser.matchStyle(l,a,this,c);if(!d)break;if(d.ignore)return null;if(d.clearMark?n=n.filter(h=>!d.clearMark(h)):n=n.concat(this.parser.schema.marks[d.mark].create(d.attrs)),d.consuming===!1)c=d;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 d=this.enter(a,n.attrs||null,r,n.preserveWhitespace);d&&(l=!0,r=d)}else{let d=this.parser.schema.marks[n.mark];r=r.concat(d.create(n.attrs))}let c=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(d=>this.insertNode(d,r,!1));else{let d=e;typeof n.contentElement=="string"?d=e.querySelector(n.contentElement):typeof n.contentElement=="function"?d=n.contentElement(e):n.contentElement&&(d=n.contentElement),this.findAround(e,d,!0),this.addAll(d,r),this.findAround(e,d,!1)}l&&this.sync(c)&&this.open--}addAll(e,n,r,o){let l=r||0;for(let a=r?e.childNodes[r]:e.firstChild,c=o==null?null:e.childNodes[o];a!=c;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,c=0;a>=0;a--){let d=this.nodes[a],h=d.findWrapping(e);if(h&&(!o||o.length>h.length+c)&&(o=h,l=d,!h.length))break;if(d.solid){if(r)break;c+=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 c of o.concat(e.marks))(l.type?l.type.allowsMarkType(c.type):NS(c.type,e.type))&&(a=c.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 c=AS(e,l,a.options);a.options&ea&&a.content.length==0&&(c|=ea);let d=Qe.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):NS(h.type,e))?(d=h.addToSet(d),!1):!0),this.nodes.push(new ac(e,n,d,o,null,c)),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|=fa)}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=(c,d)=>{for(;c>=0;c--){let h=n[c];if(h==""){if(c==n.length-1||c==0)continue;for(;d>=l;d--)if(a(c-1,d))return!0;return!1}else{let p=d>0||d==0&&o?this.nodes[d].type:r&&d>=l?r.node(d-l).type:null;if(!p||p.name!=h&&!p.isInGroup(h))return!1;d--}}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 vL(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&VM.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function bL(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function kS(t){let e={};for(let n in t)e[n]=t[n];return e}function NS(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let l=[],a=c=>{l.push(c);for(let d=0;d<c.edgeCount;d++){let{type:h,next:p}=c.edge(d);if(h==e||l.indexOf(p)<0&&a(p))return!0}};if(a(o.contentMatch))return!0}}class To{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=hp(n).createDocumentFragment());let o=r,l=[];return e.forEach(a=>{if(l.length||a.marks.length){let c=0,d=0;for(;c<l.length&&d<a.marks.length;){let h=a.marks[d];if(!this.marks[h.type.name]){d++;continue}if(!h.eq(l[c][0])||h.type.spec.spanning===!1)break;c++,d++}for(;c<l.length;)o=l.pop()[1];for(;d<a.marks.length;){let h=a.marks[d++],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}=Sc(hp(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&&Sc(hp(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Sc(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new To(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=DS(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return DS(e.marks)}}function DS(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function hp(t){return t.document||window.document}const _S=new WeakMap;function SL(t){let e=_S.get(t);return e===void 0&&_S.set(t,e=xL(t)),e}function xL(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 Sc(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=SL(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 c,d=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 g in h)if(h[g]!=null){let v=g.indexOf(" ");v>0?d.setAttributeNS(g.slice(0,v),g.slice(v+1),h[g]):g=="style"&&d.style?d.style.cssText=h[g]:d.setAttribute(g,h[g])}}for(let g=p;g<e.length;g++){let v=e[g];if(v===0){if(g<e.length-1||g>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}else{let{dom:b,contentDOM:S}=Sc(t,v,n,r);if(d.appendChild(b),S){if(c)throw new RangeError("Multiple content holes");c=S}}}return{dom:d,contentDOM:c}}const FM=65535,PM=Math.pow(2,16);function wL(t,e){return t+e*PM}function zS(t){return t&FM}function CL(t){return(t-(t&FM))/PM}const $M=1,HM=2,xc=4,UM=8;class im{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&UM)>0}get deletedBefore(){return(this.delInfo&($M|xc))>0}get deletedAfter(){return(this.delInfo&(HM|xc))>0}get deletedAcross(){return(this.delInfo&xc)>0}}class Cn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Cn.empty)return Cn.empty}recover(e){let n=0,r=zS(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+CL(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 c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?o:0);if(d>e)break;let h=this.ranges[c+l],p=this.ranges[c+a],g=d+h;if(e<=g){let v=h?e==d?-1:e==g?1:n:n,b=d+o+(v<0?0:p);if(r)return b;let S=e==(n<0?d:g)?null:wL(c/3,e-d),x=e==d?HM:e==g?$M:xc;return(n<0?e!=d:e!=g)&&(x|=UM),new im(b,x,S)}o+=p-h}return r?e+o:new im(e+o,0,null)}touches(e,n){let r=0,o=zS(n),l=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?r:0);if(d>e)break;let h=this.ranges[c+l],p=d+h;if(e<=p&&c==o*3)return!0;r+=this.ranges[c+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],c=a-(this.inverted?l:0),d=a+(this.inverted?0:l),h=this.ranges[o+n],p=this.ranges[o+r];e(c,c+h,d,d+p),l+=p-h}}invert(){return new Cn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Cn.empty:new Cn(e<0?[0,-e,0]:[0,0,e])}}Cn.empty=new Cn([]);class da{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 da(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 da;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],c=a.mapResult(e,n);if(c.recover!=null){let d=this.getMirror(l);if(d!=null&&d>l&&d<this.to){l=d,e=this._maps[d].recover(c.recover);continue}}o|=c.delInfo,e=c.pos}return r?e:new im(e,o,null)}}const pp=Object.create(null);class Qt{getMap(){return Cn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=pp[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 pp)throw new RangeError("Duplicate use of step JSON ID "+e);return pp[e]=n,n.prototype.jsonID=e,n}}class yt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new yt(e,null)}static fail(e){return new yt(null,e)}static fromReplace(e,n,r,o){try{return yt.ok(e.replace(n,r,o))}catch(l){if(l instanceof jc)return yt.fail(l.message);throw l}}}function Xm(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let l=t.child(o);l.content.size&&(l=l.copy(Xm(l.content,e,l))),l.isInline&&(l=e(l,n,o)),r.push(l)}return W.fromArray(r)}class Mi extends Qt{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(Xm(n.content,(a,c)=>!a.isAtom||!c.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return yt.fromReplace(e,this.from,this.to,l)}invert(){return new Jn(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 Mi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Mi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Mi(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 Mi(n.from,n.to,e.markFromJSON(n.mark))}}Qt.jsonID("addMark",Mi);class Jn extends Qt{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(Xm(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return yt.fromReplace(e,this.from,this.to,r)}invert(){return new Mi(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 Jn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Jn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Jn(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 Jn(n.from,n.to,e.markFromJSON(n.mark))}}Qt.jsonID("removeMark",Jn);class Ei extends Qt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return yt.fromReplace(e,this.pos,this.pos+1,new le(W.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 Ei(this.pos,n.marks[o]);return new Ei(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 Ei(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 Ei(n.pos,e.markFromJSON(n.mark))}}Qt.jsonID("addNodeMark",Ei);class wo extends Qt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return yt.fromReplace(e,this.pos,this.pos+1,new le(W.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ei(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))}}Qt.jsonID("removeNodeMark",wo);class Tt extends Qt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&om(e,this.from,this.to)?yt.fail("Structure replace would overwrite content"):yt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Cn([this.from,this.to-this.from,this.slice.size])}invert(e){return new Tt(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 Tt(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Tt)||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 Tt(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 Tt(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 Tt(n.from,n.to,le.fromJSON(e,n.slice),!!n.structure)}}Qt.jsonID("replace",Tt);class At extends Qt{constructor(e,n,r,o,l,a,c=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=l,this.insert=a,this.structure=c}apply(e){if(this.structure&&(om(e,this.from,this.gapFrom)||om(e,this.gapTo,this.to)))return yt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return yt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?yt.fromReplace(e,this.from,this.to,r):yt.fail("Content does not fit in gap")}getMap(){return new Cn([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 At(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 At(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 At(n.from,n.to,n.gapFrom,n.gapTo,le.fromJSON(e,n.slice),n.insert,!!n.structure)}}Qt.jsonID("replaceAround",At);function om(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 ML(t,e,n,r){let o=[],l=[],a,c;t.doc.nodesBetween(e,n,(d,h,p)=>{if(!d.isInline)return;let g=d.marks;if(!r.isInSet(g)&&p.type.allowsMarkType(r.type)){let v=Math.max(h,e),b=Math.min(h+d.nodeSize,n),S=r.addToSet(g);for(let x=0;x<g.length;x++)g[x].isInSet(S)||(a&&a.to==v&&a.mark.eq(g[x])?a.to=b:o.push(a=new Jn(v,b,g[x])));c&&c.to==v?c.to=b:l.push(c=new Mi(v,b,r))}}),o.forEach(d=>t.step(d)),l.forEach(d=>t.step(d))}function EL(t,e,n,r){let o=[],l=0;t.doc.nodesBetween(e,n,(a,c)=>{if(!a.isInline)return;l++;let d=null;if(r instanceof pf){let h=a.marks,p;for(;p=r.isInSet(h);)(d||(d=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(a.marks)&&(d=[r]):d=a.marks;if(d&&d.length){let h=Math.min(c+a.nodeSize,n);for(let p=0;p<d.length;p++){let g=d[p],v;for(let b=0;b<o.length;b++){let S=o[b];S.step==l-1&&g.eq(o[b].style)&&(v=S)}v?(v.to=h,v.step=l):o.push({style:g,from:Math.max(c,e),to:h,step:l})}}}),o.forEach(a=>t.step(new Jn(a.from,a.to,a.style)))}function Jm(t,e,n,r=n.contentMatch,o=!0){let l=t.doc.nodeAt(e),a=[],c=e+1;for(let d=0;d<l.childCount;d++){let h=l.child(d),p=c+h.nodeSize,g=r.matchType(h.type);if(!g)a.push(new Tt(c,p,le.empty));else{r=g;for(let v=0;v<h.marks.length;v++)n.allowsMarkType(h.marks[v].type)||t.step(new Jn(c,p,h.marks[v]));if(o&&h.isText&&n.whitespace!="pre"){let v,b=/\r?\n|\r/g,S;for(;v=b.exec(h.text);)S||(S=new le(W.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new Tt(c+v.index,c+v.index+v[0].length,S))}}c=p}if(!r.validEnd){let d=r.fillBefore(W.empty,!0);t.replace(c,c,new le(d,0,0))}for(let d=a.length-1;d>=0;d--)t.step(a[d])}function RL(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Gs(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,l=0;;--r){let a=t.$from.node(r),c=t.$from.index(r)+o,d=t.$to.indexAfter(r)-l;if(r<t.depth&&a.canReplace(c,d,n))return r;if(r==0||a.type.spec.isolating||!RL(a,c,d))break;c&&(o=1),d<a.childCount&&(l=1)}return null}function TL(t,e,n){let{$from:r,$to:o,depth:l}=e,a=r.before(l+1),c=o.after(l+1),d=a,h=c,p=W.empty,g=0;for(let S=l,x=!1;S>n;S--)x||r.index(S)>0?(x=!0,p=W.from(r.node(S).copy(p)),g++):d--;let v=W.empty,b=0;for(let S=l,x=!1;S>n;S--)x||o.after(S+1)<o.end(S)?(x=!0,v=W.from(o.node(S).copy(v)),b++):h++;t.step(new At(d,h,a,c,new le(p.append(v),g,b),p.size-g,!0))}function qM(t,e,n=null,r=t){let o=AL(t,e),l=o&&OL(r,e);return l?o.map(jS).concat({type:e,attrs:n}).concat(l.map(jS)):null}function jS(t){return{type:t,attrs:null}}function AL(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 OL(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 d=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;d&&h<o;h++)d=d.matchType(n.child(h).type);return!d||!d.validEnd?null:a}function kL(t,e,n){let r=W.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let c=n[a].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=W.from(n[a].type.create(n[a].attrs,r))}let o=e.start,l=e.end;t.step(new At(o,l,o,l,new le(r,0,0),n.length,!0))}function NL(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,c)=>{let d=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,d)&&DL(t.doc,t.mapping.slice(l).map(c),r)){let h=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!S?h=!1:!b&&S&&(h=!0)}h===!1&&KM(t,a,c,l),Jm(t,t.mapping.slice(l).map(c,1),r,void 0,h===null);let p=t.mapping.slice(l),g=p.map(c,1),v=p.map(c+a.nodeSize,1);return t.step(new At(g,v,g+1,v-1,new le(W.from(r.create(d,null,a.marks)),0,0),1,!0)),h===!0&&GM(t,a,c,l),!1}})}function GM(t,e,n,r){e.forEach((o,l)=>{if(o.isText){let a,c=/\r?\n|\r/g;for(;a=c.exec(o.text);){let d=t.mapping.slice(r).map(n+1+l+a.index);t.replaceWith(d,d+1,e.type.schema.linebreakReplacement.create())}}})}function KM(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(`
|
|
59
|
+
`))}})}function DL(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function _L(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 At(e,e+l.nodeSize,e+1,e+l.nodeSize-1,new le(W.from(a),0,0),1,!0))}function Fr(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 g=o.node(h),v=o.index(h);if(g.type.spec.isolating)return!1;let b=g.content.cutByIndex(v,g.childCount),S=r&&r[p+1];S&&(b=b.replaceChild(0,S.type.create(S.attrs)));let x=r&&r[p]||g;if(!g.canReplace(v+1,g.childCount)||!x.type.validContent(b))return!1}let c=o.indexAfter(l),d=r&&r[0];return o.node(l).canReplaceWith(c,c,d?d.type:o.node(l+1).type)}function zL(t,e,n=1,r){let o=t.doc.resolve(e),l=W.empty,a=W.empty;for(let c=o.depth,d=o.depth-n,h=n-1;c>d;c--,h--){l=W.from(o.node(c).copy(l));let p=r&&r[h];a=W.from(p?p.type.create(p.attrs,a):o.node(c).copy(a))}t.step(new Tt(e,e,new le(l.append(a),n,n),!0))}function Ao(t,e){let n=t.resolve(e),r=n.index();return YM(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function jL(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 YM(t,e){return!!(t&&e&&!t.isLeaf&&jL(t,e))}function mf(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let l,a,c=r.index(o);if(o==r.depth?(l=r.nodeBefore,a=r.nodeAfter):n>0?(l=r.node(o+1),c++,a=r.node(o).maybeChild(c)):(l=r.node(o).maybeChild(c-1),a=r.node(o+1)),l&&!l.isTextblock&&YM(l,a)&&r.node(o).canReplace(c,c+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function LL(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",g=!!a.contentMatch.matchType(o);p&&!g?r=!1:!p&&g&&(r=!0)}let c=t.steps.length;if(r===!1){let p=t.doc.resolve(e+n);KM(t,p.node(),p.before(),c)}a.inlineContent&&Jm(t,e+n-1,a,l.node().contentMatchAt(l.index()),r==null);let d=t.mapping.slice(c),h=d.map(e-n);if(t.step(new Tt(h,d.map(e+n,-1),le.empty,!0)),r===!0){let p=t.doc.resolve(h);GM(t,p.node(),p.before(),t.steps.length)}return t}function IL(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 XM(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 c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,d=r.index(a)+(c>0?1:0),h=r.node(a),p=!1;if(l==1)p=h.canReplace(d,d,o);else{let g=h.contentMatchAt(d).findWrapping(o.firstChild.type);p=g&&h.canReplaceWith(d,d,g[0])}if(p)return c==0?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function gf(t,e,n=e,r=le.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),l=t.resolve(n);return JM(o,l,r)?new Tt(e,n,r):new BL(o,l,r).fit()}function JM(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class BL{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=W.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=W.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,c=o.depth;for(;a&&c&&l.childCount==1;)l=l.firstChild.content,a--,c--;let d=new le(l,a,c);return e>-1?new At(r.pos,e,this.$to.pos,this.$to.end(),d,n):d.size||r.pos!=this.$to.pos?new Tt(r.pos,o.pos,d):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=mp(this.unplaced.content,r-1).firstChild,o=l.content):o=this.unplaced.content;let a=o.firstChild;for(let c=this.depth;c>=0;c--){let{type:d,match:h}=this.frontier[c],p,g=null;if(n==1&&(a?h.matchType(a.type)||(g=h.fillBefore(W.from(a),!1)):l&&d.compatibleContent(l.type)))return{sliceDepth:r,frontierDepth:c,parent:l,inject:g};if(n==2&&a&&(p=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:c,parent:l,wrap:p};if(l&&h.matchType(l.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=mp(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=mp(e,n);if(o.childCount<=1&&n>0){let l=e.size-n<=n+o.size;this.unplaced=new le(Kl(e,n-1,1),n-1,l?n-1:r)}else this.unplaced=new le(Kl(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,c=r?r.content:a.content,d=a.openStart-e,h=0,p=[],{match:g,type:v}=this.frontier[n];if(o){for(let x=0;x<o.childCount;x++)p.push(o.child(x));g=g.matchFragment(o)}let b=c.size+e-(a.content.size-a.openEnd);for(;h<c.childCount;){let x=c.child(h),C=g.matchType(x.type);if(!C)break;h++,(h>1||d==0||x.content.size)&&(g=C,p.push(QM(x.mark(v.allowedMarks(x.marks)),h==1?d:0,h==c.childCount?b:-1)))}let S=h==c.childCount;S||(b=-1),this.placed=Yl(this.placed,n,W.from(p)),this.frontier[n].match=g,S&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let x=0,C=c;x<b;x++){let E=C.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),C=E.content}this.unplaced=S?e==0?le.empty:new le(Kl(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new le(Kl(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||!gp(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=gp(e,n,o,r,l);if(a){for(let c=n-1;c>=0;c--){let{match:d,type:h}=this.frontier[c],p=gp(e,c,h,d,!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,W.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(W.empty,!0);n.childCount&&(this.placed=Yl(this.placed,this.frontier.length,n))}}function Kl(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Kl(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 mp(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function QM(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,QM(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(W.empty,!0)))),t.copy(r)}function gp(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 c=r.fillBefore(l.content,!0,a);return c&&!VL(n,l.content,a)?c:null}function VL(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function FL(t){return t.spec.defining||t.spec.definingForContent}function PL(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),l=t.doc.resolve(n);if(JM(o,l,r))return t.step(new Tt(e,n,r));let a=WM(o,l);a[a.length-1]==0&&a.pop();let c=-(o.depth+1);a.unshift(c);for(let v=o.depth,b=o.pos-1;v>0;v--,b--){let S=o.node(v).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(v)>-1?c=v:o.before(v)==b&&a.splice(1,0,-v)}let d=a.indexOf(c),h=[],p=r.openStart;for(let v=r.content,b=0;;b++){let S=v.firstChild;if(h.push(S),b==r.openStart)break;v=S.content}for(let v=p-1;v>=0;v--){let b=h[v],S=FL(b.type);if(S&&!b.sameMarkup(o.node(Math.abs(c)-1)))p=v;else if(S||!b.type.isTextblock)break}for(let v=r.openStart;v>=0;v--){let b=(v+p+1)%(r.openStart+1),S=h[b];if(S)for(let x=0;x<a.length;x++){let C=a[(x+d)%a.length],E=!0;C<0&&(E=!1,C=-C);let A=o.node(C-1),k=o.index(C-1);if(A.canReplaceWith(k,k,S.type,S.marks))return t.replace(o.before(C),E?l.after(C):n,new le(ZM(r.content,0,r.openStart,b),b,r.openEnd))}}let g=t.steps.length;for(let v=a.length-1;v>=0&&(t.replace(e,n,r),!(t.steps.length>g));v--){let b=a[v];b<0||(e=o.before(b),n=l.after(b))}}function ZM(t,e,n,r,o){if(e<n){let l=t.firstChild;t=t.replaceChild(0,l.copy(ZM(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(W.empty,!0))}return t}function $L(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=IL(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new le(W.from(r),0,0))}function HL(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),l=WM(r,o);for(let a=0;a<l.length;a++){let c=l[a],d=a==l.length-1;if(d&&c==0||r.node(c).type.contentMatch.validEnd)return t.delete(r.start(c),o.end(c));if(c>0&&(d||r.node(c-1).canReplace(r.index(c-1),o.indexAfter(c-1))))return t.delete(r.before(c),o.after(c))}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 WM(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 zs extends Qt{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 yt.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 yt.fromReplace(e,this.pos,this.pos+1,new le(W.from(o),0,n.isLeaf?0:1))}getMap(){return Cn.empty}invert(e){return new zs(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 zs(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 zs(n.pos,n.attr,n.value)}}Qt.jsonID("attr",zs);class ha extends Qt{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 yt.ok(r)}getMap(){return Cn.empty}invert(e){return new ha(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 ha(n.attr,n.value)}}Qt.jsonID("docAttr",ha);let Is=class extends Error{};Is=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Is.prototype=Object.create(Error.prototype);Is.prototype.constructor=Is;Is.prototype.name="TransformError";class eE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new da}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Is(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}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(e=o.map(e,1),n=o.map(n,-1)),o.forEach((l,a,c,d)=>{e=Math.min(e,c),n=Math.max(n,d)})}return e==1e9?null:{from:e,to:n}}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=gf(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new le(W.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 PL(this,e,n,r),this}replaceRangeWith(e,n,r){return $L(this,e,n,r),this}deleteRange(e,n){return HL(this,e,n),this}lift(e,n){return TL(this,e,n),this}join(e,n=1){return LL(this,e,n),this}wrap(e,n){return kL(this,e,n),this}setBlockType(e,n=e,r,o=null){return NL(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return _L(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new zs(e,n,r)),this}setDocAttribute(e,n){return this.step(new ha(e,n)),this}addNodeMark(e,n){return this.step(new Ei(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 c=a.length-1;c>=0;c--)this.step(a[c])}return this}split(e,n=1,r){return zL(this,e,n,r),this}addMark(e,n,r){return ML(this,e,n,r),this}removeMark(e,n,r){return EL(this,e,n,r),this}clearIncompatible(e,n,r){return Jm(this,e,n,r),this}}const yp=Object.create(null);class ze{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new UL(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 c=0;c<n.openEnd;c++)o=r,r=r.lastChild;let l=e.steps.length,a=this.ranges;for(let c=0;c<a.length;c++){let{$from:d,$to:h}=a[c],p=e.mapping.slice(l);e.replaceRange(p.map(d.pos),p.map(h.pos),c?le.empty:n),c==0&&BS(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:c}=o[l],d=e.mapping.slice(r),h=d.map(a.pos),p=d.map(c.pos);l?e.deleteRange(h,p):(e.replaceRangeWith(h,p,n),BS(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Oe(e):Ts(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?Ts(e.node(0),e.node(l),e.before(l+1),e.index(l),n,r):Ts(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 En(e.node(0))}static atStart(e){return Ts(e,e,0,0,1)||new En(e)}static atEnd(e){return Ts(e,e,e.content.size,e.childCount,-1)||new En(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yp[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 yp)throw new RangeError("Duplicate use of selection JSON ID "+e);return yp[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Oe.between(this.$anchor,this.$head).getBookmark()}}ze.prototype.visible=!0;class UL{constructor(e,n){this.$from=e,this.$to=n}}let LS=!1;function IS(t){!LS&&!t.parent.inlineContent&&(LS=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Oe extends ze{constructor(e,n=e){IS(e),IS(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 ze.near(r);let o=e.resolve(n.map(this.anchor));return new Oe(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 Oe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new yf(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 Oe(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=ze.findFrom(n,r,!0)||ze.findFrom(n,-r,!0);if(l)n=l.$head;else return ze.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(ze.findFrom(e,-r,!0)||ze.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Oe(e,n)}}ze.jsonID("text",Oe);class yf{constructor(e,n){this.anchor=e,this.head=n}map(e){return new yf(e.map(this.anchor),e.map(this.head))}resolve(e){return Oe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Se extends ze{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?ze.near(l):new Se(l)}content(){return new le(W.from(this.node),0,0)}eq(e){return e instanceof Se&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Qm(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(e.resolve(n.anchor))}static create(e,n){return new Se(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Se.prototype.visible=!1;ze.jsonID("node",Se);class Qm{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new yf(r,r):new Qm(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Se.isSelectable(r)?new Se(n):ze.near(n)}}class En extends ze{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=ze.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new En(e)}map(e){return new En(e)}eq(e){return e instanceof En}getBookmark(){return qL}}ze.jsonID("all",En);const qL={map(){return this},resolve(t){return new En(t)}};function Ts(t,e,n,r,o,l=!1){if(e.inlineContent)return Oe.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let c=e.child(a);if(c.isAtom){if(!l&&Se.isSelectable(c))return Se.create(t,n-(o<0?c.nodeSize:0))}else{let d=Ts(t,c,n+o,o<0?c.childCount:0,o,l);if(d)return d}n+=c.nodeSize*o}return null}function BS(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Tt||o instanceof At))return;let l=t.mapping.maps[r],a;l.forEach((c,d,h,p)=>{a==null&&(a=p)}),t.setSelection(ze.near(t.doc.resolve(a),n))}const VS=1,uc=2,FS=4;class GL extends eE{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|VS)&~uc,this.storedMarks=null,this}get selectionSet(){return(this.updated&VS)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=uc,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&uc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~uc,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(ze.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|=FS,this}get scrolledIntoView(){return(this.updated&FS)>0}}function PS(t,e){return!e||!t?t:t.bind(e)}class Xl{constructor(e,n,r){this.name=e,this.init=PS(n.init,r),this.apply=PS(n.apply,r)}}const KL=[new Xl("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Xl("selection",{init(t,e){return t.selection||ze.atStart(e.doc)},apply(t){return t.selection}}),new Xl("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Xl("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class vp{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=KL.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 Xl(r.key,r.spec.state,r))})}}class Os{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 c=this.config.plugins[a];if(c.spec.appendTransaction){let d=o?o[a].n:0,h=o?o[a].state:this,p=d<n.length&&c.spec.appendTransaction.call(c,d?n.slice(d):n,h,r);if(p&&r.filterTransaction(p,a)){if(p.setMeta("appendedTransaction",e),!o){o=[];for(let g=0;g<this.config.plugins.length;g++)o.push(g<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 Os(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 GL(this)}static create(e){let n=new vp(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Os(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 vp(this.schema,e.plugins),r=n.fields,o=new Os(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 vp(e.schema,e.plugins),l=new Os(o);return o.fields.forEach(a=>{if(a.name=="doc")l.doc=Ti.fromJSON(e.schema,n.doc);else if(a.name=="selection")l.selection=ze.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 c in r){let d=r[c],h=d.spec.state;if(d.key==a.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(n,c)){l[a.name]=h.fromJSON.call(d,e,n[c],l);return}}l[a.name]=a.init(e,l)}}),l}}function tE(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=tE(o,e,{})),n[r]=o}return n}class vt{constructor(e){this.spec=e,this.props={},e.props&&tE(e.props,this,this.props),this.key=e.key?e.key.key:nE("plugin")}getState(e){return e[this.key]}}const bp=Object.create(null);function nE(t){return t in bp?t+"$"+ ++bp[t]:(bp[t]=0,t+"$")}class Zt{constructor(e="key"){this.key=nE(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Zm=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function rE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const iE=(t,e,n)=>{let r=rE(t,n);if(!r)return!1;let o=Wm(r);if(!o){let a=r.blockRange(),c=a&&Gs(a);return c==null?!1:(e&&e(t.tr.lift(a,c).scrollIntoView()),!0)}let l=o.nodeBefore;if(hE(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Bs(l,"end")||Se.isSelectable(l)))for(let a=r.depth;;a--){let c=gf(t.doc,r.before(a),r.after(a),le.empty);if(c&&c.slice.size<c.to-c.from){if(e){let d=t.tr.step(c);d.setSelection(Bs(l,"end")?ze.findFrom(d.doc.resolve(d.mapping.map(o.pos,-1)),-1):Se.create(d.doc,o.pos-l.nodeSize)),e(d.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},YL=(t,e,n)=>{let r=rE(t,n);if(!r)return!1;let o=Wm(r);return o?oE(t,o,e):!1},XL=(t,e,n)=>{let r=lE(t,n);if(!r)return!1;let o=eg(r);return o?oE(t,o,e):!1};function oE(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,c=a,d=e.pos+1;for(;!c.isTextblock;d++){if(c.type.spec.isolating)return!1;let p=c.firstChild;if(!p)return!1;c=p}let h=gf(t.doc,l,d,le.empty);if(!h||h.from!=l||h instanceof Tt&&h.slice.size>=d-l)return!1;if(n){let p=t.tr.step(h);p.setSelection(Oe.create(p.doc,l)),n(p.scrollIntoView())}return!0}function Bs(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 sE=(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=Wm(r)}let a=l&&l.nodeBefore;return!a||!Se.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)};function Wm(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 lE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const aE=(t,e,n)=>{let r=lE(t,n);if(!r)return!1;let o=eg(r);if(!o)return!1;let l=o.nodeAfter;if(hE(t,o,e,1))return!0;if(r.parent.content.size==0&&(Bs(l,"start")||Se.isSelectable(l))){let a=gf(t.doc,r.before(),r.after(),le.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(Bs(l,"start")?ze.findFrom(c.doc.resolve(c.mapping.map(o.pos)),1):Se.create(c.doc,c.mapping.map(o.pos))),e(c.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},uE=(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=eg(r)}let a=l&&l.nodeAfter;return!a||!Se.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,l.pos)).scrollIntoView()),!0)};function eg(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 JL=(t,e)=>{let n=t.selection,r=n instanceof Se,o;if(r){if(n.node.isTextblock||!Ao(t.doc,n.from))return!1;o=n.from}else if(o=mf(t.doc,n.from,-1),o==null)return!1;if(e){let l=t.tr.join(o);r&&l.setSelection(Se.create(l.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},QL=(t,e)=>{let n=t.selection,r;if(n instanceof Se){if(n.node.isTextblock||!Ao(t.doc,n.to))return!1;r=n.to}else if(r=mf(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},ZL=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),l=o&&Gs(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)},cE=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
60
|
+
`).scrollIntoView()),!0)};function tg(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 WL=(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=tg(o.contentMatchAt(l));if(!a||!o.canReplaceWith(l,l,a))return!1;if(e){let c=n.after(),d=t.tr.replaceWith(c,c,a.createAndFill());d.setSelection(ze.near(d.doc.resolve(c),1)),e(d.scrollIntoView())}return!0},fE=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof En||r.parent.inlineContent||o.parent.inlineContent)return!1;let l=tg(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,c=t.tr.insert(a,l.createAndFill());c.setSelection(Oe.create(c.doc,a+1)),e(c.scrollIntoView())}return!0},dE=(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(Fr(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Gs(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function eI(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Se&&e.selection.node.isBlock)return!r.parentOffset||!Fr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,c,d=!1,h=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){d=r.end(b)==r.pos+(r.depth-b),h=r.start(b)==r.pos-(r.depth-b),c=tg(r.node(b-1).contentMatchAt(r.indexAfter(b-1))),l.unshift(d&&c?{type:c}:null),a=b;break}else{if(b==1)return!1;l.unshift(null)}let p=e.tr;(e.selection instanceof Oe||e.selection instanceof En)&&p.deleteSelection();let g=p.mapping.map(r.pos),v=Fr(p.doc,g,l.length,l);if(v||(l[0]=c?{type:c}:null,v=Fr(p.doc,g,l.length,l)),!v)return!1;if(p.split(g,l.length,l),!d&&h&&r.node(a).type!=c){let b=p.mapping.map(r.before(a)),S=p.doc.resolve(b);c&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,c)&&p.setNodeMarkup(p.mapping.map(r.before(a)),c)}return n&&n(p.scrollIntoView()),!0}}const tI=eI(),nI=(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(Se.create(t.doc,o))),!0)};function rI(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||Ao(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function hE(t,e,n,r){let o=e.nodeBefore,l=e.nodeAfter,a,c,d=o.type.spec.isolating||l.type.spec.isolating;if(!d&&rI(t,e,n))return!0;let h=!d&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(c=o.contentMatchAt(o.childCount)).findWrapping(l.type))&&c.matchType(a[0]||l.type).validEnd){if(n){let b=e.pos+l.nodeSize,S=W.empty;for(let E=a.length-1;E>=0;E--)S=W.from(a[E].create(null,S));S=W.from(o.copy(S));let x=t.tr.step(new At(e.pos-1,b,e.pos,b,new le(S,1,0),a.length,!0)),C=x.doc.resolve(b+2*a.length);C.nodeAfter&&C.nodeAfter.type==o.type&&Ao(x.doc,C.pos)&&x.join(C.pos),n(x.scrollIntoView())}return!0}let p=l.type.spec.isolating||r>0&&d?null:ze.findFrom(e,1),g=p&&p.$from.blockRange(p.$to),v=g&&Gs(g);if(v!=null&&v>=e.depth)return n&&n(t.tr.lift(g,v).scrollIntoView()),!0;if(h&&Bs(l,"start",!0)&&Bs(o,"end")){let b=o,S=[];for(;S.push(b),!b.isTextblock;)b=b.lastChild;let x=l,C=1;for(;!x.isTextblock;x=x.firstChild)C++;if(b.canReplace(b.childCount,b.childCount,x.content)){if(n){let E=W.empty;for(let k=S.length-1;k>=0;k--)E=W.from(S[k].copy(E));let A=t.tr.step(new At(e.pos-S.length,e.pos+l.nodeSize,e.pos+C,e.pos+l.nodeSize-C,new le(E,S.length,0),0,!0));n(A.scrollIntoView())}return!0}}return!1}function pE(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(Oe.create(e.doc,t<0?o.start(l):o.end(l)))),!0):!1}}const iI=pE(-1),oI=pE(1);function sI(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l),c=a&&qM(a,t,e);return c?(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0):!1}}function $S(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:c}}=n.selection.ranges[l];n.doc.nodesBetween(a,c,(d,h)=>{if(o)return!1;if(!(!d.isTextblock||d.hasMarkup(t,e)))if(d.type==t)o=!0;else{let p=n.doc.resolve(h),g=p.index();o=p.parent.canReplaceWith(g,g+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:c},$to:{pos:d}}=n.selection.ranges[a];l.setBlockType(c,d,t,e)}r(l.scrollIntoView())}return!0}}function ng(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}ng(Zm,iE,sE);ng(Zm,aE,uE);ng(cE,fE,dE,tI);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function lI(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l);if(!a)return!1;let c=r?n.tr:null;return aI(c,a,t,e)?(r&&r(c.scrollIntoView()),!0):!1}}function aI(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 d=a.resolve(e.start-2);l=new Ic(d,d,e.depth),e.endIndex<e.parent.childCount&&(e=new Ic(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let c=qM(l,n,r,e);return c?(t&&uI(t,e,c,o,n),!0):!1}function uI(t,e,n,r,o){let l=W.empty;for(let p=n.length-1;p>=0;p--)l=W.from(n[p].type.create(n[p].attrs,l));t.step(new At(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 c=n.length-a,d=e.start+n.length-(r?2:0),h=e.parent;for(let p=e.startIndex,g=e.endIndex,v=!0;p<g;p++,v=!1)!v&&Fr(t.doc,d,c)&&(t.split(d,c),d+=2*c),d+=h.child(p).nodeSize;return t}function cI(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?fI(e,n,t,l):dI(e,n,l):!0:!1}}function fI(t,e,n,r){let o=t.tr,l=r.end,a=r.$to.end(r.depth);l<a&&(o.step(new At(l-1,a,l,a,new le(W.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ic(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const c=Gs(r);if(c==null)return!1;o.lift(r,c);let d=o.doc.resolve(o.mapping.map(l,-1)-1);return Ao(o.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&o.join(d.pos),e(o.scrollIntoView()),!0}function dI(t,e,n){let r=t.tr,o=n.parent;for(let b=n.end,S=n.endIndex-1,x=n.startIndex;S>x;S--)b-=o.child(S).nodeSize,r.delete(b-1,b+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 c=n.startIndex==0,d=n.endIndex==o.childCount,h=l.node(-1),p=l.index(-1);if(!h.canReplace(p+(c?0:1),p+1,a.content.append(d?W.empty:W.from(o))))return!1;let g=l.pos,v=g+a.nodeSize;return r.step(new At(g-(c?1:0),v+(d?1:0),g+1,v-1,new le((c?W.empty:W.from(o.copy(W.empty))).append(d?W.empty:W.from(o.copy(W.empty))),c?0:1,d?0:1),c?0:1)),e(r.scrollIntoView()),!0}function hI(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 c=l.parent,d=c.child(a-1);if(d.type!=t)return!1;if(n){let h=d.lastChild&&d.lastChild.type==c.type,p=W.from(h?t.create():null),g=new le(W.from(t.create(null,W.from(c.type.create(null,p)))),h?3:1,0),v=l.start,b=l.end;n(e.tr.step(new At(v-(h?3:1),b,v,b,g,1,!0)).scrollIntoView())}return!0}}const It=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Vs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let sm=null;const Br=function(t,e,n){let r=sm||(sm=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},pI=function(){sm=null},Co=function(t,e,n,r){return n&&(HS(t,e,n,r,-1)||HS(t,e,n,r,1))},mI=/^(img|br|input|textarea|hr)$/i;function HS(t,e,n,r,o){for(var l;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Vn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Ta(t)||mI.test(t.nodeName)||t.contentEditable=="false")return!1;e=It(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?Vn(t):0}else return!1}}function Vn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function gI(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=Vn(t)}else if(t.parentNode&&!Ta(t))e=It(t),t=t.parentNode;else return null}}function yI(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&&!Ta(t))e=It(t)+1,t=t.parentNode;else return null}}function vI(t,e,n){for(let r=e==0,o=e==Vn(t);r||o;){if(t==n)return!0;let l=It(t);if(t=t.parentNode,!t)return!1;r=r&&l==0,o=o&&l==Vn(t)}}function Ta(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&&Co(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 bI(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function SI(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Vn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Vn(r.startContainer),r.startOffset)}}}const cr=typeof navigator<"u"?navigator:null,US=typeof document<"u"?document:null,Vi=cr&&cr.userAgent||"",lm=/Edge\/(\d+)/.exec(Vi),mE=/MSIE \d/.exec(Vi),am=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vi),hn=!!(mE||am||lm),Oi=mE?document.documentMode:am?+am[1]:lm?+lm[1]:0,Pn=!hn&&/gecko\/(\d+)/i.test(Vi);Pn&&+(/Firefox\/(\d+)/.exec(Vi)||[0,0])[1];const um=!hn&&/Chrome\/(\d+)/.exec(Vi),Vt=!!um,gE=um?+um[1]:0,Kt=!hn&&!!cr&&/Apple Computer/.test(cr.vendor),Fs=Kt&&(/Mobile\/\w+/.test(Vi)||!!cr&&cr.maxTouchPoints>2),Bn=Fs||(cr?/Mac/.test(cr.platform):!1),yE=cr?/Win/.test(cr.platform):!1,Vr=/Android \d/.test(Vi),Aa=!!US&&"webkitFontSmoothing"in US.documentElement.style,xI=Aa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wI(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 Lr(t,e){return typeof t=="number"?t:t[e]}function CI(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 qS(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=Vs(a);continue}let c=a,d=c==l.body,h=d?wI(l):CI(c),p=0,g=0;if(e.top<h.top+Lr(r,"top")?g=-(h.top-e.top+Lr(o,"top")):e.bottom>h.bottom-Lr(r,"bottom")&&(g=e.bottom-e.top>h.bottom-h.top?e.top+Lr(o,"top")-h.top:e.bottom-h.bottom+Lr(o,"bottom")),e.left<h.left+Lr(r,"left")?p=-(h.left-e.left+Lr(o,"left")):e.right>h.right-Lr(r,"right")&&(p=e.right-h.right+Lr(o,"right")),p||g)if(d)l.defaultView.scrollBy(p,g);else{let b=c.scrollLeft,S=c.scrollTop;g&&(c.scrollTop+=g),p&&(c.scrollLeft+=p);let x=c.scrollLeft-b,C=c.scrollTop-S;e={left:e.left-x,top:e.top-C,right:e.right-x,bottom:e.bottom-C}}let v=d?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(v))break;a=v=="absolute"?a.offsetParent:Vs(a)}}function MI(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 c=t.root.elementFromPoint(l,a);if(!c||c==t.dom||!t.dom.contains(c))continue;let d=c.getBoundingClientRect();if(d.top>=n-20){r=c,o=d.top;break}}return{refDOM:r,refTop:o,stack:vE(t.dom)}}function vE(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Vs(r));return e}function EI({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;bE(n,r==0?0:r-e)}function bE(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 Ms=null;function RI(t){if(t.setActive)return t.setActive();if(Ms)return t.focus(Ms);let e=vE(t);t.focus(Ms==null?{get preventScroll(){return Ms={preventScroll:!0},!0}}:void 0),Ms||(Ms=!1,bE(e,0))}function SE(t,e){let n,r=2e8,o,l=0,a=e.top,c=e.top,d,h;for(let p=t.firstChild,g=0;p;p=p.nextSibling,g++){let v;if(p.nodeType==1)v=p.getClientRects();else if(p.nodeType==3)v=Br(p).getClientRects();else continue;for(let b=0;b<v.length;b++){let S=v[b];if(S.top<=a&&S.bottom>=c){a=Math.max(S.bottom,a),c=Math.min(S.top,c);let x=S.left>e.left?S.left-e.left:S.right<e.left?e.left-S.right:0;if(x<r){n=p,r=x,o=x&&n.nodeType==3?{left:S.right<e.left?S.right:S.left,top:e.top}:e,p.nodeType==1&&x&&(l=g+(e.left>=(S.left+S.right)/2?1:0));continue}}else S.top>e.top&&!d&&S.left<=e.left&&S.right>=e.left&&(d=p,h={left:Math.max(S.left,Math.min(S.right,e.left)),top:S.top});!n&&(e.left>=S.right&&e.top>=S.top||e.left>=S.left&&e.top>=S.bottom)&&(l=g+1)}}return!n&&d&&(n=d,o=h,r=0),n&&n.nodeType==3?TI(n,o):!n||r&&n.nodeType==1?{node:t,offset:l}:SE(n,o)}function TI(t,e){let n=t.nodeValue.length,r=document.createRange(),o;for(let l=0;l<n;l++){r.setEnd(t,l+1),r.setStart(t,l);let a=Si(r,1);if(a.top!=a.bottom&&rg(e,a)){o={node:t,offset:l+(e.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function rg(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function AI(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function OI(t,e,n){let{node:r,offset:o}=SE(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 kI(t,e,n,r){let o=-1;for(let l=e,a=!1;l!=t.dom;){let c=t.docView.nearestDesc(l,!0),d;if(!c)return null;if(c.dom.nodeType==1&&(c.node.isBlock&&c.parent||!c.contentDOM)&&((d=c.dom.getBoundingClientRect()).width||d.height)&&(c.node.isBlock&&c.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(c.dom.nodeName)&&(!a&&d.left>r.left||d.top>r.top?o=c.posBefore:(!a&&d.right<r.left||d.bottom<r.top)&&(o=c.posAfter),a=!0),!c.contentDOM&&o<0&&!c.node.isText))return(c.node.isBlock?r.top<(d.top+d.bottom)/2:r.left<(d.left+d.right)/2)?c.posBefore:c.posAfter;l=c.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function xE(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 c=a.getClientRects();for(let d=0;d<c.length;d++){let h=c[d];if(rg(e,h))return xE(a,e,h)}}if((l=(l+1)%r)==o)break}return t}function NI(t,e){let n=t.dom.ownerDocument,r,o=0,l=SI(n,e.left,e.top);l&&({node:r,offset:o}=l);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),c;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let h=t.dom.getBoundingClientRect();if(!rg(e,h)||(a=xE(t.dom,e,h),!a))return null}if(Kt)for(let h=a;r&&h;h=Vs(h))h.draggable&&(r=void 0);if(a=AI(a,e),r){if(Pn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let p=r.childNodes[o],g;p.nodeName=="IMG"&&(g=p.getBoundingClientRect()).right<=e.left&&g.bottom>e.top&&o++}let h;Aa&&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?c=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(c=kI(t,r,o,e))}c==null&&(c=OI(t,a,e));let d=t.docView.nearestDesc(a,!0);return{pos:c,inside:d?d.posAtStart-d.border:-1}}function GS(t){return t.top<t.bottom||t.left<t.right}function Si(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(GS(r))return r}return Array.prototype.find.call(n,GS)||t.getBoundingClientRect()}const DI=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function wE(t,e,n){let{node:r,offset:o,atom:l}=t.docView.domFromPos(e,n<0?-1:1),a=Aa||Pn;if(r.nodeType==3)if(a&&(DI.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let d=Si(Br(r,o,o),n);if(Pn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let h=Si(Br(r,o-1,o-1),-1);if(h.top==d.top){let p=Si(Br(r,o,o+1),-1);if(p.top!=d.top)return Hl(p,p.left<h.left)}}return d}else{let d=o,h=o,p=n<0?1:-1;return n<0&&!o?(h++,p=-1):n>=0&&o==r.nodeValue.length?(d--,p=1):n<0?d--:h++,Hl(Si(Br(r,d,h),p),p<0)}if(!t.state.doc.resolve(e-(l||0)).parent.inlineContent){if(l==null&&o&&(n<0||o==Vn(r))){let d=r.childNodes[o-1];if(d.nodeType==1)return Sp(d.getBoundingClientRect(),!1)}if(l==null&&o<Vn(r)){let d=r.childNodes[o];if(d.nodeType==1)return Sp(d.getBoundingClientRect(),!0)}return Sp(r.getBoundingClientRect(),n>=0)}if(l==null&&o&&(n<0||o==Vn(r))){let d=r.childNodes[o-1],h=d.nodeType==3?Br(d,Vn(d)-(a?0:1)):d.nodeType==1&&(d.nodeName!="BR"||!d.nextSibling)?d:null;if(h)return Hl(Si(h,1),!1)}if(l==null&&o<Vn(r)){let d=r.childNodes[o];for(;d.pmViewDesc&&d.pmViewDesc.ignoreForCoords;)d=d.nextSibling;let h=d?d.nodeType==3?Br(d,0,a?0:1):d.nodeType==1?d:null:null;if(h)return Hl(Si(h,-1),!0)}return Hl(Si(r.nodeType==3?Br(r):r,-n),n>=0)}function Hl(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 Sp(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 CE(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 _I(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return CE(t,e,()=>{let{node:l}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let c=t.docView.nearestDesc(l,!0);if(!c)break;if(c.node.isBlock){l=c.contentDOM||c.dom;break}l=c.dom.parentNode}let a=wE(t,o.pos,1);for(let c=l.firstChild;c;c=c.nextSibling){let d;if(c.nodeType==1)d=c.getClientRects();else if(c.nodeType==3)d=Br(c,0,c.nodeValue.length).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[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 zI=/[\u0590-\u08ac]/;function jI(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,c=t.domSelection();return c?!zI.test(r.parent.textContent)||!c.modify?n=="left"||n=="backward"?l:a:CE(t,e,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:g}=t.domSelectionRange(),v=c.caretBidiLevel;c.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:S,focusOffset:x}=t.domSelectionRange(),C=S&&!b.contains(S.nodeType==1?S:S.parentNode)||d==S&&h==x;try{c.collapse(p,g),d&&(d!=p||h!=g)&&c.extend&&c.extend(d,h)}catch{}return v!=null&&(c.caretBidiLevel=v),C}):r.pos==r.start()||r.pos==r.end()}let KS=null,YS=null,XS=!1;function LI(t,e,n){return KS==e&&YS==n?XS:(KS=e,YS=n,XS=n=="up"||n=="down"?_I(t,e,n):jI(t,e,n))}const $n=0,JS=1,fo=2,fr=3;class Oa{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=$n,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>It(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 c=o.children[a];if(c.size){o=c;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],c=l+a.size;if(c>e||a instanceof EE){o=e-l;break}l=c}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 ME&&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?It(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?It(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,c=0;;c++){let d=this.children[c],h=a+d.size;if(o==-1&&e<=h){let p=a+d.border;if(e>=p&&n<=h-d.border&&d.node&&d.contentDOM&&this.contentDOM.contains(d.contentDOM))return d.parseRange(e,n,p);e=a;for(let g=c;g>0;g--){let v=this.children[g-1];if(v.size&&v.dom.parentNode==this.contentDOM&&!v.emptyChildAt(1)){o=It(v.dom)+1;break}e-=v.size}o==-1&&(o=0)}if(o>-1&&(h>n||c==this.children.length-1)){n=h;for(let p=c+1;p<this.children.length;p++){let g=this.children[p];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(-1)){l=It(g.dom);break}n+=g.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 b=0,S=0;b<this.children.length;b++){let x=this.children[b],C=S+x.size;if(l>S&&a<C)return x.setSelection(e-S-x.border,n-S-x.border,r,o);S=C}let c=this.domFromPos(e,e?-1:1),d=n==e?c:this.domFromPos(n,n?-1:1),h=r.root.getSelection(),p=r.domSelectionRange(),g=!1;if((Pn||Kt)&&e==n){let{node:b,offset:S}=c;if(b.nodeType==3){if(g=!!(S&&b.nodeValue[S-1]==`
|
|
61
|
+
`),g&&S==b.nodeValue.length)for(let x=b,C;x;x=x.parentNode){if(C=x.nextSibling){C.nodeName=="BR"&&(c=d={node:C.parentNode,offset:It(C)+1});break}let E=x.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let x=b.childNodes[S-1];g=x&&(x.nodeName=="BR"||x.contentEditable=="false")}}if(Pn&&p.focusNode&&p.focusNode!=d.node&&p.focusNode.nodeType==1){let b=p.focusNode.childNodes[p.focusOffset];b&&b.contentEditable=="false"&&(o=!0)}if(!(o||g&&Kt)&&Co(c.node,c.offset,p.anchorNode,p.anchorOffset)&&Co(d.node,d.offset,p.focusNode,p.focusOffset))return;let v=!1;if((h.extend||e==n)&&!(g&&Pn)){h.collapse(c.node,c.offset);try{e!=n&&h.extend(d.node,d.offset),v=!0}catch{}}if(!v){if(e>n){let S=c;c=d,d=S}let b=document.createRange();b.setEnd(d.node,d.offset),b.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(b)}}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 c=r+l.border,d=a-l.border;if(e>=c&&n<=d){this.dirty=e==r||n==a?fo:JS,e==c&&n==d&&(l.contentLost||l.dom.parentNode!=this.contentDOM)?l.dirty=fr:l.markDirty(e-c,n-c);return}else l.dirty=l.dom==l.contentDOM&&l.dom.parentNode==this.contentDOM&&!l.children.length?fo:fr}r=a}this.dirty=fo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?fo:JS;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class ME extends Oa{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 c=document.createElement("span");c.appendChild(a),a=c}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==$n&&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 II extends Oa{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 Oa{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=To.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&fr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=fr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=$n){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$n}}slice(e,n,r){let o=Mo.create(this.parent,this.mark,!0,r),l=this.children,a=this.size;n<a&&(l=fm(l,n,a,r)),e>0&&(l=fm(l,0,e,r));for(let c=0;c<l.length;c++)l[c].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 ki extends Oa{constructor(e,n,r,o,l,a,c,d,h){super(e,[],l,a),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=c}static create(e,n,r,o,l,a){let c=l.nodeViews[n.type.name],d,h=c&&c(n,l,()=>{if(!d)return a;if(d.parent)return d.parent.posBeforeChild(d)},r,o),p=h&&h.dom,g=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:g}=To.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!g&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let v=p;return p=AE(p,r,n),h?d=new BI(e,n,r,o,p,g||null,v,h,l,a+1):n.isText?new bf(e,n,r,o,p,v,l):new ki(e,n,r,o,p,g||null,v,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=()=>W.empty)}return e}matchesNode(e,n,r){return this.dirty==$n&&e.eq(this.node)&&Vc(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,c=l&&l.pos<0,d=new FI(this,a&&a.node,e);HI(this.node,this.innerDeco,(h,p,g)=>{h.spec.marks?d.syncToMarks(h.spec.marks,r,e,p):h.type.side>=0&&!g&&d.syncToMarks(p==this.node.childCount?Qe.none:this.node.child(p).marks,r,e,p),d.placeWidget(h,e,o)},(h,p,g,v)=>{d.syncToMarks(h.marks,r,e,v);let b;d.findNodeMatch(h,p,g,v)||c&&e.state.selection.from>o&&e.state.selection.to<o+h.nodeSize&&(b=d.findIndexWithChild(l.node))>-1&&d.updateNodeAt(h,p,g,b,e)||d.updateNextNode(h,p,g,e,v,o)||d.addNode(h,p,g,e,o),o+=h.nodeSize}),d.syncToMarks([],r,e,0),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||this.dirty==fo)&&(a&&this.protectLocalComposition(e,a),RE(this.contentDOM,this.children,e),Fs&&UI(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Oe)||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,c=qI(this.node.content,a,r-n,o-n);return c<0?null:{node:l,pos:c,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 II(this,l,n,o);e.input.compositionNodes.push(a),this.children=fm(this.children,r,r+o.length,e,a)}update(e,n,r,o){return this.dirty==fr||!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=$n}updateOuterDeco(e){if(Vc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=TE(this.dom,this.nodeDOM,cm(this.outerDeco,this.node,n),cm(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 QS(t,e,n,r,o){AE(r,e,t);let l=new ki(void 0,t,e,n,r,r,r,o,0);return l.contentDOM&&l.updateChildren(o,0),l}class bf extends ki{constructor(e,n,r,o,l,a,c){super(e,n,r,o,l,null,a,c,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==fr||this.dirty!=$n&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=$n||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=$n,!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 bf(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=fr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class EE extends Oa{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$n&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class BI extends ki{constructor(e,n,r,o,l,a,c,d,h,p){super(e,n,r,o,l,a,c,h,p),this.spec=d}update(e,n,r,o){if(this.dirty==fr)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 RE(t,e,n){let r=t.firstChild,o=!1;for(let l=0;l<e.length;l++){let a=e[l],c=a.dom;if(c.parentNode==t){for(;c!=r;)r=ZS(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(c,r);if(a instanceof Mo){let d=r?r.previousSibling:t.lastChild;RE(a.contentDOM,a.children,n),r=d?d.nextSibling:t.firstChild}}for(;r;)r=ZS(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const ta=function(t){t&&(this.nodeName=t)};ta.prototype=Object.create(null);const ho=[new ta];function cm(t,e,n){if(t.length==0)return ho;let r=n?ho[0]:new ta,o=[r];for(let l=0;l<t.length;l++){let a=t[l].type.attrs;if(a){a.nodeName&&o.push(r=new ta(a.nodeName));for(let c in a){let d=a[c];d!=null&&(n&&o.length==1&&o.push(r=new ta(e.isInline?"span":"div")),c=="class"?r.class=(r.class?r.class+" ":"")+d:c=="style"?r.style=(r.style?r.style+";":"")+d:c!="nodeName"&&(r[c]=d))}}}return o}function TE(t,e,n,r){if(n==ho&&r==ho)return e;let o=e;for(let l=0;l<r.length;l++){let a=r[l],c=n[l];if(l){let d;c&&c.nodeName==a.nodeName&&o!=t&&(d=o.parentNode)&&d.nodeName.toLowerCase()==a.nodeName||(d=document.createElement(a.nodeName),d.pmIsDeco=!0,d.appendChild(o),c=ho[0]),o=d}VI(o,c||ho[0],a)}return o}function VI(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 AE(t,e,n){return TE(t,t,ho,cm(e,n,t.nodeType!=1))}function Vc(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 ZS(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class FI{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=PI(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,o){let l=0,a=this.stack.length>>1,c=Math.min(a,e.length);for(;l<c&&(l==a-1?this.top:this.stack[l+1<<1]).matchesMark(e[l])&&e[l].type.spec.spanning!==!1;)l++;for(;l<a;)this.destroyRest(),this.top.dirty=$n,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let d=-1,h=this.top.children.length;o<this.preMatch.index&&(h=Math.min(this.index+3,h));for(let p=this.index;p<h;p++){let g=this.top.children[p];if(g.matchesMark(e[a])&&!this.isLocked(g.dom)){d=p;break}}if(d>-1)d>this.index&&(this.changed=!0,this.destroyBetween(this.index,d)),this.top=this.top.children[this.index];else{let p=Mo.create(this.top,e[a],n,r);this.top.children.splice(this.index,0,p),this.top=p,this.changed=!0}this.index=0,a++}}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 c=this.index,d=Math.min(this.top.children.length,c+5);c<d;c++){let h=this.top.children[c];if(h.matchesNode(e,n,r)&&!this.preMatch.matched.has(h)){l=c;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==fr&&a.dom==a.contentDOM&&(a.dirty=fo),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 c=this.index;c<this.top.children.length;c++){let d=this.top.children[c];if(d instanceof ki){let h=this.preMatch.matched.get(d);if(h!=null&&h!=l)return!1;let p=d.dom,g,v=this.isLocked(p)&&!(e.isText&&d.node&&d.node.isText&&d.nodeDOM.nodeValue==e.text&&d.dirty!=fr&&Vc(n,d.outerDeco));if(!v&&d.update(e,n,r,o))return this.destroyBetween(this.index,c),d.dom!=p&&(this.changed=!0),this.index++,!0;if(!v&&(g=this.recreateWrapper(d,e,n,r,o,a)))return this.destroyBetween(this.index,c),this.top.children[this.index]=g,g.contentDOM&&(g.dirty=fo,g.updateChildren(o,a+1),g.dirty=$n),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)||!Vc(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let c=ki.create(this.top,n,r,o,l,a);if(c.contentDOM){c.children=e.children,e.children=[];for(let d of c.children)d.parent=c}return e.destroy(),c}addNode(e,n,r,o,l){let a=ki.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 ME(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 bf)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Kt||Vt)&&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 EE(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 PI(t,e){let n=e,r=n.children.length,o=t.childCount,l=new Map,a=[];e:for(;o>0;){let c;for(;;)if(r){let h=n.children[r-1];if(h instanceof Mo)n=h,r=h.children.length;else{c=h,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let d=c.node;if(d){if(d!=t.child(o-1))break;--o,l.set(c,o),a.push(c)}}return{index:o,matched:l,matches:a.reverse()}}function $I(t,e){return t.type.side-e.type.side}function HI(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,c=[],d=null;for(let h=0;;){let p,g;for(;a<o.length&&o[a].to==l;){let C=o[a++];C.widget&&(p?(g||(g=[p])).push(C):p=C)}if(p)if(g){g.sort($I);for(let C=0;C<g.length;C++)n(g[C],h,!!d)}else n(p,h,!!d);let v,b;if(d)b=-1,v=d,d=null;else if(h<t.childCount)b=h,v=t.child(h++);else break;for(let C=0;C<c.length;C++)c[C].to<=l&&c.splice(C--,1);for(;a<o.length&&o[a].from<=l&&o[a].to>l;)c.push(o[a++]);let S=l+v.nodeSize;if(v.isText){let C=S;a<o.length&&o[a].from<C&&(C=o[a].from);for(let E=0;E<c.length;E++)c[E].to<C&&(C=c[E].to);C<S&&(d=v.cut(C-l),v=v.cut(0,C-l),S=C,b=-1)}else for(;a<o.length&&o[a].to<S;)a++;let x=v.isInline&&!v.isLeaf?c.filter(C=>!C.inline):c.slice();r(v,x,e.forChild(l,v),b),l=S}}function UI(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 qI(t,e,n,r){for(let o=0,l=0;o<t.childCount&&l<=r;){let a=t.child(o++),c=l;if(l+=a.nodeSize,!a.isText)continue;let d=a.text;for(;o<t.childCount;){let h=t.child(o++);if(l+=h.nodeSize,!h.isText)break;d+=h.text}if(l>=n){if(l>=r&&d.slice(r-e.length-c,r-c)==e)return r-e.length;let h=c<r?d.lastIndexOf(e,r-c-1):-1;if(h>=0&&h+e.length+c>=n)return c+h;if(n==r&&d.length>=r+e.length-c&&d.slice(r-c,r-c+e.length)==e)return r}}return-1}function fm(t,e,n,r,o){let l=[];for(let a=0,c=0;a<t.length;a++){let d=t[a],h=c,p=c+=d.size;h>=n||p<=e?l.push(d):(h<e&&l.push(d.slice(0,e-h,r)),o&&(l.push(o),o=void 0),p>n&&l.push(d.slice(n-h,d.size,r)))}return l}function ig(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 c=r.resolve(a),d,h;if(vf(n)){for(d=a;o&&!o.node;)o=o.parent;let g=o.node;if(o&&g.isAtom&&Se.isSelectable(g)&&o.parent&&!(g.isInline&&vI(n.focusNode,n.focusOffset,o.dom))){let v=o.posBefore;h=new Se(a==v?c:r.resolve(v))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let g=a,v=a;for(let b=0;b<n.rangeCount;b++){let S=n.getRangeAt(b);g=Math.min(g,t.docView.posFromDOM(S.startContainer,S.startOffset,1)),v=Math.max(v,t.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(g<0)return null;[d,a]=v==t.state.selection.anchor?[v,g]:[g,v],c=r.resolve(a)}else d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null}let p=r.resolve(d);if(!h){let g=e=="pointer"||t.state.selection.head<c.pos&&!l?1:-1;h=og(t,p,c,g)}return h}function OE(t){return t.editable?t.hasFocus():NE(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Pr(t,e=!1){let n=t.state.selection;if(kE(t,n),!!OE(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Vt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Co(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)KI(t);else{let{anchor:r,head:o}=n,l,a;WS&&!(n instanceof Oe)&&(n.$from.parent.inlineContent||(l=ex(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=ex(t,n.to))),t.docView.setSelection(r,o,t,e),WS&&(l&&tx(l),a&&tx(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&GI(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const WS=Kt||Vt&&gE<63;function ex(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(Kt&&o&&o.contentEditable=="false")return xp(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return xp(o);if(l)return xp(l)}}function xp(t){return t.contentEditable="true",Kt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function tx(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function GI(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(()=>{(!OE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function KI(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,It(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&hn&&Oi<=11&&(n.disabled=!0,n.disabled=!1)}function kE(t,e){if(e instanceof Se){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(nx(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else nx(t)}function nx(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function og(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Oe.between(e,n,r)}function rx(t){return t.editable&&!t.hasFocus()?!1:NE(t)}function NE(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 YI(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Co(e.node,e.offset,n.anchorNode,n.anchorOffset)}function dm(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&&ze.findFrom(l,e)}function xi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ix(t,e,n){let r=t.state.selection;if(r instanceof Oe)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 xi(t,new Oe(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=dm(t.state,e);return o&&o instanceof Se?xi(t,o):!1}else if(!(Bn&&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 c=e<0?o.pos-l.nodeSize:o.pos;return l.isAtom||(a=t.docView.descAt(c))&&!a.contentDOM?Se.isSelectable(l)?xi(t,new Se(e<0?t.state.doc.resolve(o.pos-l.nodeSize):o)):Aa?xi(t,new Oe(t.state.doc.resolve(e<0?c:c+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Se&&r.node.isInline)return xi(t,new Oe(e>0?r.$to:r.$from));{let o=dm(t.state,e);return o?xi(t,o):!1}}}function Fc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function na(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Es(t,e){return e<0?XI(t):JI(t)}function XI(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,l,a=!1;for(Pn&&n.nodeType==1&&r<Fc(n)&&na(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let c=n.childNodes[r-1];if(na(c,-1))o=n,l=--r;else if(c.nodeType==3)n=c,r=n.nodeValue.length;else break}}else{if(DE(n))break;{let c=n.previousSibling;for(;c&&na(c,-1);)o=n.parentNode,l=It(c),c=c.previousSibling;if(c)n=c,r=Fc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?hm(t,n,r):o&&hm(t,o,l)}function JI(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Fc(n),l,a;for(;;)if(r<o){if(n.nodeType!=1)break;let c=n.childNodes[r];if(na(c,1))l=n,a=++r;else break}else{if(DE(n))break;{let c=n.nextSibling;for(;c&&na(c,1);)l=c.parentNode,a=It(c)+1,c=c.nextSibling;if(c)n=c,r=0,o=Fc(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}l&&hm(t,l,a)}function DE(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function QI(t,e){for(;t&&e==t.childNodes.length&&!Ta(t);)e=It(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 ZI(t,e){for(;t&&!e&&!Ta(t);)e=It(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 hm(t,e,n){if(e.nodeType!=3){let l,a;(a=QI(e,n))?(e=a,n=0):(l=ZI(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&&Pr(t)},50)}function ox(t,e){let n=t.state.doc.resolve(e);if(!(Vt||yE)&&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 sx(t,e,n){let r=t.state.selection;if(r instanceof Oe&&!r.empty||n.indexOf("s")>-1||Bn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:l}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=dm(t.state,e);if(a&&a instanceof Se)return xi(t,a)}if(!o.parent.inlineContent){let a=e<0?o:l,c=r instanceof En?ze.near(a,e):ze.findFrom(a,e);return c?xi(t,c):!1}return!1}function lx(t,e){if(!(t.state.selection instanceof Oe))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 ax(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function WI(t){if(!Kt||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;ax(t,r,"true"),setTimeout(()=>ax(t,r,"false"),20)}return!1}function eB(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function tB(t,e){let n=e.keyCode,r=eB(e);if(n==8||Bn&&n==72&&r=="c")return lx(t,-1)||Es(t,-1);if(n==46&&!e.shiftKey||Bn&&n==68&&r=="c")return lx(t,1)||Es(t,1);if(n==13||n==27)return!0;if(n==37||Bn&&n==66&&r=="c"){let o=n==37?ox(t,t.state.selection.from)=="ltr"?-1:1:-1;return ix(t,o,r)||Es(t,o)}else if(n==39||Bn&&n==70&&r=="c"){let o=n==39?ox(t,t.state.selection.from)=="ltr"?1:-1:1;return ix(t,o,r)||Es(t,o)}else{if(n==38||Bn&&n==80&&r=="c")return sx(t,-1,r)||Es(t,-1);if(n==40||Bn&&n==78&&r=="c")return WI(t)||sx(t,1,r)||Es(t,1);if(r==(Bn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function sg(t,e){t.someProp("transformCopied",b=>{e=b(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 b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let a=t.someProp("clipboardSerializer")||To.fromSchema(t.state.schema),c=BE(),d=c.createElement("div");d.appendChild(a.serializeFragment(r,{document:c}));let h=d.firstChild,p,g=0;for(;h&&h.nodeType==1&&(p=IE[h.nodeName.toLowerCase()]);){for(let b=p.length-1;b>=0;b--){let S=c.createElement(p[b]);for(;d.firstChild;)S.appendChild(d.firstChild);d.appendChild(S),g++}h=d.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${o} ${l}${g?` -${g}`:""} ${JSON.stringify(n)}`);let v=t.someProp("clipboardTextSerializer",b=>b(e,t))||e.content.textBetween(0,e.content.size,`
|
|
62
|
+
|
|
63
|
+
`);return{dom:d,text:v,slice:e}}function _E(t,e,n,r,o){let l=o.parent.type.spec.code,a,c;if(!n&&!e)return null;let d=!!e&&(r||l||!n);if(d){if(t.someProp("transformPastedText",v=>{e=v(e,l||r,t)}),l)return c=new le(W.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
64
|
+
`))),0,0),t.someProp("transformPasted",v=>{c=v(c,t,!0)}),c;let g=t.someProp("clipboardTextParser",v=>v(e,o,r,t));if(g)c=g;else{let v=o.marks(),{schema:b}=t.state,S=To.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(x=>{let C=a.appendChild(document.createElement("p"));x&&C.appendChild(S.serializeNode(b.text(x,v)))})}}else t.someProp("transformPastedHTML",g=>{n=g(n,t)}),a=oB(n),Aa&&sB(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 g=+p[3];g>0;g--){let v=a.firstChild;for(;v&&v.nodeType!=1;)v=v.nextSibling;if(!v)break;a=v}if(c||(c=(t.someProp("clipboardParser")||t.someProp("domParser")||Ai.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(d||p),context:o,ruleFromNode(v){return v.nodeName=="BR"&&!v.nextSibling&&v.parentNode&&!nB.test(v.parentNode.nodeName)?{ignore:!0}:null}})),p)c=lB(ux(c,+p[1],+p[2]),p[4]);else if(c=le.maxOpen(rB(c.content,o),!0),c.openStart||c.openEnd){let g=0,v=0;for(let b=c.content.firstChild;g<c.openStart&&!b.type.spec.isolating;g++,b=b.firstChild);for(let b=c.content.lastChild;v<c.openEnd&&!b.type.spec.isolating;v++,b=b.lastChild);c=ux(c,g,v)}return t.someProp("transformPasted",g=>{c=g(c,t,d)}),c}const nB=/^(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 rB(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(c=>{if(!a)return;let d=o.findWrapping(c.type),h;if(!d)return a=null;if(h=a.length&&l.length&&jE(d,l,c,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=LE(a[a.length-1],l.length));let p=zE(c,d);a.push(p),o=o.matchType(p.type),l=d}}),a)return W.from(a)}return t}function zE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,W.from(t));return t}function jE(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let l=jE(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(W.from(zE(n,t,o+1))))}}function LE(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,LE(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(W.empty,!0);return t.copy(n.append(r))}function pm(t,e,n,r,o,l){let a=e<0?t.firstChild:t.lastChild,c=a.content;return t.childCount>1&&(l=0),o<r-1&&(c=pm(c,e,n,r,o+1,l)),o>=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,l<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(W.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}function ux(t,e,n){return e<t.openStart&&(t=new le(pm(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new le(pm(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const IE={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 cx=null;function BE(){return cx||(cx=document.implementation.createHTMLDocument("title"))}let wp=null;function iB(t){let e=window.trustedTypes;return e?(wp||(wp=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),wp.createHTML(t)):t}function oB(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=BE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&IE[r[1].toLowerCase()])&&(t=o.map(l=>"<"+l+">").join("")+t+o.map(l=>"</"+l+">").reverse().join("")),n.innerHTML=iB(t),o)for(let l=0;l<o.length;l++)n=n.querySelector(o[l])||n;return n}function sB(t){let e=t.querySelectorAll(Vt?"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 lB(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 c=r.length-2;c>=0;c-=2){let d=n.nodes[r[c]];if(!d||d.hasRequiredAttrs())break;o=W.from(d.create(r[c+1],o)),l++,a++}return new le(o,l,a)}const nn={},rn={},aB={touchstart:!0,touchmove:!0};class uB{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.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function cB(t){for(let e in nn){let n=nn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{dB(t,r)&&!lg(t,r)&&(t.editable||!(r.type in rn))&&n(t,r)},aB[e]?{passive:!0}:void 0)}Kt&&t.dom.addEventListener("input",()=>null),mm(t)}function Ri(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function fB(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 mm(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>lg(t,r))})}function lg(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function dB(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 hB(t,e){!lg(t,e)&&nn[e.type]&&(t.editable||!(e.type in rn))&&nn[e.type](t,e)}rn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!FE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Vr&&Vt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Fs&&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))||tB(t,n)?n.preventDefault():Ri(t,"key")};rn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};rn.keypress=(t,e)=>{let n=e;if(FE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Bn&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Oe)||!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 Sf(t){return{left:t.clientX,top:t.clientY}}function pB(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ag(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,c=>a>l.depth?c(t,n,l.nodeAfter,l.before(a),o,!0):c(t,n,l.node(a),l.before(a),o,!1)))return!0;return!1}function js(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 mB(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Se.isSelectable(r)?(js(t,new Se(n)),!0):!1}function gB(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Se&&(r=n.node);let l=t.state.doc.resolve(e);for(let a=l.depth+1;a>0;a--){let c=a>l.depth?l.nodeAfter:l.node(a);if(Se.isSelectable(c)){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?(js(t,Se.create(t.state.doc,o)),!0):!1}function yB(t,e,n,r,o){return ag(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(o?gB(t,n):mB(t,n))}function vB(t,e,n,r){return ag(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function bB(t,e,n,r){return ag(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||SB(t,n,r)}function SB(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(js(t,Oe.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),c=o.before(l);if(a.inlineContent)js(t,Oe.create(r,c+1,c+1+a.content.size));else if(Se.isSelectable(a))js(t,Se.create(r,c));else continue;return!0}}function ug(t){return Pc(t)}const VE=Bn?"metaKey":"ctrlKey";nn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ug(t),o=Date.now(),l="singleClick";o-t.input.lastClick.time<500&&pB(n,t.input.lastClick)&&!n[VE]&&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(Sf(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new xB(t,a,n,!!r)):(l=="doubleClick"?vB:bB)(t,a.pos,a.inside,n)?n.preventDefault():Ri(t,"pointer"))};class xB{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[VE],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 c=o?null:r.target,d=c?e.docView.nearestDesc(c,!0):null;this.target=d&&d.nodeDOM.nodeType==1?d.nodeDOM:null;let{selection:h}=e.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||h instanceof Se&&h.from<=a&&h.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Pn&&!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)),Ri(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(()=>Pr(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(Sf(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ri(this.view,"pointer"):yB(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Kt&&this.mightDrag&&!this.mightDrag.node.isAtom||Vt&&!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)?(js(this.view,ze.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ri(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ri(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)}}nn.touchstart=t=>{t.input.lastTouch=Date.now(),ug(t),Ri(t,"pointer")};nn.touchmove=t=>{t.input.lastTouch=Date.now(),Ri(t,"pointer")};nn.contextmenu=t=>ug(t);function FE(t,e){return t.composing?!0:Kt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const wB=Vr?5e3:-1;rn.compositionstart=rn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Oe&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Vt&&yE&&CB(t)))t.markCursor=t.state.storedMarks||n.marks(),Pc(t,!0),t.markCursor=null;else if(Pc(t,!e.selection.empty),Pn&&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 c=t.domSelection();c&&c.collapse(a,a.nodeValue.length);break}else o=a,l=-1}}t.input.composing=!0}PE(t,wB)};function CB(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}rn.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.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,PE(t,20))};function PE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Pc(t),e))}function $E(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=EB());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function MB(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=gI(e.focusNode,e.focusOffset),r=yI(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 EB(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Pc(t,e=!1){if(!(Vr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),$E(t),e||t.docView&&t.docView.dirty){let n=ig(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 RB(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 pa=hn&&Oi<15||Fs&&xI<604;nn.copy=rn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let l=pa?null:n.clipboardData,a=r.content(),{dom:c,text:d}=sg(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",c.innerHTML),l.setData("text/plain",d)):RB(t,c),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function TB(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function AB(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?ma(t,r.value,null,o,e):ma(t,r.textContent,r.innerHTML,o,e)},50)}function ma(t,e,n,r,o){let l=_E(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",d=>d(t,o,l||le.empty)))return!0;if(!l)return!1;let a=TB(l),c=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(l);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function HE(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," "):""}rn.paste=(t,e)=>{let n=e;if(t.composing&&!Vr)return;let r=pa?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ma(t,HE(r),r.getData("text/html"),o,n)?n.preventDefault():AB(t,n)};class UE{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const OB=Bn?"altKey":"ctrlKey";function qE(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[OB]}nn.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(Sf(n)),a;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof Se?o.to-1:o.to))){if(r&&r.mightDrag)a=Se.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let g=t.docView.nearestDesc(n.target,!0);g&&g.node.type.spec.draggable&&g!=t.docView&&(a=Se.create(t.state.doc,g.posBefore))}}let c=(a||t.state.selection).content(),{dom:d,text:h,slice:p}=sg(t,c);(!n.dataTransfer.files.length||!Vt||gE>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(pa?"Text":"text/html",d.innerHTML),n.dataTransfer.effectAllowed="copyMove",pa||n.dataTransfer.setData("text/plain",h),t.dragging=new UE(p,qE(t,n),a)};nn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};rn.dragover=rn.dragenter=(t,e)=>e.preventDefault();rn.drop=(t,e)=>{try{kB(t,e,t.dragging)}finally{t.dragging=null}};function kB(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Sf(e));if(!r)return;let o=t.state.doc.resolve(r.pos),l=n&&n.slice;l?t.someProp("transformPasted",b=>{l=b(l,t,!1)}):l=_E(t,HE(e.dataTransfer),pa?null:e.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&qE(t,e));if(t.someProp("handleDrop",b=>b(t,e,l||le.empty,a))){e.preventDefault();return}if(!l)return;e.preventDefault();let c=l?XM(t.state.doc,o.pos,l):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(a){let{node:b}=n;b?b.replace(d):d.deleteSelection()}let h=d.mapping.map(c),p=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,g=d.doc;if(p?d.replaceRangeWith(h,h,l.content.firstChild):d.replaceRange(h,h,l),d.doc.eq(g))return;let v=d.doc.resolve(h);if(p&&Se.isSelectable(l.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(l.content.firstChild))d.setSelection(new Se(v));else{let b=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((S,x,C,E)=>b=E),d.setSelection(og(t,v,d.doc.resolve(b)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))}nn.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())&&Pr(t)},20))};nn.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)};nn.beforeinput=(t,e)=>{if(Vt&&Vr&&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 rn)nn[t]=rn[t];function ga(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 $c{constructor(e,n){this.toDOM=e,this.spec=n||yo,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 Gt(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof $c&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ga(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ni{constructor(e,n){this.attrs=e,this.spec=n||yo}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 Gt(l,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Ni&&ga(this.attrs,e.attrs)&&ga(this.spec,e.spec)}static is(e){return e.type instanceof Ni}destroy(){}}class cg{constructor(e,n){this.attrs=e,this.spec=n||yo}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 Gt(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 cg&&ga(this.attrs,e.attrs)&&ga(this.spec,e.spec)}destroy(){}}class Gt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Gt(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 Gt(e,e,new $c(n,r))}static inline(e,n,r,o){return new Gt(e,n,new Ni(r,o))}static node(e,n,r,o){return new Gt(e,n,new cg(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ni}get widget(){return this.type instanceof $c}}const As=[],yo={};class it{constructor(e,n){this.local=e.length?e:As,this.children=n.length?n:As}static create(e,n){return n.length?Hc(n,e,0,yo):qt}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 c=this.local[a];c.from<=n&&c.to>=e&&(!l||l(c.spec))&&r.push(c.copy(c.from+o,c.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let c=this.children[a]+1;this.children[a+2].findInner(e-c,n-c,r,o+c,l)}}map(e,n,r){return this==qt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||yo)}mapInner(e,n,r,o,l){let a;for(let c=0;c<this.local.length;c++){let d=this.local[c].map(e,r,o);d&&d.type.valid(n,d)?(a||(a=[])).push(d):l.onRemove&&l.onRemove(this.local[c].spec)}return this.children.length?NB(this.children,a||[],e,n,r,o,l):a?new it(a.sort(vo),As):qt}add(e,n){return n.length?this==qt?it.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,l=0;e.forEach((c,d)=>{let h=d+r,p;if(p=KE(n,c,h)){for(o||(o=this.children.slice());l<o.length&&o[l]<d;)l+=3;o[l]==d?o[l+2]=o[l+2].addInner(c,p,h+1):o.splice(l,0,d,d+c.nodeSize,Hc(p,c,h+1,yo)),l+=3}});let a=GE(l?YE(n):n,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new it(a.length?this.local.concat(a).sort(vo):this.local,o||this.children)}remove(e){return e.length==0||this==qt?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,c=r[l]+n,d=r[l+1]+n;for(let p=0,g;p<e.length;p++)(g=e[p])&&g.from>c&&g.to<d&&(e[p]=null,(a||(a=[])).push(g));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[l+2].removeInner(a,c+1);h!=qt?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 c=0;c<o.length;c++)o[c].eq(a,n)&&(o==this.local&&(o=this.local.slice()),o.splice(c--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new it(o,r):qt}forChild(e,n){if(this==qt)return this;if(n.isLeaf)return it.empty;let r,o;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=e){this.children[c]==e&&(r=this.children[c+2]);break}let l=e+1,a=l+n.content.size;for(let c=0;c<this.local.length;c++){let d=this.local[c];if(d.from<a&&d.to>l&&d.type instanceof Ni){let h=Math.max(l,d.from)-l,p=Math.min(a,d.to)-l;h<p&&(o||(o=[])).push(d.copy(h,p))}}if(o){let c=new it(o.sort(vo),As);return r?new Ci([c,r]):c}return r||qt}eq(e){if(this==e)return!0;if(!(e instanceof it)||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 fg(this.localsInner(e))}localsInner(e){if(this==qt)return As;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)}}it.empty=new it([],[]);it.removeOverlap=fg;const qt=it.empty;class Ci{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,yo));return Ci.from(r)}forChild(e,n){if(n.isLeaf)return it.empty;let r=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(e,n);l!=qt&&(l instanceof Ci?r=r.concat(l.members):r.push(l))}return Ci.from(r)}eq(e){if(!(e instanceof Ci)||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?fg(r?n:n.sort(vo)):As}static from(e){switch(e.length){case 0:return qt;case 1:return e[0];default:return new Ci(e.every(n=>n instanceof it)?e:e.reduce((n,r)=>n.concat(r instanceof it?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function NB(t,e,n,r,o,l,a){let c=t.slice();for(let h=0,p=l;h<n.maps.length;h++){let g=0;n.maps[h].forEach((v,b,S,x)=>{let C=x-S-(b-v);for(let E=0;E<c.length;E+=3){let A=c[E+1];if(A<0||v>A+p-g)continue;let k=c[E]+p-g;b>=k?c[E+1]=v<=k?-2:-1:v>=p&&C&&(c[E]+=C,c[E+1]+=C)}g+=C}),p=n.maps[h].map(p,-1)}let d=!1;for(let h=0;h<c.length;h+=3)if(c[h+1]<0){if(c[h+1]==-2){d=!0,c[h+1]=-1;continue}let p=n.map(t[h]+l),g=p-o;if(g<0||g>=r.content.size){d=!0;continue}let v=n.map(t[h+1]+l,-1),b=v-o,{index:S,offset:x}=r.content.findIndex(g),C=r.maybeChild(S);if(C&&x==g&&x+C.nodeSize==b){let E=c[h+2].mapInner(n,C,p+1,t[h]+l+1,a);E!=qt?(c[h]=g,c[h+1]=b,c[h+2]=E):(c[h+1]=-2,d=!0)}else d=!0}if(d){let h=DB(c,t,e,n,o,l,a),p=Hc(h,r,0,a);e=p.local;for(let g=0;g<c.length;g+=3)c[g+1]<0&&(c.splice(g,3),g-=3);for(let g=0,v=0;g<p.children.length;g+=3){let b=p.children[g];for(;v<c.length&&c[v]<b;)v+=3;c.splice(v,0,p.children[g],p.children[g+1],p.children[g+2])}}return new it(e.sort(vo),c)}function GE(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 Gt(o.from+e,o.to+e,o.type))}return n}function DB(t,e,n,r,o,l,a){function c(d,h){for(let p=0;p<d.local.length;p++){let g=d.local[p].map(r,o,h);g?n.push(g):a.onRemove&&a.onRemove(d.local[p].spec)}for(let p=0;p<d.children.length;p+=3)c(d.children[p+2],d.children[p]+h+1)}for(let d=0;d<t.length;d+=3)t[d+1]==-1&&c(t[d+2],e[d]+l+1);return n}function KE(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 YE(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Hc(t,e,n,r){let o=[],l=!1;e.forEach((c,d)=>{let h=KE(t,c,d+n);if(h){l=!0;let p=Hc(h,c,n+d+1,r);p!=qt&&o.push(d,d+c.nodeSize,p)}});let a=GE(l?YE(t):t,-n).sort(vo);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||(r.onRemove&&r.onRemove(a[c].spec),a.splice(c--,1));return a.length||o.length?new it(a,o):qt}function vo(t,e){return t.from-e.from||t.to-e.to}function fg(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),fx(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),fx(e,o,r.copy(l.from,r.to)));break}}}return e}function fx(t,e,n){for(;e<t.length&&vo(n,t[e])>0;)e++;t.splice(e,0,n)}function Cp(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=qt&&e.push(r)}),t.cursorWrapper&&e.push(it.create(t.state.doc,[t.cursorWrapper.deco])),Ci.from(e)}const _B={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},zB=hn&&Oi<=11;class jB{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 LB{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new jB,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]);hn&&Oi<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Kt&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),zB&&(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,_B)),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(rx(this.view)){if(this.suppressingSelectionUpdates)return Pr(this.view);if(hn&&Oi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Co(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=Vs(l))n.add(l);for(let l=e.anchorNode;l;l=Vs(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)&&rx(e)&&!this.ignoreSelectionChange(r),l=-1,a=-1,c=!1,d=[];if(e.editable)for(let p=0;p<n.length;p++){let g=this.registerMutation(n[p],d);g&&(l=l<0?g.from:Math.min(g.from,l),a=a<0?g.to:Math.max(g.to,a),g.typeOver&&(c=!0))}if(d.some(p=>p.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let p of d)if(p.nodeName=="BR"&&p.parentNode){let g=p.nextSibling;for(;g&&g.nodeType==1;){if(g.contentEditable=="false"){p.parentNode.removeChild(p);break}g=g.firstChild}}}else if(Pn&&d.length){let p=d.filter(g=>g.nodeName=="BR");if(p.length==2){let[g,v]=p;g.parentNode&&g.parentNode.parentNode==v.parentNode?v.remove():g.remove()}else{let{focusNode:g}=this.currentSelection;for(let v of p){let b=v.parentNode;b&&b.nodeName=="LI"&&(!g||VB(e,g)!=b)&&v.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=ig(e))&&h.eq(ze.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Pr(e),this.currentSelection.set(r),e.scrollToSelection()):(l>-1||o)&&(l>-1&&(e.docView.markDirty(l,a),IB(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,FB(e,d)),this.handleDOMChange(l,a,c,d),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Pr(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 g=e.addedNodes[p];n.push(g),g.nodeType==3&&(this.lastChangedTextNode=g)}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(hn&&Oi<=11&&e.addedNodes.length)for(let p=0;p<e.addedNodes.length;p++){let{previousSibling:g,nextSibling:v}=e.addedNodes[p];(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(o=g),(!v||Array.prototype.indexOf.call(e.addedNodes,v)<0)&&(l=v)}let a=o&&o.parentNode==e.target?It(o)+1:0,c=r.localPosFromDOM(e.target,a,-1),d=l&&l.parentNode==e.target?It(l):e.target.childNodes.length,h=r.localPosFromDOM(e.target,d,1);return{from:c,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 dx=new WeakMap,hx=!1;function IB(t){if(!dx.has(t)&&(dx.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Pn,hx)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."),hx=!0}}function px(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,l=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Co(a.node,a.offset,o,l)&&([n,r,o,l]=[o,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:l}}function BB(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return px(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?px(t,n):null}function VB(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 FB(t,e){var n;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let l of e)if(((n=l.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=l.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let c=a;for(;;){let d=c.firstChild;if(!d||d.nodeType!=1||d.contentEditable=="false"||/^(BR|IMG)$/.test(d.nodeName))break;c=d}c.insertBefore(l,c.firstChild),r==l&&t.domSelection().collapse(l,o)}else l.parentNode.removeChild(l)}}function PB(t,e,n){let{node:r,fromOffset:o,toOffset:l,from:a,to:c}=t.docView.parseRange(e,n),d=t.domSelectionRange(),h,p=d.anchorNode;if(p&&t.dom.contains(p.nodeType==1?p:p.parentNode)&&(h=[{node:p,offset:d.anchorOffset}],vf(d)||h.push({node:d.focusNode,offset:d.focusOffset})),Vt&&t.input.lastKeyCode===8)for(let C=l;C>o;C--){let E=r.childNodes[C-1],A=E.pmViewDesc;if(E.nodeName=="BR"&&!A){l=C;break}if(!A||A.size)break}let g=t.state.doc,v=t.someProp("domParser")||Ai.fromSchema(t.state.schema),b=g.resolve(a),S=null,x=v.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:o,to:l,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:$B,context:b});if(h&&h[0].pos!=null){let C=h[0].pos,E=h[1]&&h[1].pos;E==null&&(E=C),S={anchor:C+a,head:E+a}}return{doc:x,sel:S,from:a,to:c}}function $B(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Kt&&/^(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||Kt&&/^(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 HB=/^(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 UB(t,e,n,r,o){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let _=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,I=ig(t,_);if(I&&!t.state.selection.eq(I)){if(Vt&&Vr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",se=>se(t,co(13,"Enter"))))return;let Z=t.state.tr.setSelection(I);_=="pointer"?Z.setMeta("pointer",!0):_=="key"&&Z.scrollIntoView(),l&&Z.setMeta("composition",l),t.dispatch(Z)}return}let a=t.state.doc.resolve(e),c=a.sharedDepth(n);e=a.before(c+1),n=t.state.doc.resolve(n).after(c+1);let d=t.state.selection,h=PB(t,e,n),p=t.state.doc,g=p.slice(h.from,h.to),v,b;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(v=t.state.selection.to,b="end"):(v=t.state.selection.from,b="start"),t.input.lastKeyCode=null;let S=KB(g.content,h.doc.content,h.from,v,b);if(S&&t.input.domChangeCount++,(Fs&&t.input.lastIOSEnter>Date.now()-225||Vr)&&o.some(_=>_.nodeType==1&&!HB.test(_.nodeName))&&(!S||S.endA>=S.endB)&&t.someProp("handleKeyDown",_=>_(t,co(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!S)if(r&&d instanceof Oe&&!d.empty&&d.$head.sameParent(d.$anchor)&&!t.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))S={start:d.from,endA:d.to,endB:d.to};else{if(h.sel){let _=mx(t,t.state.doc,h.sel);if(_&&!_.eq(t.state.selection)){let I=t.state.tr.setSelection(_);l&&I.setMeta("composition",l),t.dispatch(I)}}return}t.state.selection.from<t.state.selection.to&&S.start==S.endB&&t.state.selection instanceof Oe&&(S.start>t.state.selection.from&&S.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?S.start=t.state.selection.from:S.endA<t.state.selection.to&&S.endA>=t.state.selection.to-2&&t.state.selection.to<=h.to&&(S.endB+=t.state.selection.to-S.endA,S.endA=t.state.selection.to)),hn&&Oi<=11&&S.endB==S.start+1&&S.endA==S.start&&S.start>h.from&&h.doc.textBetween(S.start-h.from-1,S.start-h.from+1)==" "&&(S.start--,S.endA--,S.endB--);let x=h.doc.resolveNoCache(S.start-h.from),C=h.doc.resolveNoCache(S.endB-h.from),E=p.resolve(S.start),A=x.sameParent(C)&&x.parent.inlineContent&&E.end()>=S.endA;if((Fs&&t.input.lastIOSEnter>Date.now()-225&&(!A||o.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!A&&x.pos<h.doc.content.size&&(!x.sameParent(C)||!x.parent.inlineContent)&&x.pos<C.pos&&!/\S/.test(h.doc.textBetween(x.pos,C.pos,"","")))&&t.someProp("handleKeyDown",_=>_(t,co(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>S.start&&GB(p,S.start,S.endA,x,C)&&t.someProp("handleKeyDown",_=>_(t,co(8,"Backspace")))){Vr&&Vt&&t.domObserver.suppressSelectionUpdates();return}Vt&&S.endB==S.start&&(t.input.lastChromeDelete=Date.now()),Vr&&!A&&x.start()!=C.start()&&C.parentOffset==0&&x.depth==C.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==S.endA&&(S.endB-=2,C=h.doc.resolveNoCache(S.endB-h.from),setTimeout(()=>{t.someProp("handleKeyDown",function(_){return _(t,co(13,"Enter"))})},20));let k=S.start,N=S.endA,j=_=>{let I=_||t.state.tr.replace(k,N,h.doc.slice(S.start-h.from,S.endB-h.from));if(h.sel){let Z=mx(t,I.doc,h.sel);Z&&!(Vt&&t.composing&&Z.empty&&(S.start!=S.endB||t.input.lastChromeDelete<Date.now()-100)&&(Z.head==k||Z.head==I.mapping.map(N)-1)||hn&&Z.empty&&Z.head==k)&&I.setSelection(Z)}return l&&I.setMeta("composition",l),I.scrollIntoView()},U;if(A)if(x.pos==C.pos){hn&&Oi<=11&&x.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Pr(t),20));let _=j(t.state.tr.delete(k,N)),I=p.resolve(S.start).marksAcross(p.resolve(S.endA));I&&_.ensureMarks(I),t.dispatch(_)}else if(S.endA==S.endB&&(U=qB(x.parent.content.cut(x.parentOffset,C.parentOffset),E.parent.content.cut(E.parentOffset,S.endA-E.start())))){let _=j(t.state.tr);U.type=="add"?_.addMark(k,N,U.mark):_.removeMark(k,N,U.mark),t.dispatch(_)}else if(x.parent.child(x.index()).isText&&x.index()==C.index()-(C.textOffset?0:1)){let _=x.parent.textBetween(x.parentOffset,C.parentOffset),I=()=>j(t.state.tr.insertText(_,k,N));t.someProp("handleTextInput",Z=>Z(t,k,N,_,I))||t.dispatch(I())}else t.dispatch(j());else t.dispatch(j())}function mx(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:og(t,e.resolve(n.anchor),e.resolve(n.head))}function qB(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,l=r,a,c,d;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)c=o[0],a="add",d=p=>p.mark(c.addToSet(p.marks));else if(o.length==0&&l.length==1)c=l[0],a="remove",d=p=>p.mark(c.removeFromSet(p.marks));else return null;let h=[];for(let p=0;p<e.childCount;p++)h.push(d(e.child(p)));if(W.from(h).eq(t))return{mark:c,type:a}}function GB(t,e,n,r,o){if(n-e<=o.pos-r.pos||Mp(r,!0,!1)<o.pos)return!1;let l=t.resolve(e);if(!r.parent.isTextblock){let c=l.nodeAfter;return c!=null&&n==e+c.nodeSize}if(l.parentOffset<l.parent.content.size||!l.parent.isTextblock)return!1;let a=t.resolve(Mp(l,!0,!0));return!a.parent.isTextblock||a.pos>n||Mp(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Mp(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 KB(t,e,n,r,o){let l=t.findDiffStart(e,n);if(l==null)return null;let{a,b:c}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let d=Math.max(0,l-Math.min(a,c));r-=a+d-l}if(a<l&&t.size<e.size){let d=r<=l&&r>=a?l-r:0;l-=d,l&&l<e.size&&gx(e.textBetween(l-1,l+1))&&(l+=d?1:-1),c=l+(c-a),a=l}else if(c<l){let d=r<=l&&r>=c?l-r:0;l-=d,l&&l<t.size&&gx(t.textBetween(l-1,l+1))&&(l+=d?1:-1),a=l+(a-c),c=l}return{start:l,endA:a,endB:c}}function gx(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 XE{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 uB,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(xx),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=bx(this),vx(this),this.nodeViews=Sx(this),this.docView=QS(this.state.doc,yx(this),Cp(this),this.dom,this),this.domObserver=new LB(this,(r,o,l,a)=>UB(this,r,o,l,a)),this.domObserver.start(),cB(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&&mm(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(xx),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&&($E(this),a=!0),this.state=e;let c=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(c||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let b=Sx(this);XB(b,this.nodeViews)&&(this.nodeViews=b,l=!0)}(c||n.handleDOMEvents!=this._props.handleDOMEvents)&&mm(this),this.editable=bx(this),vx(this);let d=Cp(this),h=yx(this),p=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",g=l||!this.docView.matchesNode(e.doc,h,d);(g||!e.selection.eq(o.selection))&&(a=!0);let v=p=="preserve"&&a&&this.dom.style.overflowAnchor==null&&MI(this);if(a){this.domObserver.stop();let b=g&&(hn||Vt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&YB(o.selection,e.selection);if(g){let S=Vt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=MB(this)),(l||!this.docView.update(e.doc,h,d,this))&&(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=QS(e.doc,h,d,this.dom,this)),S&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&YI(this))?Pr(this,b):(kE(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():v&&EI(v)}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 Se){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&qS(this,n.getBoundingClientRect(),e)}else qS(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(r.from<this.state.doc.content.size&&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&&l<this.state.doc.content.size&&this.state.doc.nodeAt(l))==r.node&&(o=l)}this.dragging=new UE(e.slice,e.move,o<0?void 0:Se.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 c=this.directPlugins[a].props[e];if(c!=null&&(o=n?n(c):c))return o}let l=this.state.plugins;if(l)for(let a=0;a<l.length;a++){let c=l[a].props[e];if(c!=null&&(o=n?n(c):c))return o}}hasFocus(){if(hn){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&&RI(this.dom),Pr(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 NI(this,e)}coordsAtPos(e,n=1){return wE(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 LI(this,n||this.state,e)}pasteHTML(e,n){return ma(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ma(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return sg(this,e)}destroy(){this.docView&&(fB(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Cp(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pI())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return hB(this,e)}domSelectionRange(){let e=this.domSelection();return e?Kt&&this.root.nodeType===11&&bI(this.dom.ownerDocument)==this.dom&&BB(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}XE.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function yx(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"),[Gt.node(0,t.state.doc.content.size,e)]}function vx(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:Gt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function bx(t){return!t.someProp("editable",e=>e(t.state)===!1)}function YB(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 Sx(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 XB(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 xx(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 Li={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:"'"},Uc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},JB=typeof navigator<"u"&&/Mac/.test(navigator.platform),QB=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Bt=0;Bt<10;Bt++)Li[48+Bt]=Li[96+Bt]=String(Bt);for(var Bt=1;Bt<=24;Bt++)Li[Bt+111]="F"+Bt;for(var Bt=65;Bt<=90;Bt++)Li[Bt]=String.fromCharCode(Bt+32),Uc[Bt]=String.fromCharCode(Bt);for(var Ep in Li)Uc.hasOwnProperty(Ep)||(Uc[Ep]=Li[Ep]);function ZB(t){var e=JB&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||QB&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Uc:Li)[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 WB=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),eV=typeof navigator<"u"&&/Win/.test(navigator.platform);function tV(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,l,a;for(let c=0;c<e.length-1;c++){let d=e[c];if(/^(cmd|meta|m)$/i.test(d))a=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))l=!0;else if(/^mod$/i.test(d))WB?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),a&&(n="Meta-"+n),l&&(n="Shift-"+n),n}function nV(t){let e=Object.create(null);for(let n in t)e[tV(n)]=t[n];return e}function Rp(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 rV(t){return new vt({props:{handleKeyDown:JE(t)}})}function JE(t){let e=nV(t);return function(n,r){let o=ZB(r),l,a=e[Rp(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let c=e[Rp(o,r,!1)];if(c&&c(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(eV&&r.ctrlKey&&r.altKey)&&(l=Li[r.keyCode])&&l!=o){let c=e[Rp(l,r)];if(c&&c(n.state,n.dispatch,n))return!0}}return!1}}var iV=Object.defineProperty,dg=(t,e)=>{for(var n in e)iV(t,n,{get:e[n],enumerable:!0})};function xf(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 wf=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,c])=>[a,(...h)=>{const p=c(...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=[],c=!!t,d=t||o.tr,h=()=>(!c&&e&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(d),a.every(g=>g===!0)),p={...Object.fromEntries(Object.entries(n).map(([g,v])=>[g,(...S)=>{const x=this.buildProps(d,e),C=v(...S)(x);return a.push(C),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(([c,d])=>[c,(...h)=>d(...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:xf({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(([c,d])=>[c,(...h)=>d(...h)(a)]))}};return a}},QE={};dg(QE,{blur:()=>oV,clearContent:()=>sV,clearNodes:()=>lV,command:()=>aV,createParagraphNear:()=>uV,cut:()=>cV,deleteCurrentNode:()=>fV,deleteNode:()=>dV,deleteRange:()=>hV,deleteSelection:()=>pV,enter:()=>mV,exitCode:()=>gV,extendMarkRange:()=>yV,first:()=>vV,focus:()=>SV,forEach:()=>xV,insertContent:()=>wV,insertContentAt:()=>EV,joinBackward:()=>AV,joinDown:()=>TV,joinForward:()=>OV,joinItemBackward:()=>kV,joinItemForward:()=>NV,joinTextblockBackward:()=>DV,joinTextblockForward:()=>_V,joinUp:()=>RV,keyboardShortcut:()=>jV,lift:()=>LV,liftEmptyBlock:()=>IV,liftListItem:()=>BV,newlineInCode:()=>VV,resetAttributes:()=>FV,scrollIntoView:()=>PV,selectAll:()=>$V,selectNodeBackward:()=>HV,selectNodeForward:()=>UV,selectParentNode:()=>qV,selectTextblockEnd:()=>GV,selectTextblockStart:()=>KV,setContent:()=>YV,setMark:()=>m4,setMeta:()=>g4,setNode:()=>y4,setNodeSelection:()=>v4,setTextDirection:()=>b4,setTextSelection:()=>S4,sinkListItem:()=>x4,splitBlock:()=>w4,splitListItem:()=>C4,toggleList:()=>M4,toggleMark:()=>E4,toggleNode:()=>R4,toggleWrap:()=>T4,undoInputRule:()=>A4,unsetAllMarks:()=>O4,unsetMark:()=>k4,unsetTextDirection:()=>N4,updateAttributes:()=>D4,wrapIn:()=>_4,wrapInList:()=>z4});var oV=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),sV=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),lV=()=>({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,(c,d)=>{if(c.type.isText)return;const{doc:h,mapping:p}=e,g=h.resolve(p.map(d)),v=h.resolve(p.map(d+c.nodeSize)),b=g.blockRange(v);if(!b)return;const S=Gs(b);if(c.type.isTextblock){const{defaultType:x}=g.parent.contentMatchAt(g.index());e.setNodeMarkup(b.start,x)}(S||S===0)&&e.lift(b,S)})}),!0},aV=t=>e=>t(e),uV=()=>({state:t,dispatch:e})=>fE(t,e),cV=(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 Oe(r.doc.resolve(Math.max(a-1,0)))),!0},fV=()=>({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 c=o.before(l),d=o.after(l);t.delete(c,d).scrollIntoView()}return!0}return!1};function kt(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 dV=t=>({tr:e,state:n,dispatch:r})=>{const o=kt(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 d=l.before(a),h=l.after(a);e.delete(d,h).scrollIntoView()}return!0}return!1},hV=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},pV=()=>({state:t,dispatch:e})=>Zm(t,e),mV=()=>({commands:t})=>t.keyboardShortcut("Enter"),gV=()=>({state:t,dispatch:e})=>WL(t,e);function hg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function qc(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:hg(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function ZE(t,e,n={}){return t.find(r=>r.type===e&&qc(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function wx(t,e,n={}){return!!ZE(t,e,n)}function WE(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),!ZE([...o.node.marks],e,n)))return;let a=o.index,c=t.start()+o.offset,d=a+1,h=c+o.node.nodeSize;for(;a>0&&wx([...t.parent.child(a-1).marks],e,n);)a-=1,c-=t.parent.child(a).nodeSize;for(;d<t.parent.childCount&&wx([...t.parent.child(d).marks],e,n);)h+=t.parent.child(d).nodeSize,d+=1;return{from:c,to:h}}function qr(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 yV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const l=qr(t,r.schema),{doc:a,selection:c}=n,{$from:d,from:h,to:p}=c;if(o){const g=WE(d,l,e);if(g&&g.from<=h&&g.to>=p){const v=Oe.create(a,g.from,g.to);n.setSelection(v)}}return!0},vV=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 eR(t){return t instanceof Oe}function po(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function tR(t,e=null){if(!e)return null;const n=ze.atStart(t),r=ze.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,l=r.to;return e==="all"?Oe.create(t,po(0,o,l),po(t.content.size,o,l)):Oe.create(t,po(e,o,l),po(e,o,l))}function Cx(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Gc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function bV(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var SV=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:l})=>{e={scrollIntoView:!0,...e};const a=()=>{(Gc()||Cx())&&r.dom.focus(),bV()&&!Gc()&&!Cx()&&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&&!eR(n.state.selection))return a(),!0;const c=tR(o.doc,t)||n.state.selection,d=n.state.selection.eq(c);return l&&(d||o.setSelection(c),d&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},xV=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),wV=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),nR=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&&nR(r)}return t};function cc(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 nR(n)}function ya(t,e,n){if(t instanceof Ti||t instanceof W)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 W.fromArray(t.map(c=>e.nodeFromJSON(c)));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),ya("",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,c="";const d=new IM({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,c=typeof h=="string"?h:h.outerHTML,null)}]}})});if(n.slice?Ai.fromSchema(d).parseSlice(cc(t),n.parseOptions):Ai.fromSchema(d).parse(cc(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const l=Ai.fromSchema(e);return n.slice?l.parseSlice(cc(t),n.parseOptions).content:l.parse(cc(t),n.parseOptions)}return ya("",e,n)}function CV(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Tt||o instanceof At))return;const l=t.mapping.maps[r];let a=0;l.forEach((c,d,h,p)=>{a===0&&(a=p)}),t.setSelection(ze.near(t.doc.resolve(a),n))}var MV=t=>!("type"in t),EV=(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 c;const d=C=>{l.emit("contentError",{editor:l,error:C,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{ya(e,l.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(C){d(C)}try{c=ya(e,l.schema,{parseOptions:h,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:l.options.enableContentCheck})}catch(C){return d(C),!1}let{from:p,to:g}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},v=!0,b=!0;if((MV(c)?c:[c]).forEach(C=>{C.check(),v=v?C.isText&&C.marks.length===0:!1,b=b?C.isBlock:!1}),p===g&&b){const{parent:C}=r.doc.resolve(p);C.isTextblock&&!C.type.spec.code&&!C.childCount&&(p-=1,g+=1)}let x;if(v){if(Array.isArray(e))x=e.map(C=>C.text||"").join("");else if(e instanceof W){let C="";e.forEach(E=>{E.text&&(C+=E.text)}),x=C}else typeof e=="object"&&e&&e.text?x=e.text:x=e;r.insertText(x,p,g)}else{x=c;const C=r.doc.resolve(p),E=C.node(),A=C.parentOffset===0,k=E.isText||E.isTextblock,N=E.content.size>0;A&&k&&N&&(p=Math.max(0,p-1)),r.replaceWith(p,g,x)}n.updateSelection&&CV(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},RV=()=>({state:t,dispatch:e})=>JL(t,e),TV=()=>({state:t,dispatch:e})=>QL(t,e),AV=()=>({state:t,dispatch:e})=>iE(t,e),OV=()=>({state:t,dispatch:e})=>aE(t,e),kV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=mf(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},NV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=mf(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},DV=()=>({state:t,dispatch:e})=>YL(t,e),_V=()=>({state:t,dispatch:e})=>XL(t,e);function rR(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function zV(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,l,a;for(let c=0;c<e.length-1;c+=1){const d=e[c];if(/^(cmd|meta|m)$/i.test(d))a=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))l=!0;else if(/^mod$/i.test(d))Gc()||rR()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${d}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),l&&(n=`Shift-${n}`),n}var jV=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const l=zV(t).split(/-(?!$)/),a=l.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),c=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}),d=e.captureTransaction(()=>{n.someProp("handleKeyDown",h=>h(n,c))});return d?.steps.forEach(h=>{const p=h.map(r.mapping);p&&o&&r.maybeStep(p)}),!0};function va(t,e,n={}){const{from:r,to:o,empty:l}=t.selection,a=e?kt(e,t.schema):null,c=[];t.doc.nodesBetween(r,o,(g,v)=>{if(g.isText)return;const b=Math.max(r,v),S=Math.min(o,v+g.nodeSize);c.push({node:g,from:b,to:S})});const d=o-r,h=c.filter(g=>a?a.name===g.node.type.name:!0).filter(g=>qc(g.node.attrs,n,{strict:!1}));return l?!!h.length:h.reduce((g,v)=>g+v.to-v.from,0)>=d}var LV=(t,e={})=>({state:n,dispatch:r})=>{const o=kt(t,n.schema);return va(n,o,e)?ZL(n,r):!1},IV=()=>({state:t,dispatch:e})=>dE(t,e),BV=t=>({state:e,dispatch:n})=>{const r=kt(t,e.schema);return cI(r)(e,n)},VV=()=>({state:t,dispatch:e})=>cE(t,e);function Cf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Mx(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 FV=(t,e)=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=Cf(typeof t=="string"?t:t.name,r.schema);if(!c)return!1;c==="node"&&(l=kt(t,r.schema)),c==="mark"&&(a=qr(t,r.schema));let d=!1;return n.selection.ranges.forEach(h=>{r.doc.nodesBetween(h.$from.pos,h.$to.pos,(p,g)=>{l&&l===p.type&&(d=!0,o&&n.setNodeMarkup(g,void 0,Mx(p.attrs,e))),a&&p.marks.length&&p.marks.forEach(v=>{a===v.type&&(d=!0,o&&n.addMark(g,g+p.nodeSize,a.create(Mx(v.attrs,e))))})})}),d},PV=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),$V=()=>({tr:t,dispatch:e})=>{if(e){const n=new En(t.doc);t.setSelection(n)}return!0},HV=()=>({state:t,dispatch:e})=>sE(t,e),UV=()=>({state:t,dispatch:e})=>uE(t,e),qV=()=>({state:t,dispatch:e})=>nI(t,e),GV=()=>({state:t,dispatch:e})=>oI(t,e),KV=()=>({state:t,dispatch:e})=>iI(t,e);function gm(t,e,n={},r={}){return ya(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var YV=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:l,dispatch:a,commands:c})=>{const{doc:d}=l;if(r.preserveWhitespace!=="full"){const h=gm(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return a&&l.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!n),!0}return a&&l.setMeta("preventUpdate",!n),c.insertContentAt({from:0,to:d.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function iR(t,e){const n=qr(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,d=>{a.push(...d.marks)});const c=a.find(d=>d.type.name===n.name);return c?{...c.attrs}:{}}function XV(t,e){const n=new eE(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function JV(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 QV(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 pg(t){return e=>QV(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 mg(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ge(e,"addExtensions",n);return r?[e,...mg(r())]:e}).flat(10)}function gg(t,e){const n=To.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function oR(t){return typeof t=="function"}function rt(t,e=void 0,...n){return oR(t)?e?t.bind(e)(...n):t(...n):t}function ZV(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Ps(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 sR(t){const e=[],{nodeExtensions:n,markExtensions:r}=Ps(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),c=r.map(h=>h.name),d=[...a,...c];return t.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage,extensions:o},g=ge(h,"addGlobalAttributes",p);if(!g)return;g().forEach(b=>{let S;Array.isArray(b.types)?S=b.types:b.types==="*"?S=d:b.types==="nodes"?S=a:b.types==="marks"?S=c:S=[],S.forEach(x=>{Object.entries(b.attributes).forEach(([C,E])=>{e.push({type:x,name:C,attribute:{...l,...E}})})})})}),o.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage},g=ge(h,"addAttributes",p);if(!g)return;const v=g();Object.entries(v).forEach(([b,S])=>{const x={...l,...S};typeof x?.default=="function"&&(x.default=x.default()),x?.isRequired&&x?.default===void 0&&delete x.default,e.push({type:h.name,name:b,attribute:x})})}),e}function WV(t){const e=[];let n="",r=!1,o=!1,l=0;const a=t.length;for(let c=0;c<a;c+=1){const d=t[c];if(d==="'"&&!o){r=!r,n+=d;continue}if(d==='"'&&!r){o=!o,n+=d;continue}if(!r&&!o){if(d==="("){l+=1,n+=d;continue}if(d===")"&&l>0){l-=1,n+=d;continue}if(d===";"&&l===0){e.push(n),n="";continue}}n+=d}return n&&e.push(n),e}function Ex(t){const e=[],n=WV(t||""),r=n.length;for(let o=0;o<r;o+=1){const l=n[o],a=l.indexOf(":");if(a===-1)continue;const c=l.slice(0,a).trim(),d=l.slice(a+1).trim();c&&d&&e.push([c,d])}return e}function lR(...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 c=l?String(l).split(" "):[],d=r[o]?r[o].split(" "):[],h=c.filter(p=>!d.includes(p));r[o]=[...d,...h].join(" ")}else if(o==="style"){const c=new Map([...Ex(r[o]),...Ex(l)]);r[o]=Array.from(c.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[o]=l}),r},{})}function Kc(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)=>lR(n,r),{})}function e4(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Rx(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 c=a.attribute.parseHTML?a.attribute.parseHTML(n):e4(n.getAttribute(a.name));return c==null?l:{...l,[a.name]:c}},{});return{...r,...o}}}}function Tx(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&ZV(n)?!1:n!=null))}function Ax(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 t4(t,e){var n;const r=sR(t),{nodeExtensions:o,markExtensions:l}=Ps(t),a=(n=o.find(h=>ge(h,"topNode")))==null?void 0:n.name,c=Object.fromEntries(o.map(h=>{const p=r.filter(E=>E.type===h.name),g={name:h.name,options:h.options,storage:h.storage,editor:e},v=t.reduce((E,A)=>{const k=ge(A,"extendNodeSchema",g);return{...E,...k?k(h):{}}},{}),b=Tx({...v,content:rt(ge(h,"content",g)),marks:rt(ge(h,"marks",g)),group:rt(ge(h,"group",g)),inline:rt(ge(h,"inline",g)),atom:rt(ge(h,"atom",g)),selectable:rt(ge(h,"selectable",g)),draggable:rt(ge(h,"draggable",g)),code:rt(ge(h,"code",g)),whitespace:rt(ge(h,"whitespace",g)),linebreakReplacement:rt(ge(h,"linebreakReplacement",g)),defining:rt(ge(h,"defining",g)),isolating:rt(ge(h,"isolating",g)),attrs:Object.fromEntries(p.map(Ax))}),S=rt(ge(h,"parseHTML",g));S&&(b.parseDOM=S.map(E=>Rx(E,p)));const x=ge(h,"renderHTML",g);x&&(b.toDOM=E=>x({node:E,HTMLAttributes:Kc(E,p)}));const C=ge(h,"renderText",g);return C&&(b.toText=C),[h.name,b]})),d=Object.fromEntries(l.map(h=>{const p=r.filter(C=>C.type===h.name),g={name:h.name,options:h.options,storage:h.storage,editor:e},v=t.reduce((C,E)=>{const A=ge(E,"extendMarkSchema",g);return{...C,...A?A(h):{}}},{}),b=Tx({...v,inclusive:rt(ge(h,"inclusive",g)),excludes:rt(ge(h,"excludes",g)),group:rt(ge(h,"group",g)),spanning:rt(ge(h,"spanning",g)),code:rt(ge(h,"code",g)),attrs:Object.fromEntries(p.map(Ax))}),S=rt(ge(h,"parseHTML",g));S&&(b.parseDOM=S.map(C=>Rx(C,p)));const x=ge(h,"renderHTML",g);return x&&(b.toDOM=C=>x({mark:C,HTMLAttributes:Kc(C,p)})),[h.name,b]}));return new IM({topNode:a,nodes:c,marks:d})}function n4(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ra(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 aR(t){const e=ra(mg(t)),n=n4(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 uR(t,e,n){const{from:r,to:o}=e,{blockSeparator:l=`
|
|
65
|
+
|
|
66
|
+
`,textSerializers:a={}}=n||{};let c="";return t.nodesBetween(r,o,(d,h,p,g)=>{var v;d.isBlock&&h>r&&(c+=l);const b=a?.[d.type.name];if(b)return p&&(c+=b({node:d,pos:h,parent:p,index:g,range:e})),!1;d.isText&&(c+=(v=d?.text)==null?void 0:v.slice(Math.max(r,h)-h,o-h))}),c}function r4(t,e){const n={from:0,to:t.content.size};return uR(t,n,e)}function cR(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function i4(t,e){const n=kt(e,t.schema),{from:r,to:o}=t.selection,l=[];t.doc.nodesBetween(r,o,c=>{l.push(c)});const a=l.reverse().find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function o4(t,e){const n=Cf(typeof e=="string"?e:e.name,t.schema);return n==="node"?i4(t,e):n==="mark"?iR(t,e):{}}function s4(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 l4(t){const e=s4(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 a4(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,l)=>{const a=[];if(o.ranges.length)o.forEach((c,d)=>{a.push({from:c,to:d})});else{const{from:c,to:d}=n[l];if(c===void 0||d===void 0)return;a.push({from:c,to:d})}a.forEach(({from:c,to:d})=>{const h=e.slice(l).map(c,-1),p=e.slice(l).map(d),g=e.invert().map(h,-1),v=e.invert().map(p);r.push({oldRange:{from:g,to:v},newRange:{from:h,to:p}})})}),l4(r)}function Ul(t,e){return e.nodes[t]||e.marks[t]||null}function wc(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 u4=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,l,a,c)=>{var d,h;const p=((h=(d=o.type.spec).toText)==null?void 0:h.call(d,{node:o,pos:l,parent:a,index:c}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?p:p.slice(0,Math.max(0,r-l))}),n};function ym(t,e,n={}){const{empty:r,ranges:o}=t.selection,l=e?qr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(g=>l?l.name===g.type.name:!0).find(g=>qc(g.attrs,n,{strict:!1}));let a=0;const c=[];if(o.forEach(({$from:g,$to:v})=>{const b=g.pos,S=v.pos;t.doc.nodesBetween(b,S,(x,C)=>{if(l&&x.inlineContent&&!x.type.allowsMarkType(l))return!1;if(!x.isText&&!x.marks.length)return;const E=Math.max(b,C),A=Math.min(S,C+x.nodeSize),k=A-E;a+=k,c.push(...x.marks.map(N=>({mark:N,from:E,to:A})))})}),a===0)return!1;const d=c.filter(g=>l?l.name===g.mark.type.name:!0).filter(g=>qc(g.mark.attrs,n,{strict:!1})).reduce((g,v)=>g+v.to-v.from,0),h=c.filter(g=>l?g.mark.type!==l&&g.mark.type.excludes(l):!0).reduce((g,v)=>g+v.to-v.from,0);return(d>0?d+h:d)>=a}function c4(t,e,n={}){if(!e)return va(t,null,n)||ym(t,null,n);const r=Cf(e,t.schema);return r==="node"?va(t,e,n):r==="mark"?ym(t,e,n):!1}function Ox(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function kx(t,e){const{nodeExtensions:n}=Ps(e),r=n.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},l=rt(ge(r,"group",o));return typeof l!="string"?!1:l.split(" ").includes("list")}function Mf(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&&(Mf(l,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function f4(t){return t instanceof Se}var fR=class dR{constructor(e){this.position=e}static fromJSON(e){return new dR(e.position)}toJSON(){return{position:this.position}}};function d4(t,e){const n=e.mapping.mapResult(t.position);return{position:new fR(n.pos),mapResult:n}}function h4(t){return new fR(t)}function p4(t,e,n){var r;const{selection:o}=e;let l=null;if(eR(o)&&(l=o.$cursor),l){const c=(r=t.storedMarks)!=null?r:l.marks();return l.parent.type.allowsMarkType(n)&&(!!n.isInSet(c)||!c.some(h=>h.type.excludes(n)))}const{ranges:a}=o;return a.some(({$from:c,$to:d})=>{let h=c.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(c.pos,d.pos,(p,g,v)=>{if(h)return!1;if(p.isInline){const b=!v||v.type.allowsMarkType(n),S=!!n.isInSet(p.marks)||!p.marks.some(x=>x.type.excludes(n));h=b&&S}return!h}),h})}var m4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=n,{empty:a,ranges:c}=l,d=qr(t,r.schema);if(o)if(a){const h=iR(r,d);n.addStoredMark(d.create({...h,...e}))}else c.forEach(h=>{const p=h.$from.pos,g=h.$to.pos;r.doc.nodesBetween(p,g,(v,b)=>{const S=Math.max(b,p),x=Math.min(b+v.nodeSize,g);v.marks.find(E=>E.type===d)?v.marks.forEach(E=>{d===E.type&&n.addMark(S,x,d.create({...E.attrs,...e}))}):n.addMark(S,x,d.create(e))})});return p4(r,n,d)},g4=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),y4=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const l=kt(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),l.isTextblock?o().command(({commands:c})=>$S(l,{...a,...e})(n)?!0:c.clearNodes()).command(({state:c})=>$S(l,{...a,...e})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},v4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=po(t,0,r.content.size),l=Se.create(r,o);e.setSelection(l)}return!0},b4=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=r;let a,c;return typeof e=="number"?(a=e,c=e):e&&"from"in e&&"to"in e?(a=e.from,c=e.to):(a=l.from,c=l.to),o&&n.doc.nodesBetween(a,c,(d,h)=>{d.isText||n.setNodeMarkup(h,void 0,{...d.attrs,dir:t})}),!0},S4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:l}=typeof t=="number"?{from:t,to:t}:t,a=Oe.atStart(r).from,c=Oe.atEnd(r).to,d=po(o,a,c),h=po(l,a,c),p=Oe.create(r,d,h);e.setSelection(p)}return!0},x4=t=>({state:e,dispatch:n})=>{const r=kt(t,e.schema);return hI(r)(e,n)};function Nx(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 w4=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:l,doc:a}=e,{$from:c,$to:d}=l,h=o.extensionManager.attributes,p=wc(h,c.node().type.name,c.node().attrs);if(l instanceof Se&&l.node.isBlock)return!c.parentOffset||!Fr(a,c.pos)?!1:(r&&(t&&Nx(n,o.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const g=d.parentOffset===d.parent.content.size,v=c.depth===0?void 0:JV(c.node(-1).contentMatchAt(c.indexAfter(-1)));let b=g&&v?[{type:v,attrs:p}]:void 0,S=Fr(e.doc,e.mapping.map(c.pos),1,b);if(!b&&!S&&Fr(e.doc,e.mapping.map(c.pos),1,v?[{type:v}]:void 0)&&(S=!0,b=v?[{type:v,attrs:p}]:void 0),r){if(S&&(l instanceof Oe&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,b),v&&!g&&!c.parentOffset&&c.parent.type!==v)){const x=e.mapping.map(c.before()),C=e.doc.resolve(x);c.node(-1).canReplaceWith(C.index(),C.index()+1,v)&&e.setNodeMarkup(e.mapping.map(c.before()),v)}t&&Nx(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return S},C4=(t,e={})=>({tr:n,state:r,dispatch:o,editor:l})=>{var a;const c=kt(t,r.schema),{$from:d,$to:h}=r.selection,p=r.selection.node;if(p&&p.isBlock||d.depth<2||!d.sameParent(h))return!1;const g=d.node(-1);if(g.type!==c)return!1;const v=l.extensionManager.attributes;if(d.parent.content.size===0&&d.node(-1).childCount===d.indexAfter(-1)){if(d.depth===2||d.node(-3).type!==c||d.index(-2)!==d.node(-2).childCount-1)return!1;if(o){let E=W.empty;const A=d.index(-1)?1:d.index(-2)?2:3;for(let I=d.depth-A;I>=d.depth-3;I-=1)E=W.from(d.node(I).copy(E));const k=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3,N={...wc(v,d.node().type.name,d.node().attrs),...e},j=((a=c.contentMatch.defaultType)==null?void 0:a.createAndFill(N))||void 0;E=E.append(W.from(c.createAndFill(null,j)||void 0));const U=d.before(d.depth-(A-1));n.replace(U,d.after(-k),new le(E,4-A,0));let _=-1;n.doc.nodesBetween(U,n.doc.content.size,(I,Z)=>{if(_>-1)return!1;I.isTextblock&&I.content.size===0&&(_=Z+1)}),_>-1&&n.setSelection(Oe.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const b=h.pos===d.end()?g.contentMatchAt(0).defaultType:null,S={...wc(v,g.type.name,g.attrs),...e},x={...wc(v,d.node().type.name,d.node().attrs),...e};n.delete(d.pos,h.pos);const C=b?[{type:c,attrs:S},{type:b,attrs:x}]:[{type:c,attrs:S}];if(!Fr(n.doc,d.pos,2))return!1;if(o){const{selection:E,storedMarks:A}=r,{splittableMarks:k}=l.extensionManager,N=A||E.$to.parentOffset&&E.$from.marks();if(n.split(d.pos,2,C).scrollIntoView(),!N||!o)return!0;const j=N.filter(U=>k.includes(U.type.name));n.ensureMarks(j)}return!0},Tp=(t,e)=>{const n=pg(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&&Ao(t.doc,n.pos)&&t.join(n.pos),!0},Ap=(t,e)=>{const n=pg(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&&Ao(t.doc,r)&&t.join(r),!0},M4=(t,e,n,r={})=>({editor:o,tr:l,state:a,dispatch:c,chain:d,commands:h,can:p})=>{const{extensions:g,splittableMarks:v}=o.extensionManager,b=kt(t,a.schema),S=kt(e,a.schema),{selection:x,storedMarks:C}=a,{$from:E,$to:A}=x,k=E.blockRange(A),N=C||x.$to.parentOffset&&x.$from.marks();if(!k)return!1;const j=pg(U=>kx(U.type.name,g))(x);if(k.depth>=1&&j&&k.depth-j.depth<=1){if(j.node.type===b)return h.liftListItem(S);if(kx(j.node.type.name,g)&&b.validContent(j.node.content)&&c)return d().command(()=>(l.setNodeMarkup(j.pos,b),!0)).command(()=>Tp(l,b)).command(()=>Ap(l,b)).run()}return!n||!N||!c?d().command(()=>p().wrapInList(b,r)?!0:h.clearNodes()).wrapInList(b,r).command(()=>Tp(l,b)).command(()=>Ap(l,b)).run():d().command(()=>{const U=p().wrapInList(b,r),_=N.filter(I=>v.includes(I.type.name));return l.ensureMarks(_),U?!0:h.clearNodes()}).wrapInList(b,r).command(()=>Tp(l,b)).command(()=>Ap(l,b)).run()},E4=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:l=!1}=n,a=qr(t,r.schema);return ym(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:l}):o.setMark(a,e)},R4=(t,e,n={})=>({state:r,commands:o})=>{const l=kt(t,r.schema),a=kt(e,r.schema),c=va(r,l,n);let d;return r.selection.$anchor.sameParent(r.selection.$head)&&(d=r.selection.$anchor.parent.attrs),c?o.setNode(a,d):o.setNode(l,{...d,...n})},T4=(t,e={})=>({state:n,commands:r})=>{const o=kt(t,n.schema);return va(n,o,e)?r.lift(o):r.wrapIn(o,e)},A4=()=>({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,c=l.transform;for(let d=c.steps.length-1;d>=0;d-=1)a.step(c.steps[d].invert(c.docs[d]));if(l.text){const d=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,d))}else a.delete(l.from,l.to)}return!0}}return!1},O4=()=>({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},k4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var l;const{extendEmptyMarkRange:a=!1}=e,{selection:c}=n,d=qr(t,r.schema),{$from:h,empty:p,ranges:g}=c;if(!o)return!0;if(p&&a){let{from:v,to:b}=c;const S=(l=h.marks().find(C=>C.type===d))==null?void 0:l.attrs,x=WE(h,d,S);x&&(v=x.from,b=x.to),n.removeMark(v,b,d)}else g.forEach(v=>{n.removeMark(v.$from.pos,v.$to.pos,d)});return n.removeStoredMark(d),!0},N4=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,(c,d)=>{if(c.isText)return;const h={...c.attrs};delete h.dir,e.setNodeMarkup(d,void 0,h)}),!0},D4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=Cf(typeof t=="string"?t:t.name,r.schema);if(!c)return!1;c==="node"&&(l=kt(t,r.schema)),c==="mark"&&(a=qr(t,r.schema));let d=!1;return n.selection.ranges.forEach(h=>{const p=h.$from.pos,g=h.$to.pos;let v,b,S,x;n.selection.empty?r.doc.nodesBetween(p,g,(C,E)=>{l&&l===C.type&&(d=!0,S=Math.max(E,p),x=Math.min(E+C.nodeSize,g),v=E,b=C)}):r.doc.nodesBetween(p,g,(C,E)=>{E<p&&l&&l===C.type&&(d=!0,S=Math.max(E,p),x=Math.min(E+C.nodeSize,g),v=E,b=C),E>=p&&E<=g&&(l&&l===C.type&&(d=!0,o&&n.setNodeMarkup(E,void 0,{...C.attrs,...e})),a&&C.marks.length&&C.marks.forEach(A=>{if(a===A.type&&(d=!0,o)){const k=Math.max(E,p),N=Math.min(E+C.nodeSize,g);n.addMark(k,N,a.create({...A.attrs,...e}))}}))}),b&&(v!==void 0&&o&&n.setNodeMarkup(v,void 0,{...b.attrs,...e}),a&&b.marks.length&&b.marks.forEach(C=>{a===C.type&&o&&n.addMark(S,x,a.create({...C.attrs,...e}))}))}),d},_4=(t,e={})=>({state:n,dispatch:r})=>{const o=kt(t,n.schema);return sI(o,e)(n,r)},z4=(t,e={})=>({state:n,dispatch:r})=>{const o=kt(t,n.schema);return lI(o,e)(n,r)},j4=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={}}},L4=(t,e)=>{if(hg(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 fc(t){var e;const{editor:n,from:r,to:o,text:l,rules:a,plugin:c}=t,{view:d}=n;if(d.composing)return!1;const h=d.state.doc.resolve(r);if(h.parent.type.spec.code||(e=h.nodeBefore||h.nodeAfter)!=null&&e.marks.find(v=>v.type.spec.code))return!1;let p=!1;const g=u4(h)+l;return a.forEach(v=>{if(p)return;const b=L4(g,v.find);if(!b)return;const S=d.state.tr,x=xf({state:d.state,transaction:S}),C={from:r-(b[0].length-l.length),to:o},{commands:E,chain:A,can:k}=new wf({editor:n,state:x});v.handler({state:x,range:C,match:b,commands:E,chain:A,can:k})===null||!S.steps.length||(v.undoable&&S.setMeta(c,{transform:S,from:r,to:o,text:l}),d.dispatch(S),p=!0)}),p}function I4(t){const{editor:e,rules:n}=t,r=new vt({state:{init(){return null},apply(o,l,a){const c=o.getMeta(r);if(c)return c;const d=o.getMeta("applyInputRules");return d&&setTimeout(()=>{let{text:p}=d;typeof p=="string"?p=p:p=gg(W.from(p),a.schema);const{from:g}=d,v=g+p.length;fc({editor:e,from:g,to:v,text:p,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:l}},props:{handleTextInput(o,l,a,c){return fc({editor:e,from:l,to:a,text:c,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:l}=o.state.selection;l&&fc({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?fc({editor:e,from:a.pos,to:a.pos,text:`
|
|
67
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function B4(t){return Object.prototype.toString.call(t).slice(8,-1)}function dc(t){return B4(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function hR(t,e){const n={...t};return dc(t)&&dc(e)&&Object.keys(e).forEach(r=>{dc(e[r])&&dc(t[r])?n[r]=hR(t[r],e[r]):n[r]=e[r]}),n}var yg=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{...rt(ge(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...rt(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>hR(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}},V4=class pR extends yg{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new pR(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 d=a.find(h=>h?.type.name===n.name);return d&&r.removeStoredMark(d),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 F4(t){return typeof t=="number"}var P4=(t,e,n)=>{if(hg(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 $4(t){const{editor:e,state:n,from:r,to:o,rule:l,pasteEvent:a,dropEvent:c}=t,{commands:d,chain:h,can:p}=new wf({editor:e,state:n}),g=[];return n.doc.nodesBetween(r,o,(b,S)=>{var x,C,E,A,k;if((C=(x=b.type)==null?void 0:x.spec)!=null&&C.code||!(b.isText||b.isTextblock||b.isInline))return;const N=(k=(A=(E=b.content)==null?void 0:E.size)!=null?A:b.nodeSize)!=null?k:0,j=Math.max(r,S),U=Math.min(o,S+N);if(j>=U)return;const _=b.isText?b.text||"":b.textBetween(j-S,U-S,void 0,"");P4(_,l.find,a).forEach(Z=>{if(Z.index===void 0)return;const se=j+Z.index+1,me=se+Z[0].length,ue={from:n.tr.mapping.map(se),to:n.tr.mapping.map(me)},be=l.handler({state:n,range:ue,match:Z,commands:d,chain:h,can:p,pasteEvent:a,dropEvent:c});g.push(be)})}),g.every(b=>b!==null)}var hc=null,H4=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function U4(t){const{editor:e,rules:n}=t;let r=null,o=!1,l=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const d=({state:p,from:g,to:v,rule:b,pasteEvt:S})=>{const x=p.tr,C=xf({state:p,transaction:x});if(!(!$4({editor:e,state:C,from:Math.max(g-1,0),to:v.b-1,rule:b,pasteEvent:S,dropEvent:c})||!x.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,x}};return n.map(p=>new vt({view(g){const v=S=>{var x;r=(x=g.dom.parentElement)!=null&&x.contains(S.target)?g.dom.parentElement:null,r&&(hc=e)},b=()=>{hc&&(hc=null)};return window.addEventListener("dragstart",v),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",v),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(g,v)=>{if(l=r===g.dom.parentElement,c=v,!l){const b=hc;b?.isEditable&&setTimeout(()=>{const S=b.state.selection;S&&b.commands.deleteRange({from:S.from,to:S.to})},10)}return!1},paste:(g,v)=>{var b;const S=(b=v.clipboardData)==null?void 0:b.getData("text/html");return a=v,o=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(g,v,b)=>{const S=g[0],x=S.getMeta("uiEvent")==="paste"&&!o,C=S.getMeta("uiEvent")==="drop"&&!l,E=S.getMeta("applyPasteRules"),A=!!E;if(!x&&!C&&!A)return;if(A){let{text:j}=E;typeof j=="string"?j=j:j=gg(W.from(j),b.schema);const{from:U}=E,_=U+j.length,I=H4(j);return d({rule:p,state:b,from:U,to:{b:_},pasteEvt:I})}const k=v.doc.content.findDiffStart(b.doc.content),N=v.doc.content.findDiffEnd(b.doc.content);if(!(!F4(k)||!N||k===N.b))return d({rule:p,state:b,from:k,to:N,pasteEvt:a})}}))}var Ef=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=aR(t),this.schema=t4(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:Ul(e.name,this.schema)},r=ge(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return ra([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Ul(r.name,this.schema)},l=[],a=ge(r,"addKeyboardShortcuts",o);let c={};if(r.type==="mark"&&ge(r,"exitable",o)&&(c.ArrowRight=()=>V4.handleExit({editor:t,mark:r})),a){const v=Object.fromEntries(Object.entries(a()).map(([b,S])=>[b,()=>S({editor:t})]));c={...c,...v}}const d=rV(c);l.push(d);const h=ge(r,"addInputRules",o);if(Ox(r,t.options.enableInputRules)&&h){const v=h();if(v&&v.length){const b=I4({editor:t,rules:v}),S=Array.isArray(b)?b:[b];l.push(...S)}}const p=ge(r,"addPasteRules",o);if(Ox(r,t.options.enablePasteRules)&&p){const v=p();if(v&&v.length){const b=U4({editor:t,rules:v});l.push(...b)}}const g=ge(r,"addProseMirrorPlugins",o);if(g){const v=g();l.push(...v)}return l})}get attributes(){return sR(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Ps(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(n,"addNodeView")).map(n=>{const r=this.attributes.filter(d=>d.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:kt(n.name,this.schema)},l=ge(n,"addNodeView",o);if(!l)return[];const a=l();if(!a)return[];const c=(d,h,p,g,v)=>{const b=Kc(d,r);return a({node:d,view:h,getPos:p,decorations:g,innerDecorations:v,editor:t,extension:n,HTMLAttributes:b})};return[n.name,c]}))}dispatchTransaction(t){const{editor:e}=this;return ra([...this.extensions].reverse()).reduceRight((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:Ul(o.name,this.schema)},a=ge(o,"dispatchTransaction",l);return a?c=>{a.call(l,{transaction:c,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return ra([...this.extensions]).reduce((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:Ul(o.name,this.schema)},a=ge(o,"transformPastedHTML",l);return a?(c,d)=>{const h=r(c,d);return a.call(l,h)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Ps(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(n,"addMarkView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:qr(n.name,this.schema)},l=ge(n,"addMarkView",o);if(!l)return[];const a=(c,d,h)=>{const p=Kc(c,r);return l()({mark:c,view:d,inline:h,editor:t,extension:n,HTMLAttributes:p,updateAttributes:g=>{iF(c,t,g)}})};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:Ul(e.name,this.schema)};e.type==="mark"&&((n=rt(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),c=ge(e,"onSelectionUpdate",r),d=ge(e,"onTransaction",r),h=ge(e,"onFocus",r),p=ge(e,"onBlur",r),g=ge(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),l&&this.editor.on("create",l),a&&this.editor.on("update",a),c&&this.editor.on("selectionUpdate",c),d&&this.editor.on("transaction",d),h&&this.editor.on("focus",h),p&&this.editor.on("blur",p),g&&this.editor.on("destroy",g)})}};Ef.resolve=aR;Ef.sort=ra;Ef.flatten=mg;var q4={};dg(q4,{ClipboardTextSerializer:()=>gR,Commands:()=>yR,Delete:()=>vR,Drop:()=>bR,Editable:()=>SR,FocusEvents:()=>wR,Keymap:()=>CR,Paste:()=>MR,Tabindex:()=>ER,TextDirection:()=>RR,focusEventsPluginKey:()=>xR});var bt=class mR extends yg{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new mR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},gR=bt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new vt({key:new Zt("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)),c=Math.max(...l.map(p=>p.$to.pos)),d=cR(n);return uR(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:d})}}})]}}),yR=bt.create({name:"commands",addCommands(){return{...QE}}}),vR=bt.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const l=()=>{var a,c,d,h;if((h=(d=(c=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:c.filterTransaction)==null?void 0:d.call(c,t))!=null?h:t.getMeta("y-sync$"))return;const p=XV(t.before,[t,...e]);a4(p).forEach(b=>{p.mapping.mapResult(b.oldRange.from).deletedAfter&&p.mapping.mapResult(b.oldRange.to).deletedBefore&&p.before.nodesBetween(b.oldRange.from,b.oldRange.to,(S,x)=>{const C=x+S.nodeSize-2,E=b.oldRange.from<=x&&C<=b.oldRange.to;this.editor.emit("delete",{type:"node",node:S,from:x,to:C,newFrom:p.mapping.map(x),newTo:p.mapping.map(C),deletedRange:b.oldRange,newRange:b.newRange,partial:!E,editor:this.editor,transaction:t,combinedTransform:p})})});const v=p.mapping;p.steps.forEach((b,S)=>{var x,C;if(b instanceof Jn){const E=v.slice(S).map(b.from,-1),A=v.slice(S).map(b.to),k=v.invert().map(E,-1),N=v.invert().map(A),j=(x=p.doc.nodeAt(E-1))==null?void 0:x.marks.some(_=>_.eq(b.mark)),U=(C=p.doc.nodeAt(A))==null?void 0:C.marks.some(_=>_.eq(b.mark));this.editor.emit("delete",{type:"mark",mark:b.mark,from:b.from,to:b.to,deletedRange:{from:k,to:N},newRange:{from:E,to:A},partial:!!(U||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()}}),bR=bt.create({name:"drop",addProseMirrorPlugins(){return[new vt({key:new Zt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),SR=bt.create({name:"editable",addProseMirrorPlugins(){return[new vt({key:new Zt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),xR=new Zt("focusEvents"),wR=bt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new vt({key:xR,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}}}})]}}),CR=bt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:c})=>{const{selection:d,doc:h}=c,{empty:p,$anchor:g}=d,{pos:v,parent:b}=g,S=g.parent.isTextblock&&v>0?c.doc.resolve(v-1):g,x=S.parent.type.spec.isolating,C=g.pos-g.parentOffset,E=x&&S.parent.childCount===1?C===g.pos:ze.atStart(h).from===v;return!p||!b.type.isTextblock||b.textContent.length||!E||E&&g.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 Gc()||rR()?l:o},addProseMirrorPlugins(){return[new vt({key:new Zt("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:c}=e.selection,d=ze.atStart(e.doc).from,h=ze.atEnd(e.doc).to;if(l||!(a===d&&c===h)||!Mf(n.doc))return;const v=n.tr,b=xf({state:n,transaction:v}),{commands:S}=new wf({editor:this.editor,state:b});if(S.clearNodes(),!!v.steps.length)return v}})]}}),MR=bt.create({name:"paste",addProseMirrorPlugins(){return[new vt({key:new Zt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),ER=bt.create({name:"tabindex",addProseMirrorPlugins(){return[new vt({key:new Zt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),RR=bt.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Ps(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 vt({key:new Zt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),G4=class Jl{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 Jl(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 Jl(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 Jl(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,c=this.pos+r+(l?0:1);if(c<0||c>this.resolvedPos.doc.nodeSize-2)return;const d=this.resolvedPos.doc.resolve(c);if(!o&&!a&&d.depth<=this.depth)return;const h=new Jl(d,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 c=0;c<a.length;c+=1){const d=a[c];if(l[d]!==n[d])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(d=>n[d]===a.node.attrs[d])&&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)}},K4=`.ProseMirror {
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ProseMirror {
|
|
72
|
+
word-wrap: break-word;
|
|
73
|
+
white-space: pre-wrap;
|
|
74
|
+
white-space: break-spaces;
|
|
75
|
+
-webkit-font-variant-ligatures: none;
|
|
76
|
+
font-variant-ligatures: none;
|
|
77
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ProseMirror [contenteditable="false"] {
|
|
81
|
+
white-space: normal;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
85
|
+
white-space: pre-wrap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ProseMirror pre {
|
|
89
|
+
white-space: pre-wrap;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
img.ProseMirror-separator {
|
|
93
|
+
display: inline !important;
|
|
94
|
+
border: none !important;
|
|
95
|
+
margin: 0 !important;
|
|
96
|
+
width: 0 !important;
|
|
97
|
+
height: 0 !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ProseMirror-gapcursor {
|
|
101
|
+
display: none;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
position: absolute;
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ProseMirror-gapcursor:after {
|
|
108
|
+
content: "";
|
|
109
|
+
display: block;
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: -2px;
|
|
112
|
+
width: 20px;
|
|
113
|
+
border-top: 1px solid black;
|
|
114
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@keyframes ProseMirror-cursor-blink {
|
|
118
|
+
to {
|
|
119
|
+
visibility: hidden;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ProseMirror-hideselection *::selection {
|
|
124
|
+
background: transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
128
|
+
background: transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ProseMirror-hideselection * {
|
|
132
|
+
caret-color: transparent;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
136
|
+
display: block;
|
|
137
|
+
}`;function Y4(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 X4=class extends j4{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:d4,createMappablePosition:h4},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=tR(e,this.options.autofocus);this.editorState=Os.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=Y4(K4,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=oR(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?[SR,gR.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),yR,wR,CR,ER,bR,MR,vR,RR.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 Ef(r,this)}createCommandManager(){this.commandManager=new wf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=gm(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=gm(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 XE(t,{...e,attributes:{role:"textbox",...e?.attributes},dispatchTransaction:o,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const d=this.view.dom;d.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")),c=a?.getMeta("focus"),d=a?.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:a}),d&&this.emit("blur",{editor:this,event:d.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 o4(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return c4(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gg(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
138
|
+
|
|
139
|
+
`,textSerializers:n={}}=t||{};return r4(this.state.doc,{blockSeparator:e,textSerializers:{...cR(this.schema),...n}})}get isEmpty(){return Mf(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 G4(e,this)}get $doc(){return this.$pos(0)}},J4={};dg(J4,{createAtomBlockMarkdownSpec:()=>Q4,createBlockMarkdownSpec:()=>Z4,createInlineMarkdownSpec:()=>tF,parseAttributes:()=>vg,parseIndentedBlocks:()=>nF,renderNestedMarkdownContent:()=>rF,serializeAttributes:()=>bg});function vg(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 g;const v=parseInt(((g=p.match(/__QUOTED_(\d+)__/))==null?void 0:g[1])||"0",10),b=n[v];b&&(e[h]=b.slice(1,-1))});const d=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 d&&d.split(/\s+/).filter(Boolean).forEach(p=>{p.match(/^[a-zA-Z][\w-]*$/)&&(e[p]=!0)}),e}function bg(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 Q4(t){const{nodeName:e,name:n,parseAttributes:r=vg,serializeAttributes:o=bg,defaultAttributes:l={},requiredAttributes:a=[],allowedAttributes:c}=t,d=n||e,h=p=>{if(!c)return p;const g={};return c.forEach(v=>{v in p&&(g[v]=p[v])}),g};return{parseMarkdown:(p,g)=>{const v={...l,...p.attributes};return g.createNode(e,v,[])},markdownTokenizer:{name:e,level:"block",start(p){var g;const v=new RegExp(`^:::${d}(?:\\s|$)`,"m"),b=(g=p.match(v))==null?void 0:g.index;return b!==void 0?b:-1},tokenize(p,g,v){const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),S=p.match(b);if(!S)return;const x=S[1]||"",C=r(x);if(!a.find(A=>!(A in C)))return{type:e,raw:S[0],attributes:C}}},renderMarkdown:p=>{const g=h(p.attrs||{}),v=o(g),b=v?` {${v}}`:"";return`:::${d}${b} :::`}}}function Z4(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=vg,serializeAttributes:l=bg,defaultAttributes:a={},content:c="block",allowedAttributes:d}=t,h=n||e,p=g=>{if(!d)return g;const v={};return d.forEach(b=>{b in g&&(v[b]=g[b])}),v};return{parseMarkdown:(g,v)=>{let b;if(r){const x=r(g);b=typeof x=="string"?[{type:"text",text:x}]:x}else c==="block"?b=v.parseChildren(g.tokens||[]):b=v.parseInline(g.tokens||[]);const S={...a,...g.attributes};return v.createNode(e,S,b)},markdownTokenizer:{name:e,level:"block",start(g){var v;const b=new RegExp(`^:::${h}`,"m"),S=(v=g.match(b))==null?void 0:v.index;return S!==void 0?S:-1},tokenize(g,v,b){var S;const x=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),C=g.match(x);if(!C)return;const[E,A=""]=C,k=o(A);let N=1;const j=E.length;let U="";const _=/^:::([\w-]*)(\s.*)?/gm,I=g.slice(j);for(_.lastIndex=0;;){const Z=_.exec(I);if(Z===null)break;const se=Z.index,me=Z[1];if(!((S=Z[2])!=null&&S.endsWith(":::"))){if(me)N+=1;else if(N-=1,N===0){const ue=I.slice(0,se);U=ue.trim();const be=g.slice(0,j+se+Z[0].length);let ne=[];if(U)if(c==="block")for(ne=b.blockTokens(ue),ne.forEach(ye=>{ye.text&&(!ye.tokens||ye.tokens.length===0)&&(ye.tokens=b.inlineTokens(ye.text))});ne.length>0;){const ye=ne[ne.length-1];if(ye.type==="paragraph"&&(!ye.text||ye.text.trim()===""))ne.pop();else break}else ne=b.inlineTokens(U);return{type:e,raw:be,attributes:k,content:U,tokens:ne}}}}}},renderMarkdown:(g,v)=>{const b=p(g.attrs||{}),S=l(b),x=S?` {${S}}`:"",C=v.renderChildren(g.content||[],`
|
|
140
|
+
|
|
141
|
+
`);return`:::${h}${x}
|
|
142
|
+
|
|
143
|
+
${C}
|
|
144
|
+
|
|
145
|
+
:::`}}}function W4(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 eF(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function tF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=W4,serializeAttributes:l=eF,defaultAttributes:a={},selfClosing:c=!1,allowedAttributes:d}=t,h=n||e,p=v=>{if(!d)return v;const b={};return d.forEach(S=>{const x=typeof S=="string"?S:S.name,C=typeof S=="string"?void 0:S.skipIfDefault;if(x in v){const E=v[x];if(C!==void 0&&E===C)return;b[x]=E}}),b},g=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(v,b)=>{const S={...a,...v.attributes};if(c)return b.createNode(e,S);const x=r?r(v):v.content||"";return x?b.createNode(e,S,[b.createTextNode(x)]):b.createNode(e,S,[])},markdownTokenizer:{name:e,level:"inline",start(v){const b=c?new RegExp(`\\[${g}\\s*[^\\]]*\\]`):new RegExp(`\\[${g}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${g}\\]`),S=v.match(b),x=S?.index;return x!==void 0?x:-1},tokenize(v,b,S){const x=c?new RegExp(`^\\[${g}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${g}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${g}\\]`),C=v.match(x);if(!C)return;let E="",A="";if(c){const[,N]=C;A=N}else{const[,N,j]=C;A=N,E=j||""}const k=o(A.trim());return{type:e,raw:C[0],content:E.trim(),attributes:k}}},renderMarkdown:v=>{let b="";r?b=r(v):v.content&&v.content.length>0&&(b=v.content.filter(E=>E.type==="text").map(E=>E.text).join(""));const S=p(v.attrs||{}),x=l(S),C=x?` ${x}`:"";return c?`[${h}${C}]`:`[${h}${C}]${b}[/${h}]`}}}function nF(t,e,n){var r,o,l,a;const c=t.split(`
|
|
146
|
+
`),d=[];let h="",p=0;const g=e.baseIndentSize||2;for(;p<c.length;){const v=c[p],b=v.match(e.itemPattern);if(!b){if(d.length>0)break;if(v.trim()===""){p+=1,h=`${h}${v}
|
|
147
|
+
`;continue}else return}const S=e.extractItemData(b),{indentLevel:x,mainContent:C}=S;h=`${h}${v}
|
|
148
|
+
`;const E=[C];for(p+=1;p<c.length;){const j=c[p];if(j.trim()===""){const _=c.slice(p+1).findIndex(se=>se.trim()!=="");if(_===-1)break;if((((o=(r=c[p+1+_].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>x){E.push(j),h=`${h}${j}
|
|
149
|
+
`,p+=1;continue}else break}if((((a=(l=j.match(/^(\s*)/))==null?void 0:l[1])==null?void 0:a.length)||0)>x)E.push(j),h=`${h}${j}
|
|
150
|
+
`,p+=1;else break}let A;const k=E.slice(1);if(k.length>0){const j=k.map(U=>U.slice(x+g)).join(`
|
|
151
|
+
`);j.trim()&&(e.customNestedParser?A=e.customNestedParser(j):A=n.blockTokens(j))}const N=e.createToken(S,A);d.push(N)}if(d.length!==0)return{items:d,raw:h}}function rF(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[l,...a]=t.content,c=e.renderChildren([l]);let d=`${o}${c}`;return a&&a.length>0&&a.forEach((h,p)=>{var g,v;const b=(v=(g=e.renderChild)==null?void 0:g.call(e,h,p+1))!=null?v:e.renderChildren([h]);if(b!=null){const S=b.split(`
|
|
152
|
+
`).map(x=>x?e.indent(x):e.indent("")).join(`
|
|
153
|
+
`);d+=h.type==="paragraph"?`
|
|
154
|
+
|
|
155
|
+
${S}`:`
|
|
156
|
+
${S}`}}),d}function iF(t,e,n={}){const{state:r}=e,{doc:o,tr:l}=r,a=t;o.descendants((c,d)=>{const h=l.mapping.map(d),p=l.mapping.map(d)+c.nodeSize;let g=null;if(c.marks.forEach(b=>{if(b!==a)return!1;g=b}),!g)return;let v=!1;if(Object.keys(n).forEach(b=>{n[b]!==g.attrs[b]&&(v=!0)}),v){const b=t.type.create({...t.attrs,...n});l.removeMark(h,p,t.type),l.addMark(h,p,b)}}),l.docChanged&&e.view.dispatch(l)}var Sg=class TR extends yg{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new TR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},oF=Sg.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
157
|
+
|
|
158
|
+
`):""}),sF=oF,Dx=" ",lF=" ",aF=Sg.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",lR(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Dx||r[0].text===lF)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,o;if(!t)return"";const l=Array.isArray(t.content)?t.content:[];if(l.length===0){const a=Array.isArray((r=n?.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((o=n?.previousNode)==null?void 0:o.type)==="paragraph"&&a.length===0?Dx:""}return e.renderChildren(l)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uF=aF;function cF(t={}){return new vt({view(e){return new fF(e,t)}})}class fF{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,c=l.height/o.offsetHeight;if(n){let g=e.nodeBefore,v=e.nodeAfter;if(g||v){let b=this.editorView.nodeDOM(this.cursorPos-(g?g.nodeSize:0));if(b){let S=b.getBoundingClientRect(),x=g?S.bottom:S.top;g&&v&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let C=this.width/2*c;r={left:S.left,right:S.right,top:x-C,bottom:x+C}}}}if(!r){let g=this.editorView.coordsAtPos(this.cursorPos),v=this.width/2*a;r={left:g.left-v,right:g.left+v,top:g.top,bottom:g.bottom}}let d=this.editorView.dom.offsetParent;this.element||(this.element=d.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(!d||d==document.body&&getComputedStyle(d).position=="static")h=-pageXOffset,p=-pageYOffset;else{let g=d.getBoundingClientRect(),v=g.width/d.offsetWidth,b=g.height/d.offsetHeight;h=g.left-d.scrollLeft*v,p=g.top-d.scrollTop*b}this.element.style.left=(r.left-h)/a+"px",this.element.style.top=(r.top-p)/c+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/c+"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 c=XM(this.editorView.state.doc,a,this.editorView.dragging.slice);c!=null&&(a=c)}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 lt extends ze{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return lt.valid(r)?new lt(r):ze.near(r)}content(){return le.empty}eq(e){return e instanceof lt&&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 lt(e.resolve(n.pos))}getBookmark(){return new xg(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!dF(e)||!hF(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&<.valid(e))return e;let o=e.pos,l=null;for(let a=e.depth;;a--){let c=e.node(a);if(n>0?e.indexAfter(a)<c.childCount:e.index(a)>0){l=c.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;o+=n;let d=e.doc.resolve(o);if(lt.valid(d))return d}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!Se.isSelectable(l)){e=e.doc.resolve(o+l.nodeSize*n),r=!1;continue e}break}l=a,o+=n;let c=e.doc.resolve(o);if(lt.valid(c))return c}return null}}}lt.prototype.visible=!1;lt.findFrom=lt.findGapCursorFrom;ze.jsonID("gapcursor",lt);class xg{constructor(e){this.pos=e}map(e){return new xg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return lt.valid(n)?new lt(n):ze.near(n)}}function AR(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function dF(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||AR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function hF(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||AR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function pF(){return new vt({props:{decorations:vF,createSelectionBetween(t,e,n){return e.pos==n.pos&<.valid(n)?new lt(n):null},handleClick:gF,handleKeyDown:mF,handleDOMEvents:{beforeinput:yF}}})}const mF=JE({ArrowLeft:pc("horiz",-1),ArrowRight:pc("horiz",1),ArrowUp:pc("vert",-1),ArrowDown:pc("vert",1)});function pc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,l){let a=r.selection,c=e>0?a.$to:a.$from,d=a.empty;if(a instanceof Oe){if(!l.endOfTextblock(n)||c.depth==0)return!1;d=!1,c=r.doc.resolve(e>0?c.after():c.before())}let h=lt.findGapCursorFrom(c,e,d);return h?(o&&o(r.tr.setSelection(new lt(h))),!0):!1}}function gF(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!lt.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Se.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new lt(r))),!0)}function yF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof lt))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=W.empty;for(let a=r.length-1;a>=0;a--)o=W.from(r[a].createAndFill(null,o));let l=t.state.tr.replace(n.pos,n.pos,new le(o,0,0));return l.setSelection(Oe.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}function vF(t){if(!(t.selection instanceof lt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",it.create(t.doc,[Gt.widget(t.selection.head,e,{key:"gapcursor"})])}var Yc=200,Ot=function(){};Ot.prototype.append=function(e){return e.length?(e=Ot.from(e),!this.length&&e||e.length<Yc&&this.leafAppend(e)||this.length<Yc&&e.leafPrepend(this)||this.appendInner(e)):this};Ot.prototype.prepend=function(e){return e.length?Ot.from(e).append(this):this};Ot.prototype.appendInner=function(e){return new bF(this,e)};Ot.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ot.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Ot.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ot.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)};Ot.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};Ot.from=function(e){return e instanceof Ot?e:e&&e.length?new OR(e):Ot.empty};var OR=(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,c){for(var d=l;d<a;d++)if(o(this.values[d],c+d)===!1)return!1},e.prototype.forEachInvertedInner=function(o,l,a,c){for(var d=l-1;d>=a;d--)if(o(this.values[d],c+d)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Yc)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Yc)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})(Ot);Ot.empty=new OR([]);var bF=(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 c=this.left.length;if(o<c&&this.left.forEachInner(r,o,Math.min(l,c),a)===!1||l>c&&this.right.forEachInner(r,Math.max(o-c,0),Math.min(this.length,l)-c,a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,l,a){var c=this.left.length;if(o>c&&this.right.forEachInvertedInner(r,o-c,Math.max(l,c)-c,a+c)===!1||l<c&&this.left.forEachInvertedInner(r,Math.min(o,c),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})(Ot);const SF=500;class Yn{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,c,d,h=[],p=[];return this.items.forEach((g,v)=>{if(!g.step){o||(o=this.remapping(r,v+1),l=o.maps.length),l--,p.push(g);return}if(o){p.push(new sr(g.map));let b=g.step.map(o.slice(l)),S;b&&a.maybeStep(b).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new sr(S,void 0,void 0,h.length+p.length))),l--,S&&o.appendMap(S,l)}else a.maybeStep(g.step);if(g.selection)return c=o?g.selection.map(o.slice(l)):g.selection,d=new Yn(this.items.slice(0,r).append(p.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:d,transform:a,selection:c}}addTransform(e,n,r,o){let l=[],a=this.eventCount,c=this.items,d=!o&&c.length?c.get(c.length-1):null;for(let p=0;p<e.steps.length;p++){let g=e.steps[p].invert(e.docs[p]),v=new sr(e.mapping.maps[p],g,n),b;(b=d&&d.merge(v))&&(v=b,p?l.pop():c=c.slice(0,c.length-1)),l.push(v),n&&(a++,n=void 0),o||(d=v)}let h=a-r.depth;return h>wF&&(c=xF(c,h),a-=h),new Yn(c.append(l),a)}remapping(e,n){let r=new da;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 Yn(this.items.append(e.map(n=>new sr(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,c=this.eventCount;this.items.forEach(v=>{v.selection&&c--},o);let d=n;this.items.forEach(v=>{let b=l.getMirror(--d);if(b==null)return;a=Math.min(a,b);let S=l.maps[b];if(v.step){let x=e.steps[b].invert(e.docs[b]),C=v.selection&&v.selection.map(l.slice(d+1,b));C&&c++,r.push(new sr(S,x,C))}else r.push(new sr(S))},o);let h=[];for(let v=n;v<a;v++)h.push(new sr(l.maps[v]));let p=this.items.slice(0,o).append(h).append(r),g=new Yn(p,c);return g.emptyItemCount()>SF&&(g=g.compress(this.items.length-r.length)),g}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,c)=>{if(c>=e)o.push(a),a.selection&&l++;else if(a.step){let d=a.step.map(n.slice(r)),h=d&&d.getMap();if(r--,h&&n.appendMap(h,r),d){let p=a.selection&&a.selection.map(n.slice(r));p&&l++;let g=new sr(h.invert(),d,p),v,b=o.length-1;(v=o.length&&o[b].merge(g))?o[b]=v:o.push(g)}}else a.map&&r--},this.items.length,0),new Yn(Ot.from(o.reverse()),l)}}Yn.empty=new Yn(Ot.empty,0);function xF(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class sr{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 sr(n.getMap().invert(),n,this.selection)}}}class wi{constructor(e,n,r,o,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=l}}const wF=20;function CF(t,e,n,r){let o=n.getMeta(bo),l;if(o)return o.historyState;n.getMeta(RF)&&(t=new wi(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(bo))return a.getMeta(bo).redo?new wi(t.done.addTransform(n,void 0,r,Cc(e)),t.undone,_x(n.mapping.maps),t.prevTime,t.prevComposition):new wi(t.done,t.undone.addTransform(n,void 0,r,Cc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let c=n.getMeta("composition"),d=t.prevTime==0||!a&&t.prevComposition!=c&&(t.prevTime<(n.time||0)-r.newGroupDelay||!MF(n,t.prevRanges)),h=a?Op(t.prevRanges,n.mapping):_x(n.mapping.maps);return new wi(t.done.addTransform(n,d?e.selection.getBookmark():void 0,r,Cc(e)),Yn.empty,h,n.time,c??t.prevComposition)}else return(l=n.getMeta("rebased"))?new wi(t.done.rebased(n,l),t.undone.rebased(n,l),Op(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new wi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Op(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function MF(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 _x(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 Op(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 EF(t,e,n){let r=Cc(e),o=bo.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),c=(n?t.done:t.undone).addTransform(l.transform,e.selection.getBookmark(),o,r),d=new wi(n?c:l.remaining,n?l.remaining:c,null,0,-1);return l.transform.setSelection(a).setMeta(bo,{redo:n,historyState:d})}let kp=!1,zx=null;function Cc(t){let e=t.plugins;if(zx!=e){kp=!1,zx=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){kp=!0;break}}return kp}const bo=new Zt("history"),RF=new Zt("closeHistory");function TF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new vt({key:bo,state:{init(){return new wi(Yn.empty,Yn.empty,null,0,-1)},apply(e,n,r){return CF(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?NR:r=="historyRedo"?DR:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function kR(t,e){return(n,r)=>{let o=bo.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let l=EF(o,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}const NR=kR(!1,!0),DR=kR(!0,!0);bt.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 vt({key:new Zt("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,c=0,d=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const h=r.tr.deleteRange(c,d);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 c=e.selection.$head.pos,d=l-r,h=c-d,p=c;return e.deleteRange(h,p),!(this.storage.characters({node:e.doc})>r)}})]}});bt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[cF(this.options)]}});bt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new vt({key:new Zt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,l=[];if(!n||!r)return it.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((d,h)=>{if(d.isText)return;if(!(o>=h&&o<=h+d.nodeSize-1))return!1;a+=1});let c=0;return t.descendants((d,h)=>{if(d.isText||!(o>=h&&o<=h+d.nodeSize-1))return!1;if(c+=1,this.options.mode==="deepest"&&a-c>0||this.options.mode==="shallowest"&&c>1)return this.options.mode==="deepest";l.push(Gt.node(h,h+d.nodeSize,{class:this.options.className}))}),it.create(t,l)}}})]}});bt.create({name:"gapCursor",addProseMirrorPlugins(){return[pF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=rt(ge(t,"allowGapCursor",n)))!=null?e:null}}});var jx="placeholder";function AF(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var OF=bt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:jx,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${AF(this.options.dataAttribute)}`:`data-${jx}`;return[new vt({key:new Zt("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,l=[];if(!r)return null;const a=this.editor.isEmpty;return e.descendants((c,d)=>{const h=o>=d&&o<=d+c.nodeSize,p=!c.isLeaf&&Mf(c);if(!c.type.isTextblock)return this.options.includeChildren;if((h||!this.options.showOnlyCurrent)&&p){const g=[this.options.emptyNodeClass];a&&g.push(this.options.emptyEditorClass);const v=Gt.node(d,d+c.nodeSize,{class:g.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:c,pos:d,hasAnchor:h}):this.options.placeholder});l.push(v)}return this.options.includeChildren}),it.create(e,l)}}})]}});bt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new vt({key:new Zt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||f4(n.selection)||t.view.dragging?null:it.create(n.doc,[Gt.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Lx({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}bt.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Zt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new vt({key:e,appendTransaction:(o,l,a)=>{const{doc:c,tr:d,schema:h}=a,p=e.getState(a),g=c.content.size,v=h.nodes[n];if(p)return d.insert(g,v.create())},state:{init:(o,l)=>{const a=l.tr.doc.lastChild;return!Lx({node:a,types:r})},apply:(o,l)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return l;const a=o.doc.lastChild;return!Lx({node:a,types:r})}}})]}});bt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>NR(t,e),redo:()=>({state:t,dispatch:e})=>DR(t,e)}},addProseMirrorPlugins(){return[TF(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()}}});var kF=OF,NF=Sg.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),DF=NF;const{getOwnPropertyNames:_F,getOwnPropertySymbols:zF}=Object,{hasOwnProperty:jF}=Object.prototype;function Np(t,e){return function(r,o,l){return t(r,o,l)&&e(r,o,l)}}function mc(t){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,o);const{cache:l}=o,a=l.get(n),c=l.get(r);if(a&&c)return a===r&&c===n;l.set(n,r),l.set(r,n);const d=t(n,r,o);return l.delete(n),l.delete(r),d}}function LF(t){return t?.[Symbol.toStringTag]}function Ix(t){return _F(t).concat(zF(t))}const IF=Object.hasOwn||((t,e)=>jF.call(t,e));function Oo(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const BF="__v",VF="__o",FF="_owner",{getOwnPropertyDescriptor:Bx,keys:Vx}=Object;function PF(t,e){return t.byteLength===e.byteLength&&Xc(new Uint8Array(t),new Uint8Array(e))}function $F(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function HF(t,e){return t.byteLength===e.byteLength&&Xc(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function UF(t,e){return Oo(t.getTime(),e.getTime())}function qF(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function GF(t,e){return t===e}function Fx(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),l=t.entries();let a,c,d=0;for(;(a=l.next())&&!a.done;){const h=e.entries();let p=!1,g=0;for(;(c=h.next())&&!c.done;){if(o[g]){g++;continue}const v=a.value,b=c.value;if(n.equals(v[0],b[0],d,g,t,e,n)&&n.equals(v[1],b[1],v[0],b[0],t,e,n)){p=o[g]=!0;break}g++}if(!p)return!1;d++}return!0}const KF=Oo;function YF(t,e,n){const r=Vx(t);let o=r.length;if(Vx(e).length!==o)return!1;for(;o-- >0;)if(!_R(t,e,n,r[o]))return!1;return!0}function ql(t,e,n){const r=Ix(t);let o=r.length;if(Ix(e).length!==o)return!1;let l,a,c;for(;o-- >0;)if(l=r[o],!_R(t,e,n,l)||(a=Bx(t,l),c=Bx(e,l),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function XF(t,e){return Oo(t.valueOf(),e.valueOf())}function JF(t,e){return t.source===e.source&&t.flags===e.flags}function Px(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),l=t.values();let a,c;for(;(a=l.next())&&!a.done;){const d=e.values();let h=!1,p=0;for(;(c=d.next())&&!c.done;){if(!o[p]&&n.equals(a.value,c.value,a.value,c.value,t,e,n)){h=o[p]=!0;break}p++}if(!h)return!1}return!0}function Xc(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function QF(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function _R(t,e,n,r){return(r===FF||r===VF||r===BF)&&(t.$$typeof||e.$$typeof)?!0:IF(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const ZF="[object ArrayBuffer]",WF="[object Arguments]",e5="[object Boolean]",t5="[object DataView]",n5="[object Date]",r5="[object Error]",i5="[object Map]",o5="[object Number]",s5="[object Object]",l5="[object RegExp]",a5="[object Set]",u5="[object String]",c5={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},f5="[object URL]",d5=Object.prototype.toString;function h5({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:l,areMapsEqual:a,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:h,areRegExpsEqual:p,areSetsEqual:g,areTypedArraysEqual:v,areUrlsEqual:b,unknownTagComparators:S}){return function(C,E,A){if(C===E)return!0;if(C==null||E==null)return!1;const k=typeof C;if(k!==typeof E)return!1;if(k!=="object")return k==="number"?c(C,E,A):k==="function"?l(C,E,A):!1;const N=C.constructor;if(N!==E.constructor)return!1;if(N===Object)return d(C,E,A);if(Array.isArray(C))return e(C,E,A);if(N===Date)return r(C,E,A);if(N===RegExp)return p(C,E,A);if(N===Map)return a(C,E,A);if(N===Set)return g(C,E,A);const j=d5.call(C);if(j===n5)return r(C,E,A);if(j===l5)return p(C,E,A);if(j===i5)return a(C,E,A);if(j===a5)return g(C,E,A);if(j===s5)return typeof C.then!="function"&&typeof E.then!="function"&&d(C,E,A);if(j===f5)return b(C,E,A);if(j===r5)return o(C,E,A);if(j===WF)return d(C,E,A);if(c5[j])return v(C,E,A);if(j===ZF)return t(C,E,A);if(j===t5)return n(C,E,A);if(j===e5||j===o5||j===u5)return h(C,E,A);if(S){let U=S[j];if(!U){const _=LF(C);_&&(U=S[_])}if(U)return U(C,E,A)}return!1}}function p5({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:PF,areArraysEqual:n?ql:$F,areDataViewsEqual:HF,areDatesEqual:UF,areErrorsEqual:qF,areFunctionsEqual:GF,areMapsEqual:n?Np(Fx,ql):Fx,areNumbersEqual:KF,areObjectsEqual:n?ql:YF,arePrimitiveWrappersEqual:XF,areRegExpsEqual:JF,areSetsEqual:n?Np(Px,ql):Px,areTypedArraysEqual:n?Np(Xc,ql):Xc,areUrlsEqual:QF,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=mc(r.areArraysEqual),l=mc(r.areMapsEqual),a=mc(r.areObjectsEqual),c=mc(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:l,areObjectsEqual:a,areSetsEqual:c})}return r}function m5(t){return function(e,n,r,o,l,a,c){return t(e,n,c)}}function g5({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(c,d){const{cache:h=t?new WeakMap:void 0,meta:p}=n();return e(c,d,{cache:h,equals:r,meta:p,strict:o})};if(t)return function(c,d){return e(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const l={cache:void 0,equals:r,meta:void 0,strict:o};return function(c,d){return e(c,d,l)}}const y5=Fi();Fi({strict:!0});Fi({circular:!0});Fi({circular:!0,strict:!0});Fi({createInternalComparator:()=>Oo});Fi({strict:!0,createInternalComparator:()=>Oo});Fi({circular:!0,createInternalComparator:()=>Oo});Fi({circular:!0,createInternalComparator:()=>Oo,strict:!0});function Fi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,l=p5(t),a=h5(l),c=n?n(a):m5(a);return g5({circular:e,comparator:a,createState:r,equals:c,strict:o})}var Dp={exports:{}},_p={};var $x;function v5(){if($x)return _p;$x=1;var t=ba(),e=uw();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,c=t.useMemo,d=t.useDebugValue;return _p.useSyncExternalStoreWithSelector=function(h,p,g,v,b){var S=l(null);if(S.current===null){var x={hasValue:!1,value:null};S.current=x}else x=S.current;S=c(function(){function E(U){if(!A){if(A=!0,k=U,U=v(U),b!==void 0&&x.hasValue){var _=x.value;if(b(_,U))return N=_}return N=U}if(_=N,r(k,U))return _;var I=v(U);return b!==void 0&&b(_,I)?(k=U,_):(k=U,N=I)}var A=!1,k,N,j=g===void 0?null:g;return[function(){return E(p())},j===null?void 0:function(){return E(j())}]},[p,g,v,b]);var C=o(h,S[0],S[1]);return a(function(){x.hasValue=!0,x.value=C},[C]),d(C),C},_p}var Hx;function b5(){return Hx||(Hx=1,Dp.exports=v5()),Dp.exports}var S5=b5(),x5=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},w5=({contentComponent:t})=>{const e=cw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return T.jsx(T.Fragment,{children:Object.values(e)})};function C5(){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]:R1.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 M5=class extends tn.Component{constructor(t){var e;super(t),this.editorContentRef=tn.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=C5(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.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.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return T.jsxs(T.Fragment,{children:[T.jsx("div",{ref:x5(e,this.editorContentRef),...n}),t?.contentComponent&&T.jsx(w5,{contentComponent:t.contentComponent})]})}},E5=M.forwardRef((t,e)=>{const n=tn.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return tn.createElement(M5,{key:n,innerRef:e,...t})}),zR=tn.memo(E5),R5=typeof window<"u"?M.useLayoutEffect:M.useEffect,T5=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 A5(t){var e;const[n]=M.useState(()=>new T5(t.editor)),r=S5.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:y5);return R5(()=>n.watch(t.editor),[t.editor,n]),M.useDebugValue(r),r}var O5=!1,vm=typeof window>"u",k5=vm||!!(typeof window<"u"&&window.next),N5=class jR{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?vm||k5?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 X4(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?jR.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 D5(t={},e=[]){const n=M.useRef(t);n.current=t;const[r]=M.useState(()=>new N5(n)),o=cw.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return M.useDebugValue(o),M.useEffect(r.onRender(e)),A5({editor:o,selector:({transactionNumber:l})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&l===0?0:l+1}),o}var LR=M.createContext({editor:null});LR.Consumer;var _5=M.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),z5=()=>M.useContext(_5);tn.forwardRef((t,e)=>{const{onDragStart:n}=z5(),r=t.as||"div";return T.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});tn.createContext({markViewContentRef:()=>{}});var wg=M.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});wg.displayName="TiptapContext";var j5=()=>M.useContext(wg);function IR({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=M.useMemo(()=>({editor:r}),[r]),l=M.useMemo(()=>({editor:r}),[r]);return T.jsx(LR.Provider,{value:l,children:T.jsx(wg.Provider,{value:o,children:n})})}IR.displayName="Tiptap";function BR({...t}){const{editor:e}=j5();return T.jsx(zR,{editor:e,...t})}BR.displayName="Tiptap.Content";Object.assign(IR,{Content:BR});function L5({className:t,...e}){return T.jsx("div",{"data-slot":"input-group",role:"group",className:De("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",t),...e})}const I5=Am("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function Ux({className:t,align:e="inline-start",...n}){return T.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:De(I5({align:e}),t),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const B5=Am("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function V5({className:t,type:e="button",variant:n="ghost",size:r="xs",...o}){return T.jsx(_s,{type:e,"data-size":r,variant:n,className:De(B5({size:r}),t),...o})}const qx=new Zt("data-table-search-selector-highlighter"),VR="refresh-data-table-search-selector-highlighter",FR={fields:[]};function Gx(t){const e=E3(Jc(t),FR.fields);return it.create(t,e.map(n=>{const r=ks(t,n.start),o=ks(t,n.end);return r>=o?null:Gt.inline(r,o,{class:"data-table-search-input-selector-token","data-table-search-selector":""},{inclusiveEnd:!1,inclusiveStart:!1})}).filter(n=>n!==null))}const F5=bt.create({name:"dataTableSelectorHighlighter",addProseMirrorPlugins(){return[new vt({key:qx,state:{init:(t,e)=>Gx(e.doc),apply:(t,e,n,r)=>t.docChanged||t.getMeta(VR)?Gx(r.doc):e.map(t.mapping,t.doc)},props:{decorations(t){return qx.getState(t)}}})]}});function Kx(t,e){if(typeof t=="function"){t(e);return}t&&(t.current=e)}function Yx(t){return{content:t?[{content:[{text:t,type:"text"}],type:"paragraph"}]:[{type:"paragraph"}],type:"doc"}}function Jc(t){return t.textBetween(0,t.content.size,"","")}function Rs(t){return t.state.doc.textBetween(0,t.state.selection.from,"","").length}function ks(t,e){const n=Jc(t).length;let o=Math.max(0,Math.min(e,n)),l=Oe.atStart(t).from;return t.descendants((a,c)=>{if(!a.isText)return!0;const d=a.text??"";return o<=d.length?(l=c+o,!1):(o-=d.length,l=c+d.length,!0)}),l}function P5(t){return t.replace(/\r\n?/g,`
|
|
159
|
+
`).replace(/\n/g," ")}function Xx(t,e,n){return e<=0?-1:t<0?n===1?0:e-1:(t+n+e)%e}function $5({inputRef:t,isLoading:e=!1,placeholder:n="Search table...",...r}){const o=hf(),l="fields"in r?r.fields:o?.searchFields??void 0,a="value"in r?r.value:o?.search??void 0,c="onSearchChange"in r?r.onSearchChange:o?.setSearch??void 0,d=M.useRef(null),h=M.useRef([]),p=M.useRef(a??""),g=M.useRef(!1),v=M.useRef(-1),b=M.useRef(!1),S=M.useRef([]),x=M.useRef(()=>{}),C=M.useRef(null),[E,A]=M.useState(0),[k,N]=M.useState(!1),[j,U]=M.useState(-1);if(!l||a===void 0||!c)throw new Error("DataTableSearchInput must be used inside DataTableProvider or receive fields, value, and onSearchChange props.");const _=M.useCallback(B=>{v.current=B,U(B)},[]),I=M.useMemo(()=>R3(a,E,l),[E,l,a]),Z=M.useMemo(()=>I.filter(B=>B.group==="input"),[I]),se=M.useMemo(()=>I.filter(B=>B.group==="values"),[I]),me=M.useMemo(()=>I.filter(B=>B.group==="filters"),[I]),ue=M.useCallback((B,q,K)=>{B.commands.setContent(Yx(q),{emitUpdate:!1,parseOptions:{preserveWhitespace:"full"}}),K&&B.commands.setTextSelection({from:ks(B.state.doc,K.start),to:ks(B.state.doc,K.end)})},[]),be=M.useCallback((B,q)=>{const K=T3(a,E,l,q);C.current={end:K.selectionStart,start:K.selectionStart},A(K.selectionStart),N(K.keepOpen),K.keepOpen||(b.current=!0),B&&(ue(B,K.value,C.current),B.commands.focus()),c(K.value)},[E,l,c,ue,a]),ne=D5({content:Yx(a),editorProps:{attributes:{autocapitalize:"off",autocomplete:"off",autocorrect:"off",class:"data-table-search-input-editor min-w-0 flex-1 overflow-x-auto px-2 py-0 text-sm outline-none whitespace-pre",spellcheck:"false"},handleKeyDown:(B,q)=>{if(q.key==="Escape")return q.preventDefault(),b.current=!0,N(!1),!0;if(q.key==="ArrowDown")return q.preventDefault(),N(!0),_(Xx(v.current,S.current.length,1)),!0;if(q.key==="ArrowUp")return q.preventDefault(),N(!0),_(Xx(v.current,S.current.length,-1)),!0;if(q.key==="Tab"){const K=S.current[v.current];return!g.current||!K?!1:(q.preventDefault(),x.current(ne,K),!0)}if(q.key==="Enter"){q.preventDefault(),q.stopPropagation();const K=S.current[v.current];return g.current&&K?x.current(ne,K):A(Rs(ne)),!0}return!1},handlePaste:(B,q)=>{const K=q.clipboardData?.getData("text/plain");return typeof K!="string"?!1:(q.preventDefault(),B.dispatch(B.state.tr.insertText(P5(K),B.state.selection.from,B.state.selection.to)),!0)}},extensions:[sF,uF,DF,kF.configure({placeholder:n}),F5,bt.create({name:"singleLineSearchBehavior",addKeyboardShortcuts(){return{Enter:()=>!0}}})],immediatelyRender:!0,onSelectionUpdate:({editor:B})=>{A(Rs(B))},onUpdate:({editor:B})=>{const q=Jc(B.state.doc);A(Rs(B)),q!==p.current&&c(q),N(!0)}},[]);M.useEffect(()=>{p.current=a},[a]),M.useEffect(()=>{g.current=k},[k]),M.useEffect(()=>{v.current=j},[j]),M.useEffect(()=>{S.current=I},[I]),M.useEffect(()=>{x.current=be},[be]),M.useEffect(()=>{h.current.length=I.length},[I.length]),M.useEffect(()=>{FR.fields=l},[l]),M.useEffect(()=>{ne&&ne.view.dispatch(ne.state.tr.setMeta(VR,!0))},[ne,l]),M.useEffect(()=>{if(!ne)return;const B=C.current;Jc(ne.state.doc)!==a?ue(ne,a,B??void 0):B&&ne.commands.setTextSelection({from:ks(ne.state.doc,B.start),to:ks(ne.state.doc,B.end)}),C.current=null,A(Rs(ne))},[ne,ue,a]),M.useEffect(()=>{const B=Math.min(E,a.length);B!==E&&A(B)},[E,a.length]),M.useEffect(()=>{const B=I.length>0?Math.min(j,I.length-1):-1;_(k?B:-1)},[j,k,_,I.length]),M.useEffect(()=>{!k||j<0||h.current[j]?.scrollIntoView({block:"nearest"})},[j,k]),M.useEffect(()=>{const B=q=>{d.current?.contains(q.target)||N(!1)};return window.addEventListener("pointerdown",B),()=>window.removeEventListener("pointerdown",B)},[]),M.useEffect(()=>{if(t)return Kx(t,{focus:()=>{ne?.commands.focus()},selectAll:()=>{ne?.chain().focus().selectAll().run()}}),()=>Kx(t,null)},[ne,t]);const ye=e,V=[{items:Z,label:void 0},{items:se,label:"Values"},{items:me,label:"Filters"}];let $=0;return T.jsxs("div",{ref:d,className:"relative min-w-64 flex-1",children:[T.jsxs(L5,{className:"h-10 w-full text-lg focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",children:[T.jsx(Ux,{align:"inline-start",children:T.jsx("span",{"aria-hidden":"true",className:"flex size-5 shrink-0 items-center justify-center",children:ye?T.jsx(ef,{className:"size-4.5 animate-spin"}):T.jsx(Sm,{className:"size-4.5"})})}),T.jsx("div",{className:"min-w-0 flex-1",children:T.jsx(zR,{editor:ne,onBlur:()=>{requestAnimationFrame(()=>{d.current?.contains(document.activeElement)||N(!1),b.current=!1})},onClick:()=>{A(ne?Rs(ne):0),b.current=!1,N(!0)},onFocus:()=>{if(A(ne?Rs(ne):0),b.current){b.current=!1;return}N(!0)}})}),T.jsx(Ux,{align:"inline-end",children:a?T.jsx(V5,{"aria-label":"Clear search",size:"icon-xs",variant:"ghost",onClick:()=>{if(!ne){c(""),A(0),N(!1);return}C.current={end:0,start:0},A(0),N(!1),ue(ne,"",C.current),ne.commands.focus(),c("")},children:T.jsx(xm,{className:"pointer-events-none"})}):null})]}),k?T.jsx("div",{className:"absolute top-full left-0 z-50 mt-1 w-full",children:T.jsx("div",{className:"max-h-[min(calc(var(--spacing(72)---spacing(9)),calc(100svh---spacing(20)))] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",children:I.length===0?T.jsx("div",{className:"flex w-full justify-center py-2 text-center text-xs/relaxed text-muted-foreground",children:"No items found."}):T.jsx("div",{className:"max-h-[min(calc(var(--spacing(72)---spacing(9)),calc(100svh---spacing(20)))] overflow-y-auto p-1",children:V.map(B=>B.items.length===0?null:T.jsxs("div",{children:[B.label?T.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:B.label}):null,B.items.map(q=>{const K=$;return $+=1,T.jsx("button",{ref:D=>{h.current[K]=D},type:"button",className:`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-left text-xs/relaxed outline-hidden select-none hover:bg-accent hover:text-accent-foreground ${K===j?"bg-accent text-accent-foreground":""}`,"data-highlighted":K===j?"":void 0,onClick:()=>be(ne,q),onMouseDown:D=>{D.preventDefault()},onMouseEnter:()=>_(K),children:T.jsx("span",{className:"truncate",children:q.label})},q.id)})]},B.label??"Input"))})})}):null]})}function PR({...t}){return T.jsx(Jj,{"data-slot":"dropdown-menu",...t})}function $R({...t}){return T.jsx(Qj,{"data-slot":"dropdown-menu-trigger",...t})}function HR({className:t,align:e="start",sideOffset:n=4,...r}){return T.jsx(Zj,{children:T.jsx(Wj,{"data-slot":"dropdown-menu-content",sideOffset:n,align:e,className:De("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r})})}function Jx({className:t,inset:e,variant:n="default",...r}){return T.jsx(t3,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:De("group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function H5({className:t,children:e,checked:n,inset:r,...o}){return T.jsxs(n3,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:De("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),checked:n,...o,children:[T.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:T.jsx(nM,{children:T.jsx($s,{})})}),e]})}function UR({...t}){return T.jsx(r3,{"data-slot":"dropdown-menu-radio-group",...t})}function qR({className:t,children:e,inset:n,...r}){return T.jsxs(i3,{"data-slot":"dropdown-menu-radio-item","data-inset":n,className:De("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[T.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:T.jsx(nM,{children:T.jsx($s,{})})}),e]})}function Ql({className:t,inset:e,...n}){return T.jsx(e3,{"data-slot":"dropdown-menu-label","data-inset":e,className:De("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",t),...n})}function ia({className:t,...e}){return T.jsx(o3,{"data-slot":"dropdown-menu-separator",className:De("-mx-1 my-1 h-px bg-border/50",t),...e})}function Qx({...t}){return T.jsx(s3,{"data-slot":"dropdown-menu-sub",...t})}function Zx({className:t,inset:e,children:n,...r}){return T.jsxs(l3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:De("flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[n,T.jsx(f1,{className:"ml-auto"})]})}function Wx({className:t,...e}){return T.jsx(a3,{"data-slot":"dropdown-menu-sub-content",className:De("z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})}function U5({isConnected:t,isConnecting:e,className:n}){const r=t?{dotClassName:"bg-emerald-500",label:"Connected",textClassName:"text-emerald-600 dark:text-emerald-400"}:e?{dotClassName:"bg-amber-500",label:"Connecting",textClassName:"text-amber-600 dark:text-amber-400"}:{dotClassName:"bg-muted-foreground/60",label:"Disconnected",textClassName:"text-muted-foreground"};return T.jsxs("div",{className:De("inline-flex items-center gap-2 text-xs font-medium",n),children:[T.jsx("span",{"aria-hidden":"true",className:De("size-2 rounded-full",r.dotClassName)}),T.jsx("span",{className:r.textClassName,children:r.label})]})}function q5({streams:t,selectedStreamId:e,isConnected:n,isConnecting:r,isDisabled:o=!1,canClear:l=!0,onClear:a,onPause:c,onPlay:d,onSelectStream:h,className:p}){const g=M.useMemo(()=>e?t.find(x=>x.id===e)?.label??"Select a stream":t[0]?.label??"Select a stream",[e,t]),v=!o&&t.length>0,b=!o&&!!e&&!r,S=n?"Pause stream":"Play stream";return T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsxs("div",{className:De("flex min-w-0 h-10 overflow-hidden rounded-md border border-input bg-background",p),children:[T.jsxs(PR,{children:[T.jsx($R,{asChild:!0,children:T.jsxs(_s,{type:"button",variant:"ghost",className:"h-10 min-w-0 border-0 flex-1 justify-between",disabled:!v,children:[T.jsx("span",{className:"truncate text-sm",children:g}),T.jsx(VO,{className:"size-4 text-muted-foreground"})]})}),T.jsxs(HR,{align:"start",sideOffset:10,className:"max-h-80 max-w-[min(24rem,calc(100vw-2rem))]",children:[T.jsx("div",{className:"px-2 py-1.5",children:T.jsx(U5,{isConnected:n,isConnecting:r})}),T.jsx(ia,{}),T.jsx(Ql,{children:"Streams"}),T.jsx(ia,{}),T.jsx(UR,{value:e??"",onValueChange:h,children:t.map(x=>T.jsx(qR,{value:x.id,className:"min-h-9 text-sm",children:x.label},x.id))})]})]}),T.jsx(_s,{type:"button",variant:"ghost",size:"icon-xl",disabled:!l,"aria-label":"Clear rows",onClick:a,className:"rounded-full",children:T.jsx(xm,{className:"size-5"})})]}),T.jsxs(_s,{type:"button",size:"xl",variant:"outline",disabled:!b,"aria-label":S,onClick:n?c:d,className:De(n?"border-blue-500 ring-1 ring-blue-500 text-blue-500!":"","cursor-pointer gap-2"),children:[T.jsx("div",{className:De("[&_svg]:shrink-0 [&_svg]:size-3",r?"animate-spin":""),children:r?T.jsx(ef,{}):n?T.jsx(qO,{className:"[&_rect]:fill-current"}):T.jsx(HO,{className:"[&_path]:fill-current"})}),"Live"]})]})}const GR="(prefers-color-scheme: dark)",G5=["dark","light","system"],KR=M.createContext(void 0);function e1(t){return t===null?!1:G5.includes(t)}function t1(){return window.matchMedia(GR).matches?"dark":"light"}function K5(){const t=document.createElement("style");return t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.remove()})})}}function Y5(t){return t instanceof HTMLElement?!!(t.isContentEditable||t.closest("input, textarea, select, [contenteditable='true']")):!1}function X5({children:t,defaultTheme:e="system",storageKey:n="theme",disableTransitionOnChange:r=!0,...o}){const[l,a]=M.useState(()=>{const p=localStorage.getItem(n);return e1(p)?p:e}),c=M.useCallback(p=>{localStorage.setItem(n,p),a(p)},[n]),d=M.useCallback(p=>{const g=document.documentElement,v=p==="system"?t1():p,b=r?K5():null;g.classList.remove("light","dark"),g.classList.add(v),b&&b()},[r]);M.useEffect(()=>{if(d(l),l!=="system")return;const p=window.matchMedia(GR),g=()=>{d("system")};return p.addEventListener("change",g),()=>{p.removeEventListener("change",g)}},[l,d]),M.useEffect(()=>{const p=g=>{g.repeat||g.metaKey||g.ctrlKey||g.altKey||Y5(g.target)||g.key.toLowerCase()==="d"&&a(v=>{const b=v==="dark"?"light":v==="light"?"dark":t1()==="dark"?"light":"dark";return localStorage.setItem(n,b),b})};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p)}},[n]),M.useEffect(()=>{const p=g=>{if(g.storageArea===localStorage&&g.key===n){if(e1(g.newValue)){a(g.newValue);return}a(e)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}},[e,n]);const h=M.useMemo(()=>({theme:l,setTheme:c}),[l,c]);return T.jsx(KR.Provider,{...o,value:h,children:t})}const J5=()=>{const t=M.useContext(KR);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},Q5=[{icon:g1,label:"Light",value:"light"},{icon:p1,label:"Dark",value:"dark"},{icon:m1,label:"System",value:"system"}];function Z5({columns:t,isDisabled:e=!1,onExportCsv:n,onExportMarkdown:r,onToggleColumn:o,className:l}){const{theme:a,setTheme:c}=J5(),d=!e&&t.length>0;return T.jsxs(PR,{children:[T.jsx($R,{asChild:!0,children:T.jsx(_s,{type:"button",variant:"outline",size:"icon-xl",disabled:e,className:De("shrink-0",l),"aria-label":"Open settings",children:T.jsx(XO,{className:"size-4"})})}),T.jsxs(HR,{align:"end",sideOffset:10,className:"w-64 max-w-[min(24rem,calc(100vw-2rem))]",children:[T.jsx(Ql,{children:"View"}),T.jsxs(Qx,{children:[T.jsxs(Zx,{className:"min-h-9 text-sm",children:[T.jsx(m1,{className:"size-4 text-muted-foreground"}),"Columns"]}),T.jsxs(Wx,{className:"max-h-80 w-64 overflow-y-auto",children:[T.jsx(Ql,{children:"Visible columns"}),T.jsx(ia,{}),t.map(h=>T.jsx(H5,{checked:h.visible,className:"min-h-9 text-sm",onSelect:p=>{p.preventDefault()},onCheckedChange:p=>o(h.id,p===!0),children:T.jsxs("span",{className:"flex min-w-0 items-center gap-2 pr-4",children:[h.kind?T.jsx(Rc,{kind:h.kind,className:"size-4 shrink-0 text-muted-foreground"}):null,T.jsx("span",{className:"truncate",children:h.label})]})},h.id))]})]}),T.jsxs(Qx,{children:[T.jsxs(Zx,{className:"min-h-9 text-sm",children:[T.jsx(g1,{className:"size-4 text-muted-foreground dark:hidden"}),T.jsx(p1,{className:"hidden size-4 text-muted-foreground dark:block"}),"Theme"]}),T.jsxs(Wx,{className:"w-44",children:[T.jsx(Ql,{children:"Appearance"}),T.jsx(ia,{}),T.jsx(UR,{value:a,onValueChange:h=>c(h),children:Q5.map(h=>{const p=h.icon;return T.jsxs(qR,{value:h.value,className:"min-h-9 text-sm",children:[T.jsx(p,{className:"size-4 text-muted-foreground"}),h.label]},h.value)})})]})]}),T.jsx(ia,{}),T.jsx(Ql,{children:"Export"}),T.jsxs(Jx,{className:"min-h-9 text-sm",disabled:!d,onSelect:n,children:[T.jsx(Lp,{className:"size-4 text-muted-foreground"}),"Export CSV"]}),T.jsxs(Jx,{className:"min-h-9 text-sm",disabled:!d,onSelect:r,children:[T.jsx(Lp,{className:"size-4 text-muted-foreground"}),"Export Markdown"]})]})]})}const Qc="stream",YR="datatable-",n1="datool";function Zc(t){return`${t}-search`}function Wc(t){return`${YR}${t}`}function W5(t){return t.startsWith(`${YR}${n1}`)||t.startsWith(`${n1}-`)&&t.endsWith("-search")}function XR(t){if(typeof window>"u")return null;try{const e=new URL(window.location.href).searchParams.get(Wc(t));return e?JSON.parse(e):null}catch{return null}}function JR(t,e){const n=new Set(e);return Object.fromEntries(Object.entries(t??{}).filter(([r])=>n.has(r)))}function eP(t,e){const n=Zc(e),r=Wc(e);for(const o of Array.from(t.searchParams.keys()))o===Qc||o===n||o===r||W5(o)&&t.searchParams.delete(o)}function QR(){return typeof window>"u"?null:new URL(window.location.href).searchParams.get(Qc)}function zp(t){return typeof window>"u"?"":new URL(window.location.href).searchParams.get(Zc(t))??""}function r1(t,e){return JR(XR(t)?.columnVisibility,e)}function tP({columnIds:t,columnVisibility:e,search:n,selectedStreamId:r,tableId:o}){if(typeof window>"u")return;const l=new URL(window.location.href),a=n.trim(),c=JR(e,t),d={...XR(o)};eP(l,o),r?l.searchParams.set(Qc,r):l.searchParams.delete(Qc),a?l.searchParams.set(Zc(o),n):l.searchParams.delete(Zc(o)),Object.keys(c).length>0?d.columnVisibility=c:delete d.columnVisibility,Object.keys(d).length>0?l.searchParams.set(Wc(o),JSON.stringify(d)):l.searchParams.delete(Wc(o)),window.history.replaceState(window.history.state,"",l)}const nP={Ban:DO,Check:$s,CircleAlert:bm,Copy:d1,Download:Lp,ExternalLink:QO,Filter:h1,Info:nk,Play:ck,RefreshCcw:dk,Search:Sm,Trash:vk,X:xm};function rP(t,e){const n=t.findIndex(r=>r.__datoolRowId===e.__datoolRowId);return n<0?[...t,e]:t.map((r,o)=>o===n?e:r)}function iP(t){return t.map(({__datoolRowId:e,...n})=>n)}function oP(t,e,n){if(!n||n.length===0)return t;const r=new Map(e.map((o,l)=>[o,n[l]??!0]));return t.flatMap(o=>{const l=r.get(o.__datoolRowId);return l===void 0||l===!0?[o]:l===!1||l===null?[]:[{...l,__datoolRowId:o.__datoolRowId}]})}function sP(){return QR()}function lP(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function jp(t){return t?`datool-${t}`:"datool"}function ZR(t,e){if(t==null||t==="")return"";if(e==="date"){const n=t instanceof Date?t:new Date(t);if(!Number.isNaN(n.getTime()))return n.toISOString()}return typeof t=="object"?JSON.stringify(t):String(t)}function i1(t){return/[",\n]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function o1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
|
|
160
|
+
`).replace(/\n/g,"<br />")}function aP(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"log-view"}function uP(t,e,n){const r=new Blob([t],{type:`${n};charset=utf-8`}),o=window.URL.createObjectURL(r),l=document.createElement("a");l.href=o,l.download=e,document.body.appendChild(l),l.click(),l.remove(),window.setTimeout(()=>{window.URL.revokeObjectURL(o)},0)}function cP(t,e){const n=e.map(o=>i1(o.label)).join(","),r=t.map(o=>e.map(l=>i1(ZR(Ym(o,l.accessorKey),l.kind))).join(","));return[n,...r].join(`
|
|
161
|
+
`)}function fP(t,e){const n=`| ${e.map(l=>o1(l.label)).join(" | ")} |`,r=`| ${e.map(()=>"---").join(" | ")} |`,o=t.map(l=>`| ${e.map(a=>o1(ZR(Ym(l,a.accessorKey),a.kind))).join(" | ")} |`);return[n,r,...o].join(`
|
|
162
|
+
`)}function dP(t){return t.map((e,n)=>{const r=Z3(e.accessorKey);return{accessorFn:r?o=>Ym(o,e.accessorKey):void 0,accessorKey:r?void 0:e.accessorKey,align:e.align,enumColors:e.enumColors,header:e.header,id:xM(e,n),kind:e.kind,maxWidth:e.maxWidth,minWidth:e.minWidth,truncate:e.truncate,width:e.width}})}function hP(t){return JSON.parse(t.data)}function pP(t){return JSON.parse(t.data)}function mP(t){return JSON.parse(t.data)}function Cg(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function s1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
|
|
163
|
+
`).replace(/\n/g,"<br />")}function WR(t,e){if(e.accessorFn)return e.accessorFn(t);if(e.accessorKey)return t[e.accessorKey]}function eT(t,e){return t.header??t.id??t.accessorKey??`Column ${e+1}`}function gP(t,e){const n=e.map((o,l)=>s1(eT(o,l)));return[`| ${n.join(" | ")} |`,`| ${n.map(()=>"---").join(" | ")} |`,...t.map(o=>`| ${e.map(a=>s1(Cg(WR(o,a)))).join(" | ")} |`)].join(`
|
|
164
|
+
`)}function yP(t,e){const n=Cg(e);return n.trim()?`${t}:${lM(n)}`:null}function vP(t,e,n){const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=oM(t).filter(l=>!l.match(new RegExp(`^${r}(:|>|<)`)));return o.push(n),o.join(" ")}function bP({activeStream:t,columns:e,config:n,errorMessage:r,isConnected:o,isConnecting:l,isLoadingConfig:a,rows:c,settingsColumns:d,selectedStreamId:h,setColumnVisibility:p,searchInputRef:g,handleExport:v,setRows:b,setSelectedStreamId:S,setShouldConnect:x}){const{search:C,setSearch:E}=I3(),A=M.useMemo(()=>[...t?.actions.map(N=>({button:N.button,icon:N.icon?nP[N.icon]:void 0,id:`config-${N.id}`,label:N.label,onSelect:async({actionRowIds:j,actionRows:U})=>{if(!t)return;const _=new URL(`/api/streams/${encodeURIComponent(t.id)}/actions/${encodeURIComponent(N.id)}`,window.location.origin),I=new URL(window.location.href).searchParams;for(const[ue,be]of I.entries())_.searchParams.set(ue,be);const Z={rows:iP(U)},se=await fetch(_,{body:JSON.stringify(Z),headers:{"Content-Type":"application/json"},method:"POST"}),me=await se.json().catch(()=>null);if(!se.ok)throw new Error(me?.error??`Failed to run action "${N.label}".`);if(me?.rowChanges!==void 0&&!Array.isArray(me.rowChanges))throw new Error(`Action "${N.label}" returned an invalid response.`);b(ue=>oP(ue,j,me?.rowChanges))},scope:"selection"}))??[],{icon:d1,id:"copy-markdown",label:({actionRows:N})=>N.length>1?`Copy ${N.length} rows as Markdown`:"Copy row as Markdown",onSelect:async({actionRows:N})=>{await navigator.clipboard.writeText(gP(N,e))},scope:"selection"},{icon:h1,id:"filter-matching",items:({anchorRow:N})=>e.map((j,U)=>{const _=WR(N,j),I=yP(j.id??`column-${U}`,_);return{disabled:I===null,icon:Z=>T.jsx(Rc,{kind:j.kind??"text",...Z}),id:`filter-${j.id??U}`,label:`${eT(j,U)}: ${Cg(_)||"(empty)"}`,onSelect:()=>{I&&E(vP(C,j.id??`column-${U}`,I))},scope:"row"}}),label:"Filter matching",scope:"row"}],[t,e,C,E]);return T.jsxs("main",{className:"flex h-svh min-h-0 w-full min-w-0 flex-col gap-3 bg-background px-0 pt-3 pb-0",children:[T.jsxs("header",{className:"flex w-full flex-wrap items-start gap-3 px-4",children:[T.jsx($5,{inputRef:g}),T.jsxs("div",{className:"flex min-w-20 items-start gap-3",children:[T.jsx(q5,{streams:n?.streams??[],selectedStreamId:h,isConnected:o,isConnecting:l,isDisabled:a||!n,canClear:c.length>0,onSelectStream:S,onPlay:()=>x(!0),onPause:()=>x(!1),onClear:()=>b([])}),T.jsx(Z5,{columns:d,isDisabled:a||!t,onExportCsv:()=>v("csv"),onExportMarkdown:()=>v("md"),onToggleColumn:(k,N)=>p(j=>({...j,[k]:N}))})]})]}),r?T.jsx("div",{className:"px-4 text-sm text-destructive",children:r}):null,T.jsx("div",{className:"min-h-0 flex-1",children:t?T.jsx(Q3,{rowActions:A}):T.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"No stream selected."})})]})}function SP(){const[t]=M.useState(()=>{const $=sP(),B=jp($);return{search:zp(B),streamId:$,tableId:B}}),[e,n]=M.useState(null),[r,o]=M.useState([]),[l,a]=M.useState(()=>t.streamId),[c,d]=M.useState(()=>!!t.streamId),[h,p]=M.useState(!0),[g,v]=M.useState(!1),[b,S]=M.useState(null),[x,C]=M.useState(()=>t.search),[E,A]=M.useState({}),k=M.useRef(null),N=M.useRef(!1),[j,U]=M.useState(null);M.useEffect(()=>{let $=!1;return fetch("/api/config").then(async B=>{if(!B.ok)throw new Error("Failed to load log viewer config.");return await B.json()}).then(B=>{$||(n(B),a(q=>q&&B.streams.some(K=>K.id===q)?q:B.streams[0]?.id??null))}).catch(B=>{$||S(B instanceof Error?B.message:String(B))}).finally(()=>{$||p(!1)}),()=>{$=!0}},[]);const _=M.useMemo(()=>!e||!l?null:e.streams.find($=>$.id===l)??null,[e,l]),I=M.useMemo(()=>_?dP(_.columns):[],[_]),Z=M.useMemo(()=>jp(l),[l]),se=M.useMemo(()=>_?.columns.map(($,B)=>({accessorKey:$.accessorKey,id:xM($,B),kind:$.kind,label:$.header??lP($.accessorKey)}))??[],[_]),me=M.useMemo(()=>se.map($=>({id:$.id,kind:$.kind,label:$.label,visible:E[$.id]!==!1})),[E,se]),ue=M.useMemo(()=>se.filter($=>E[$.id]!==!1),[E,se]),be=!!l&&c&&!g,ne=M.useMemo(()=>se.map($=>$.id),[se]);M.useEffect(()=>{N.current&&(o([]),S(null)),N.current=!0},[l]),M.useEffect(()=>{if(!_){U(null);return}C(zp(Z)),A(r1(Z,ne)),U(Z)},[_,ne,Z]),M.useEffect(()=>{if(!_||j!==Z)return;const $=window.setTimeout(()=>{tP({columnIds:ne,columnVisibility:E,search:x,selectedStreamId:l,tableId:Z})},300);return()=>window.clearTimeout($)},[_,ne,E,j,x,l,Z]),M.useEffect(()=>{const $=()=>{const B=QR(),q=jp(B);a(K=>(K===B&&(C(zp(q)),A(r1(q,ne)),U(q)),B))};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[ne]),M.useEffect(()=>{if(!l||!c){k.current?.close(),k.current=null,v(!1);return}S(null),o([]);const $=new URL(`/api/streams/${encodeURIComponent(l)}/events`,window.location.origin),B=new URL(window.location.href).searchParams;for(const[ee,te]of B.entries())$.searchParams.set(ee,te);const q=new EventSource($);k.current=q;const K=ee=>{const te=hP(ee);o(oe=>rP(oe,{...te.row,__datoolRowId:te.id}))},D=ee=>{const te=pP(ee);S(te.message)},Y=ee=>{mP(ee),q.close(),k.current=null,v(!1)};return q.onopen=()=>{v(!0)},q.onerror=()=>{v(!1)},q.addEventListener("row",K),q.addEventListener("runtime-error",D),q.addEventListener("end",Y),()=>{q.removeEventListener("row",K),q.removeEventListener("runtime-error",D),q.removeEventListener("end",Y),q.close(),v(!1)}},[l,c]);const ye=M.useRef(null);M.useEffect(()=>{const $=B=>{(B.metaKey||B.ctrlKey)&&B.key.toLowerCase()==="f"&&(B.preventDefault(),ye.current?.focus(),ye.current?.selectAll())};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[]);const V=M.useCallback($=>{if(!_||ue.length===0)return;const B=new Date().toISOString().replaceAll(":","-"),q=`${aP(_.label)}-${B}`,K=$==="csv"?cP(r,ue):fP(r,ue);uP(K,`${q}.${$}`,$==="csv"?"text/csv":"text/markdown")},[_,r,ue]);return T.jsx(B3,{autoScrollToBottom:!0,columnVisibility:E,columns:I,data:r,getRowId:$=>$.__datoolRowId,height:"100%",id:Z,onColumnVisibilityChange:A,onSearchChange:C,search:x,rowHeight:20,statePersistence:"none",children:T.jsx(bP,{activeStream:_,columns:I,config:e,errorMessage:b,handleExport:V,isConnected:g,isConnecting:be,isLoadingConfig:h,rows:r,settingsColumns:me,setColumnVisibility:A,searchInputRef:ye,selectedStreamId:l,setRows:o,setSelectedStreamId:a,setShouldConnect:d})})}xO.createRoot(document.getElementById("root")).render(T.jsx(M.StrictMode,{children:T.jsx(X5,{storageKey:"datool-theme",children:T.jsx(SP,{})})}));
|