@promptowl/contextnest-community 0.1.0-alpha.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONFIGURATION.md +118 -118
- package/dist/{chunk-DJFEV4ET.js → chunk-5VHKEIAW.js} +100 -4
- package/dist/{chunk-P6NG56CO.js → chunk-JMZ75ZCD.js} +44 -6
- package/dist/{chunk-Q2DCOS7V.js → chunk-K22GWPT4.js} +65 -58
- package/dist/{chunk-USIDOGVJ.js → chunk-KQCWNHDM.js} +218 -21
- package/dist/index.js +1738 -462
- package/dist/{review-service-5CLVZKAR.js → review-service-4WS3XL6K.js} +4 -3
- package/dist/{stewardship-service-NC67XBYO.js → stewardship-service-C5D2O7ZE.js} +2 -2
- package/dist/{version-service-Z6FYJRAG.js → version-service-TFEYNPH7.js} +10 -4
- package/dist/web3/assets/index-DkLevP7k.js +624 -0
- package/dist/web3/assets/index-DpoBdKrd.css +1 -0
- package/dist/web3/index.html +2 -2
- package/package.json +134 -108
- package/dist/web3/assets/index-CemroDXg.css +0 -1
- package/dist/web3/assets/index-xLLf4lHJ.js +0 -332
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
function xO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function _c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tm={exports:{}},La={},Mm={exports:{}},Qe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var j1;function vO(){if(j1)return Qe;j1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;function g(z){return z===null||typeof z!="object"?null:(z=f&&z[f]||z["@@iterator"],typeof z=="function"?z:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,w={};function S(z,Q,P){this.props=z,this.context=Q,this.refs=w,this.updater=P||y}S.prototype.isReactComponent={},S.prototype.setState=function(z,Q){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,Q,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=S.prototype;function T(z,Q,P){this.props=z,this.context=Q,this.refs=w,this.updater=P||y}var N=T.prototype=new C;N.constructor=T,v(N,S.prototype),N.isPureReactComponent=!0;var R=Array.isArray,I=Object.prototype.hasOwnProperty,j={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function O(z,Q,P){var fe,ue={},re=null,ne=null;if(Q!=null)for(fe in Q.ref!==void 0&&(ne=Q.ref),Q.key!==void 0&&(re=""+Q.key),Q)I.call(Q,fe)&&!D.hasOwnProperty(fe)&&(ue[fe]=Q[fe]);var oe=arguments.length-2;if(oe===1)ue.children=P;else if(1<oe){for(var me=Array(oe),Ce=0;Ce<oe;Ce++)me[Ce]=arguments[Ce+2];ue.children=me}if(z&&z.defaultProps)for(fe in oe=z.defaultProps,oe)ue[fe]===void 0&&(ue[fe]=oe[fe]);return{$$typeof:e,type:z,key:re,ref:ne,props:ue,_owner:j.current}}function B(z,Q){return{$$typeof:e,type:z.type,key:Q,ref:z.ref,props:z.props,_owner:z._owner}}function _(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function V(z){var Q={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(P){return Q[P]})}var U=/\/+/g;function Z(z,Q){return typeof z=="object"&&z!==null&&z.key!=null?V(""+z.key):Q.toString(36)}function K(z,Q,P,fe,ue){var re=typeof z;(re==="undefined"||re==="boolean")&&(z=null);var ne=!1;if(z===null)ne=!0;else switch(re){case"string":case"number":ne=!0;break;case"object":switch(z.$$typeof){case e:case t:ne=!0}}if(ne)return ne=z,ue=ue(ne),z=fe===""?"."+Z(ne,0):fe,R(ue)?(P="",z!=null&&(P=z.replace(U,"$&/")+"/"),K(ue,Q,P,"",function(Ce){return Ce})):ue!=null&&(_(ue)&&(ue=B(ue,P+(!ue.key||ne&&ne.key===ue.key?"":(""+ue.key).replace(U,"$&/")+"/")+z)),Q.push(ue)),1;if(ne=0,fe=fe===""?".":fe+":",R(z))for(var oe=0;oe<z.length;oe++){re=z[oe];var me=fe+Z(re,oe);ne+=K(re,Q,P,me,ue)}else if(me=g(z),typeof me=="function")for(z=me.call(z),oe=0;!(re=z.next()).done;)re=re.value,me=fe+Z(re,oe++),ne+=K(re,Q,P,me,ue);else if(re==="object")throw Q=String(z),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return ne}function W(z,Q,P){if(z==null)return z;var fe=[],ue=0;return K(z,fe,"","",function(re){return Q.call(P,re,ue++)}),fe}function X(z){if(z._status===-1){var Q=z._result;Q=Q(),Q.then(function(P){(z._status===0||z._status===-1)&&(z._status=1,z._result=P)},function(P){(z._status===0||z._status===-1)&&(z._status=2,z._result=P)}),z._status===-1&&(z._status=0,z._result=Q)}if(z._status===1)return z._result.default;throw z._result}var te={current:null},q={transition:null},Y={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:q,ReactCurrentOwner:j};function A(){throw Error("act(...) is not supported in production builds of React.")}return Qe.Children={map:W,forEach:function(z,Q,P){W(z,function(){Q.apply(this,arguments)},P)},count:function(z){var Q=0;return W(z,function(){Q++}),Q},toArray:function(z){return W(z,function(Q){return Q})||[]},only:function(z){if(!_(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Qe.Component=S,Qe.Fragment=n,Qe.Profiler=i,Qe.PureComponent=T,Qe.StrictMode=r,Qe.Suspense=c,Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Qe.act=A,Qe.cloneElement=function(z,Q,P){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var fe=v({},z.props),ue=z.key,re=z.ref,ne=z._owner;if(Q!=null){if(Q.ref!==void 0&&(re=Q.ref,ne=j.current),Q.key!==void 0&&(ue=""+Q.key),z.type&&z.type.defaultProps)var oe=z.type.defaultProps;for(me in Q)I.call(Q,me)&&!D.hasOwnProperty(me)&&(fe[me]=Q[me]===void 0&&oe!==void 0?oe[me]:Q[me])}var me=arguments.length-2;if(me===1)fe.children=P;else if(1<me){oe=Array(me);for(var Ce=0;Ce<me;Ce++)oe[Ce]=arguments[Ce+2];fe.children=oe}return{$$typeof:e,type:z.type,key:ue,ref:re,props:fe,_owner:ne}},Qe.createContext=function(z){return z={$$typeof:s,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:o,_context:z},z.Consumer=z},Qe.createElement=O,Qe.createFactory=function(z){var Q=O.bind(null,z);return Q.type=z,Q},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(z){return{$$typeof:l,render:z}},Qe.isValidElement=_,Qe.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:X}},Qe.memo=function(z,Q){return{$$typeof:d,type:z,compare:Q===void 0?null:Q}},Qe.startTransition=function(z){var Q=q.transition;q.transition={};try{z()}finally{q.transition=Q}},Qe.unstable_act=A,Qe.useCallback=function(z,Q){return te.current.useCallback(z,Q)},Qe.useContext=function(z){return te.current.useContext(z)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(z){return te.current.useDeferredValue(z)},Qe.useEffect=function(z,Q){return te.current.useEffect(z,Q)},Qe.useId=function(){return te.current.useId()},Qe.useImperativeHandle=function(z,Q,P){return te.current.useImperativeHandle(z,Q,P)},Qe.useInsertionEffect=function(z,Q){return te.current.useInsertionEffect(z,Q)},Qe.useLayoutEffect=function(z,Q){return te.current.useLayoutEffect(z,Q)},Qe.useMemo=function(z,Q){return te.current.useMemo(z,Q)},Qe.useReducer=function(z,Q,P){return te.current.useReducer(z,Q,P)},Qe.useRef=function(z){return te.current.useRef(z)},Qe.useState=function(z){return te.current.useState(z)},Qe.useSyncExternalStore=function(z,Q,P){return te.current.useSyncExternalStore(z,Q,P)},Qe.useTransition=function(){return te.current.useTransition()},Qe.version="18.3.1",Qe}var R1;function Lc(){return R1||(R1=1,Mm.exports=vO()),Mm.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var P1;function wO(){if(P1)return La;P1=1;var e=Lc(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var h,f={},g=null,y=null;d!==void 0&&(g=""+d),c.key!==void 0&&(g=""+c.key),c.ref!==void 0&&(y=c.ref);for(h in c)r.call(c,h)&&!o.hasOwnProperty(h)&&(f[h]=c[h]);if(l&&l.defaultProps)for(h in c=l.defaultProps,c)f[h]===void 0&&(f[h]=c[h]);return{$$typeof:t,type:l,key:g,ref:y,props:f,_owner:i.current}}return La.Fragment=n,La.jsx=s,La.jsxs=s,La}var O1;function bO(){return O1||(O1=1,Tm.exports=wO()),Tm.exports}var p=bO(),b=Lc();const ce=_c(b),tx=xO({__proto__:null,default:ce},[b]);var ld={},Am={exports:{}},Xn={},jm={exports:{}},Rm={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var I1;function kO(){return I1||(I1=1,(function(e){function t(q,Y){var A=q.length;q.push(Y);e:for(;0<A;){var z=A-1>>>1,Q=q[z];if(0<i(Q,Y))q[z]=Y,q[A]=Q,A=z;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var Y=q[0],A=q.pop();if(A!==Y){q[0]=A;e:for(var z=0,Q=q.length,P=Q>>>1;z<P;){var fe=2*(z+1)-1,ue=q[fe],re=fe+1,ne=q[re];if(0>i(ue,A))re<Q&&0>i(ne,ue)?(q[z]=ne,q[re]=A,z=re):(q[z]=ue,q[fe]=A,z=fe);else if(re<Q&&0>i(ne,A))q[z]=ne,q[re]=A,z=re;else break e}}return Y}function i(q,Y){var A=q.sortIndex-Y.sortIndex;return A!==0?A:q.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],d=[],h=1,f=null,g=3,y=!1,v=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(q){for(var Y=n(d);Y!==null;){if(Y.callback===null)r(d);else if(Y.startTime<=q)r(d),Y.sortIndex=Y.expirationTime,t(c,Y);else break;Y=n(d)}}function R(q){if(w=!1,N(q),!v)if(n(c)!==null)v=!0,X(I);else{var Y=n(d);Y!==null&&te(R,Y.startTime-q)}}function I(q,Y){v=!1,w&&(w=!1,C(O),O=-1),y=!0;var A=g;try{for(N(Y),f=n(c);f!==null&&(!(f.expirationTime>Y)||q&&!V());){var z=f.callback;if(typeof z=="function"){f.callback=null,g=f.priorityLevel;var Q=z(f.expirationTime<=Y);Y=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(c)&&r(c),N(Y)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var fe=n(d);fe!==null&&te(R,fe.startTime-Y),P=!1}return P}finally{f=null,g=A,y=!1}}var j=!1,D=null,O=-1,B=5,_=-1;function V(){return!(e.unstable_now()-_<B)}function U(){if(D!==null){var q=e.unstable_now();_=q;var Y=!0;try{Y=D(!0,q)}finally{Y?Z():(j=!1,D=null)}}else j=!1}var Z;if(typeof T=="function")Z=function(){T(U)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,W=K.port2;K.port1.onmessage=U,Z=function(){W.postMessage(null)}}else Z=function(){S(U,0)};function X(q){D=q,j||(j=!0,Z())}function te(q,Y){O=S(function(){q(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_continueExecution=function(){v||y||(v=!0,X(I))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(q){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var A=g;g=Y;try{return q()}finally{g=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,Y){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var A=g;g=q;try{return Y()}finally{g=A}},e.unstable_scheduleCallback=function(q,Y,A){var z=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?z+A:z):A=z,q){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=A+Q,q={id:h++,callback:Y,priorityLevel:q,startTime:A,expirationTime:Q,sortIndex:-1},A>z?(q.sortIndex=A,t(d,q),n(c)===null&&q===n(d)&&(w?(C(O),O=-1):w=!0,te(R,A-z))):(q.sortIndex=Q,t(c,q),v||y||(v=!0,X(I))),q},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(q){var Y=g;return function(){var A=g;g=Y;try{return q.apply(this,arguments)}finally{g=A}}}})(Rm)),Rm}var D1;function SO(){return D1||(D1=1,jm.exports=kO()),jm.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var _1;function CO(){if(_1)return Xn;_1=1;var e=Lc(),t=SO();function n(a){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+a,m=1;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(a,u){s(a,u),s(a+"Capture",u)}function s(a,u){for(i[a]=u,a=0;a<u.length;a++)r.add(u[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},f={};function g(a){return c.call(f,a)?!0:c.call(h,a)?!1:d.test(a)?f[a]=!0:(h[a]=!0,!1)}function y(a,u,m,x){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return x?!1:m!==null?!m.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function v(a,u,m,x){if(u===null||typeof u>"u"||y(a,u,m,x))return!0;if(x)return!1;if(m!==null)switch(m.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function w(a,u,m,x,k,E,M){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=x,this.attributeNamespace=k,this.mustUseProperty=m,this.propertyName=a,this.type=u,this.sanitizeURL=E,this.removeEmptyString=M}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){S[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var u=a[0];S[u]=new w(u,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){S[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){S[a]=new w(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){S[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){S[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){S[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){S[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){S[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function T(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var u=a.replace(C,T);S[u]=new w(u,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var u=a.replace(C,T);S[u]=new w(u,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var u=a.replace(C,T);S[u]=new w(u,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){S[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),S.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){S[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function N(a,u,m,x){var k=S.hasOwnProperty(u)?S[u]:null;(k!==null?k.type!==0:x||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(v(u,m,k,x)&&(m=null),x||k===null?g(u)&&(m===null?a.removeAttribute(u):a.setAttribute(u,""+m)):k.mustUseProperty?a[k.propertyName]=m===null?k.type===3?!1:"":m:(u=k.attributeName,x=k.attributeNamespace,m===null?a.removeAttribute(u):(k=k.type,m=k===3||k===4&&m===!0?"":""+m,x?a.setAttributeNS(x,u,m):a.setAttribute(u,m))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),j=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),V=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),q=Symbol.iterator;function Y(a){return a===null||typeof a!="object"?null:(a=q&&a[q]||a["@@iterator"],typeof a=="function"?a:null)}var A=Object.assign,z;function Q(a){if(z===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);z=u&&u[1]||""}return`
|
|
34
|
+
`+z+a}var P=!1;function fe(a,u){if(!a||P)return"";P=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(J){var x=J}Reflect.construct(a,[],u)}else{try{u.call()}catch(J){x=J}a.call(u.prototype)}else{try{throw Error()}catch(J){x=J}a()}}catch(J){if(J&&x&&typeof J.stack=="string"){for(var k=J.stack.split(`
|
|
35
|
+
`),E=x.stack.split(`
|
|
36
|
+
`),M=k.length-1,L=E.length-1;1<=M&&0<=L&&k[M]!==E[L];)L--;for(;1<=M&&0<=L;M--,L--)if(k[M]!==E[L]){if(M!==1||L!==1)do if(M--,L--,0>L||k[M]!==E[L]){var F=`
|
|
37
|
+
`+k[M].replace(" at new "," at ");return a.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",a.displayName)),F}while(1<=M&&0<=L);break}}}finally{P=!1,Error.prepareStackTrace=m}return(a=a?a.displayName||a.name:"")?Q(a):""}function ue(a){switch(a.tag){case 5:return Q(a.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return a=fe(a.type,!1),a;case 11:return a=fe(a.type.render,!1),a;case 1:return a=fe(a.type,!0),a;default:return""}}function re(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case D:return"Fragment";case j:return"Portal";case B:return"Profiler";case O:return"StrictMode";case Z:return"Suspense";case K:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case V:return(a.displayName||"Context")+".Consumer";case _:return(a._context.displayName||"Context")+".Provider";case U:var u=a.render;return a=a.displayName,a||(a=u.displayName||u.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case W:return u=a.displayName||null,u!==null?u:re(a.type)||"Memo";case X:u=a._payload,a=a._init;try{return re(a(u))}catch{}}return null}function ne(a){var u=a.type;switch(a.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=u.render,a=a.displayName||a.name||"",u.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(u);case 8:return u===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function oe(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function me(a){var u=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Ce(a){var u=me(a)?"checked":"value",m=Object.getOwnPropertyDescriptor(a.constructor.prototype,u),x=""+a[u];if(!a.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var k=m.get,E=m.set;return Object.defineProperty(a,u,{configurable:!0,get:function(){return k.call(this)},set:function(M){x=""+M,E.call(this,M)}}),Object.defineProperty(a,u,{enumerable:m.enumerable}),{getValue:function(){return x},setValue:function(M){x=""+M},stopTracking:function(){a._valueTracker=null,delete a[u]}}}}function Ae(a){a._valueTracker||(a._valueTracker=Ce(a))}function Fe(a){if(!a)return!1;var u=a._valueTracker;if(!u)return!0;var m=u.getValue(),x="";return a&&(x=me(a)?a.checked?"true":"false":a.value),a=x,a!==m?(u.setValue(a),!0):!1}function it(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function lt(a,u){var m=u.checked;return A({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??a._wrapperState.initialChecked})}function _t(a,u){var m=u.defaultValue==null?"":u.defaultValue,x=u.checked!=null?u.checked:u.defaultChecked;m=oe(u.value!=null?u.value:m),a._wrapperState={initialChecked:x,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function Mt(a,u){u=u.checked,u!=null&&N(a,"checked",u,!1)}function dt(a,u){Mt(a,u);var m=oe(u.value),x=u.type;if(m!=null)x==="number"?(m===0&&a.value===""||a.value!=m)&&(a.value=""+m):a.value!==""+m&&(a.value=""+m);else if(x==="submit"||x==="reset"){a.removeAttribute("value");return}u.hasOwnProperty("value")?pt(a,u.type,m):u.hasOwnProperty("defaultValue")&&pt(a,u.type,oe(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(a.defaultChecked=!!u.defaultChecked)}function ir(a,u,m){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var x=u.type;if(!(x!=="submit"&&x!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+a._wrapperState.initialValue,m||u===a.value||(a.value=u),a.defaultValue=u}m=a.name,m!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,m!==""&&(a.name=m)}function pt(a,u,m){(u!=="number"||it(a.ownerDocument)!==a)&&(m==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+m&&(a.defaultValue=""+m))}var Dn=Array.isArray;function dn(a,u,m,x){if(a=a.options,u){u={};for(var k=0;k<m.length;k++)u["$"+m[k]]=!0;for(m=0;m<a.length;m++)k=u.hasOwnProperty("$"+a[m].value),a[m].selected!==k&&(a[m].selected=k),k&&x&&(a[m].defaultSelected=!0)}else{for(m=""+oe(m),u=null,k=0;k<a.length;k++){if(a[k].value===m){a[k].selected=!0,x&&(a[k].defaultSelected=!0);return}u!==null||a[k].disabled||(u=a[k])}u!==null&&(u.selected=!0)}}function kt(a,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return A({},u,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function xe(a,u){var m=u.value;if(m==null){if(m=u.children,u=u.defaultValue,m!=null){if(u!=null)throw Error(n(92));if(Dn(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}a._wrapperState={initialValue:oe(m)}}function at(a,u){var m=oe(u.value),x=oe(u.defaultValue);m!=null&&(m=""+m,m!==a.value&&(a.value=m),u.defaultValue==null&&a.defaultValue!==m&&(a.defaultValue=m)),x!=null&&(a.defaultValue=""+x)}function tt(a){var u=a.textContent;u===a._wrapperState.initialValue&&u!==""&&u!==null&&(a.value=u)}function ee(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ge(a,u){return a==null||a==="http://www.w3.org/1999/xhtml"?ee(u):a==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var De,He=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,x,k){MSApp.execUnsafeLocalFunction(function(){return a(u,m,x,k)})}:a})(function(a,u){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=u;else{for(De=De||document.createElement("div"),De.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=De.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;u.firstChild;)a.appendChild(u.firstChild)}});function We(a,u){if(u){var m=a.firstChild;if(m&&m===a.lastChild&&m.nodeType===3){m.nodeValue=u;return}}a.textContent=u}var ie={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qe=["Webkit","ms","Moz","O"];Object.keys(ie).forEach(function(a){qe.forEach(function(u){u=u+a.charAt(0).toUpperCase()+a.substring(1),ie[u]=ie[a]})});function nt(a,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||ie.hasOwnProperty(a)&&ie[a]?(""+u).trim():u+"px"}function Zt(a,u){a=a.style;for(var m in u)if(u.hasOwnProperty(m)){var x=m.indexOf("--")===0,k=nt(m,u[m],x);m==="float"&&(m="cssFloat"),x?a.setProperty(m,k):a[m]=k}}var yr=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Lt(a,u){if(u){if(yr[a]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function xr(a,u){if(a.indexOf("-")===-1)return typeof u.is=="string";switch(a){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 fn=null;function vr(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ta=null,Ji=null,ki=null;function na(a){if(a=ka(a)){if(typeof ta!="function")throw Error(n(280));var u=a.stateNode;u&&(u=ku(u),ta(a.stateNode,a.type,u))}}function Ue(a){Ji?ki?ki.push(a):ki=[a]:Ji=a}function Ot(){if(Ji){var a=Ji,u=ki;if(ki=Ji=null,na(a),u)for(a=0;a<u.length;a++)na(u[a])}}function Yt(a,u){return a(u)}function Cn(){}var Xi=!1;function zt(a,u,m){if(Xi)return a(u,m);Xi=!0;try{return Yt(a,u,m)}finally{Xi=!1,(Ji!==null||ki!==null)&&(Cn(),Ot())}}function en(a,u){var m=a.stateNode;if(m===null)return null;var x=ku(m);if(x===null)return null;m=x[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(a=a.type,x=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!x;break e;default:a=!1}if(a)return null;if(m&&typeof m!="function")throw Error(n(231,u,typeof m));return m}var Qi=!1;if(l)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){Qi=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{Qi=!1}function or(a,u,m,x,k,E,M,L,F){var J=Array.prototype.slice.call(arguments,3);try{u.apply(m,J)}catch(le){this.onError(le)}}var Zi=!1,wr=null,ra=!1,qh=null,ER={onError:function(a){Zi=!0,wr=a}};function NR(a,u,m,x,k,E,M,L,F){Zi=!1,wr=null,or.apply(ER,arguments)}function TR(a,u,m,x,k,E,M,L,F){if(NR.apply(this,arguments),Zi){if(Zi){var J=wr;Zi=!1,wr=null}else throw Error(n(198));ra||(ra=!0,qh=J)}}function Zo(a){var u=a,m=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do u=a,(u.flags&4098)!==0&&(m=u.return),a=u.return;while(a)}return u.tag===3?m:null}function Zv(a){if(a.tag===13){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function e0(a){if(Zo(a)!==a)throw Error(n(188))}function MR(a){var u=a.alternate;if(!u){if(u=Zo(a),u===null)throw Error(n(188));return u!==a?null:a}for(var m=a,x=u;;){var k=m.return;if(k===null)break;var E=k.alternate;if(E===null){if(x=k.return,x!==null){m=x;continue}break}if(k.child===E.child){for(E=k.child;E;){if(E===m)return e0(k),a;if(E===x)return e0(k),u;E=E.sibling}throw Error(n(188))}if(m.return!==x.return)m=k,x=E;else{for(var M=!1,L=k.child;L;){if(L===m){M=!0,m=k,x=E;break}if(L===x){M=!0,x=k,m=E;break}L=L.sibling}if(!M){for(L=E.child;L;){if(L===m){M=!0,m=E,x=k;break}if(L===x){M=!0,x=E,m=k;break}L=L.sibling}if(!M)throw Error(n(189))}}if(m.alternate!==x)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?a:u}function t0(a){return a=MR(a),a!==null?n0(a):null}function n0(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var u=n0(a);if(u!==null)return u;a=a.sibling}return null}var r0=t.unstable_scheduleCallback,i0=t.unstable_cancelCallback,AR=t.unstable_shouldYield,jR=t.unstable_requestPaint,It=t.unstable_now,RR=t.unstable_getCurrentPriorityLevel,Kh=t.unstable_ImmediatePriority,o0=t.unstable_UserBlockingPriority,nu=t.unstable_NormalPriority,PR=t.unstable_LowPriority,s0=t.unstable_IdlePriority,ru=null,ii=null;function OR(a){if(ii&&typeof ii.onCommitFiberRoot=="function")try{ii.onCommitFiberRoot(ru,a,void 0,(a.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:_R,IR=Math.log,DR=Math.LN2;function _R(a){return a>>>=0,a===0?32:31-(IR(a)/DR|0)|0}var iu=64,ou=4194304;function ia(a){switch(a&-a){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: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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function su(a,u){var m=a.pendingLanes;if(m===0)return 0;var x=0,k=a.suspendedLanes,E=a.pingedLanes,M=m&268435455;if(M!==0){var L=M&~k;L!==0?x=ia(L):(E&=M,E!==0&&(x=ia(E)))}else M=m&~k,M!==0?x=ia(M):E!==0&&(x=ia(E));if(x===0)return 0;if(u!==0&&u!==x&&(u&k)===0&&(k=x&-x,E=u&-u,k>=E||k===16&&(E&4194240)!==0))return u;if((x&4)!==0&&(x|=m&16),u=a.entangledLanes,u!==0)for(a=a.entanglements,u&=x;0<u;)m=31-Vr(u),k=1<<m,x|=a[m],u&=~k;return x}function LR(a,u){switch(a){case 1:case 2:case 4:return u+250;case 8:case 16:case 32:case 64: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zR(a,u){for(var m=a.suspendedLanes,x=a.pingedLanes,k=a.expirationTimes,E=a.pendingLanes;0<E;){var M=31-Vr(E),L=1<<M,F=k[M];F===-1?((L&m)===0||(L&x)!==0)&&(k[M]=LR(L,u)):F<=u&&(a.expiredLanes|=L),E&=~L}}function Gh(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function l0(){var a=iu;return iu<<=1,(iu&4194240)===0&&(iu=64),a}function Yh(a){for(var u=[],m=0;31>m;m++)u.push(a);return u}function oa(a,u,m){a.pendingLanes|=u,u!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,u=31-Vr(u),a[u]=m}function FR(a,u){var m=a.pendingLanes&~u;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=u,a.mutableReadLanes&=u,a.entangledLanes&=u,u=a.entanglements;var x=a.eventTimes;for(a=a.expirationTimes;0<m;){var k=31-Vr(m),E=1<<k;u[k]=0,x[k]=-1,a[k]=-1,m&=~E}}function Jh(a,u){var m=a.entangledLanes|=u;for(a=a.entanglements;m;){var x=31-Vr(m),k=1<<x;k&u|a[x]&u&&(a[x]|=u),m&=~k}}var ct=0;function a0(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var c0,Xh,u0,d0,f0,Qh=!1,lu=[],eo=null,to=null,no=null,sa=new Map,la=new Map,ro=[],$R="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function h0(a,u){switch(a){case"focusin":case"focusout":eo=null;break;case"dragenter":case"dragleave":to=null;break;case"mouseover":case"mouseout":no=null;break;case"pointerover":case"pointerout":sa.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":la.delete(u.pointerId)}}function aa(a,u,m,x,k,E){return a===null||a.nativeEvent!==E?(a={blockedOn:u,domEventName:m,eventSystemFlags:x,nativeEvent:E,targetContainers:[k]},u!==null&&(u=ka(u),u!==null&&Xh(u)),a):(a.eventSystemFlags|=x,u=a.targetContainers,k!==null&&u.indexOf(k)===-1&&u.push(k),a)}function BR(a,u,m,x,k){switch(u){case"focusin":return eo=aa(eo,a,u,m,x,k),!0;case"dragenter":return to=aa(to,a,u,m,x,k),!0;case"mouseover":return no=aa(no,a,u,m,x,k),!0;case"pointerover":var E=k.pointerId;return sa.set(E,aa(sa.get(E)||null,a,u,m,x,k)),!0;case"gotpointercapture":return E=k.pointerId,la.set(E,aa(la.get(E)||null,a,u,m,x,k)),!0}return!1}function p0(a){var u=es(a.target);if(u!==null){var m=Zo(u);if(m!==null){if(u=m.tag,u===13){if(u=Zv(m),u!==null){a.blockedOn=u,f0(a.priority,function(){u0(m)});return}}else if(u===3&&m.stateNode.current.memoizedState.isDehydrated){a.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}a.blockedOn=null}function au(a){if(a.blockedOn!==null)return!1;for(var u=a.targetContainers;0<u.length;){var m=ep(a.domEventName,a.eventSystemFlags,u[0],a.nativeEvent);if(m===null){m=a.nativeEvent;var x=new m.constructor(m.type,m);fn=x,m.target.dispatchEvent(x),fn=null}else return u=ka(m),u!==null&&Xh(u),a.blockedOn=m,!1;u.shift()}return!0}function m0(a,u,m){au(a)&&m.delete(u)}function VR(){Qh=!1,eo!==null&&au(eo)&&(eo=null),to!==null&&au(to)&&(to=null),no!==null&&au(no)&&(no=null),sa.forEach(m0),la.forEach(m0)}function ca(a,u){a.blockedOn===u&&(a.blockedOn=null,Qh||(Qh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,VR)))}function ua(a){function u(k){return ca(k,a)}if(0<lu.length){ca(lu[0],a);for(var m=1;m<lu.length;m++){var x=lu[m];x.blockedOn===a&&(x.blockedOn=null)}}for(eo!==null&&ca(eo,a),to!==null&&ca(to,a),no!==null&&ca(no,a),sa.forEach(u),la.forEach(u),m=0;m<ro.length;m++)x=ro[m],x.blockedOn===a&&(x.blockedOn=null);for(;0<ro.length&&(m=ro[0],m.blockedOn===null);)p0(m),m.blockedOn===null&&ro.shift()}var Ks=R.ReactCurrentBatchConfig,cu=!0;function HR(a,u,m,x){var k=ct,E=Ks.transition;Ks.transition=null;try{ct=1,Zh(a,u,m,x)}finally{ct=k,Ks.transition=E}}function UR(a,u,m,x){var k=ct,E=Ks.transition;Ks.transition=null;try{ct=4,Zh(a,u,m,x)}finally{ct=k,Ks.transition=E}}function Zh(a,u,m,x){if(cu){var k=ep(a,u,m,x);if(k===null)yp(a,u,x,uu,m),h0(a,x);else if(BR(k,a,u,m,x))x.stopPropagation();else if(h0(a,x),u&4&&-1<$R.indexOf(a)){for(;k!==null;){var E=ka(k);if(E!==null&&c0(E),E=ep(a,u,m,x),E===null&&yp(a,u,x,uu,m),E===k)break;k=E}k!==null&&x.stopPropagation()}else yp(a,u,x,null,m)}}var uu=null;function ep(a,u,m,x){if(uu=null,a=vr(x),a=es(a),a!==null)if(u=Zo(a),u===null)a=null;else if(m=u.tag,m===13){if(a=Zv(u),a!==null)return a;a=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;a=null}else u!==a&&(a=null);return uu=a,null}function g0(a){switch(a){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(RR()){case Kh:return 1;case o0:return 4;case nu:case PR:return 16;case s0:return 536870912;default:return 16}default:return 16}}var io=null,tp=null,du=null;function y0(){if(du)return du;var a,u=tp,m=u.length,x,k="value"in io?io.value:io.textContent,E=k.length;for(a=0;a<m&&u[a]===k[a];a++);var M=m-a;for(x=1;x<=M&&u[m-x]===k[E-x];x++);return du=k.slice(a,1<x?1-x:void 0)}function fu(a){var u=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&u===13&&(a=13)):a=u,a===10&&(a=13),32<=a||a===13?a:0}function hu(){return!0}function x0(){return!1}function sr(a){function u(m,x,k,E,M){this._reactName=m,this._targetInst=k,this.type=x,this.nativeEvent=E,this.target=M,this.currentTarget=null;for(var L in a)a.hasOwnProperty(L)&&(m=a[L],this[L]=m?m(E):E[L]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?hu:x0,this.isPropagationStopped=x0,this}return A(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=hu)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=hu)},persist:function(){},isPersistent:hu}),u}var Gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},np=sr(Gs),da=A({},Gs,{view:0,detail:0}),WR=sr(da),rp,ip,fa,pu=A({},da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sp,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==fa&&(fa&&a.type==="mousemove"?(rp=a.screenX-fa.screenX,ip=a.screenY-fa.screenY):ip=rp=0,fa=a),rp)},movementY:function(a){return"movementY"in a?a.movementY:ip}}),v0=sr(pu),qR=A({},pu,{dataTransfer:0}),KR=sr(qR),GR=A({},da,{relatedTarget:0}),op=sr(GR),YR=A({},Gs,{animationName:0,elapsedTime:0,pseudoElement:0}),JR=sr(YR),XR=A({},Gs,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),QR=sr(XR),ZR=A({},Gs,{data:0}),w0=sr(ZR),eP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tP={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"},nP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rP(a){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(a):(a=nP[a])?!!u[a]:!1}function sp(){return rP}var iP=A({},da,{key:function(a){if(a.key){var u=eP[a.key]||a.key;if(u!=="Unidentified")return u}return a.type==="keypress"?(a=fu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?tP[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sp,charCode:function(a){return a.type==="keypress"?fu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?fu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),oP=sr(iP),sP=A({},pu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),b0=sr(sP),lP=A({},da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sp}),aP=sr(lP),cP=A({},Gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),uP=sr(cP),dP=A({},pu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),fP=sr(dP),hP=[9,13,27,32],lp=l&&"CompositionEvent"in window,ha=null;l&&"documentMode"in document&&(ha=document.documentMode);var pP=l&&"TextEvent"in window&&!ha,k0=l&&(!lp||ha&&8<ha&&11>=ha),S0=" ",C0=!1;function E0(a,u){switch(a){case"keyup":return hP.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N0(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ys=!1;function mP(a,u){switch(a){case"compositionend":return N0(u);case"keypress":return u.which!==32?null:(C0=!0,S0);case"textInput":return a=u.data,a===S0&&C0?null:a;default:return null}}function gP(a,u){if(Ys)return a==="compositionend"||!lp&&E0(a,u)?(a=y0(),du=tp=io=null,Ys=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return k0&&u.locale!=="ko"?null:u.data;default:return null}}var yP={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 T0(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u==="input"?!!yP[a.type]:u==="textarea"}function M0(a,u,m,x){Ue(x),u=vu(u,"onChange"),0<u.length&&(m=new np("onChange","change",null,m,x),a.push({event:m,listeners:u}))}var pa=null,ma=null;function xP(a){q0(a,0)}function mu(a){var u=el(a);if(Fe(u))return a}function vP(a,u){if(a==="change")return u}var A0=!1;if(l){var ap;if(l){var cp="oninput"in document;if(!cp){var j0=document.createElement("div");j0.setAttribute("oninput","return;"),cp=typeof j0.oninput=="function"}ap=cp}else ap=!1;A0=ap&&(!document.documentMode||9<document.documentMode)}function R0(){pa&&(pa.detachEvent("onpropertychange",P0),ma=pa=null)}function P0(a){if(a.propertyName==="value"&&mu(ma)){var u=[];M0(u,ma,a,vr(a)),zt(xP,u)}}function wP(a,u,m){a==="focusin"?(R0(),pa=u,ma=m,pa.attachEvent("onpropertychange",P0)):a==="focusout"&&R0()}function bP(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return mu(ma)}function kP(a,u){if(a==="click")return mu(u)}function SP(a,u){if(a==="input"||a==="change")return mu(u)}function CP(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var Hr=typeof Object.is=="function"?Object.is:CP;function ga(a,u){if(Hr(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var m=Object.keys(a),x=Object.keys(u);if(m.length!==x.length)return!1;for(x=0;x<m.length;x++){var k=m[x];if(!c.call(u,k)||!Hr(a[k],u[k]))return!1}return!0}function O0(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function I0(a,u){var m=O0(a);a=0;for(var x;m;){if(m.nodeType===3){if(x=a+m.textContent.length,a<=u&&x>=u)return{node:m,offset:u-a};a=x}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=O0(m)}}function D0(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?D0(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function _0(){for(var a=window,u=it();u instanceof a.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)a=u.contentWindow;else break;u=it(a.document)}return u}function up(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}function EP(a){var u=_0(),m=a.focusedElem,x=a.selectionRange;if(u!==m&&m&&m.ownerDocument&&D0(m.ownerDocument.documentElement,m)){if(x!==null&&up(m)){if(u=x.start,a=x.end,a===void 0&&(a=u),"selectionStart"in m)m.selectionStart=u,m.selectionEnd=Math.min(a,m.value.length);else if(a=(u=m.ownerDocument||document)&&u.defaultView||window,a.getSelection){a=a.getSelection();var k=m.textContent.length,E=Math.min(x.start,k);x=x.end===void 0?E:Math.min(x.end,k),!a.extend&&E>x&&(k=x,x=E,E=k),k=I0(m,E);var M=I0(m,x);k&&M&&(a.rangeCount!==1||a.anchorNode!==k.node||a.anchorOffset!==k.offset||a.focusNode!==M.node||a.focusOffset!==M.offset)&&(u=u.createRange(),u.setStart(k.node,k.offset),a.removeAllRanges(),E>x?(a.addRange(u),a.extend(M.node,M.offset)):(u.setEnd(M.node,M.offset),a.addRange(u)))}}for(u=[],a=m;a=a.parentNode;)a.nodeType===1&&u.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<u.length;m++)a=u[m],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var NP=l&&"documentMode"in document&&11>=document.documentMode,Js=null,dp=null,ya=null,fp=!1;function L0(a,u,m){var x=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;fp||Js==null||Js!==it(x)||(x=Js,"selectionStart"in x&&up(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),ya&&ga(ya,x)||(ya=x,x=vu(dp,"onSelect"),0<x.length&&(u=new np("onSelect","select",null,u,m),a.push({event:u,listeners:x}),u.target=Js)))}function gu(a,u){var m={};return m[a.toLowerCase()]=u.toLowerCase(),m["Webkit"+a]="webkit"+u,m["Moz"+a]="moz"+u,m}var Xs={animationend:gu("Animation","AnimationEnd"),animationiteration:gu("Animation","AnimationIteration"),animationstart:gu("Animation","AnimationStart"),transitionend:gu("Transition","TransitionEnd")},hp={},z0={};l&&(z0=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);function yu(a){if(hp[a])return hp[a];if(!Xs[a])return a;var u=Xs[a],m;for(m in u)if(u.hasOwnProperty(m)&&m in z0)return hp[a]=u[m];return a}var F0=yu("animationend"),$0=yu("animationiteration"),B0=yu("animationstart"),V0=yu("transitionend"),H0=new Map,U0="abort auxClick 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(" ");function oo(a,u){H0.set(a,u),o(u,[a])}for(var pp=0;pp<U0.length;pp++){var mp=U0[pp],TP=mp.toLowerCase(),MP=mp[0].toUpperCase()+mp.slice(1);oo(TP,"on"+MP)}oo(F0,"onAnimationEnd"),oo($0,"onAnimationIteration"),oo(B0,"onAnimationStart"),oo("dblclick","onDoubleClick"),oo("focusin","onFocus"),oo("focusout","onBlur"),oo(V0,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xa="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(" "),AP=new Set("cancel close invalid load scroll toggle".split(" ").concat(xa));function W0(a,u,m){var x=a.type||"unknown-event";a.currentTarget=m,TR(x,u,void 0,a),a.currentTarget=null}function q0(a,u){u=(u&4)!==0;for(var m=0;m<a.length;m++){var x=a[m],k=x.event;x=x.listeners;e:{var E=void 0;if(u)for(var M=x.length-1;0<=M;M--){var L=x[M],F=L.instance,J=L.currentTarget;if(L=L.listener,F!==E&&k.isPropagationStopped())break e;W0(k,L,J),E=F}else for(M=0;M<x.length;M++){if(L=x[M],F=L.instance,J=L.currentTarget,L=L.listener,F!==E&&k.isPropagationStopped())break e;W0(k,L,J),E=F}}}if(ra)throw a=qh,ra=!1,qh=null,a}function vt(a,u){var m=u[Sp];m===void 0&&(m=u[Sp]=new Set);var x=a+"__bubble";m.has(x)||(K0(u,a,2,!1),m.add(x))}function gp(a,u,m){var x=0;u&&(x|=4),K0(m,a,x,u)}var xu="_reactListening"+Math.random().toString(36).slice(2);function va(a){if(!a[xu]){a[xu]=!0,r.forEach(function(m){m!=="selectionchange"&&(AP.has(m)||gp(m,!1,a),gp(m,!0,a))});var u=a.nodeType===9?a:a.ownerDocument;u===null||u[xu]||(u[xu]=!0,gp("selectionchange",!1,u))}}function K0(a,u,m,x){switch(g0(u)){case 1:var k=HR;break;case 4:k=UR;break;default:k=Zh}m=k.bind(null,u,m,a),k=void 0,!Qi||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(k=!0),x?k!==void 0?a.addEventListener(u,m,{capture:!0,passive:k}):a.addEventListener(u,m,!0):k!==void 0?a.addEventListener(u,m,{passive:k}):a.addEventListener(u,m,!1)}function yp(a,u,m,x,k){var E=x;if((u&1)===0&&(u&2)===0&&x!==null)e:for(;;){if(x===null)return;var M=x.tag;if(M===3||M===4){var L=x.stateNode.containerInfo;if(L===k||L.nodeType===8&&L.parentNode===k)break;if(M===4)for(M=x.return;M!==null;){var F=M.tag;if((F===3||F===4)&&(F=M.stateNode.containerInfo,F===k||F.nodeType===8&&F.parentNode===k))return;M=M.return}for(;L!==null;){if(M=es(L),M===null)return;if(F=M.tag,F===5||F===6){x=E=M;continue e}L=L.parentNode}}x=x.return}zt(function(){var J=E,le=vr(m),de=[];e:{var se=H0.get(a);if(se!==void 0){var be=np,Ee=a;switch(a){case"keypress":if(fu(m)===0)break e;case"keydown":case"keyup":be=oP;break;case"focusin":Ee="focus",be=op;break;case"focusout":Ee="blur",be=op;break;case"beforeblur":case"afterblur":be=op;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=v0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=KR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=aP;break;case F0:case $0:case B0:be=JR;break;case V0:be=uP;break;case"scroll":be=WR;break;case"wheel":be=fP;break;case"copy":case"cut":case"paste":be=QR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=b0}var je=(u&4)!==0,Dt=!je&&a==="scroll",H=je?se!==null?se+"Capture":null:se;je=[];for(var $=J,G;$!==null;){G=$;var ye=G.stateNode;if(G.tag===5&&ye!==null&&(G=ye,H!==null&&(ye=en($,H),ye!=null&&je.push(wa($,ye,G)))),Dt)break;$=$.return}0<je.length&&(se=new be(se,Ee,null,m,le),de.push({event:se,listeners:je}))}}if((u&7)===0){e:{if(se=a==="mouseover"||a==="pointerover",be=a==="mouseout"||a==="pointerout",se&&m!==fn&&(Ee=m.relatedTarget||m.fromElement)&&(es(Ee)||Ee[Si]))break e;if((be||se)&&(se=le.window===le?le:(se=le.ownerDocument)?se.defaultView||se.parentWindow:window,be?(Ee=m.relatedTarget||m.toElement,be=J,Ee=Ee?es(Ee):null,Ee!==null&&(Dt=Zo(Ee),Ee!==Dt||Ee.tag!==5&&Ee.tag!==6)&&(Ee=null)):(be=null,Ee=J),be!==Ee)){if(je=v0,ye="onMouseLeave",H="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(je=b0,ye="onPointerLeave",H="onPointerEnter",$="pointer"),Dt=be==null?se:el(be),G=Ee==null?se:el(Ee),se=new je(ye,$+"leave",be,m,le),se.target=Dt,se.relatedTarget=G,ye=null,es(le)===J&&(je=new je(H,$+"enter",Ee,m,le),je.target=G,je.relatedTarget=Dt,ye=je),Dt=ye,be&&Ee)t:{for(je=be,H=Ee,$=0,G=je;G;G=Qs(G))$++;for(G=0,ye=H;ye;ye=Qs(ye))G++;for(;0<$-G;)je=Qs(je),$--;for(;0<G-$;)H=Qs(H),G--;for(;$--;){if(je===H||H!==null&&je===H.alternate)break t;je=Qs(je),H=Qs(H)}je=null}else je=null;be!==null&&G0(de,se,be,je,!1),Ee!==null&&Dt!==null&&G0(de,Dt,Ee,je,!0)}}e:{if(se=J?el(J):window,be=se.nodeName&&se.nodeName.toLowerCase(),be==="select"||be==="input"&&se.type==="file")var Re=vP;else if(T0(se))if(A0)Re=SP;else{Re=bP;var _e=wP}else(be=se.nodeName)&&be.toLowerCase()==="input"&&(se.type==="checkbox"||se.type==="radio")&&(Re=kP);if(Re&&(Re=Re(a,J))){M0(de,Re,m,le);break e}_e&&_e(a,se,J),a==="focusout"&&(_e=se._wrapperState)&&_e.controlled&&se.type==="number"&&pt(se,"number",se.value)}switch(_e=J?el(J):window,a){case"focusin":(T0(_e)||_e.contentEditable==="true")&&(Js=_e,dp=J,ya=null);break;case"focusout":ya=dp=Js=null;break;case"mousedown":fp=!0;break;case"contextmenu":case"mouseup":case"dragend":fp=!1,L0(de,m,le);break;case"selectionchange":if(NP)break;case"keydown":case"keyup":L0(de,m,le)}var Le;if(lp)e:{switch(a){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Ys?E0(a,m)&&($e="onCompositionEnd"):a==="keydown"&&m.keyCode===229&&($e="onCompositionStart");$e&&(k0&&m.locale!=="ko"&&(Ys||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Ys&&(Le=y0()):(io=le,tp="value"in io?io.value:io.textContent,Ys=!0)),_e=vu(J,$e),0<_e.length&&($e=new w0($e,a,null,m,le),de.push({event:$e,listeners:_e}),Le?$e.data=Le:(Le=N0(m),Le!==null&&($e.data=Le)))),(Le=pP?mP(a,m):gP(a,m))&&(J=vu(J,"onBeforeInput"),0<J.length&&(le=new w0("onBeforeInput","beforeinput",null,m,le),de.push({event:le,listeners:J}),le.data=Le))}q0(de,u)})}function wa(a,u,m){return{instance:a,listener:u,currentTarget:m}}function vu(a,u){for(var m=u+"Capture",x=[];a!==null;){var k=a,E=k.stateNode;k.tag===5&&E!==null&&(k=E,E=en(a,m),E!=null&&x.unshift(wa(a,E,k)),E=en(a,u),E!=null&&x.push(wa(a,E,k))),a=a.return}return x}function Qs(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function G0(a,u,m,x,k){for(var E=u._reactName,M=[];m!==null&&m!==x;){var L=m,F=L.alternate,J=L.stateNode;if(F!==null&&F===x)break;L.tag===5&&J!==null&&(L=J,k?(F=en(m,E),F!=null&&M.unshift(wa(m,F,L))):k||(F=en(m,E),F!=null&&M.push(wa(m,F,L)))),m=m.return}M.length!==0&&a.push({event:u,listeners:M})}var jP=/\r\n?/g,RP=/\u0000|\uFFFD/g;function Y0(a){return(typeof a=="string"?a:""+a).replace(jP,`
|
|
38
|
+
`).replace(RP,"")}function wu(a,u,m){if(u=Y0(u),Y0(a)!==u&&m)throw Error(n(425))}function bu(){}var xp=null,vp=null;function wp(a,u){return a==="textarea"||a==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var bp=typeof setTimeout=="function"?setTimeout:void 0,PP=typeof clearTimeout=="function"?clearTimeout:void 0,J0=typeof Promise=="function"?Promise:void 0,OP=typeof queueMicrotask=="function"?queueMicrotask:typeof J0<"u"?function(a){return J0.resolve(null).then(a).catch(IP)}:bp;function IP(a){setTimeout(function(){throw a})}function kp(a,u){var m=u,x=0;do{var k=m.nextSibling;if(a.removeChild(m),k&&k.nodeType===8)if(m=k.data,m==="/$"){if(x===0){a.removeChild(k),ua(u);return}x--}else m!=="$"&&m!=="$?"&&m!=="$!"||x++;m=k}while(m);ua(u)}function so(a){for(;a!=null;a=a.nextSibling){var u=a.nodeType;if(u===1||u===3)break;if(u===8){if(u=a.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return a}function X0(a){a=a.previousSibling;for(var u=0;a;){if(a.nodeType===8){var m=a.data;if(m==="$"||m==="$!"||m==="$?"){if(u===0)return a;u--}else m==="/$"&&u++}a=a.previousSibling}return null}var Zs=Math.random().toString(36).slice(2),oi="__reactFiber$"+Zs,ba="__reactProps$"+Zs,Si="__reactContainer$"+Zs,Sp="__reactEvents$"+Zs,DP="__reactListeners$"+Zs,_P="__reactHandles$"+Zs;function es(a){var u=a[oi];if(u)return u;for(var m=a.parentNode;m;){if(u=m[Si]||m[oi]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(a=X0(a);a!==null;){if(m=a[oi])return m;a=X0(a)}return u}a=m,m=a.parentNode}return null}function ka(a){return a=a[oi]||a[Si],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function el(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function ku(a){return a[ba]||null}var Cp=[],tl=-1;function lo(a){return{current:a}}function wt(a){0>tl||(a.current=Cp[tl],Cp[tl]=null,tl--)}function mt(a,u){tl++,Cp[tl]=a.current,a.current=u}var ao={},En=lo(ao),qn=lo(!1),ts=ao;function nl(a,u){var m=a.type.contextTypes;if(!m)return ao;var x=a.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===u)return x.__reactInternalMemoizedMaskedChildContext;var k={},E;for(E in m)k[E]=u[E];return x&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=u,a.__reactInternalMemoizedMaskedChildContext=k),k}function Kn(a){return a=a.childContextTypes,a!=null}function Su(){wt(qn),wt(En)}function Q0(a,u,m){if(En.current!==ao)throw Error(n(168));mt(En,u),mt(qn,m)}function Z0(a,u,m){var x=a.stateNode;if(u=u.childContextTypes,typeof x.getChildContext!="function")return m;x=x.getChildContext();for(var k in x)if(!(k in u))throw Error(n(108,ne(a)||"Unknown",k));return A({},m,x)}function Cu(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ao,ts=En.current,mt(En,a),mt(qn,qn.current),!0}function ew(a,u,m){var x=a.stateNode;if(!x)throw Error(n(169));m?(a=Z0(a,u,ts),x.__reactInternalMemoizedMergedChildContext=a,wt(qn),wt(En),mt(En,a)):wt(qn),mt(qn,m)}var Ci=null,Eu=!1,Ep=!1;function tw(a){Ci===null?Ci=[a]:Ci.push(a)}function LP(a){Eu=!0,tw(a)}function co(){if(!Ep&&Ci!==null){Ep=!0;var a=0,u=ct;try{var m=Ci;for(ct=1;a<m.length;a++){var x=m[a];do x=x(!0);while(x!==null)}Ci=null,Eu=!1}catch(k){throw Ci!==null&&(Ci=Ci.slice(a+1)),r0(Kh,co),k}finally{ct=u,Ep=!1}}return null}var rl=[],il=0,Nu=null,Tu=0,br=[],kr=0,ns=null,Ei=1,Ni="";function rs(a,u){rl[il++]=Tu,rl[il++]=Nu,Nu=a,Tu=u}function nw(a,u,m){br[kr++]=Ei,br[kr++]=Ni,br[kr++]=ns,ns=a;var x=Ei;a=Ni;var k=32-Vr(x)-1;x&=~(1<<k),m+=1;var E=32-Vr(u)+k;if(30<E){var M=k-k%5;E=(x&(1<<M)-1).toString(32),x>>=M,k-=M,Ei=1<<32-Vr(u)+k|m<<k|x,Ni=E+a}else Ei=1<<E|m<<k|x,Ni=a}function Np(a){a.return!==null&&(rs(a,1),nw(a,1,0))}function Tp(a){for(;a===Nu;)Nu=rl[--il],rl[il]=null,Tu=rl[--il],rl[il]=null;for(;a===ns;)ns=br[--kr],br[kr]=null,Ni=br[--kr],br[kr]=null,Ei=br[--kr],br[kr]=null}var lr=null,ar=null,St=!1,Ur=null;function rw(a,u){var m=Nr(5,null,null,0);m.elementType="DELETED",m.stateNode=u,m.return=a,u=a.deletions,u===null?(a.deletions=[m],a.flags|=16):u.push(m)}function iw(a,u){switch(a.tag){case 5:var m=a.type;return u=u.nodeType!==1||m.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(a.stateNode=u,lr=a,ar=so(u.firstChild),!0):!1;case 6:return u=a.pendingProps===""||u.nodeType!==3?null:u,u!==null?(a.stateNode=u,lr=a,ar=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=ns!==null?{id:Ei,overflow:Ni}:null,a.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=Nr(18,null,null,0),m.stateNode=u,m.return=a,a.child=m,lr=a,ar=null,!0):!1;default:return!1}}function Mp(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Ap(a){if(St){var u=ar;if(u){var m=u;if(!iw(a,u)){if(Mp(a))throw Error(n(418));u=so(m.nextSibling);var x=lr;u&&iw(a,u)?rw(x,m):(a.flags=a.flags&-4097|2,St=!1,lr=a)}}else{if(Mp(a))throw Error(n(418));a.flags=a.flags&-4097|2,St=!1,lr=a}}}function ow(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;lr=a}function Mu(a){if(a!==lr)return!1;if(!St)return ow(a),St=!0,!1;var u;if((u=a.tag!==3)&&!(u=a.tag!==5)&&(u=a.type,u=u!=="head"&&u!=="body"&&!wp(a.type,a.memoizedProps)),u&&(u=ar)){if(Mp(a))throw sw(),Error(n(418));for(;u;)rw(a,u),u=so(u.nextSibling)}if(ow(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,u=0;a;){if(a.nodeType===8){var m=a.data;if(m==="/$"){if(u===0){ar=so(a.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}a=a.nextSibling}ar=null}}else ar=lr?so(a.stateNode.nextSibling):null;return!0}function sw(){for(var a=ar;a;)a=so(a.nextSibling)}function ol(){ar=lr=null,St=!1}function jp(a){Ur===null?Ur=[a]:Ur.push(a)}var zP=R.ReactCurrentBatchConfig;function Sa(a,u,m){if(a=m.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var x=m.stateNode}if(!x)throw Error(n(147,a));var k=x,E=""+a;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===E?u.ref:(u=function(M){var L=k.refs;M===null?delete L[E]:L[E]=M},u._stringRef=E,u)}if(typeof a!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,a))}return a}function Au(a,u){throw a=Object.prototype.toString.call(u),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a))}function lw(a){var u=a._init;return u(a._payload)}function aw(a){function u(H,$){if(a){var G=H.deletions;G===null?(H.deletions=[$],H.flags|=16):G.push($)}}function m(H,$){if(!a)return null;for(;$!==null;)u(H,$),$=$.sibling;return null}function x(H,$){for(H=new Map;$!==null;)$.key!==null?H.set($.key,$):H.set($.index,$),$=$.sibling;return H}function k(H,$){return H=xo(H,$),H.index=0,H.sibling=null,H}function E(H,$,G){return H.index=G,a?(G=H.alternate,G!==null?(G=G.index,G<$?(H.flags|=2,$):G):(H.flags|=2,$)):(H.flags|=1048576,$)}function M(H){return a&&H.alternate===null&&(H.flags|=2),H}function L(H,$,G,ye){return $===null||$.tag!==6?($=bm(G,H.mode,ye),$.return=H,$):($=k($,G),$.return=H,$)}function F(H,$,G,ye){var Re=G.type;return Re===D?le(H,$,G.props.children,ye,G.key):$!==null&&($.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===X&&lw(Re)===$.type)?(ye=k($,G.props),ye.ref=Sa(H,$,G),ye.return=H,ye):(ye=Zu(G.type,G.key,G.props,null,H.mode,ye),ye.ref=Sa(H,$,G),ye.return=H,ye)}function J(H,$,G,ye){return $===null||$.tag!==4||$.stateNode.containerInfo!==G.containerInfo||$.stateNode.implementation!==G.implementation?($=km(G,H.mode,ye),$.return=H,$):($=k($,G.children||[]),$.return=H,$)}function le(H,$,G,ye,Re){return $===null||$.tag!==7?($=fs(G,H.mode,ye,Re),$.return=H,$):($=k($,G),$.return=H,$)}function de(H,$,G){if(typeof $=="string"&&$!==""||typeof $=="number")return $=bm(""+$,H.mode,G),$.return=H,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case I:return G=Zu($.type,$.key,$.props,null,H.mode,G),G.ref=Sa(H,null,$),G.return=H,G;case j:return $=km($,H.mode,G),$.return=H,$;case X:var ye=$._init;return de(H,ye($._payload),G)}if(Dn($)||Y($))return $=fs($,H.mode,G,null),$.return=H,$;Au(H,$)}return null}function se(H,$,G,ye){var Re=$!==null?$.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return Re!==null?null:L(H,$,""+G,ye);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case I:return G.key===Re?F(H,$,G,ye):null;case j:return G.key===Re?J(H,$,G,ye):null;case X:return Re=G._init,se(H,$,Re(G._payload),ye)}if(Dn(G)||Y(G))return Re!==null?null:le(H,$,G,ye,null);Au(H,G)}return null}function be(H,$,G,ye,Re){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return H=H.get(G)||null,L($,H,""+ye,Re);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case I:return H=H.get(ye.key===null?G:ye.key)||null,F($,H,ye,Re);case j:return H=H.get(ye.key===null?G:ye.key)||null,J($,H,ye,Re);case X:var _e=ye._init;return be(H,$,G,_e(ye._payload),Re)}if(Dn(ye)||Y(ye))return H=H.get(G)||null,le($,H,ye,Re,null);Au($,ye)}return null}function Ee(H,$,G,ye){for(var Re=null,_e=null,Le=$,$e=$=0,rn=null;Le!==null&&$e<G.length;$e++){Le.index>$e?(rn=Le,Le=null):rn=Le.sibling;var st=se(H,Le,G[$e],ye);if(st===null){Le===null&&(Le=rn);break}a&&Le&&st.alternate===null&&u(H,Le),$=E(st,$,$e),_e===null?Re=st:_e.sibling=st,_e=st,Le=rn}if($e===G.length)return m(H,Le),St&&rs(H,$e),Re;if(Le===null){for(;$e<G.length;$e++)Le=de(H,G[$e],ye),Le!==null&&($=E(Le,$,$e),_e===null?Re=Le:_e.sibling=Le,_e=Le);return St&&rs(H,$e),Re}for(Le=x(H,Le);$e<G.length;$e++)rn=be(Le,H,$e,G[$e],ye),rn!==null&&(a&&rn.alternate!==null&&Le.delete(rn.key===null?$e:rn.key),$=E(rn,$,$e),_e===null?Re=rn:_e.sibling=rn,_e=rn);return a&&Le.forEach(function(vo){return u(H,vo)}),St&&rs(H,$e),Re}function je(H,$,G,ye){var Re=Y(G);if(typeof Re!="function")throw Error(n(150));if(G=Re.call(G),G==null)throw Error(n(151));for(var _e=Re=null,Le=$,$e=$=0,rn=null,st=G.next();Le!==null&&!st.done;$e++,st=G.next()){Le.index>$e?(rn=Le,Le=null):rn=Le.sibling;var vo=se(H,Le,st.value,ye);if(vo===null){Le===null&&(Le=rn);break}a&&Le&&vo.alternate===null&&u(H,Le),$=E(vo,$,$e),_e===null?Re=vo:_e.sibling=vo,_e=vo,Le=rn}if(st.done)return m(H,Le),St&&rs(H,$e),Re;if(Le===null){for(;!st.done;$e++,st=G.next())st=de(H,st.value,ye),st!==null&&($=E(st,$,$e),_e===null?Re=st:_e.sibling=st,_e=st);return St&&rs(H,$e),Re}for(Le=x(H,Le);!st.done;$e++,st=G.next())st=be(Le,H,$e,st.value,ye),st!==null&&(a&&st.alternate!==null&&Le.delete(st.key===null?$e:st.key),$=E(st,$,$e),_e===null?Re=st:_e.sibling=st,_e=st);return a&&Le.forEach(function(yO){return u(H,yO)}),St&&rs(H,$e),Re}function Dt(H,$,G,ye){if(typeof G=="object"&&G!==null&&G.type===D&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case I:e:{for(var Re=G.key,_e=$;_e!==null;){if(_e.key===Re){if(Re=G.type,Re===D){if(_e.tag===7){m(H,_e.sibling),$=k(_e,G.props.children),$.return=H,H=$;break e}}else if(_e.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===X&&lw(Re)===_e.type){m(H,_e.sibling),$=k(_e,G.props),$.ref=Sa(H,_e,G),$.return=H,H=$;break e}m(H,_e);break}else u(H,_e);_e=_e.sibling}G.type===D?($=fs(G.props.children,H.mode,ye,G.key),$.return=H,H=$):(ye=Zu(G.type,G.key,G.props,null,H.mode,ye),ye.ref=Sa(H,$,G),ye.return=H,H=ye)}return M(H);case j:e:{for(_e=G.key;$!==null;){if($.key===_e)if($.tag===4&&$.stateNode.containerInfo===G.containerInfo&&$.stateNode.implementation===G.implementation){m(H,$.sibling),$=k($,G.children||[]),$.return=H,H=$;break e}else{m(H,$);break}else u(H,$);$=$.sibling}$=km(G,H.mode,ye),$.return=H,H=$}return M(H);case X:return _e=G._init,Dt(H,$,_e(G._payload),ye)}if(Dn(G))return Ee(H,$,G,ye);if(Y(G))return je(H,$,G,ye);Au(H,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,$!==null&&$.tag===6?(m(H,$.sibling),$=k($,G),$.return=H,H=$):(m(H,$),$=bm(G,H.mode,ye),$.return=H,H=$),M(H)):m(H,$)}return Dt}var sl=aw(!0),cw=aw(!1),ju=lo(null),Ru=null,ll=null,Rp=null;function Pp(){Rp=ll=Ru=null}function Op(a){var u=ju.current;wt(ju),a._currentValue=u}function Ip(a,u,m){for(;a!==null;){var x=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,x!==null&&(x.childLanes|=u)):x!==null&&(x.childLanes&u)!==u&&(x.childLanes|=u),a===m)break;a=a.return}}function al(a,u){Ru=a,Rp=ll=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&u)!==0&&(Gn=!0),a.firstContext=null)}function Sr(a){var u=a._currentValue;if(Rp!==a)if(a={context:a,memoizedValue:u,next:null},ll===null){if(Ru===null)throw Error(n(308));ll=a,Ru.dependencies={lanes:0,firstContext:a}}else ll=ll.next=a;return u}var is=null;function Dp(a){is===null?is=[a]:is.push(a)}function uw(a,u,m,x){var k=u.interleaved;return k===null?(m.next=m,Dp(u)):(m.next=k.next,k.next=m),u.interleaved=m,Ti(a,x)}function Ti(a,u){a.lanes|=u;var m=a.alternate;for(m!==null&&(m.lanes|=u),m=a,a=a.return;a!==null;)a.childLanes|=u,m=a.alternate,m!==null&&(m.childLanes|=u),m=a,a=a.return;return m.tag===3?m.stateNode:null}var uo=!1;function _p(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dw(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Mi(a,u){return{eventTime:a,lane:u,tag:0,payload:null,callback:null,next:null}}function fo(a,u,m){var x=a.updateQueue;if(x===null)return null;if(x=x.shared,(ot&2)!==0){var k=x.pending;return k===null?u.next=u:(u.next=k.next,k.next=u),x.pending=u,Ti(a,m)}return k=x.interleaved,k===null?(u.next=u,Dp(x)):(u.next=k.next,k.next=u),x.interleaved=u,Ti(a,m)}function Pu(a,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var x=u.lanes;x&=a.pendingLanes,m|=x,u.lanes=m,Jh(a,m)}}function fw(a,u){var m=a.updateQueue,x=a.alternate;if(x!==null&&(x=x.updateQueue,m===x)){var k=null,E=null;if(m=m.firstBaseUpdate,m!==null){do{var M={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};E===null?k=E=M:E=E.next=M,m=m.next}while(m!==null);E===null?k=E=u:E=E.next=u}else k=E=u;m={baseState:x.baseState,firstBaseUpdate:k,lastBaseUpdate:E,shared:x.shared,effects:x.effects},a.updateQueue=m;return}a=m.lastBaseUpdate,a===null?m.firstBaseUpdate=u:a.next=u,m.lastBaseUpdate=u}function Ou(a,u,m,x){var k=a.updateQueue;uo=!1;var E=k.firstBaseUpdate,M=k.lastBaseUpdate,L=k.shared.pending;if(L!==null){k.shared.pending=null;var F=L,J=F.next;F.next=null,M===null?E=J:M.next=J,M=F;var le=a.alternate;le!==null&&(le=le.updateQueue,L=le.lastBaseUpdate,L!==M&&(L===null?le.firstBaseUpdate=J:L.next=J,le.lastBaseUpdate=F))}if(E!==null){var de=k.baseState;M=0,le=J=F=null,L=E;do{var se=L.lane,be=L.eventTime;if((x&se)===se){le!==null&&(le=le.next={eventTime:be,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Ee=a,je=L;switch(se=u,be=m,je.tag){case 1:if(Ee=je.payload,typeof Ee=="function"){de=Ee.call(be,de,se);break e}de=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=je.payload,se=typeof Ee=="function"?Ee.call(be,de,se):Ee,se==null)break e;de=A({},de,se);break e;case 2:uo=!0}}L.callback!==null&&L.lane!==0&&(a.flags|=64,se=k.effects,se===null?k.effects=[L]:se.push(L))}else be={eventTime:be,lane:se,tag:L.tag,payload:L.payload,callback:L.callback,next:null},le===null?(J=le=be,F=de):le=le.next=be,M|=se;if(L=L.next,L===null){if(L=k.shared.pending,L===null)break;se=L,L=se.next,se.next=null,k.lastBaseUpdate=se,k.shared.pending=null}}while(!0);if(le===null&&(F=de),k.baseState=F,k.firstBaseUpdate=J,k.lastBaseUpdate=le,u=k.shared.interleaved,u!==null){k=u;do M|=k.lane,k=k.next;while(k!==u)}else E===null&&(k.shared.lanes=0);as|=M,a.lanes=M,a.memoizedState=de}}function hw(a,u,m){if(a=u.effects,u.effects=null,a!==null)for(u=0;u<a.length;u++){var x=a[u],k=x.callback;if(k!==null){if(x.callback=null,x=m,typeof k!="function")throw Error(n(191,k));k.call(x)}}}var Ca={},si=lo(Ca),Ea=lo(Ca),Na=lo(Ca);function ss(a){if(a===Ca)throw Error(n(174));return a}function Lp(a,u){switch(mt(Na,u),mt(Ea,a),mt(si,Ca),a=u.nodeType,a){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:ge(null,"");break;default:a=a===8?u.parentNode:u,u=a.namespaceURI||null,a=a.tagName,u=ge(u,a)}wt(si),mt(si,u)}function cl(){wt(si),wt(Ea),wt(Na)}function pw(a){ss(Na.current);var u=ss(si.current),m=ge(u,a.type);u!==m&&(mt(Ea,a),mt(si,m))}function zp(a){Ea.current===a&&(wt(si),wt(Ea))}var Nt=lo(0);function Iu(a){for(var u=a;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Fp=[];function $p(){for(var a=0;a<Fp.length;a++)Fp[a]._workInProgressVersionPrimary=null;Fp.length=0}var Du=R.ReactCurrentDispatcher,Bp=R.ReactCurrentBatchConfig,ls=0,Tt=null,Jt=null,tn=null,_u=!1,Ta=!1,Ma=0,FP=0;function Nn(){throw Error(n(321))}function Vp(a,u){if(u===null)return!1;for(var m=0;m<u.length&&m<a.length;m++)if(!Hr(a[m],u[m]))return!1;return!0}function Hp(a,u,m,x,k,E){if(ls=E,Tt=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Du.current=a===null||a.memoizedState===null?HP:UP,a=m(x,k),Ta){E=0;do{if(Ta=!1,Ma=0,25<=E)throw Error(n(301));E+=1,tn=Jt=null,u.updateQueue=null,Du.current=WP,a=m(x,k)}while(Ta)}if(Du.current=Fu,u=Jt!==null&&Jt.next!==null,ls=0,tn=Jt=Tt=null,_u=!1,u)throw Error(n(300));return a}function Up(){var a=Ma!==0;return Ma=0,a}function li(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Tt.memoizedState=tn=a:tn=tn.next=a,tn}function Cr(){if(Jt===null){var a=Tt.alternate;a=a!==null?a.memoizedState:null}else a=Jt.next;var u=tn===null?Tt.memoizedState:tn.next;if(u!==null)tn=u,Jt=a;else{if(a===null)throw Error(n(310));Jt=a,a={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},tn===null?Tt.memoizedState=tn=a:tn=tn.next=a}return tn}function Aa(a,u){return typeof u=="function"?u(a):u}function Wp(a){var u=Cr(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=a;var x=Jt,k=x.baseQueue,E=m.pending;if(E!==null){if(k!==null){var M=k.next;k.next=E.next,E.next=M}x.baseQueue=k=E,m.pending=null}if(k!==null){E=k.next,x=x.baseState;var L=M=null,F=null,J=E;do{var le=J.lane;if((ls&le)===le)F!==null&&(F=F.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),x=J.hasEagerState?J.eagerState:a(x,J.action);else{var de={lane:le,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};F===null?(L=F=de,M=x):F=F.next=de,Tt.lanes|=le,as|=le}J=J.next}while(J!==null&&J!==E);F===null?M=x:F.next=L,Hr(x,u.memoizedState)||(Gn=!0),u.memoizedState=x,u.baseState=M,u.baseQueue=F,m.lastRenderedState=x}if(a=m.interleaved,a!==null){k=a;do E=k.lane,Tt.lanes|=E,as|=E,k=k.next;while(k!==a)}else k===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function qp(a){var u=Cr(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=a;var x=m.dispatch,k=m.pending,E=u.memoizedState;if(k!==null){m.pending=null;var M=k=k.next;do E=a(E,M.action),M=M.next;while(M!==k);Hr(E,u.memoizedState)||(Gn=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),m.lastRenderedState=E}return[E,x]}function mw(){}function gw(a,u){var m=Tt,x=Cr(),k=u(),E=!Hr(x.memoizedState,k);if(E&&(x.memoizedState=k,Gn=!0),x=x.queue,Kp(vw.bind(null,m,x,a),[a]),x.getSnapshot!==u||E||tn!==null&&tn.memoizedState.tag&1){if(m.flags|=2048,ja(9,xw.bind(null,m,x,k,u),void 0,null),nn===null)throw Error(n(349));(ls&30)!==0||yw(m,u,k)}return k}function yw(a,u,m){a.flags|=16384,a={getSnapshot:u,value:m},u=Tt.updateQueue,u===null?(u={lastEffect:null,stores:null},Tt.updateQueue=u,u.stores=[a]):(m=u.stores,m===null?u.stores=[a]:m.push(a))}function xw(a,u,m,x){u.value=m,u.getSnapshot=x,ww(u)&&bw(a)}function vw(a,u,m){return m(function(){ww(u)&&bw(a)})}function ww(a){var u=a.getSnapshot;a=a.value;try{var m=u();return!Hr(a,m)}catch{return!0}}function bw(a){var u=Ti(a,1);u!==null&&Gr(u,a,1,-1)}function kw(a){var u=li();return typeof a=="function"&&(a=a()),u.memoizedState=u.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:a},u.queue=a,a=a.dispatch=VP.bind(null,Tt,a),[u.memoizedState,a]}function ja(a,u,m,x){return a={tag:a,create:u,destroy:m,deps:x,next:null},u=Tt.updateQueue,u===null?(u={lastEffect:null,stores:null},Tt.updateQueue=u,u.lastEffect=a.next=a):(m=u.lastEffect,m===null?u.lastEffect=a.next=a:(x=m.next,m.next=a,a.next=x,u.lastEffect=a)),a}function Sw(){return Cr().memoizedState}function Lu(a,u,m,x){var k=li();Tt.flags|=a,k.memoizedState=ja(1|u,m,void 0,x===void 0?null:x)}function zu(a,u,m,x){var k=Cr();x=x===void 0?null:x;var E=void 0;if(Jt!==null){var M=Jt.memoizedState;if(E=M.destroy,x!==null&&Vp(x,M.deps)){k.memoizedState=ja(u,m,E,x);return}}Tt.flags|=a,k.memoizedState=ja(1|u,m,E,x)}function Cw(a,u){return Lu(8390656,8,a,u)}function Kp(a,u){return zu(2048,8,a,u)}function Ew(a,u){return zu(4,2,a,u)}function Nw(a,u){return zu(4,4,a,u)}function Tw(a,u){if(typeof u=="function")return a=a(),u(a),function(){u(null)};if(u!=null)return a=a(),u.current=a,function(){u.current=null}}function Mw(a,u,m){return m=m!=null?m.concat([a]):null,zu(4,4,Tw.bind(null,u,a),m)}function Gp(){}function Aw(a,u){var m=Cr();u=u===void 0?null:u;var x=m.memoizedState;return x!==null&&u!==null&&Vp(u,x[1])?x[0]:(m.memoizedState=[a,u],a)}function jw(a,u){var m=Cr();u=u===void 0?null:u;var x=m.memoizedState;return x!==null&&u!==null&&Vp(u,x[1])?x[0]:(a=a(),m.memoizedState=[a,u],a)}function Rw(a,u,m){return(ls&21)===0?(a.baseState&&(a.baseState=!1,Gn=!0),a.memoizedState=m):(Hr(m,u)||(m=l0(),Tt.lanes|=m,as|=m,a.baseState=!0),u)}function $P(a,u){var m=ct;ct=m!==0&&4>m?m:4,a(!0);var x=Bp.transition;Bp.transition={};try{a(!1),u()}finally{ct=m,Bp.transition=x}}function Pw(){return Cr().memoizedState}function BP(a,u,m){var x=go(a);if(m={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null},Ow(a))Iw(u,m);else if(m=uw(a,u,m,x),m!==null){var k=Ln();Gr(m,a,x,k),Dw(m,u,x)}}function VP(a,u,m){var x=go(a),k={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null};if(Ow(a))Iw(u,k);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var M=u.lastRenderedState,L=E(M,m);if(k.hasEagerState=!0,k.eagerState=L,Hr(L,M)){var F=u.interleaved;F===null?(k.next=k,Dp(u)):(k.next=F.next,F.next=k),u.interleaved=k;return}}catch{}finally{}m=uw(a,u,k,x),m!==null&&(k=Ln(),Gr(m,a,x,k),Dw(m,u,x))}}function Ow(a){var u=a.alternate;return a===Tt||u!==null&&u===Tt}function Iw(a,u){Ta=_u=!0;var m=a.pending;m===null?u.next=u:(u.next=m.next,m.next=u),a.pending=u}function Dw(a,u,m){if((m&4194240)!==0){var x=u.lanes;x&=a.pendingLanes,m|=x,u.lanes=m,Jh(a,m)}}var Fu={readContext:Sr,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useInsertionEffect:Nn,useLayoutEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useMutableSource:Nn,useSyncExternalStore:Nn,useId:Nn,unstable_isNewReconciler:!1},HP={readContext:Sr,useCallback:function(a,u){return li().memoizedState=[a,u===void 0?null:u],a},useContext:Sr,useEffect:Cw,useImperativeHandle:function(a,u,m){return m=m!=null?m.concat([a]):null,Lu(4194308,4,Tw.bind(null,u,a),m)},useLayoutEffect:function(a,u){return Lu(4194308,4,a,u)},useInsertionEffect:function(a,u){return Lu(4,2,a,u)},useMemo:function(a,u){var m=li();return u=u===void 0?null:u,a=a(),m.memoizedState=[a,u],a},useReducer:function(a,u,m){var x=li();return u=m!==void 0?m(u):u,x.memoizedState=x.baseState=u,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:u},x.queue=a,a=a.dispatch=BP.bind(null,Tt,a),[x.memoizedState,a]},useRef:function(a){var u=li();return a={current:a},u.memoizedState=a},useState:kw,useDebugValue:Gp,useDeferredValue:function(a){return li().memoizedState=a},useTransition:function(){var a=kw(!1),u=a[0];return a=$P.bind(null,a[1]),li().memoizedState=a,[u,a]},useMutableSource:function(){},useSyncExternalStore:function(a,u,m){var x=Tt,k=li();if(St){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),nn===null)throw Error(n(349));(ls&30)!==0||yw(x,u,m)}k.memoizedState=m;var E={value:m,getSnapshot:u};return k.queue=E,Cw(vw.bind(null,x,E,a),[a]),x.flags|=2048,ja(9,xw.bind(null,x,E,m,u),void 0,null),m},useId:function(){var a=li(),u=nn.identifierPrefix;if(St){var m=Ni,x=Ei;m=(x&~(1<<32-Vr(x)-1)).toString(32)+m,u=":"+u+"R"+m,m=Ma++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=FP++,u=":"+u+"r"+m.toString(32)+":";return a.memoizedState=u},unstable_isNewReconciler:!1},UP={readContext:Sr,useCallback:Aw,useContext:Sr,useEffect:Kp,useImperativeHandle:Mw,useInsertionEffect:Ew,useLayoutEffect:Nw,useMemo:jw,useReducer:Wp,useRef:Sw,useState:function(){return Wp(Aa)},useDebugValue:Gp,useDeferredValue:function(a){var u=Cr();return Rw(u,Jt.memoizedState,a)},useTransition:function(){var a=Wp(Aa)[0],u=Cr().memoizedState;return[a,u]},useMutableSource:mw,useSyncExternalStore:gw,useId:Pw,unstable_isNewReconciler:!1},WP={readContext:Sr,useCallback:Aw,useContext:Sr,useEffect:Kp,useImperativeHandle:Mw,useInsertionEffect:Ew,useLayoutEffect:Nw,useMemo:jw,useReducer:qp,useRef:Sw,useState:function(){return qp(Aa)},useDebugValue:Gp,useDeferredValue:function(a){var u=Cr();return Jt===null?u.memoizedState=a:Rw(u,Jt.memoizedState,a)},useTransition:function(){var a=qp(Aa)[0],u=Cr().memoizedState;return[a,u]},useMutableSource:mw,useSyncExternalStore:gw,useId:Pw,unstable_isNewReconciler:!1};function Wr(a,u){if(a&&a.defaultProps){u=A({},u),a=a.defaultProps;for(var m in a)u[m]===void 0&&(u[m]=a[m]);return u}return u}function Yp(a,u,m,x){u=a.memoizedState,m=m(x,u),m=m==null?u:A({},u,m),a.memoizedState=m,a.lanes===0&&(a.updateQueue.baseState=m)}var $u={isMounted:function(a){return(a=a._reactInternals)?Zo(a)===a:!1},enqueueSetState:function(a,u,m){a=a._reactInternals;var x=Ln(),k=go(a),E=Mi(x,k);E.payload=u,m!=null&&(E.callback=m),u=fo(a,E,k),u!==null&&(Gr(u,a,k,x),Pu(u,a,k))},enqueueReplaceState:function(a,u,m){a=a._reactInternals;var x=Ln(),k=go(a),E=Mi(x,k);E.tag=1,E.payload=u,m!=null&&(E.callback=m),u=fo(a,E,k),u!==null&&(Gr(u,a,k,x),Pu(u,a,k))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var m=Ln(),x=go(a),k=Mi(m,x);k.tag=2,u!=null&&(k.callback=u),u=fo(a,k,x),u!==null&&(Gr(u,a,x,m),Pu(u,a,x))}};function _w(a,u,m,x,k,E,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(x,E,M):u.prototype&&u.prototype.isPureReactComponent?!ga(m,x)||!ga(k,E):!0}function Lw(a,u,m){var x=!1,k=ao,E=u.contextType;return typeof E=="object"&&E!==null?E=Sr(E):(k=Kn(u)?ts:En.current,x=u.contextTypes,E=(x=x!=null)?nl(a,k):ao),u=new u(m,E),a.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=$u,a.stateNode=u,u._reactInternals=a,x&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=k,a.__reactInternalMemoizedMaskedChildContext=E),u}function zw(a,u,m,x){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,x),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,x),u.state!==a&&$u.enqueueReplaceState(u,u.state,null)}function Jp(a,u,m,x){var k=a.stateNode;k.props=m,k.state=a.memoizedState,k.refs={},_p(a);var E=u.contextType;typeof E=="object"&&E!==null?k.context=Sr(E):(E=Kn(u)?ts:En.current,k.context=nl(a,E)),k.state=a.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(Yp(a,u,E,m),k.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(u=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),u!==k.state&&$u.enqueueReplaceState(k,k.state,null),Ou(a,m,k,x),k.state=a.memoizedState),typeof k.componentDidMount=="function"&&(a.flags|=4194308)}function ul(a,u){try{var m="",x=u;do m+=ue(x),x=x.return;while(x);var k=m}catch(E){k=`
|
|
39
|
+
Error generating stack: `+E.message+`
|
|
40
|
+
`+E.stack}return{value:a,source:u,stack:k,digest:null}}function Xp(a,u,m){return{value:a,source:null,stack:m??null,digest:u??null}}function Qp(a,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var qP=typeof WeakMap=="function"?WeakMap:Map;function Fw(a,u,m){m=Mi(-1,m),m.tag=3,m.payload={element:null};var x=u.value;return m.callback=function(){Ku||(Ku=!0,hm=x),Qp(a,u)},m}function $w(a,u,m){m=Mi(-1,m),m.tag=3;var x=a.type.getDerivedStateFromError;if(typeof x=="function"){var k=u.value;m.payload=function(){return x(k)},m.callback=function(){Qp(a,u)}}var E=a.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(m.callback=function(){Qp(a,u),typeof x!="function"&&(po===null?po=new Set([this]):po.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})}),m}function Bw(a,u,m){var x=a.pingCache;if(x===null){x=a.pingCache=new qP;var k=new Set;x.set(u,k)}else k=x.get(u),k===void 0&&(k=new Set,x.set(u,k));k.has(m)||(k.add(m),a=sO.bind(null,a,u,m),u.then(a,a))}function Vw(a){do{var u;if((u=a.tag===13)&&(u=a.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return a;a=a.return}while(a!==null);return null}function Hw(a,u,m,x,k){return(a.mode&1)===0?(a===u?a.flags|=65536:(a.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(u=Mi(-1,1),u.tag=2,fo(m,u,1))),m.lanes|=1),a):(a.flags|=65536,a.lanes=k,a)}var KP=R.ReactCurrentOwner,Gn=!1;function _n(a,u,m,x){u.child=a===null?cw(u,null,m,x):sl(u,a.child,m,x)}function Uw(a,u,m,x,k){m=m.render;var E=u.ref;return al(u,k),x=Hp(a,u,m,x,E,k),m=Up(),a!==null&&!Gn?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~k,Ai(a,u,k)):(St&&m&&Np(u),u.flags|=1,_n(a,u,x,k),u.child)}function Ww(a,u,m,x,k){if(a===null){var E=m.type;return typeof E=="function"&&!wm(E)&&E.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=E,qw(a,u,E,x,k)):(a=Zu(m.type,null,x,u,u.mode,k),a.ref=u.ref,a.return=u,u.child=a)}if(E=a.child,(a.lanes&k)===0){var M=E.memoizedProps;if(m=m.compare,m=m!==null?m:ga,m(M,x)&&a.ref===u.ref)return Ai(a,u,k)}return u.flags|=1,a=xo(E,x),a.ref=u.ref,a.return=u,u.child=a}function qw(a,u,m,x,k){if(a!==null){var E=a.memoizedProps;if(ga(E,x)&&a.ref===u.ref)if(Gn=!1,u.pendingProps=x=E,(a.lanes&k)!==0)(a.flags&131072)!==0&&(Gn=!0);else return u.lanes=a.lanes,Ai(a,u,k)}return Zp(a,u,m,x,k)}function Kw(a,u,m){var x=u.pendingProps,k=x.children,E=a!==null?a.memoizedState:null;if(x.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},mt(fl,cr),cr|=m;else{if((m&1073741824)===0)return a=E!==null?E.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:a,cachePool:null,transitions:null},u.updateQueue=null,mt(fl,cr),cr|=a,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=E!==null?E.baseLanes:m,mt(fl,cr),cr|=x}else E!==null?(x=E.baseLanes|m,u.memoizedState=null):x=m,mt(fl,cr),cr|=x;return _n(a,u,k,m),u.child}function Gw(a,u){var m=u.ref;(a===null&&m!==null||a!==null&&a.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function Zp(a,u,m,x,k){var E=Kn(m)?ts:En.current;return E=nl(u,E),al(u,k),m=Hp(a,u,m,x,E,k),x=Up(),a!==null&&!Gn?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~k,Ai(a,u,k)):(St&&x&&Np(u),u.flags|=1,_n(a,u,m,k),u.child)}function Yw(a,u,m,x,k){if(Kn(m)){var E=!0;Cu(u)}else E=!1;if(al(u,k),u.stateNode===null)Vu(a,u),Lw(u,m,x),Jp(u,m,x,k),x=!0;else if(a===null){var M=u.stateNode,L=u.memoizedProps;M.props=L;var F=M.context,J=m.contextType;typeof J=="object"&&J!==null?J=Sr(J):(J=Kn(m)?ts:En.current,J=nl(u,J));var le=m.getDerivedStateFromProps,de=typeof le=="function"||typeof M.getSnapshotBeforeUpdate=="function";de||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(L!==x||F!==J)&&zw(u,M,x,J),uo=!1;var se=u.memoizedState;M.state=se,Ou(u,x,M,k),F=u.memoizedState,L!==x||se!==F||qn.current||uo?(typeof le=="function"&&(Yp(u,m,le,x),F=u.memoizedState),(L=uo||_w(u,m,L,x,se,F,J))?(de||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(u.flags|=4194308)):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=F),M.props=x,M.state=F,M.context=J,x=L):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{M=u.stateNode,dw(a,u),L=u.memoizedProps,J=u.type===u.elementType?L:Wr(u.type,L),M.props=J,de=u.pendingProps,se=M.context,F=m.contextType,typeof F=="object"&&F!==null?F=Sr(F):(F=Kn(m)?ts:En.current,F=nl(u,F));var be=m.getDerivedStateFromProps;(le=typeof be=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(L!==de||se!==F)&&zw(u,M,x,F),uo=!1,se=u.memoizedState,M.state=se,Ou(u,x,M,k);var Ee=u.memoizedState;L!==de||se!==Ee||qn.current||uo?(typeof be=="function"&&(Yp(u,m,be,x),Ee=u.memoizedState),(J=uo||_w(u,m,J,x,se,Ee,F)||!1)?(le||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(x,Ee,F),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(x,Ee,F)),typeof M.componentDidUpdate=="function"&&(u.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof M.componentDidUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=Ee),M.props=x,M.state=Ee,M.context=F,x=J):(typeof M.componentDidUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(u.flags|=1024),x=!1)}return em(a,u,m,x,E,k)}function em(a,u,m,x,k,E){Gw(a,u);var M=(u.flags&128)!==0;if(!x&&!M)return k&&ew(u,m,!1),Ai(a,u,E);x=u.stateNode,KP.current=u;var L=M&&typeof m.getDerivedStateFromError!="function"?null:x.render();return u.flags|=1,a!==null&&M?(u.child=sl(u,a.child,null,E),u.child=sl(u,null,L,E)):_n(a,u,L,E),u.memoizedState=x.state,k&&ew(u,m,!0),u.child}function Jw(a){var u=a.stateNode;u.pendingContext?Q0(a,u.pendingContext,u.pendingContext!==u.context):u.context&&Q0(a,u.context,!1),Lp(a,u.containerInfo)}function Xw(a,u,m,x,k){return ol(),jp(k),u.flags|=256,_n(a,u,m,x),u.child}var tm={dehydrated:null,treeContext:null,retryLane:0};function nm(a){return{baseLanes:a,cachePool:null,transitions:null}}function Qw(a,u,m){var x=u.pendingProps,k=Nt.current,E=!1,M=(u.flags&128)!==0,L;if((L=M)||(L=a!==null&&a.memoizedState===null?!1:(k&2)!==0),L?(E=!0,u.flags&=-129):(a===null||a.memoizedState!==null)&&(k|=1),mt(Nt,k&1),a===null)return Ap(u),a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((u.mode&1)===0?u.lanes=1:a.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(M=x.children,a=x.fallback,E?(x=u.mode,E=u.child,M={mode:"hidden",children:M},(x&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=M):E=ed(M,x,0,null),a=fs(a,x,m,null),E.return=u,a.return=u,E.sibling=a,u.child=E,u.child.memoizedState=nm(m),u.memoizedState=tm,a):rm(u,M));if(k=a.memoizedState,k!==null&&(L=k.dehydrated,L!==null))return GP(a,u,M,x,L,k,m);if(E){E=x.fallback,M=u.mode,k=a.child,L=k.sibling;var F={mode:"hidden",children:x.children};return(M&1)===0&&u.child!==k?(x=u.child,x.childLanes=0,x.pendingProps=F,u.deletions=null):(x=xo(k,F),x.subtreeFlags=k.subtreeFlags&14680064),L!==null?E=xo(L,E):(E=fs(E,M,m,null),E.flags|=2),E.return=u,x.return=u,x.sibling=E,u.child=x,x=E,E=u.child,M=a.child.memoizedState,M=M===null?nm(m):{baseLanes:M.baseLanes|m,cachePool:null,transitions:M.transitions},E.memoizedState=M,E.childLanes=a.childLanes&~m,u.memoizedState=tm,x}return E=a.child,a=E.sibling,x=xo(E,{mode:"visible",children:x.children}),(u.mode&1)===0&&(x.lanes=m),x.return=u,x.sibling=null,a!==null&&(m=u.deletions,m===null?(u.deletions=[a],u.flags|=16):m.push(a)),u.child=x,u.memoizedState=null,x}function rm(a,u){return u=ed({mode:"visible",children:u},a.mode,0,null),u.return=a,a.child=u}function Bu(a,u,m,x){return x!==null&&jp(x),sl(u,a.child,null,m),a=rm(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function GP(a,u,m,x,k,E,M){if(m)return u.flags&256?(u.flags&=-257,x=Xp(Error(n(422))),Bu(a,u,M,x)):u.memoizedState!==null?(u.child=a.child,u.flags|=128,null):(E=x.fallback,k=u.mode,x=ed({mode:"visible",children:x.children},k,0,null),E=fs(E,k,M,null),E.flags|=2,x.return=u,E.return=u,x.sibling=E,u.child=x,(u.mode&1)!==0&&sl(u,a.child,null,M),u.child.memoizedState=nm(M),u.memoizedState=tm,E);if((u.mode&1)===0)return Bu(a,u,M,null);if(k.data==="$!"){if(x=k.nextSibling&&k.nextSibling.dataset,x)var L=x.dgst;return x=L,E=Error(n(419)),x=Xp(E,x,void 0),Bu(a,u,M,x)}if(L=(M&a.childLanes)!==0,Gn||L){if(x=nn,x!==null){switch(M&-M){case 4:k=2;break;case 16:k=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:k=32;break;case 536870912:k=268435456;break;default:k=0}k=(k&(x.suspendedLanes|M))!==0?0:k,k!==0&&k!==E.retryLane&&(E.retryLane=k,Ti(a,k),Gr(x,a,k,-1))}return vm(),x=Xp(Error(n(421))),Bu(a,u,M,x)}return k.data==="$?"?(u.flags|=128,u.child=a.child,u=lO.bind(null,a),k._reactRetry=u,null):(a=E.treeContext,ar=so(k.nextSibling),lr=u,St=!0,Ur=null,a!==null&&(br[kr++]=Ei,br[kr++]=Ni,br[kr++]=ns,Ei=a.id,Ni=a.overflow,ns=u),u=rm(u,x.children),u.flags|=4096,u)}function Zw(a,u,m){a.lanes|=u;var x=a.alternate;x!==null&&(x.lanes|=u),Ip(a.return,u,m)}function im(a,u,m,x,k){var E=a.memoizedState;E===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:m,tailMode:k}:(E.isBackwards=u,E.rendering=null,E.renderingStartTime=0,E.last=x,E.tail=m,E.tailMode=k)}function e1(a,u,m){var x=u.pendingProps,k=x.revealOrder,E=x.tail;if(_n(a,u,x.children,m),x=Nt.current,(x&2)!==0)x=x&1|2,u.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Zw(a,m,u);else if(a.tag===19)Zw(a,m,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}x&=1}if(mt(Nt,x),(u.mode&1)===0)u.memoizedState=null;else switch(k){case"forwards":for(m=u.child,k=null;m!==null;)a=m.alternate,a!==null&&Iu(a)===null&&(k=m),m=m.sibling;m=k,m===null?(k=u.child,u.child=null):(k=m.sibling,m.sibling=null),im(u,!1,k,m,E);break;case"backwards":for(m=null,k=u.child,u.child=null;k!==null;){if(a=k.alternate,a!==null&&Iu(a)===null){u.child=k;break}a=k.sibling,k.sibling=m,m=k,k=a}im(u,!0,m,null,E);break;case"together":im(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Vu(a,u){(u.mode&1)===0&&a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2)}function Ai(a,u,m){if(a!==null&&(u.dependencies=a.dependencies),as|=u.lanes,(m&u.childLanes)===0)return null;if(a!==null&&u.child!==a.child)throw Error(n(153));if(u.child!==null){for(a=u.child,m=xo(a,a.pendingProps),u.child=m,m.return=u;a.sibling!==null;)a=a.sibling,m=m.sibling=xo(a,a.pendingProps),m.return=u;m.sibling=null}return u.child}function YP(a,u,m){switch(u.tag){case 3:Jw(u),ol();break;case 5:pw(u);break;case 1:Kn(u.type)&&Cu(u);break;case 4:Lp(u,u.stateNode.containerInfo);break;case 10:var x=u.type._context,k=u.memoizedProps.value;mt(ju,x._currentValue),x._currentValue=k;break;case 13:if(x=u.memoizedState,x!==null)return x.dehydrated!==null?(mt(Nt,Nt.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?Qw(a,u,m):(mt(Nt,Nt.current&1),a=Ai(a,u,m),a!==null?a.sibling:null);mt(Nt,Nt.current&1);break;case 19:if(x=(m&u.childLanes)!==0,(a.flags&128)!==0){if(x)return e1(a,u,m);u.flags|=128}if(k=u.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),mt(Nt,Nt.current),x)break;return null;case 22:case 23:return u.lanes=0,Kw(a,u,m)}return Ai(a,u,m)}var t1,om,n1,r1;t1=function(a,u){for(var m=u.child;m!==null;){if(m.tag===5||m.tag===6)a.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===u)break;for(;m.sibling===null;){if(m.return===null||m.return===u)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},om=function(){},n1=function(a,u,m,x){var k=a.memoizedProps;if(k!==x){a=u.stateNode,ss(si.current);var E=null;switch(m){case"input":k=lt(a,k),x=lt(a,x),E=[];break;case"select":k=A({},k,{value:void 0}),x=A({},x,{value:void 0}),E=[];break;case"textarea":k=kt(a,k),x=kt(a,x),E=[];break;default:typeof k.onClick!="function"&&typeof x.onClick=="function"&&(a.onclick=bu)}Lt(m,x);var M;m=null;for(J in k)if(!x.hasOwnProperty(J)&&k.hasOwnProperty(J)&&k[J]!=null)if(J==="style"){var L=k[J];for(M in L)L.hasOwnProperty(M)&&(m||(m={}),m[M]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(i.hasOwnProperty(J)?E||(E=[]):(E=E||[]).push(J,null));for(J in x){var F=x[J];if(L=k!=null?k[J]:void 0,x.hasOwnProperty(J)&&F!==L&&(F!=null||L!=null))if(J==="style")if(L){for(M in L)!L.hasOwnProperty(M)||F&&F.hasOwnProperty(M)||(m||(m={}),m[M]="");for(M in F)F.hasOwnProperty(M)&&L[M]!==F[M]&&(m||(m={}),m[M]=F[M])}else m||(E||(E=[]),E.push(J,m)),m=F;else J==="dangerouslySetInnerHTML"?(F=F?F.__html:void 0,L=L?L.__html:void 0,F!=null&&L!==F&&(E=E||[]).push(J,F)):J==="children"?typeof F!="string"&&typeof F!="number"||(E=E||[]).push(J,""+F):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(i.hasOwnProperty(J)?(F!=null&&J==="onScroll"&&vt("scroll",a),E||L===F||(E=[])):(E=E||[]).push(J,F))}m&&(E=E||[]).push("style",m);var J=E;(u.updateQueue=J)&&(u.flags|=4)}},r1=function(a,u,m,x){m!==x&&(u.flags|=4)};function Ra(a,u){if(!St)switch(a.tailMode){case"hidden":u=a.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?a.tail=null:m.sibling=null;break;case"collapsed":m=a.tail;for(var x=null;m!==null;)m.alternate!==null&&(x=m),m=m.sibling;x===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:x.sibling=null}}function Tn(a){var u=a.alternate!==null&&a.alternate.child===a.child,m=0,x=0;if(u)for(var k=a.child;k!==null;)m|=k.lanes|k.childLanes,x|=k.subtreeFlags&14680064,x|=k.flags&14680064,k.return=a,k=k.sibling;else for(k=a.child;k!==null;)m|=k.lanes|k.childLanes,x|=k.subtreeFlags,x|=k.flags,k.return=a,k=k.sibling;return a.subtreeFlags|=x,a.childLanes=m,u}function JP(a,u,m){var x=u.pendingProps;switch(Tp(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(u),null;case 1:return Kn(u.type)&&Su(),Tn(u),null;case 3:return x=u.stateNode,cl(),wt(qn),wt(En),$p(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(a===null||a.child===null)&&(Mu(u)?u.flags|=4:a===null||a.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ur!==null&&(gm(Ur),Ur=null))),om(a,u),Tn(u),null;case 5:zp(u);var k=ss(Na.current);if(m=u.type,a!==null&&u.stateNode!=null)n1(a,u,m,x,k),a.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!x){if(u.stateNode===null)throw Error(n(166));return Tn(u),null}if(a=ss(si.current),Mu(u)){x=u.stateNode,m=u.type;var E=u.memoizedProps;switch(x[oi]=u,x[ba]=E,a=(u.mode&1)!==0,m){case"dialog":vt("cancel",x),vt("close",x);break;case"iframe":case"object":case"embed":vt("load",x);break;case"video":case"audio":for(k=0;k<xa.length;k++)vt(xa[k],x);break;case"source":vt("error",x);break;case"img":case"image":case"link":vt("error",x),vt("load",x);break;case"details":vt("toggle",x);break;case"input":_t(x,E),vt("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!E.multiple},vt("invalid",x);break;case"textarea":xe(x,E),vt("invalid",x)}Lt(m,E),k=null;for(var M in E)if(E.hasOwnProperty(M)){var L=E[M];M==="children"?typeof L=="string"?x.textContent!==L&&(E.suppressHydrationWarning!==!0&&wu(x.textContent,L,a),k=["children",L]):typeof L=="number"&&x.textContent!==""+L&&(E.suppressHydrationWarning!==!0&&wu(x.textContent,L,a),k=["children",""+L]):i.hasOwnProperty(M)&&L!=null&&M==="onScroll"&&vt("scroll",x)}switch(m){case"input":Ae(x),ir(x,E,!0);break;case"textarea":Ae(x),tt(x);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(x.onclick=bu)}x=k,u.updateQueue=x,x!==null&&(u.flags|=4)}else{M=k.nodeType===9?k:k.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ee(m)),a==="http://www.w3.org/1999/xhtml"?m==="script"?(a=M.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof x.is=="string"?a=M.createElement(m,{is:x.is}):(a=M.createElement(m),m==="select"&&(M=a,x.multiple?M.multiple=!0:x.size&&(M.size=x.size))):a=M.createElementNS(a,m),a[oi]=u,a[ba]=x,t1(a,u,!1,!1),u.stateNode=a;e:{switch(M=xr(m,x),m){case"dialog":vt("cancel",a),vt("close",a),k=x;break;case"iframe":case"object":case"embed":vt("load",a),k=x;break;case"video":case"audio":for(k=0;k<xa.length;k++)vt(xa[k],a);k=x;break;case"source":vt("error",a),k=x;break;case"img":case"image":case"link":vt("error",a),vt("load",a),k=x;break;case"details":vt("toggle",a),k=x;break;case"input":_t(a,x),k=lt(a,x),vt("invalid",a);break;case"option":k=x;break;case"select":a._wrapperState={wasMultiple:!!x.multiple},k=A({},x,{value:void 0}),vt("invalid",a);break;case"textarea":xe(a,x),k=kt(a,x),vt("invalid",a);break;default:k=x}Lt(m,k),L=k;for(E in L)if(L.hasOwnProperty(E)){var F=L[E];E==="style"?Zt(a,F):E==="dangerouslySetInnerHTML"?(F=F?F.__html:void 0,F!=null&&He(a,F)):E==="children"?typeof F=="string"?(m!=="textarea"||F!=="")&&We(a,F):typeof F=="number"&&We(a,""+F):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(i.hasOwnProperty(E)?F!=null&&E==="onScroll"&&vt("scroll",a):F!=null&&N(a,E,F,M))}switch(m){case"input":Ae(a),ir(a,x,!1);break;case"textarea":Ae(a),tt(a);break;case"option":x.value!=null&&a.setAttribute("value",""+oe(x.value));break;case"select":a.multiple=!!x.multiple,E=x.value,E!=null?dn(a,!!x.multiple,E,!1):x.defaultValue!=null&&dn(a,!!x.multiple,x.defaultValue,!0);break;default:typeof k.onClick=="function"&&(a.onclick=bu)}switch(m){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return Tn(u),null;case 6:if(a&&u.stateNode!=null)r1(a,u,a.memoizedProps,x);else{if(typeof x!="string"&&u.stateNode===null)throw Error(n(166));if(m=ss(Na.current),ss(si.current),Mu(u)){if(x=u.stateNode,m=u.memoizedProps,x[oi]=u,(E=x.nodeValue!==m)&&(a=lr,a!==null))switch(a.tag){case 3:wu(x.nodeValue,m,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&wu(x.nodeValue,m,(a.mode&1)!==0)}E&&(u.flags|=4)}else x=(m.nodeType===9?m:m.ownerDocument).createTextNode(x),x[oi]=u,u.stateNode=x}return Tn(u),null;case 13:if(wt(Nt),x=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(St&&ar!==null&&(u.mode&1)!==0&&(u.flags&128)===0)sw(),ol(),u.flags|=98560,E=!1;else if(E=Mu(u),x!==null&&x.dehydrated!==null){if(a===null){if(!E)throw Error(n(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[oi]=u}else ol(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Tn(u),E=!1}else Ur!==null&&(gm(Ur),Ur=null),E=!0;if(!E)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=m,u):(x=x!==null,x!==(a!==null&&a.memoizedState!==null)&&x&&(u.child.flags|=8192,(u.mode&1)!==0&&(a===null||(Nt.current&1)!==0?Xt===0&&(Xt=3):vm())),u.updateQueue!==null&&(u.flags|=4),Tn(u),null);case 4:return cl(),om(a,u),a===null&&va(u.stateNode.containerInfo),Tn(u),null;case 10:return Op(u.type._context),Tn(u),null;case 17:return Kn(u.type)&&Su(),Tn(u),null;case 19:if(wt(Nt),E=u.memoizedState,E===null)return Tn(u),null;if(x=(u.flags&128)!==0,M=E.rendering,M===null)if(x)Ra(E,!1);else{if(Xt!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(M=Iu(a),M!==null){for(u.flags|=128,Ra(E,!1),x=M.updateQueue,x!==null&&(u.updateQueue=x,u.flags|=4),u.subtreeFlags=0,x=m,m=u.child;m!==null;)E=m,a=x,E.flags&=14680066,M=E.alternate,M===null?(E.childLanes=0,E.lanes=a,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=M.childLanes,E.lanes=M.lanes,E.child=M.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=M.memoizedProps,E.memoizedState=M.memoizedState,E.updateQueue=M.updateQueue,E.type=M.type,a=M.dependencies,E.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),m=m.sibling;return mt(Nt,Nt.current&1|2),u.child}a=a.sibling}E.tail!==null&&It()>hl&&(u.flags|=128,x=!0,Ra(E,!1),u.lanes=4194304)}else{if(!x)if(a=Iu(M),a!==null){if(u.flags|=128,x=!0,m=a.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Ra(E,!0),E.tail===null&&E.tailMode==="hidden"&&!M.alternate&&!St)return Tn(u),null}else 2*It()-E.renderingStartTime>hl&&m!==1073741824&&(u.flags|=128,x=!0,Ra(E,!1),u.lanes=4194304);E.isBackwards?(M.sibling=u.child,u.child=M):(m=E.last,m!==null?m.sibling=M:u.child=M,E.last=M)}return E.tail!==null?(u=E.tail,E.rendering=u,E.tail=u.sibling,E.renderingStartTime=It(),u.sibling=null,m=Nt.current,mt(Nt,x?m&1|2:m&1),u):(Tn(u),null);case 22:case 23:return xm(),x=u.memoizedState!==null,a!==null&&a.memoizedState!==null!==x&&(u.flags|=8192),x&&(u.mode&1)!==0?(cr&1073741824)!==0&&(Tn(u),u.subtreeFlags&6&&(u.flags|=8192)):Tn(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function XP(a,u){switch(Tp(u),u.tag){case 1:return Kn(u.type)&&Su(),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return cl(),wt(qn),wt(En),$p(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 5:return zp(u),null;case 13:if(wt(Nt),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(n(340));ol()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return wt(Nt),null;case 4:return cl(),null;case 10:return Op(u.type._context),null;case 22:case 23:return xm(),null;case 24:return null;default:return null}}var Hu=!1,Mn=!1,QP=typeof WeakSet=="function"?WeakSet:Set,Se=null;function dl(a,u){var m=a.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(x){At(a,u,x)}else m.current=null}function sm(a,u,m){try{m()}catch(x){At(a,u,x)}}var i1=!1;function ZP(a,u){if(xp=cu,a=_0(),up(a)){if("selectionStart"in a)var m={start:a.selectionStart,end:a.selectionEnd};else e:{m=(m=a.ownerDocument)&&m.defaultView||window;var x=m.getSelection&&m.getSelection();if(x&&x.rangeCount!==0){m=x.anchorNode;var k=x.anchorOffset,E=x.focusNode;x=x.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var M=0,L=-1,F=-1,J=0,le=0,de=a,se=null;t:for(;;){for(var be;de!==m||k!==0&&de.nodeType!==3||(L=M+k),de!==E||x!==0&&de.nodeType!==3||(F=M+x),de.nodeType===3&&(M+=de.nodeValue.length),(be=de.firstChild)!==null;)se=de,de=be;for(;;){if(de===a)break t;if(se===m&&++J===k&&(L=M),se===E&&++le===x&&(F=M),(be=de.nextSibling)!==null)break;de=se,se=de.parentNode}de=be}m=L===-1||F===-1?null:{start:L,end:F}}else m=null}m=m||{start:0,end:0}}else m=null;for(vp={focusedElem:a,selectionRange:m},cu=!1,Se=u;Se!==null;)if(u=Se,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,Se=a;else for(;Se!==null;){u=Se;try{var Ee=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Ee!==null){var je=Ee.memoizedProps,Dt=Ee.memoizedState,H=u.stateNode,$=H.getSnapshotBeforeUpdate(u.elementType===u.type?je:Wr(u.type,je),Dt);H.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var G=u.stateNode.containerInfo;G.nodeType===1?G.textContent="":G.nodeType===9&&G.documentElement&&G.removeChild(G.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ye){At(u,u.return,ye)}if(a=u.sibling,a!==null){a.return=u.return,Se=a;break}Se=u.return}return Ee=i1,i1=!1,Ee}function Pa(a,u,m){var x=u.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var k=x=x.next;do{if((k.tag&a)===a){var E=k.destroy;k.destroy=void 0,E!==void 0&&sm(u,m,E)}k=k.next}while(k!==x)}}function Uu(a,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&a)===a){var x=m.create;m.destroy=x()}m=m.next}while(m!==u)}}function lm(a){var u=a.ref;if(u!==null){var m=a.stateNode;switch(a.tag){case 5:a=m;break;default:a=m}typeof u=="function"?u(a):u.current=a}}function o1(a){var u=a.alternate;u!==null&&(a.alternate=null,o1(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&(delete u[oi],delete u[ba],delete u[Sp],delete u[DP],delete u[_P])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function s1(a){return a.tag===5||a.tag===3||a.tag===4}function l1(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||s1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function am(a,u,m){var x=a.tag;if(x===5||x===6)a=a.stateNode,u?m.nodeType===8?m.parentNode.insertBefore(a,u):m.insertBefore(a,u):(m.nodeType===8?(u=m.parentNode,u.insertBefore(a,m)):(u=m,u.appendChild(a)),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=bu));else if(x!==4&&(a=a.child,a!==null))for(am(a,u,m),a=a.sibling;a!==null;)am(a,u,m),a=a.sibling}function cm(a,u,m){var x=a.tag;if(x===5||x===6)a=a.stateNode,u?m.insertBefore(a,u):m.appendChild(a);else if(x!==4&&(a=a.child,a!==null))for(cm(a,u,m),a=a.sibling;a!==null;)cm(a,u,m),a=a.sibling}var pn=null,qr=!1;function ho(a,u,m){for(m=m.child;m!==null;)a1(a,u,m),m=m.sibling}function a1(a,u,m){if(ii&&typeof ii.onCommitFiberUnmount=="function")try{ii.onCommitFiberUnmount(ru,m)}catch{}switch(m.tag){case 5:Mn||dl(m,u);case 6:var x=pn,k=qr;pn=null,ho(a,u,m),pn=x,qr=k,pn!==null&&(qr?(a=pn,m=m.stateNode,a.nodeType===8?a.parentNode.removeChild(m):a.removeChild(m)):pn.removeChild(m.stateNode));break;case 18:pn!==null&&(qr?(a=pn,m=m.stateNode,a.nodeType===8?kp(a.parentNode,m):a.nodeType===1&&kp(a,m),ua(a)):kp(pn,m.stateNode));break;case 4:x=pn,k=qr,pn=m.stateNode.containerInfo,qr=!0,ho(a,u,m),pn=x,qr=k;break;case 0:case 11:case 14:case 15:if(!Mn&&(x=m.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){k=x=x.next;do{var E=k,M=E.destroy;E=E.tag,M!==void 0&&((E&2)!==0||(E&4)!==0)&&sm(m,u,M),k=k.next}while(k!==x)}ho(a,u,m);break;case 1:if(!Mn&&(dl(m,u),x=m.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=m.memoizedProps,x.state=m.memoizedState,x.componentWillUnmount()}catch(L){At(m,u,L)}ho(a,u,m);break;case 21:ho(a,u,m);break;case 22:m.mode&1?(Mn=(x=Mn)||m.memoizedState!==null,ho(a,u,m),Mn=x):ho(a,u,m);break;default:ho(a,u,m)}}function c1(a){var u=a.updateQueue;if(u!==null){a.updateQueue=null;var m=a.stateNode;m===null&&(m=a.stateNode=new QP),u.forEach(function(x){var k=aO.bind(null,a,x);m.has(x)||(m.add(x),x.then(k,k))})}}function Kr(a,u){var m=u.deletions;if(m!==null)for(var x=0;x<m.length;x++){var k=m[x];try{var E=a,M=u,L=M;e:for(;L!==null;){switch(L.tag){case 5:pn=L.stateNode,qr=!1;break e;case 3:pn=L.stateNode.containerInfo,qr=!0;break e;case 4:pn=L.stateNode.containerInfo,qr=!0;break e}L=L.return}if(pn===null)throw Error(n(160));a1(E,M,k),pn=null,qr=!1;var F=k.alternate;F!==null&&(F.return=null),k.return=null}catch(J){At(k,u,J)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)u1(u,a),u=u.sibling}function u1(a,u){var m=a.alternate,x=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Kr(u,a),ai(a),x&4){try{Pa(3,a,a.return),Uu(3,a)}catch(je){At(a,a.return,je)}try{Pa(5,a,a.return)}catch(je){At(a,a.return,je)}}break;case 1:Kr(u,a),ai(a),x&512&&m!==null&&dl(m,m.return);break;case 5:if(Kr(u,a),ai(a),x&512&&m!==null&&dl(m,m.return),a.flags&32){var k=a.stateNode;try{We(k,"")}catch(je){At(a,a.return,je)}}if(x&4&&(k=a.stateNode,k!=null)){var E=a.memoizedProps,M=m!==null?m.memoizedProps:E,L=a.type,F=a.updateQueue;if(a.updateQueue=null,F!==null)try{L==="input"&&E.type==="radio"&&E.name!=null&&Mt(k,E),xr(L,M);var J=xr(L,E);for(M=0;M<F.length;M+=2){var le=F[M],de=F[M+1];le==="style"?Zt(k,de):le==="dangerouslySetInnerHTML"?He(k,de):le==="children"?We(k,de):N(k,le,de,J)}switch(L){case"input":dt(k,E);break;case"textarea":at(k,E);break;case"select":var se=k._wrapperState.wasMultiple;k._wrapperState.wasMultiple=!!E.multiple;var be=E.value;be!=null?dn(k,!!E.multiple,be,!1):se!==!!E.multiple&&(E.defaultValue!=null?dn(k,!!E.multiple,E.defaultValue,!0):dn(k,!!E.multiple,E.multiple?[]:"",!1))}k[ba]=E}catch(je){At(a,a.return,je)}}break;case 6:if(Kr(u,a),ai(a),x&4){if(a.stateNode===null)throw Error(n(162));k=a.stateNode,E=a.memoizedProps;try{k.nodeValue=E}catch(je){At(a,a.return,je)}}break;case 3:if(Kr(u,a),ai(a),x&4&&m!==null&&m.memoizedState.isDehydrated)try{ua(u.containerInfo)}catch(je){At(a,a.return,je)}break;case 4:Kr(u,a),ai(a);break;case 13:Kr(u,a),ai(a),k=a.child,k.flags&8192&&(E=k.memoizedState!==null,k.stateNode.isHidden=E,!E||k.alternate!==null&&k.alternate.memoizedState!==null||(fm=It())),x&4&&c1(a);break;case 22:if(le=m!==null&&m.memoizedState!==null,a.mode&1?(Mn=(J=Mn)||le,Kr(u,a),Mn=J):Kr(u,a),ai(a),x&8192){if(J=a.memoizedState!==null,(a.stateNode.isHidden=J)&&!le&&(a.mode&1)!==0)for(Se=a,le=a.child;le!==null;){for(de=Se=le;Se!==null;){switch(se=Se,be=se.child,se.tag){case 0:case 11:case 14:case 15:Pa(4,se,se.return);break;case 1:dl(se,se.return);var Ee=se.stateNode;if(typeof Ee.componentWillUnmount=="function"){x=se,m=se.return;try{u=x,Ee.props=u.memoizedProps,Ee.state=u.memoizedState,Ee.componentWillUnmount()}catch(je){At(x,m,je)}}break;case 5:dl(se,se.return);break;case 22:if(se.memoizedState!==null){h1(de);continue}}be!==null?(be.return=se,Se=be):h1(de)}le=le.sibling}e:for(le=null,de=a;;){if(de.tag===5){if(le===null){le=de;try{k=de.stateNode,J?(E=k.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(L=de.stateNode,F=de.memoizedProps.style,M=F!=null&&F.hasOwnProperty("display")?F.display:null,L.style.display=nt("display",M))}catch(je){At(a,a.return,je)}}}else if(de.tag===6){if(le===null)try{de.stateNode.nodeValue=J?"":de.memoizedProps}catch(je){At(a,a.return,je)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===a)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===a)break e;for(;de.sibling===null;){if(de.return===null||de.return===a)break e;le===de&&(le=null),de=de.return}le===de&&(le=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:Kr(u,a),ai(a),x&4&&c1(a);break;case 21:break;default:Kr(u,a),ai(a)}}function ai(a){var u=a.flags;if(u&2){try{e:{for(var m=a.return;m!==null;){if(s1(m)){var x=m;break e}m=m.return}throw Error(n(160))}switch(x.tag){case 5:var k=x.stateNode;x.flags&32&&(We(k,""),x.flags&=-33);var E=l1(a);cm(a,E,k);break;case 3:case 4:var M=x.stateNode.containerInfo,L=l1(a);am(a,L,M);break;default:throw Error(n(161))}}catch(F){At(a,a.return,F)}a.flags&=-3}u&4096&&(a.flags&=-4097)}function eO(a,u,m){Se=a,d1(a)}function d1(a,u,m){for(var x=(a.mode&1)!==0;Se!==null;){var k=Se,E=k.child;if(k.tag===22&&x){var M=k.memoizedState!==null||Hu;if(!M){var L=k.alternate,F=L!==null&&L.memoizedState!==null||Mn;L=Hu;var J=Mn;if(Hu=M,(Mn=F)&&!J)for(Se=k;Se!==null;)M=Se,F=M.child,M.tag===22&&M.memoizedState!==null?p1(k):F!==null?(F.return=M,Se=F):p1(k);for(;E!==null;)Se=E,d1(E),E=E.sibling;Se=k,Hu=L,Mn=J}f1(a)}else(k.subtreeFlags&8772)!==0&&E!==null?(E.return=k,Se=E):f1(a)}}function f1(a){for(;Se!==null;){var u=Se;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:Mn||Uu(5,u);break;case 1:var x=u.stateNode;if(u.flags&4&&!Mn)if(m===null)x.componentDidMount();else{var k=u.elementType===u.type?m.memoizedProps:Wr(u.type,m.memoizedProps);x.componentDidUpdate(k,m.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var E=u.updateQueue;E!==null&&hw(u,E,x);break;case 3:var M=u.updateQueue;if(M!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}hw(u,M,m)}break;case 5:var L=u.stateNode;if(m===null&&u.flags&4){m=L;var F=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":F.autoFocus&&m.focus();break;case"img":F.src&&(m.src=F.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var J=u.alternate;if(J!==null){var le=J.memoizedState;if(le!==null){var de=le.dehydrated;de!==null&&ua(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Mn||u.flags&512&&lm(u)}catch(se){At(u,u.return,se)}}if(u===a){Se=null;break}if(m=u.sibling,m!==null){m.return=u.return,Se=m;break}Se=u.return}}function h1(a){for(;Se!==null;){var u=Se;if(u===a){Se=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Se=m;break}Se=u.return}}function p1(a){for(;Se!==null;){var u=Se;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{Uu(4,u)}catch(F){At(u,m,F)}break;case 1:var x=u.stateNode;if(typeof x.componentDidMount=="function"){var k=u.return;try{x.componentDidMount()}catch(F){At(u,k,F)}}var E=u.return;try{lm(u)}catch(F){At(u,E,F)}break;case 5:var M=u.return;try{lm(u)}catch(F){At(u,M,F)}}}catch(F){At(u,u.return,F)}if(u===a){Se=null;break}var L=u.sibling;if(L!==null){L.return=u.return,Se=L;break}Se=u.return}}var tO=Math.ceil,Wu=R.ReactCurrentDispatcher,um=R.ReactCurrentOwner,Er=R.ReactCurrentBatchConfig,ot=0,nn=null,Ft=null,mn=0,cr=0,fl=lo(0),Xt=0,Oa=null,as=0,qu=0,dm=0,Ia=null,Yn=null,fm=0,hl=1/0,ji=null,Ku=!1,hm=null,po=null,Gu=!1,mo=null,Yu=0,Da=0,pm=null,Ju=-1,Xu=0;function Ln(){return(ot&6)!==0?It():Ju!==-1?Ju:Ju=It()}function go(a){return(a.mode&1)===0?1:(ot&2)!==0&&mn!==0?mn&-mn:zP.transition!==null?(Xu===0&&(Xu=l0()),Xu):(a=ct,a!==0||(a=window.event,a=a===void 0?16:g0(a.type)),a)}function Gr(a,u,m,x){if(50<Da)throw Da=0,pm=null,Error(n(185));oa(a,m,x),((ot&2)===0||a!==nn)&&(a===nn&&((ot&2)===0&&(qu|=m),Xt===4&&yo(a,mn)),Jn(a,x),m===1&&ot===0&&(u.mode&1)===0&&(hl=It()+500,Eu&&co()))}function Jn(a,u){var m=a.callbackNode;zR(a,u);var x=su(a,a===nn?mn:0);if(x===0)m!==null&&i0(m),a.callbackNode=null,a.callbackPriority=0;else if(u=x&-x,a.callbackPriority!==u){if(m!=null&&i0(m),u===1)a.tag===0?LP(g1.bind(null,a)):tw(g1.bind(null,a)),OP(function(){(ot&6)===0&&co()}),m=null;else{switch(a0(x)){case 1:m=Kh;break;case 4:m=o0;break;case 16:m=nu;break;case 536870912:m=s0;break;default:m=nu}m=C1(m,m1.bind(null,a))}a.callbackPriority=u,a.callbackNode=m}}function m1(a,u){if(Ju=-1,Xu=0,(ot&6)!==0)throw Error(n(327));var m=a.callbackNode;if(pl()&&a.callbackNode!==m)return null;var x=su(a,a===nn?mn:0);if(x===0)return null;if((x&30)!==0||(x&a.expiredLanes)!==0||u)u=Qu(a,x);else{u=x;var k=ot;ot|=2;var E=x1();(nn!==a||mn!==u)&&(ji=null,hl=It()+500,us(a,u));do try{iO();break}catch(L){y1(a,L)}while(!0);Pp(),Wu.current=E,ot=k,Ft!==null?u=0:(nn=null,mn=0,u=Xt)}if(u!==0){if(u===2&&(k=Gh(a),k!==0&&(x=k,u=mm(a,k))),u===1)throw m=Oa,us(a,0),yo(a,x),Jn(a,It()),m;if(u===6)yo(a,x);else{if(k=a.current.alternate,(x&30)===0&&!nO(k)&&(u=Qu(a,x),u===2&&(E=Gh(a),E!==0&&(x=E,u=mm(a,E))),u===1))throw m=Oa,us(a,0),yo(a,x),Jn(a,It()),m;switch(a.finishedWork=k,a.finishedLanes=x,u){case 0:case 1:throw Error(n(345));case 2:ds(a,Yn,ji);break;case 3:if(yo(a,x),(x&130023424)===x&&(u=fm+500-It(),10<u)){if(su(a,0)!==0)break;if(k=a.suspendedLanes,(k&x)!==x){Ln(),a.pingedLanes|=a.suspendedLanes&k;break}a.timeoutHandle=bp(ds.bind(null,a,Yn,ji),u);break}ds(a,Yn,ji);break;case 4:if(yo(a,x),(x&4194240)===x)break;for(u=a.eventTimes,k=-1;0<x;){var M=31-Vr(x);E=1<<M,M=u[M],M>k&&(k=M),x&=~E}if(x=k,x=It()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*tO(x/1960))-x,10<x){a.timeoutHandle=bp(ds.bind(null,a,Yn,ji),x);break}ds(a,Yn,ji);break;case 5:ds(a,Yn,ji);break;default:throw Error(n(329))}}}return Jn(a,It()),a.callbackNode===m?m1.bind(null,a):null}function mm(a,u){var m=Ia;return a.current.memoizedState.isDehydrated&&(us(a,u).flags|=256),a=Qu(a,u),a!==2&&(u=Yn,Yn=m,u!==null&&gm(u)),a}function gm(a){Yn===null?Yn=a:Yn.push.apply(Yn,a)}function nO(a){for(var u=a;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var x=0;x<m.length;x++){var k=m[x],E=k.getSnapshot;k=k.value;try{if(!Hr(E(),k))return!1}catch{return!1}}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function yo(a,u){for(u&=~dm,u&=~qu,a.suspendedLanes|=u,a.pingedLanes&=~u,a=a.expirationTimes;0<u;){var m=31-Vr(u),x=1<<m;a[m]=-1,u&=~x}}function g1(a){if((ot&6)!==0)throw Error(n(327));pl();var u=su(a,0);if((u&1)===0)return Jn(a,It()),null;var m=Qu(a,u);if(a.tag!==0&&m===2){var x=Gh(a);x!==0&&(u=x,m=mm(a,x))}if(m===1)throw m=Oa,us(a,0),yo(a,u),Jn(a,It()),m;if(m===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=u,ds(a,Yn,ji),Jn(a,It()),null}function ym(a,u){var m=ot;ot|=1;try{return a(u)}finally{ot=m,ot===0&&(hl=It()+500,Eu&&co())}}function cs(a){mo!==null&&mo.tag===0&&(ot&6)===0&&pl();var u=ot;ot|=1;var m=Er.transition,x=ct;try{if(Er.transition=null,ct=1,a)return a()}finally{ct=x,Er.transition=m,ot=u,(ot&6)===0&&co()}}function xm(){cr=fl.current,wt(fl)}function us(a,u){a.finishedWork=null,a.finishedLanes=0;var m=a.timeoutHandle;if(m!==-1&&(a.timeoutHandle=-1,PP(m)),Ft!==null)for(m=Ft.return;m!==null;){var x=m;switch(Tp(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Su();break;case 3:cl(),wt(qn),wt(En),$p();break;case 5:zp(x);break;case 4:cl();break;case 13:wt(Nt);break;case 19:wt(Nt);break;case 10:Op(x.type._context);break;case 22:case 23:xm()}m=m.return}if(nn=a,Ft=a=xo(a.current,null),mn=cr=u,Xt=0,Oa=null,dm=qu=as=0,Yn=Ia=null,is!==null){for(u=0;u<is.length;u++)if(m=is[u],x=m.interleaved,x!==null){m.interleaved=null;var k=x.next,E=m.pending;if(E!==null){var M=E.next;E.next=k,x.next=M}m.pending=x}is=null}return a}function y1(a,u){do{var m=Ft;try{if(Pp(),Du.current=Fu,_u){for(var x=Tt.memoizedState;x!==null;){var k=x.queue;k!==null&&(k.pending=null),x=x.next}_u=!1}if(ls=0,tn=Jt=Tt=null,Ta=!1,Ma=0,um.current=null,m===null||m.return===null){Xt=1,Oa=u,Ft=null;break}e:{var E=a,M=m.return,L=m,F=u;if(u=mn,L.flags|=32768,F!==null&&typeof F=="object"&&typeof F.then=="function"){var J=F,le=L,de=le.tag;if((le.mode&1)===0&&(de===0||de===11||de===15)){var se=le.alternate;se?(le.updateQueue=se.updateQueue,le.memoizedState=se.memoizedState,le.lanes=se.lanes):(le.updateQueue=null,le.memoizedState=null)}var be=Vw(M);if(be!==null){be.flags&=-257,Hw(be,M,L,E,u),be.mode&1&&Bw(E,J,u),u=be,F=J;var Ee=u.updateQueue;if(Ee===null){var je=new Set;je.add(F),u.updateQueue=je}else Ee.add(F);break e}else{if((u&1)===0){Bw(E,J,u),vm();break e}F=Error(n(426))}}else if(St&&L.mode&1){var Dt=Vw(M);if(Dt!==null){(Dt.flags&65536)===0&&(Dt.flags|=256),Hw(Dt,M,L,E,u),jp(ul(F,L));break e}}E=F=ul(F,L),Xt!==4&&(Xt=2),Ia===null?Ia=[E]:Ia.push(E),E=M;do{switch(E.tag){case 3:E.flags|=65536,u&=-u,E.lanes|=u;var H=Fw(E,F,u);fw(E,H);break e;case 1:L=F;var $=E.type,G=E.stateNode;if((E.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(po===null||!po.has(G)))){E.flags|=65536,u&=-u,E.lanes|=u;var ye=$w(E,L,u);fw(E,ye);break e}}E=E.return}while(E!==null)}w1(m)}catch(Re){u=Re,Ft===m&&m!==null&&(Ft=m=m.return);continue}break}while(!0)}function x1(){var a=Wu.current;return Wu.current=Fu,a===null?Fu:a}function vm(){(Xt===0||Xt===3||Xt===2)&&(Xt=4),nn===null||(as&268435455)===0&&(qu&268435455)===0||yo(nn,mn)}function Qu(a,u){var m=ot;ot|=2;var x=x1();(nn!==a||mn!==u)&&(ji=null,us(a,u));do try{rO();break}catch(k){y1(a,k)}while(!0);if(Pp(),ot=m,Wu.current=x,Ft!==null)throw Error(n(261));return nn=null,mn=0,Xt}function rO(){for(;Ft!==null;)v1(Ft)}function iO(){for(;Ft!==null&&!AR();)v1(Ft)}function v1(a){var u=S1(a.alternate,a,cr);a.memoizedProps=a.pendingProps,u===null?w1(a):Ft=u,um.current=null}function w1(a){var u=a;do{var m=u.alternate;if(a=u.return,(u.flags&32768)===0){if(m=JP(m,u,cr),m!==null){Ft=m;return}}else{if(m=XP(m,u),m!==null){m.flags&=32767,Ft=m;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Xt=6,Ft=null;return}}if(u=u.sibling,u!==null){Ft=u;return}Ft=u=a}while(u!==null);Xt===0&&(Xt=5)}function ds(a,u,m){var x=ct,k=Er.transition;try{Er.transition=null,ct=1,oO(a,u,m,x)}finally{Er.transition=k,ct=x}return null}function oO(a,u,m,x){do pl();while(mo!==null);if((ot&6)!==0)throw Error(n(327));m=a.finishedWork;var k=a.finishedLanes;if(m===null)return null;if(a.finishedWork=null,a.finishedLanes=0,m===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var E=m.lanes|m.childLanes;if(FR(a,E),a===nn&&(Ft=nn=null,mn=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Gu||(Gu=!0,C1(nu,function(){return pl(),null})),E=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||E){E=Er.transition,Er.transition=null;var M=ct;ct=1;var L=ot;ot|=4,um.current=null,ZP(a,m),u1(m,a),EP(vp),cu=!!xp,vp=xp=null,a.current=m,eO(m),jR(),ot=L,ct=M,Er.transition=E}else a.current=m;if(Gu&&(Gu=!1,mo=a,Yu=k),E=a.pendingLanes,E===0&&(po=null),OR(m.stateNode),Jn(a,It()),u!==null)for(x=a.onRecoverableError,m=0;m<u.length;m++)k=u[m],x(k.value,{componentStack:k.stack,digest:k.digest});if(Ku)throw Ku=!1,a=hm,hm=null,a;return(Yu&1)!==0&&a.tag!==0&&pl(),E=a.pendingLanes,(E&1)!==0?a===pm?Da++:(Da=0,pm=a):Da=0,co(),null}function pl(){if(mo!==null){var a=a0(Yu),u=Er.transition,m=ct;try{if(Er.transition=null,ct=16>a?16:a,mo===null)var x=!1;else{if(a=mo,mo=null,Yu=0,(ot&6)!==0)throw Error(n(331));var k=ot;for(ot|=4,Se=a.current;Se!==null;){var E=Se,M=E.child;if((Se.flags&16)!==0){var L=E.deletions;if(L!==null){for(var F=0;F<L.length;F++){var J=L[F];for(Se=J;Se!==null;){var le=Se;switch(le.tag){case 0:case 11:case 15:Pa(8,le,E)}var de=le.child;if(de!==null)de.return=le,Se=de;else for(;Se!==null;){le=Se;var se=le.sibling,be=le.return;if(o1(le),le===J){Se=null;break}if(se!==null){se.return=be,Se=se;break}Se=be}}}var Ee=E.alternate;if(Ee!==null){var je=Ee.child;if(je!==null){Ee.child=null;do{var Dt=je.sibling;je.sibling=null,je=Dt}while(je!==null)}}Se=E}}if((E.subtreeFlags&2064)!==0&&M!==null)M.return=E,Se=M;else e:for(;Se!==null;){if(E=Se,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:Pa(9,E,E.return)}var H=E.sibling;if(H!==null){H.return=E.return,Se=H;break e}Se=E.return}}var $=a.current;for(Se=$;Se!==null;){M=Se;var G=M.child;if((M.subtreeFlags&2064)!==0&&G!==null)G.return=M,Se=G;else e:for(M=$;Se!==null;){if(L=Se,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:Uu(9,L)}}catch(Re){At(L,L.return,Re)}if(L===M){Se=null;break e}var ye=L.sibling;if(ye!==null){ye.return=L.return,Se=ye;break e}Se=L.return}}if(ot=k,co(),ii&&typeof ii.onPostCommitFiberRoot=="function")try{ii.onPostCommitFiberRoot(ru,a)}catch{}x=!0}return x}finally{ct=m,Er.transition=u}}return!1}function b1(a,u,m){u=ul(m,u),u=Fw(a,u,1),a=fo(a,u,1),u=Ln(),a!==null&&(oa(a,1,u),Jn(a,u))}function At(a,u,m){if(a.tag===3)b1(a,a,m);else for(;u!==null;){if(u.tag===3){b1(u,a,m);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(po===null||!po.has(x))){a=ul(m,a),a=$w(u,a,1),u=fo(u,a,1),a=Ln(),u!==null&&(oa(u,1,a),Jn(u,a));break}}u=u.return}}function sO(a,u,m){var x=a.pingCache;x!==null&&x.delete(u),u=Ln(),a.pingedLanes|=a.suspendedLanes&m,nn===a&&(mn&m)===m&&(Xt===4||Xt===3&&(mn&130023424)===mn&&500>It()-fm?us(a,0):dm|=m),Jn(a,u)}function k1(a,u){u===0&&((a.mode&1)===0?u=1:(u=ou,ou<<=1,(ou&130023424)===0&&(ou=4194304)));var m=Ln();a=Ti(a,u),a!==null&&(oa(a,u,m),Jn(a,m))}function lO(a){var u=a.memoizedState,m=0;u!==null&&(m=u.retryLane),k1(a,m)}function aO(a,u){var m=0;switch(a.tag){case 13:var x=a.stateNode,k=a.memoizedState;k!==null&&(m=k.retryLane);break;case 19:x=a.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(u),k1(a,m)}var S1;S1=function(a,u,m){if(a!==null)if(a.memoizedProps!==u.pendingProps||qn.current)Gn=!0;else{if((a.lanes&m)===0&&(u.flags&128)===0)return Gn=!1,YP(a,u,m);Gn=(a.flags&131072)!==0}else Gn=!1,St&&(u.flags&1048576)!==0&&nw(u,Tu,u.index);switch(u.lanes=0,u.tag){case 2:var x=u.type;Vu(a,u),a=u.pendingProps;var k=nl(u,En.current);al(u,m),k=Hp(null,u,x,a,k,m);var E=Up();return u.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Kn(x)?(E=!0,Cu(u)):E=!1,u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,_p(u),k.updater=$u,u.stateNode=k,k._reactInternals=u,Jp(u,x,a,m),u=em(null,u,x,!0,E,m)):(u.tag=0,St&&E&&Np(u),_n(null,u,k,m),u=u.child),u;case 16:x=u.elementType;e:{switch(Vu(a,u),a=u.pendingProps,k=x._init,x=k(x._payload),u.type=x,k=u.tag=uO(x),a=Wr(x,a),k){case 0:u=Zp(null,u,x,a,m);break e;case 1:u=Yw(null,u,x,a,m);break e;case 11:u=Uw(null,u,x,a,m);break e;case 14:u=Ww(null,u,x,Wr(x.type,a),m);break e}throw Error(n(306,x,""))}return u;case 0:return x=u.type,k=u.pendingProps,k=u.elementType===x?k:Wr(x,k),Zp(a,u,x,k,m);case 1:return x=u.type,k=u.pendingProps,k=u.elementType===x?k:Wr(x,k),Yw(a,u,x,k,m);case 3:e:{if(Jw(u),a===null)throw Error(n(387));x=u.pendingProps,E=u.memoizedState,k=E.element,dw(a,u),Ou(u,x,null,m);var M=u.memoizedState;if(x=M.element,E.isDehydrated)if(E={element:x,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=E,u.memoizedState=E,u.flags&256){k=ul(Error(n(423)),u),u=Xw(a,u,x,m,k);break e}else if(x!==k){k=ul(Error(n(424)),u),u=Xw(a,u,x,m,k);break e}else for(ar=so(u.stateNode.containerInfo.firstChild),lr=u,St=!0,Ur=null,m=cw(u,null,x,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(ol(),x===k){u=Ai(a,u,m);break e}_n(a,u,x,m)}u=u.child}return u;case 5:return pw(u),a===null&&Ap(u),x=u.type,k=u.pendingProps,E=a!==null?a.memoizedProps:null,M=k.children,wp(x,k)?M=null:E!==null&&wp(x,E)&&(u.flags|=32),Gw(a,u),_n(a,u,M,m),u.child;case 6:return a===null&&Ap(u),null;case 13:return Qw(a,u,m);case 4:return Lp(u,u.stateNode.containerInfo),x=u.pendingProps,a===null?u.child=sl(u,null,x,m):_n(a,u,x,m),u.child;case 11:return x=u.type,k=u.pendingProps,k=u.elementType===x?k:Wr(x,k),Uw(a,u,x,k,m);case 7:return _n(a,u,u.pendingProps,m),u.child;case 8:return _n(a,u,u.pendingProps.children,m),u.child;case 12:return _n(a,u,u.pendingProps.children,m),u.child;case 10:e:{if(x=u.type._context,k=u.pendingProps,E=u.memoizedProps,M=k.value,mt(ju,x._currentValue),x._currentValue=M,E!==null)if(Hr(E.value,M)){if(E.children===k.children&&!qn.current){u=Ai(a,u,m);break e}}else for(E=u.child,E!==null&&(E.return=u);E!==null;){var L=E.dependencies;if(L!==null){M=E.child;for(var F=L.firstContext;F!==null;){if(F.context===x){if(E.tag===1){F=Mi(-1,m&-m),F.tag=2;var J=E.updateQueue;if(J!==null){J=J.shared;var le=J.pending;le===null?F.next=F:(F.next=le.next,le.next=F),J.pending=F}}E.lanes|=m,F=E.alternate,F!==null&&(F.lanes|=m),Ip(E.return,m,u),L.lanes|=m;break}F=F.next}}else if(E.tag===10)M=E.type===u.type?null:E.child;else if(E.tag===18){if(M=E.return,M===null)throw Error(n(341));M.lanes|=m,L=M.alternate,L!==null&&(L.lanes|=m),Ip(M,m,u),M=E.sibling}else M=E.child;if(M!==null)M.return=E;else for(M=E;M!==null;){if(M===u){M=null;break}if(E=M.sibling,E!==null){E.return=M.return,M=E;break}M=M.return}E=M}_n(a,u,k.children,m),u=u.child}return u;case 9:return k=u.type,x=u.pendingProps.children,al(u,m),k=Sr(k),x=x(k),u.flags|=1,_n(a,u,x,m),u.child;case 14:return x=u.type,k=Wr(x,u.pendingProps),k=Wr(x.type,k),Ww(a,u,x,k,m);case 15:return qw(a,u,u.type,u.pendingProps,m);case 17:return x=u.type,k=u.pendingProps,k=u.elementType===x?k:Wr(x,k),Vu(a,u),u.tag=1,Kn(x)?(a=!0,Cu(u)):a=!1,al(u,m),Lw(u,x,k),Jp(u,x,k,m),em(null,u,x,!0,a,m);case 19:return e1(a,u,m);case 22:return Kw(a,u,m)}throw Error(n(156,u.tag))};function C1(a,u){return r0(a,u)}function cO(a,u,m,x){this.tag=a,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nr(a,u,m,x){return new cO(a,u,m,x)}function wm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function uO(a){if(typeof a=="function")return wm(a)?1:0;if(a!=null){if(a=a.$$typeof,a===U)return 11;if(a===W)return 14}return 2}function xo(a,u){var m=a.alternate;return m===null?(m=Nr(a.tag,u,a.key,a.mode),m.elementType=a.elementType,m.type=a.type,m.stateNode=a.stateNode,m.alternate=a,a.alternate=m):(m.pendingProps=u,m.type=a.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=a.flags&14680064,m.childLanes=a.childLanes,m.lanes=a.lanes,m.child=a.child,m.memoizedProps=a.memoizedProps,m.memoizedState=a.memoizedState,m.updateQueue=a.updateQueue,u=a.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=a.sibling,m.index=a.index,m.ref=a.ref,m}function Zu(a,u,m,x,k,E){var M=2;if(x=a,typeof a=="function")wm(a)&&(M=1);else if(typeof a=="string")M=5;else e:switch(a){case D:return fs(m.children,k,E,u);case O:M=8,k|=8;break;case B:return a=Nr(12,m,u,k|2),a.elementType=B,a.lanes=E,a;case Z:return a=Nr(13,m,u,k),a.elementType=Z,a.lanes=E,a;case K:return a=Nr(19,m,u,k),a.elementType=K,a.lanes=E,a;case te:return ed(m,k,E,u);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case _:M=10;break e;case V:M=9;break e;case U:M=11;break e;case W:M=14;break e;case X:M=16,x=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return u=Nr(M,m,u,k),u.elementType=a,u.type=x,u.lanes=E,u}function fs(a,u,m,x){return a=Nr(7,a,x,u),a.lanes=m,a}function ed(a,u,m,x){return a=Nr(22,a,x,u),a.elementType=te,a.lanes=m,a.stateNode={isHidden:!1},a}function bm(a,u,m){return a=Nr(6,a,null,u),a.lanes=m,a}function km(a,u,m){return u=Nr(4,a.children!==null?a.children:[],a.key,u),u.lanes=m,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}function dO(a,u,m,x,k){this.tag=u,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yh(0),this.expirationTimes=Yh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yh(0),this.identifierPrefix=x,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function Sm(a,u,m,x,k,E,M,L,F){return a=new dO(a,u,m,L,F),u===1?(u=1,E===!0&&(u|=8)):u=0,E=Nr(3,null,null,u),a.current=E,E.stateNode=a,E.memoizedState={element:x,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},_p(E),a}function fO(a,u,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:x==null?null:""+x,children:a,containerInfo:u,implementation:m}}function E1(a){if(!a)return ao;a=a._reactInternals;e:{if(Zo(a)!==a||a.tag!==1)throw Error(n(170));var u=a;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Kn(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(a.tag===1){var m=a.type;if(Kn(m))return Z0(a,m,u)}return u}function N1(a,u,m,x,k,E,M,L,F){return a=Sm(m,x,!0,a,k,E,M,L,F),a.context=E1(null),m=a.current,x=Ln(),k=go(m),E=Mi(x,k),E.callback=u??null,fo(m,E,k),a.current.lanes=k,oa(a,k,x),Jn(a,x),a}function td(a,u,m,x){var k=u.current,E=Ln(),M=go(k);return m=E1(m),u.context===null?u.context=m:u.pendingContext=m,u=Mi(E,M),u.payload={element:a},x=x===void 0?null:x,x!==null&&(u.callback=x),a=fo(k,u,M),a!==null&&(Gr(a,k,M,E),Pu(a,k,M)),M}function nd(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function T1(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var m=a.retryLane;a.retryLane=m!==0&&m<u?m:u}}function Cm(a,u){T1(a,u),(a=a.alternate)&&T1(a,u)}function hO(){return null}var M1=typeof reportError=="function"?reportError:function(a){console.error(a)};function Em(a){this._internalRoot=a}rd.prototype.render=Em.prototype.render=function(a){var u=this._internalRoot;if(u===null)throw Error(n(409));td(a,u,null,null)},rd.prototype.unmount=Em.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var u=a.containerInfo;cs(function(){td(null,a,null,null)}),u[Si]=null}};function rd(a){this._internalRoot=a}rd.prototype.unstable_scheduleHydration=function(a){if(a){var u=d0();a={blockedOn:null,target:a,priority:u};for(var m=0;m<ro.length&&u!==0&&u<ro[m].priority;m++);ro.splice(m,0,a),m===0&&p0(a)}};function Nm(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function id(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function A1(){}function pO(a,u,m,x,k){if(k){if(typeof x=="function"){var E=x;x=function(){var J=nd(M);E.call(J)}}var M=N1(u,x,a,0,null,!1,!1,"",A1);return a._reactRootContainer=M,a[Si]=M.current,va(a.nodeType===8?a.parentNode:a),cs(),M}for(;k=a.lastChild;)a.removeChild(k);if(typeof x=="function"){var L=x;x=function(){var J=nd(F);L.call(J)}}var F=Sm(a,0,!1,null,null,!1,!1,"",A1);return a._reactRootContainer=F,a[Si]=F.current,va(a.nodeType===8?a.parentNode:a),cs(function(){td(u,F,m,x)}),F}function od(a,u,m,x,k){var E=m._reactRootContainer;if(E){var M=E;if(typeof k=="function"){var L=k;k=function(){var F=nd(M);L.call(F)}}td(u,M,a,k)}else M=pO(m,u,a,k,x);return nd(M)}c0=function(a){switch(a.tag){case 3:var u=a.stateNode;if(u.current.memoizedState.isDehydrated){var m=ia(u.pendingLanes);m!==0&&(Jh(u,m|1),Jn(u,It()),(ot&6)===0&&(hl=It()+500,co()))}break;case 13:cs(function(){var x=Ti(a,1);if(x!==null){var k=Ln();Gr(x,a,1,k)}}),Cm(a,1)}},Xh=function(a){if(a.tag===13){var u=Ti(a,134217728);if(u!==null){var m=Ln();Gr(u,a,134217728,m)}Cm(a,134217728)}},u0=function(a){if(a.tag===13){var u=go(a),m=Ti(a,u);if(m!==null){var x=Ln();Gr(m,a,u,x)}Cm(a,u)}},d0=function(){return ct},f0=function(a,u){var m=ct;try{return ct=a,u()}finally{ct=m}},ta=function(a,u,m){switch(u){case"input":if(dt(a,m),u=m.name,m.type==="radio"&&u!=null){for(m=a;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<m.length;u++){var x=m[u];if(x!==a&&x.form===a.form){var k=ku(x);if(!k)throw Error(n(90));Fe(x),dt(x,k)}}}break;case"textarea":at(a,m);break;case"select":u=m.value,u!=null&&dn(a,!!m.multiple,u,!1)}},Yt=ym,Cn=cs;var mO={usingClientEntryPoint:!1,Events:[ka,el,ku,Ue,Ot,ym]},_a={findFiberByHostInstance:es,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gO={bundleType:_a.bundleType,version:_a.version,rendererPackageName:_a.rendererPackageName,rendererConfig:_a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=t0(a),a===null?null:a.stateNode},findFiberByHostInstance:_a.findFiberByHostInstance||hO,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sd.isDisabled&&sd.supportsFiber)try{ru=sd.inject(gO),ii=sd}catch{}}return Xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mO,Xn.createPortal=function(a,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nm(u))throw Error(n(200));return fO(a,u,null,m)},Xn.createRoot=function(a,u){if(!Nm(a))throw Error(n(299));var m=!1,x="",k=M1;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(k=u.onRecoverableError)),u=Sm(a,1,!1,null,null,m,!1,x,k),a[Si]=u.current,va(a.nodeType===8?a.parentNode:a),new Em(u)},Xn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=t0(u),a=a===null?null:a.stateNode,a},Xn.flushSync=function(a){return cs(a)},Xn.hydrate=function(a,u,m){if(!id(u))throw Error(n(200));return od(null,a,u,!0,m)},Xn.hydrateRoot=function(a,u,m){if(!Nm(a))throw Error(n(405));var x=m!=null&&m.hydratedSources||null,k=!1,E="",M=M1;if(m!=null&&(m.unstable_strictMode===!0&&(k=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onRecoverableError!==void 0&&(M=m.onRecoverableError)),u=N1(u,null,a,1,m??null,k,!1,E,M),a[Si]=u.current,va(a),x)for(a=0;a<x.length;a++)m=x[a],k=m._getVersion,k=k(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,k]:u.mutableSourceEagerHydrationData.push(m,k);return new rd(u)},Xn.render=function(a,u,m){if(!id(u))throw Error(n(200));return od(null,a,u,!1,m)},Xn.unmountComponentAtNode=function(a){if(!id(a))throw Error(n(40));return a._reactRootContainer?(cs(function(){od(null,null,a,!1,function(){a._reactRootContainer=null,a[Si]=null})}),!0):!1},Xn.unstable_batchedUpdates=ym,Xn.unstable_renderSubtreeIntoContainer=function(a,u,m,x){if(!id(m))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return od(a,u,m,!1,x)},Xn.version="18.3.1-next-f1338f8080-20240426",Xn}var L1;function ZS(){if(L1)return Am.exports;L1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Am.exports=CO(),Am.exports}var z1;function EO(){if(z1)return ld;z1=1;var e=ZS();return ld.createRoot=e.createRoot,ld.hydrateRoot=e.hydrateRoot,ld}var NO=EO();const TO=_c(NO);var zc=ZS();const nx=_c(zc);function MO(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const AO=e=>{switch(e){case"success":return PO;case"info":return IO;case"warning":return OO;case"error":return DO;default:return null}},jO=Array(12).fill(0),RO=({visible:e,className:t})=>ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ce.createElement("div",{className:"sonner-spinner"},jO.map((n,r)=>ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),PO=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),OO=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),IO=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),DO=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),_O=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),LO=()=>{const[e,t]=ce.useState(document.hidden);return ce.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Hg=1;class zO{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Hg++,s=this.toasts.find(c=>c.id===o),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:l,title:r}):c):this.addToast({title:r,...i,dismissible:l,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,s;const l=i.then(async d=>{if(s=["resolve",d],ce.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if($O(d)&&!d.ok){o=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,v=typeof f=="object"&&!ce.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...v})}else if(d instanceof Error){o=!1;const f=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!ce.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...v})}else if(n.success!==void 0){o=!1;const f=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!ce.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:g,...v})}}).catch(async d=>{if(s=["reject",d],n.error!==void 0){o=!1;const h=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:f,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,h)=>l.then(()=>s[0]==="reject"?h(s[1]):d(s[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Hg++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Zn=new zO,FO=(e,t)=>{const n=(t==null?void 0:t.id)||Hg++;return Zn.addToast({title:e,...t,id:n}),n},$O=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",BO=FO,VO=()=>Zn.toasts,HO=()=>Zn.getActiveToasts(),UO=Object.assign(BO,{success:Zn.success,info:Zn.info,warning:Zn.warning,error:Zn.error,custom:Zn.custom,message:Zn.message,promise:Zn.promise,dismiss:Zn.dismiss,loading:Zn.loading},{getHistory:VO,getToasts:HO});MO("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ad(e){return e.label!==void 0}const WO=3,qO="24px",KO="16px",F1=4e3,GO=356,YO=14,JO=45,XO=200;function ci(...e){return e.filter(Boolean).join(" ")}function QO(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const ZO=e=>{var t,n,r,i,o,s,l,c,d;const{invert:h,toast:f,unstyled:g,interacting:y,setHeights:v,visibleToasts:w,heights:S,index:C,toasts:T,expanded:N,removeToast:R,defaultRichColors:I,closeButton:j,style:D,cancelButtonStyle:O,actionButtonStyle:B,className:_="",descriptionClassName:V="",duration:U,position:Z,gap:K,expandByDefault:W,classNames:X,icons:te,closeButtonAriaLabel:q="Close toast"}=e,[Y,A]=ce.useState(null),[z,Q]=ce.useState(null),[P,fe]=ce.useState(!1),[ue,re]=ce.useState(!1),[ne,oe]=ce.useState(!1),[me,Ce]=ce.useState(!1),[Ae,Fe]=ce.useState(!1),[it,lt]=ce.useState(0),[_t,Mt]=ce.useState(0),dt=ce.useRef(f.duration||U||F1),ir=ce.useRef(null),pt=ce.useRef(null),Dn=C===0,dn=C+1<=w,kt=f.type,xe=f.dismissible!==!1,at=f.className||"",tt=f.descriptionClassName||"",ee=ce.useMemo(()=>S.findIndex(Ue=>Ue.toastId===f.id)||0,[S,f.id]),ge=ce.useMemo(()=>{var Ue;return(Ue=f.closeButton)!=null?Ue:j},[f.closeButton,j]),De=ce.useMemo(()=>f.duration||U||F1,[f.duration,U]),He=ce.useRef(0),We=ce.useRef(0),ie=ce.useRef(0),qe=ce.useRef(null),[nt,Zt]=Z.split("-"),yr=ce.useMemo(()=>S.reduce((Ue,Ot,Yt)=>Yt>=ee?Ue:Ue+Ot.height,0),[S,ee]),Lt=LO(),xr=f.invert||h,fn=kt==="loading";We.current=ce.useMemo(()=>ee*K+yr,[ee,yr]),ce.useEffect(()=>{dt.current=De},[De]),ce.useEffect(()=>{fe(!0)},[]),ce.useEffect(()=>{const Ue=pt.current;if(Ue){const Ot=Ue.getBoundingClientRect().height;return Mt(Ot),v(Yt=>[{toastId:f.id,height:Ot,position:f.position},...Yt]),()=>v(Yt=>Yt.filter(Cn=>Cn.toastId!==f.id))}},[v,f.id]),ce.useLayoutEffect(()=>{if(!P)return;const Ue=pt.current,Ot=Ue.style.height;Ue.style.height="auto";const Yt=Ue.getBoundingClientRect().height;Ue.style.height=Ot,Mt(Yt),v(Cn=>Cn.find(zt=>zt.toastId===f.id)?Cn.map(zt=>zt.toastId===f.id?{...zt,height:Yt}:zt):[{toastId:f.id,height:Yt,position:f.position},...Cn])},[P,f.title,f.description,v,f.id,f.jsx,f.action,f.cancel]);const vr=ce.useCallback(()=>{re(!0),lt(We.current),v(Ue=>Ue.filter(Ot=>Ot.toastId!==f.id)),setTimeout(()=>{R(f)},XO)},[f,R,v,We]);ce.useEffect(()=>{if(f.promise&&kt==="loading"||f.duration===1/0||f.type==="loading")return;let Ue;return N||y||Lt?(()=>{if(ie.current<He.current){const Cn=new Date().getTime()-He.current;dt.current=dt.current-Cn}ie.current=new Date().getTime()})():(()=>{dt.current!==1/0&&(He.current=new Date().getTime(),Ue=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),vr()},dt.current))})(),()=>clearTimeout(Ue)},[N,y,f,kt,Lt,vr]),ce.useEffect(()=>{f.delete&&(vr(),f.onDismiss==null||f.onDismiss.call(f,f))},[vr,f.delete]);function ta(){var Ue;if(te!=null&&te.loading){var Ot;return ce.createElement("div",{className:ci(X==null?void 0:X.loader,f==null||(Ot=f.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":kt==="loading"},te.loading)}return ce.createElement(RO,{className:ci(X==null?void 0:X.loader,f==null||(Ue=f.classNames)==null?void 0:Ue.loader),visible:kt==="loading"})}const Ji=f.icon||(te==null?void 0:te[kt])||AO(kt);var ki,na;return ce.createElement("li",{tabIndex:0,ref:pt,className:ci(_,at,X==null?void 0:X.toast,f==null||(t=f.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[kt],f==null||(n=f.classNames)==null?void 0:n[kt]),"data-sonner-toast":"","data-rich-colors":(ki=f.richColors)!=null?ki:I,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":P,"data-promise":!!f.promise,"data-swiped":Ae,"data-removed":ue,"data-visible":dn,"data-y-position":nt,"data-x-position":Zt,"data-index":C,"data-front":Dn,"data-swiping":ne,"data-dismissible":xe,"data-type":kt,"data-invert":xr,"data-swipe-out":me,"data-swipe-direction":z,"data-expanded":!!(N||W&&P),"data-testid":f.testId,style:{"--index":C,"--toasts-before":C,"--z-index":T.length-C,"--offset":`${ue?it:We.current}px`,"--initial-height":W?"auto":`${_t}px`,...D,...f.style},onDragEnd:()=>{oe(!1),A(null),qe.current=null},onPointerDown:Ue=>{Ue.button!==2&&(fn||!xe||(ir.current=new Date,lt(We.current),Ue.target.setPointerCapture(Ue.pointerId),Ue.target.tagName!=="BUTTON"&&(oe(!0),qe.current={x:Ue.clientX,y:Ue.clientY})))},onPointerUp:()=>{var Ue,Ot,Yt;if(me||!xe)return;qe.current=null;const Cn=Number(((Ue=pt.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xi=Number(((Ot=pt.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),zt=new Date().getTime()-((Yt=ir.current)==null?void 0:Yt.getTime()),en=Y==="x"?Cn:Xi,Qi=Math.abs(en)/zt;if(Math.abs(en)>=JO||Qi>.11){lt(We.current),f.onDismiss==null||f.onDismiss.call(f,f),Q(Y==="x"?Cn>0?"right":"left":Xi>0?"down":"up"),vr(),Ce(!0);return}else{var hn,or;(hn=pt.current)==null||hn.style.setProperty("--swipe-amount-x","0px"),(or=pt.current)==null||or.style.setProperty("--swipe-amount-y","0px")}Fe(!1),oe(!1),A(null)},onPointerMove:Ue=>{var Ot,Yt,Cn;if(!qe.current||!xe||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const zt=Ue.clientY-qe.current.y,en=Ue.clientX-qe.current.x;var Qi;const hn=(Qi=e.swipeDirections)!=null?Qi:QO(Z);!Y&&(Math.abs(en)>1||Math.abs(zt)>1)&&A(Math.abs(en)>Math.abs(zt)?"x":"y");let or={x:0,y:0};const Zi=wr=>1/(1.5+Math.abs(wr)/20);if(Y==="y"){if(hn.includes("top")||hn.includes("bottom"))if(hn.includes("top")&&zt<0||hn.includes("bottom")&&zt>0)or.y=zt;else{const wr=zt*Zi(zt);or.y=Math.abs(wr)<Math.abs(zt)?wr:zt}}else if(Y==="x"&&(hn.includes("left")||hn.includes("right")))if(hn.includes("left")&&en<0||hn.includes("right")&&en>0)or.x=en;else{const wr=en*Zi(en);or.x=Math.abs(wr)<Math.abs(en)?wr:en}(Math.abs(or.x)>0||Math.abs(or.y)>0)&&Fe(!0),(Yt=pt.current)==null||Yt.style.setProperty("--swipe-amount-x",`${or.x}px`),(Cn=pt.current)==null||Cn.style.setProperty("--swipe-amount-y",`${or.y}px`)}},ge&&!f.jsx&&kt!=="loading"?ce.createElement("button",{"aria-label":q,"data-disabled":fn,"data-close-button":!0,onClick:fn||!xe?()=>{}:()=>{vr(),f.onDismiss==null||f.onDismiss.call(f,f)},className:ci(X==null?void 0:X.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(na=te==null?void 0:te.close)!=null?na:_O):null,(kt||f.icon||f.promise)&&f.icon!==null&&((te==null?void 0:te[kt])!==null||f.icon)?ce.createElement("div",{"data-icon":"",className:ci(X==null?void 0:X.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ta():null,f.type!=="loading"?Ji:null):null,ce.createElement("div",{"data-content":"",className:ci(X==null?void 0:X.content,f==null||(o=f.classNames)==null?void 0:o.content)},ce.createElement("div",{"data-title":"",className:ci(X==null?void 0:X.title,f==null||(s=f.classNames)==null?void 0:s.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?ce.createElement("div",{"data-description":"",className:ci(V,tt,X==null?void 0:X.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),ce.isValidElement(f.cancel)?f.cancel:f.cancel&&ad(f.cancel)?ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||O,onClick:Ue=>{ad(f.cancel)&&xe&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ue),vr())},className:ci(X==null?void 0:X.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,ce.isValidElement(f.action)?f.action:f.action&&ad(f.action)?ce.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||B,onClick:Ue=>{ad(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ue),!Ue.defaultPrevented&&vr())},className:ci(X==null?void 0:X.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function $1(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function eI(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,s=o?"--mobile-offset":"--offset",l=o?KO:qO;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${s}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=l:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const tI=ce.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:s=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:h,mobileOffset:f,theme:g="light",richColors:y,duration:v,style:w,visibleToasts:S=WO,toastOptions:C,dir:T=$1(),gap:N=YO,icons:R,containerAriaLabel:I="Notifications"}=t,[j,D]=ce.useState([]),O=ce.useMemo(()=>r?j.filter(P=>P.toasterId===r):j.filter(P=>!P.toasterId),[j,r]),B=ce.useMemo(()=>Array.from(new Set([o].concat(O.filter(P=>P.position).map(P=>P.position)))),[O,o]),[_,V]=ce.useState([]),[U,Z]=ce.useState(!1),[K,W]=ce.useState(!1),[X,te]=ce.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=ce.useRef(null),Y=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=ce.useRef(null),z=ce.useRef(!1),Q=ce.useCallback(P=>{D(fe=>{var ue;return(ue=fe.find(re=>re.id===P.id))!=null&&ue.delete||Zn.dismiss(P.id),fe.filter(({id:re})=>re!==P.id)})},[]);return ce.useEffect(()=>Zn.subscribe(P=>{if(P.dismiss){requestAnimationFrame(()=>{D(fe=>fe.map(ue=>ue.id===P.id?{...ue,delete:!0}:ue))});return}setTimeout(()=>{nx.flushSync(()=>{D(fe=>{const ue=fe.findIndex(re=>re.id===P.id);return ue!==-1?[...fe.slice(0,ue),{...fe[ue],...P},...fe.slice(ue+1)]:[P,...fe]})})})}),[j]),ce.useEffect(()=>{if(g!=="system"){te(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:fe})=>{te(fe?"dark":"light")})}catch{P.addListener(({matches:ue})=>{try{te(ue?"dark":"light")}catch(re){console.error(re)}})}},[g]),ce.useEffect(()=>{j.length<=1&&Z(!1)},[j]),ce.useEffect(()=>{const P=fe=>{var ue;if(s.every(oe=>fe[oe]||fe.code===oe)){var ne;Z(!0),(ne=q.current)==null||ne.focus()}fe.code==="Escape"&&(document.activeElement===q.current||(ue=q.current)!=null&&ue.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[s]),ce.useEffect(()=>{if(q.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,z.current=!1)}},[q.current]),ce.createElement("section",{ref:n,"aria-label":`${I} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((P,fe)=>{var ue;const[re,ne]=P.split("-");return O.length?ce.createElement("ol",{key:P,dir:T==="auto"?$1():T,tabIndex:-1,ref:q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":re,"data-x-position":ne,style:{"--front-toast-height":`${((ue=_[0])==null?void 0:ue.height)||0}px`,"--width":`${GO}px`,"--gap":`${N}px`,...w,...eI(h,f)},onBlur:oe=>{z.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(z.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||z.current||(z.current=!0,A.current=oe.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{K||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},O.filter(oe=>!oe.position&&fe===0||oe.position===P).map((oe,me)=>{var Ce,Ae;return ce.createElement(ZO,{key:oe.id,icons:R,index:me,toast:oe,defaultRichColors:y,duration:(Ce=C==null?void 0:C.duration)!=null?Ce:v,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:i,visibleToasts:S,closeButton:(Ae=C==null?void 0:C.closeButton)!=null?Ae:c,interacting:K,position:P,style:C==null?void 0:C.style,unstyled:C==null?void 0:C.unstyled,classNames:C==null?void 0:C.classNames,cancelButtonStyle:C==null?void 0:C.cancelButtonStyle,actionButtonStyle:C==null?void 0:C.actionButtonStyle,closeButtonAriaLabel:C==null?void 0:C.closeButtonAriaLabel,removeToast:Q,toasts:O.filter(Fe=>Fe.position==oe.position),heights:_.filter(Fe=>Fe.position==oe.position),setHeights:V,expandByDefault:l,gap:N,expanded:U,swipeDirections:t.swipeDirections})})):null}))});/**
|
|
41
|
+
* @license lucide-react v0.577.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const eC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
46
|
+
* @license lucide-react v0.577.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const nI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
51
|
+
* @license lucide-react v0.577.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const rI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
56
|
+
* @license lucide-react v0.577.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const B1=e=>{const t=rI(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
61
|
+
* @license lucide-react v0.577.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/var iI={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"};/**
|
|
66
|
+
* @license lucide-react v0.577.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const oI=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
71
|
+
* @license lucide-react v0.577.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const sI=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},c)=>b.createElement("svg",{ref:c,...iI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:eC("lucide",i),...!o&&!oI(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,h])=>b.createElement(d,h)),...Array.isArray(o)?o:[o]]));/**
|
|
76
|
+
* @license lucide-react v0.577.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Me=(e,t)=>{const n=b.forwardRef(({className:r,...i},o)=>b.createElement(sI,{ref:o,iconNode:t,className:eC(`lucide-${nI(B1(e))}`,`lucide-${e}`,r),...i}));return n.displayName=B1(e),n};/**
|
|
81
|
+
* @license lucide-react v0.577.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const lI=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],rx=Me("arrow-left",lI);/**
|
|
86
|
+
* @license lucide-react v0.577.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const aI=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],cI=Me("bold",aI);/**
|
|
91
|
+
* @license lucide-react v0.577.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const uI=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],tC=Me("bot",uI);/**
|
|
96
|
+
* @license lucide-react v0.577.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const dI=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],nC=Me("building-2",dI);/**
|
|
101
|
+
* @license lucide-react v0.577.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const fI=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zs=Me("check",fI);/**
|
|
106
|
+
* @license lucide-react v0.577.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const hI=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ix=Me("chevron-down",hI);/**
|
|
111
|
+
* @license lucide-react v0.577.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const pI=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],rC=Me("chevron-right",pI);/**
|
|
116
|
+
* @license lucide-react v0.577.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const mI=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],gI=Me("chevron-up",mI);/**
|
|
121
|
+
* @license lucide-react v0.577.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const yI=[["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"}]],Or=Me("circle-alert",yI);/**
|
|
126
|
+
* @license lucide-react v0.577.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const xI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Hi=Me("circle-check",xI);/**
|
|
131
|
+
* @license lucide-react v0.577.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const vI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ug=Me("circle-x",vI);/**
|
|
136
|
+
* @license lucide-react v0.577.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const wI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],bI=Me("circle",wI);/**
|
|
141
|
+
* @license lucide-react v0.577.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const kI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],qd=Me("clock",kI);/**
|
|
146
|
+
* @license lucide-react v0.577.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const SI=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],CI=Me("code",SI);/**
|
|
151
|
+
* @license lucide-react v0.577.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const EI=[["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"}]],Fc=Me("copy",EI);/**
|
|
156
|
+
* @license lucide-react v0.577.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const NI=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],TI=Me("database",NI);/**
|
|
161
|
+
* @license lucide-react v0.577.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const MI=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],AI=Me("ellipsis-vertical",MI);/**
|
|
166
|
+
* @license lucide-react v0.577.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const jI=[["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"}]],Wg=Me("external-link",jI);/**
|
|
171
|
+
* @license lucide-react v0.577.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const RI=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],iC=Me("eye-off",RI);/**
|
|
176
|
+
* @license lucide-react v0.577.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const PI=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$c=Me("eye",PI);/**
|
|
181
|
+
* @license lucide-react v0.577.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const OI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Kd=Me("file-exclamation-point",OI);/**
|
|
186
|
+
* @license lucide-react v0.577.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const II=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],DI=Me("file-pen",II);/**
|
|
191
|
+
* @license lucide-react v0.577.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const _I=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],zo=Me("file-text",_I);/**
|
|
196
|
+
* @license lucide-react v0.577.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const LI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],zI=Me("globe",LI);/**
|
|
201
|
+
* @license lucide-react v0.577.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const FI=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],$I=Me("heading-1",FI);/**
|
|
206
|
+
* @license lucide-react v0.577.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const BI=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],VI=Me("heading-2",BI);/**
|
|
211
|
+
* @license lucide-react v0.577.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const HI=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],UI=Me("heading-3",HI);/**
|
|
216
|
+
* @license lucide-react v0.577.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const WI=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],qg=Me("history",WI);/**
|
|
221
|
+
* @license lucide-react v0.577.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const qI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Kg=Me("info",qI);/**
|
|
226
|
+
* @license lucide-react v0.577.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const KI=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],GI=Me("italic",KI);/**
|
|
231
|
+
* @license lucide-react v0.577.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const YI=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],oC=Me("key-round",YI);/**
|
|
236
|
+
* @license lucide-react v0.577.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const JI=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],XI=Me("key",JI);/**
|
|
241
|
+
* @license lucide-react v0.577.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const QI=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ZI=Me("link-2",QI);/**
|
|
246
|
+
* @license lucide-react v0.577.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const eD=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],tD=Me("link",eD);/**
|
|
251
|
+
* @license lucide-react v0.577.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const nD=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],rD=Me("list-ordered",nD);/**
|
|
256
|
+
* @license lucide-react v0.577.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const iD=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],oD=Me("list",iD);/**
|
|
261
|
+
* @license lucide-react v0.577.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const sD=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ct=Me("loader-circle",sD);/**
|
|
266
|
+
* @license lucide-react v0.577.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const lD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],sC=Me("log-out",lD);/**
|
|
271
|
+
* @license lucide-react v0.577.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const aD=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],cD=Me("message-square",aD);/**
|
|
276
|
+
* @license lucide-react v0.577.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const uD=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],lC=Me("monitor",uD);/**
|
|
281
|
+
* @license lucide-react v0.577.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const dD=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],th=Me("pencil",dD);/**
|
|
286
|
+
* @license lucide-react v0.577.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const fD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Gg=Me("plus",fD);/**
|
|
291
|
+
* @license lucide-react v0.577.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const hD=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],pD=Me("quote",hD);/**
|
|
296
|
+
* @license lucide-react v0.577.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const mD=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],gD=Me("redo",mD);/**
|
|
301
|
+
* @license lucide-react v0.577.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const yD=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],xc=Me("refresh-cw",yD);/**
|
|
306
|
+
* @license lucide-react v0.577.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const xD=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],V1=Me("rotate-ccw",xD);/**
|
|
311
|
+
* @license lucide-react v0.577.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const vD=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],wD=Me("save",vD);/**
|
|
316
|
+
* @license lucide-react v0.577.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const bD=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],aC=Me("search",bD);/**
|
|
321
|
+
* @license lucide-react v0.577.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const kD=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ox=Me("send",kD);/**
|
|
326
|
+
* @license lucide-react v0.577.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const SD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],H1=Me("settings",SD);/**
|
|
331
|
+
* @license lucide-react v0.577.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const CD=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ED=Me("shield-alert",CD);/**
|
|
336
|
+
* @license lucide-react v0.577.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const ND=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],TD=Me("shield-check",ND);/**
|
|
341
|
+
* @license lucide-react v0.577.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const MD=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],tr=Me("shield",MD);/**
|
|
346
|
+
* @license lucide-react v0.577.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const AD=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],jD=Me("square-check-big",AD);/**
|
|
351
|
+
* @license lucide-react v0.577.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const RD=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],PD=Me("strikethrough",RD);/**
|
|
356
|
+
* @license lucide-react v0.577.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const OD=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],cC=Me("tag",OD);/**
|
|
361
|
+
* @license lucide-react v0.577.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const ID=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],uC=Me("terminal",ID);/**
|
|
366
|
+
* @license lucide-react v0.577.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const DD=[["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"}]],_l=Me("trash-2",DD);/**
|
|
371
|
+
* @license lucide-react v0.577.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const _D=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],U1=Me("triangle-alert",_D);/**
|
|
376
|
+
* @license lucide-react v0.577.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const LD=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],zD=Me("undo",LD);/**
|
|
381
|
+
* @license lucide-react v0.577.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const FD=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Ml=Me("user-plus",FD);/**
|
|
386
|
+
* @license lucide-react v0.577.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const $D=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],sx=Me("users",$D);/**
|
|
391
|
+
* @license lucide-react v0.577.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const BD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],VD=Me("x",BD),HD="",UD="cnst_token";function dC(){try{localStorage.removeItem(UD)}catch{}}async function Ke(e,t={}){const n={"Content-Type":"application/json",...t.headers},r=await fetch(`${HD}${e}`,{...t,headers:n,credentials:"include"}),i=await r.text(),o=i?JSON.parse(i):{};if(!r.ok)throw r.status===401&&(dC(),typeof window<"u"&&window.dispatchEvent(new Event("auth:unauthorized"))),new Error(o.error||`Request failed: ${r.status}`);return o}async function fC(e,t){return Ke("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})})}async function WD(e,t,n){return Ke("/auth/register",{method:"POST",body:JSON.stringify({email:e,password:t,name:n})})}async function qD(){return Ke("/auth/logout",{method:"POST"})}async function hC(){return Ke("/auth/device",{method:"POST",body:JSON.stringify({})})}async function pC(e,t){return Ke(`/auth/device/poll?code=${encodeURIComponent(e)}&client_secret=${encodeURIComponent(t)}`)}async function mC(e){return Ke("/auth/promptowl",{method:"POST",body:JSON.stringify({token:e})})}async function KD(){return Ke("/health")}async function GD(){return Ke("/license/status")}async function YD(e){return Ke("/license/install",{method:"POST",body:JSON.stringify({key:e})})}async function Pm(){return Ke("/auth/admin-status")}async function JD(){return Ke("/auth/teammates")}async function XD(e,t){return Ke("/auth/invite",{method:"POST",body:JSON.stringify({email:e,label:t})})}async function QD(){return Ke("/auth/keys")}async function ZD(e){return Ke("/auth/keys",{method:"POST",body:JSON.stringify(e||{})})}async function e_(e){return Ke("/auth/keys/rotate",{method:"POST",body:JSON.stringify(e||{})})}async function gC(e){return Ke(`/nests/${e}/settings`)}async function t_(e,t){return Ke(`/nests/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}async function n_(){return Ke("/nests")}async function r_(e,t){return Ke("/nests",{method:"POST",body:JSON.stringify({name:e,description:t})})}async function i_(e){return Ke("/nests/"+e,{method:"DELETE"})}async function o_(){return Ke("/stats")}async function lx(e){return Ke(`/nests/${e}/nodes`)}async function s_(e,t){return Ke(`/nests/${e}/nodes/${t}`)}async function l_(e,t){return Ke(`/nests/${e}/nodes`,{method:"POST",body:JSON.stringify(t)})}async function a_(e,t,n,r){const i={};return r!==void 0&&(i["X-Base-Version"]=String(r)),Ke(`/nests/${e}/nodes/${t}`,{method:"PATCH",headers:i,body:JSON.stringify(n)})}async function c_(e,t){return Ke(`/nests/${e}/nodes/${t}`,{method:"DELETE"})}async function ax(e,t){return Ke(`/nests/${e}/search?q=${encodeURIComponent(t)}`)}async function u_(e){return Ke(`/nests/${e}/stewards`)}async function d_(e){return Ke(`/nests/${e}/stewards/sync`,{method:"POST",body:"{}"})}async function f_(e,t){return Ke(`/nests/${e}/stewards`,{method:"POST",body:JSON.stringify(t)})}async function h_(e,t){return Ke(`/nests/${e}/stewards/${t}`,{method:"DELETE"})}async function p_(e,t){return Ke(`/nests/${e}/nodes/${t}/stewards`)}async function m_(e,t="pending"){return Ke(`/nests/${e}/review-queue?status=${encodeURIComponent(t)}`)}async function yC(e,t,n,r){return Ke(`/nests/${e}/nodes/${t}/submit-review`,{method:"POST",body:JSON.stringify({note:n,priority:r})})}async function xC(e,t,n){return Ke(`/nests/${e}/nodes/${t}/approve`,{method:"POST",body:JSON.stringify({note:n})})}async function vC(e,t,n){return Ke(`/nests/${e}/nodes/${t}/reject`,{method:"POST",body:JSON.stringify({note:n})})}async function g_(e,t){return Ke(`/nests/${e}/nodes/${t}/versions`)}async function W1(e,t=!1){return Ke(`/nests/${e}/external-edits${t?"?refresh=true":""}`)}async function y_(e){return Ke(`/nests/${e}/external-edits/scan`,{method:"POST",body:"{}"})}async function x_(e,t,n){return Ke(`/nests/${e}/nodes/${t}/external-edits/${n}`)}async function v_(e,t,n,r){return Ke(`/nests/${e}/nodes/${t}/external-edits/${n}/approve`,{method:"POST",body:JSON.stringify({comment:r})})}async function w_(e,t,n,r){return Ke(`/nests/${e}/nodes/${t}/external-edits/${n}/reject`,{method:"POST",body:JSON.stringify({reason:r})})}const wC=b.createContext(null);function b_({children:e}){var T;const[t,n]=b.useState(null),[r,i]=b.useState(null),[o,s]=b.useState(!1),[l,c]=b.useState(!0),[d,h]=b.useState(null),f=b.useRef(0),g=b.useCallback((N,R)=>N==="open"?!0:!!R,[]),y=b.useCallback(async()=>{const N=++f.current;try{const R=await Pm();if(f.current!==N)return;i(R),s(t==="open"?!0:!!R.me)}catch{}},[t]);b.useEffect(()=>{dC();let N=!1;return(async()=>{try{const R=await KD();if(N)return;const I=R.auth_mode;n(I);const j=await Pm();if(N)return;i(j),s(g(I,j.me))}catch{N||h("Cannot connect to server")}finally{N||c(!1)}})(),()=>{N=!0}},[g]),b.useEffect(()=>{const N=()=>{++f.current,s(t==="open"),i(R=>R&&{...R,me:null})};return window.addEventListener("auth:unauthorized",N),()=>window.removeEventListener("auth:unauthorized",N)},[t]),b.useEffect(()=>{const N="cnst_auth_tick",R=j=>{j.key===N&&y()},I=()=>{document.visibilityState==="visible"&&y()};return window.addEventListener("storage",R),document.addEventListener("visibilitychange",I),()=>{window.removeEventListener("storage",R),document.removeEventListener("visibilitychange",I)}},[y]);const v=b.useCallback(()=>{try{localStorage.setItem("cnst_auth_tick",String(Date.now()))}catch{}},[]),w=b.useCallback(N=>{const R=++f.current;if(N){const I=N.name??null;i(j=>({claimed:(j==null?void 0:j.claimed)??!0,admin:(j==null?void 0:j.admin)??{email:N.email,name:I},me:{email:N.email,name:I,is_admin:N.is_admin}})),s(!0)}v(),(async()=>{try{const I=await Pm();f.current===R&&(i(I),s(g(t,I.me)))}catch{}})()},[t,v,g]),S=b.useCallback(async()=>{++f.current;try{await qD()}catch{}s(t==="open"),i(N=>N&&{...N,me:null}),v()},[t,v]),C=!!((T=r==null?void 0:r.me)!=null&&T.is_admin);return p.jsx(wC.Provider,{value:{authMode:t,adminStatus:r,authenticated:o,isAdmin:C,loading:l,error:d,refresh:y,loginSuccess:w,logout:S},children:e})}function Fs(){const e=b.useContext(wC);if(!e)throw new Error("useAuth must be used inside <AuthProvider>");return e}function k_(){const{loginSuccess:e}=Fs(),[t,n]=b.useState("login"),[r,i]=b.useState(""),[o,s]=b.useState(""),[l,c]=b.useState(""),[d,h]=b.useState(null),[f,g]=b.useState(!1),[y,v]=b.useState(null),[w,S]=b.useState(null),[C,T]=b.useState(!1),[N,R]=b.useState(!1),I=async()=>{w&&(await navigator.clipboard.writeText(w),T(!0),setTimeout(()=>T(!1),1500))},j=async O=>{O.preventDefault(),h(null),g(!0);try{const B=t==="register"?await WD(r,o,l):await fC(r,o);e(B.user?{email:B.user.email,name:B.user.name,is_admin:!!B.user.is_admin}:void 0)}catch(B){h(B.message)}finally{g(!1)}},D=async()=>{h(null),g(!0);try{const O=await hC();v(O.verificationUrl),S(O.deviceCode),window.open(O.verificationUrl,"_blank","noopener,noreferrer");for(let B=0;B<180;B++){await new Promise(U=>setTimeout(U,2e3));const _=await pC(O.deviceCode,O.clientSecret);if(_.status==="approved"&&_.token){const U=await mC(_.token);e(U.user?{email:U.user.email,name:U.user.name,is_admin:!!U.user.is_admin}:void 0);return}if(_.status==="pending")continue;const V=_.status==="denied"||_.status==="rejected"?"Login denied. Approve the request in PromptOwl to continue, or try again.":_.status==="expired"?"Login expired. Try again.":_.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${_.status}). Try again.`;h(V),v(null),S(null),g(!1);return}h("Login timed out waiting for approval. Try again."),v(null),S(null),g(!1)}catch(O){h(O.message),v(null),S(null),g(!1)}};return p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:p.jsxs("div",{className:"w-full max-w-sm space-y-6 p-6",children:[p.jsxs("div",{className:"text-center",children:[p.jsx("span",{className:"text-4xl",children:"🪺"}),p.jsx("h1",{className:"text-xl font-semibold mt-2",children:"ContextNest"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Community Server"})]}),p.jsx("button",{onClick:D,disabled:f,className:"w-full flex items-center justify-center gap-2 py-2.5 px-4 rounded-lg border border-border bg-card hover:bg-secondary text-sm font-medium transition-colors",children:f&&y?"Waiting for approval...":"Login with PromptOwl"}),y&&p.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-2",children:[p.jsxs("p",{className:"text-xs text-muted-foreground",children:["A new tab opened at"," ",p.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"PromptOwl"}),". If it asks for a verification code, use this:"]}),w&&p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"flex-1 bg-background border rounded px-2 py-1.5 text-xs font-mono break-all",children:w}),p.jsx("button",{type:"button",onClick:I,className:"px-2 py-1.5 rounded border text-xs hover:bg-secondary",children:C?"Copied":"Copy"})]})]}),!y&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-0 flex items-center",children:p.jsx("div",{className:"w-full border-t border-border"})}),p.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:p.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),p.jsxs("form",{onSubmit:j,className:"space-y-3",children:[t==="register"&&p.jsx("input",{type:"text",placeholder:"Name",value:l,onChange:O=>c(O.target.value),className:"w-full px-3 py-2 rounded-md border border-input bg-background text-sm"}),p.jsx("input",{type:"email",placeholder:"Email",value:r,onChange:O=>i(O.target.value),required:!0,className:"w-full px-3 py-2 rounded-md border border-input bg-background text-sm"}),p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:N?"text":"password",placeholder:"Password",value:o,onChange:O=>s(O.target.value),required:!0,className:"w-full px-3 py-2 pr-9 rounded-md border border-input bg-background text-sm"}),p.jsx("button",{type:"button",onClick:()=>R(O=>!O),"aria-label":N?"Hide password":"Show password",tabIndex:-1,className:"absolute inset-y-0 right-0 flex items-center px-2 text-muted-foreground hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-r-md",children:N?p.jsx(iC,{className:"h-4 w-4"}):p.jsx($c,{className:"h-4 w-4"})})]}),p.jsx("button",{type:"submit",disabled:f,className:"w-full py-2.5 px-4 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 disabled:opacity-50",children:f?"...":t==="register"?"Create Account":"Login"})]})]}),d&&p.jsx("p",{className:"text-sm text-destructive text-center",children:d}),!y&&p.jsx("p",{className:"text-xs text-center text-muted-foreground",children:t==="login"?p.jsxs(p.Fragment,{children:["No account?"," ",p.jsx("button",{onClick:()=>n("register"),className:"text-primary underline",children:"Register"})]}):p.jsxs(p.Fragment,{children:["Have an account?"," ",p.jsx("button",{onClick:()=>n("login"),className:"text-primary underline",children:"Login"})]})})]})})}const S_="00000000-0000-0000-0000-000000000000";function bC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=bC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function kC(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bC(e))&&(r&&(r+=" "),r+=t);return r}const C_=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},E_=(e,t)=>({classGroupId:e,validator:t}),SC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Gd="-",q1=[],N_="arbitrary..",T_=e=>{const t=A_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return M_(s);const l=s.split(Gd),c=l[0]===""&&l.length>1?1:0;return CC(l,c,t)},getConflictingClassGroupIds:(s,l)=>{if(l){const c=r[s],d=n[s];return c?d?C_(d,c):c:d||q1}return n[s]||q1}}},CC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const d=CC(e,t+1,o);if(d)return d}const s=n.validators;if(s===null)return;const l=t===0?e.join(Gd):e.slice(t).join(Gd),c=s.length;for(let d=0;d<c;d++){const h=s[d];if(h.validator(l))return h.classGroupId}},M_=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?N_+r:void 0})(),A_=e=>{const{theme:t,classGroups:n}=e;return j_(n,t)},j_=(e,t)=>{const n=SC();for(const r in e){const i=e[r];cx(i,n,r,t)}return n},cx=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const s=e[o];R_(s,t,n,r)}},R_=(e,t,n,r)=>{if(typeof e=="string"){P_(e,t,n);return}if(typeof e=="function"){O_(e,t,n,r);return}I_(e,t,n,r)},P_=(e,t,n)=>{const r=e===""?t:EC(t,e);r.classGroupId=n},O_=(e,t,n,r)=>{if(D_(e)){cx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(E_(n,e))},I_=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let s=0;s<o;s++){const[l,c]=i[s];cx(c,EC(t,l),n,r)}},EC=(e,t)=>{let n=e;const r=t.split(Gd),i=r.length;for(let o=0;o<i;o++){const s=r[o];let l=n.nextPart.get(s);l||(l=SC(),n.nextPart.set(s,l)),n=l}return n},D_=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,__=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,s)=>{n[o]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let s=n[o];if(s!==void 0)return s;if((s=r[o])!==void 0)return i(o,s),s},set(o,s){o in n?n[o]=s:i(o,s)}}},Yg="!",K1=":",L_=[],G1=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),z_=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,l=0,c=0,d;const h=i.length;for(let w=0;w<h;w++){const S=i[w];if(s===0&&l===0){if(S===K1){o.push(i.slice(c,w)),c=w+1;continue}if(S==="/"){d=w;continue}}S==="["?s++:S==="]"?s--:S==="("?l++:S===")"&&l--}const f=o.length===0?i:i.slice(c);let g=f,y=!1;f.endsWith(Yg)?(g=f.slice(0,-1),y=!0):f.startsWith(Yg)&&(g=f.slice(1),y=!0);const v=d&&d>c?d-c:void 0;return G1(o,y,g,v)};if(t){const i=t+K1,o=r;r=s=>s.startsWith(i)?o(s.slice(i.length)):G1(L_,!1,s,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},F_=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const s=n[o],l=s[0]==="[",c=t.has(s);l||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},$_=e=>({cache:__(e.cacheSize),parseClassName:z_(e),sortModifiers:F_(e),...T_(e)}),B_=/\s+/,V_=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],l=e.trim().split(B_);let c="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:f,modifiers:g,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:w}=n(h);if(f){c=h+(c.length>0?" "+c:c);continue}let S=!!w,C=r(S?v.substring(0,w):v);if(!C){if(!S){c=h+(c.length>0?" "+c:c);continue}if(C=r(v),!C){c=h+(c.length>0?" "+c:c);continue}S=!1}const T=g.length===0?"":g.length===1?g[0]:o(g).join(":"),N=y?T+Yg:T,R=N+C;if(s.indexOf(R)>-1)continue;s.push(R);const I=i(C,S);for(let j=0;j<I.length;++j){const D=I[j];s.push(N+D)}c=h+(c.length>0?" "+c:c)}return c},H_=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=NC(n))&&(i&&(i+=" "),i+=r);return i},NC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=NC(e[r]))&&(n&&(n+=" "),n+=t);return n},U_=(e,...t)=>{let n,r,i,o;const s=c=>{const d=t.reduce((h,f)=>f(h),e());return n=$_(d),r=n.cache.get,i=n.cache.set,o=l,l(c)},l=c=>{const d=r(c);if(d)return d;const h=V_(c,n);return i(c,h),h};return o=s,(...c)=>o(H_(...c))},W_=[],Qt=e=>{const t=n=>n[e]||W_;return t.isThemeGetter=!0,t},TC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,MC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,q_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,K_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,G_=/\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$/,Y_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,J_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wo=e=>q_.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),Om=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),Ri=e=>K_.test(e),AC=()=>!0,Q_=e=>G_.test(e)&&!Y_.test(e),ux=()=>!1,Z_=e=>J_.test(e),eL=e=>X_.test(e),tL=e=>!Ne(e)&&!Te(e),nL=e=>qo(e,PC,ux),Ne=e=>TC.test(e),hs=e=>qo(e,OC,Q_),Y1=e=>qo(e,uL,Xe),rL=e=>qo(e,DC,AC),iL=e=>qo(e,IC,ux),J1=e=>qo(e,jC,ux),oL=e=>qo(e,RC,eL),cd=e=>qo(e,_C,Z_),Te=e=>MC.test(e),za=e=>$s(e,OC),sL=e=>$s(e,IC),X1=e=>$s(e,jC),lL=e=>$s(e,PC),aL=e=>$s(e,RC),ud=e=>$s(e,_C,!0),cL=e=>$s(e,DC,!0),qo=(e,t,n)=>{const r=TC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$s=(e,t,n=!1)=>{const r=MC.exec(e);return r?r[1]?t(r[1]):n:!1},jC=e=>e==="position"||e==="percentage",RC=e=>e==="image"||e==="url",PC=e=>e==="length"||e==="size"||e==="bg-size",OC=e=>e==="length",uL=e=>e==="number",IC=e=>e==="family-name",DC=e=>e==="number"||e==="weight",_C=e=>e==="shadow",dL=()=>{const e=Qt("color"),t=Qt("font"),n=Qt("text"),r=Qt("font-weight"),i=Qt("tracking"),o=Qt("leading"),s=Qt("breakpoint"),l=Qt("container"),c=Qt("spacing"),d=Qt("radius"),h=Qt("shadow"),f=Qt("inset-shadow"),g=Qt("text-shadow"),y=Qt("drop-shadow"),v=Qt("blur"),w=Qt("perspective"),S=Qt("aspect"),C=Qt("ease"),T=Qt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...R(),Te,Ne],j=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],O=()=>[Te,Ne,c],B=()=>[wo,"full","auto",...O()],_=()=>[bo,"none","subgrid",Te,Ne],V=()=>["auto",{span:["full",bo,Te,Ne]},bo,Te,Ne],U=()=>[bo,"auto",Te,Ne],Z=()=>["auto","min","max","fr",Te,Ne],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...O()],te=()=>[wo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],q=()=>[wo,"screen","full","dvw","lvw","svw","min","max","fit",...O()],Y=()=>[wo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],A=()=>[e,Te,Ne],z=()=>[...R(),X1,J1,{position:[Te,Ne]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",lL,nL,{size:[Te,Ne]}],fe=()=>[Om,za,hs],ue=()=>["","none","full",d,Te,Ne],re=()=>["",Xe,za,hs],ne=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Xe,Om,X1,J1],Ce=()=>["","none",v,Te,Ne],Ae=()=>["none",Xe,Te,Ne],Fe=()=>["none",Xe,Te,Ne],it=()=>[Xe,Te,Ne],lt=()=>[wo,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ri],breakpoint:[Ri],color:[AC],container:[Ri],"drop-shadow":[Ri],ease:["in","out","in-out"],font:[tL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ri],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ri],shadow:[Ri],spacing:["px",Xe],text:[Ri],"text-shadow":[Ri],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wo,Ne,Te,S]}],container:["container"],columns:[{columns:[Xe,Ne,Te,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:I()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",Te,Ne]}],basis:[{basis:[wo,"full","auto",l,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,wo,"auto","initial","none",Ne]}],grow:[{grow:["",Xe,Te,Ne]}],shrink:[{shrink:["",Xe,Te,Ne]}],order:[{order:[bo,"first","last","none",Te,Ne]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[l,"screen",...te()]}],"min-w":[{"min-w":[l,"screen","none",...te()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[s]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,za,hs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,cL,rL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Om,Ne]}],"font-family":[{font:[sL,iL,t]}],"font-features":[{"font-features":[Ne]}],"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:[i,Te,Ne]}],"line-clamp":[{"line-clamp":[Xe,"none",Te,Y1]}],leading:[{leading:[o,...O()]}],"list-image":[{"list-image":["none",Te,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Te,hs]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Xe,"auto",Te,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Ne]}],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",Te,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,Te,Ne],radial:["",Te,Ne],conic:[bo,Te,Ne]},aL,oL]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Te,Ne]}],"outline-w":[{outline:["",Xe,za,hs]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",h,ud,cd]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",f,ud,cd]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Xe,hs]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",g,ud,cd]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Xe,Te,Ne]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"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":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Te,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Ne]}],filter:[{filter:["","none",Te,Ne]}],blur:[{blur:Ce()}],brightness:[{brightness:[Xe,Te,Ne]}],contrast:[{contrast:[Xe,Te,Ne]}],"drop-shadow":[{"drop-shadow":["","none",y,ud,cd]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Xe,Te,Ne]}],"hue-rotate":[{"hue-rotate":[Xe,Te,Ne]}],invert:[{invert:["",Xe,Te,Ne]}],saturate:[{saturate:[Xe,Te,Ne]}],sepia:[{sepia:["",Xe,Te,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Ne]}],"backdrop-blur":[{"backdrop-blur":Ce()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Te,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Te,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Te,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Te,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Te,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Te,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Te,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Te,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Te,Ne]}],ease:[{ease:["linear","initial",C,Te,Ne]}],delay:[{delay:[Xe,Te,Ne]}],animate:[{animate:["none",T,Te,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Te,Ne]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[Te,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:lt()}],"translate-x":[{"translate-x":lt()}],"translate-y":[{"translate-y":lt()}],"translate-z":[{"translate-z":lt()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Te,Ne]}],"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":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Te,Ne]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Xe,za,hs,Y1]}],stroke:[{stroke:["none",...A()]}],"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"]}},fL=U_(dL);function Pe(...e){return fL(kC(e))}const Bt=b.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Bt.displayName="Card";const on=b.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));on.displayName="CardHeader";const sn=b.forwardRef(({className:e,...t},n)=>p.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",e),...t}));sn.displayName="CardTitle";const Ar=b.forwardRef(({className:e,...t},n)=>p.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Ar.displayName="CardDescription";const Vt=b.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));Vt.displayName="CardContent";const hL=b.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",e),...t}));hL.displayName="CardFooter";function Q1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qi(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Q1(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Q1(e[i],null)}}}}function et(...e){return b.useCallback(qi(...e),e)}var pL=Symbol.for("react.lazy"),Yd=tx[" use ".trim().toString()];function mL(e){return typeof e=="object"&&e!==null&&"then"in e}function LC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pL&&"_payload"in e&&mL(e._payload)}function dx(e){const t=yL(e),n=b.forwardRef((r,i)=>{let{children:o,...s}=r;LC(o)&&typeof Yd=="function"&&(o=Yd(o._payload));const l=b.Children.toArray(o),c=l.find(vL);if(c){const d=c.props.children,h=l.map(f=>f===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var gL=dx("Slot");function yL(e){const t=b.forwardRef((n,r)=>{let{children:i,...o}=n;if(LC(i)&&typeof Yd=="function"&&(i=Yd(i._payload)),b.isValidElement(i)){const s=bL(i),l=wL(o,i.props);return i.type!==b.Fragment&&(l.ref=r?qi(r,s):s),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xL=Symbol("radix.slottable");function vL(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xL}function wL(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const c=o(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function bL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Z1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eb=kC,nh=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return eb(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(d=>{const h=n==null?void 0:n[d],f=o==null?void 0:o[d];if(h===null)return null;const g=Z1(h)||Z1(f);return i[d][g]}),l=n&&Object.entries(n).reduce((d,h)=>{let[f,g]=h;return g===void 0||(d[f]=g),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:f,className:g,...y}=h;return Object.entries(y).every(v=>{let[w,S]=v;return Array.isArray(S)?S.includes({...o,...l}[w]):{...o,...l}[w]===S})?[...d,f,g]:d},[]);return eb(e,s,c,n==null?void 0:n.class,n==null?void 0:n.className)},kL=nh("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ve=b.forwardRef(({className:e,variant:t="default",size:n="default",asChild:r=!1,...i},o)=>{const s=r?gL:"button";return p.jsx(s,{className:Pe(kL({variant:t,size:n,className:e})),ref:o,...i})});ve.displayName="Button";const $n=b.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:Pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));$n.displayName="Input";var SL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],CL=SL.reduce((e,t)=>{const n=dx(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:s,...l}=i,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),EL="Label",zC=b.forwardRef((e,t)=>p.jsx(CL.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));zC.displayName=EL;var FC=zC;const NL=nh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),an=b.forwardRef(({className:e,...t},n)=>p.jsx(FC,{ref:n,className:Pe(NL(),e),...t}));an.displayName=FC.displayName;function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function TL(e,t){const n=b.createContext(t),r=o=>{const{children:s,...l}=o,c=b.useMemo(()=>l,Object.values(l));return p.jsx(n.Provider,{value:c,children:s})};r.displayName=e+"Provider";function i(o){const s=b.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function ni(e,t=[]){let n=[];function r(o,s){const l=b.createContext(s),c=n.length;n=[...n,s];const d=f=>{var C;const{scope:g,children:y,...v}=f,w=((C=g==null?void 0:g[e])==null?void 0:C[c])||l,S=b.useMemo(()=>v,Object.values(v));return p.jsx(w.Provider,{value:S,children:y})};d.displayName=o+"Provider";function h(f,g){var w;const y=((w=g==null?void 0:g[e])==null?void 0:w[c])||l,v=b.useContext(y);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[d,h]}const i=()=>{const o=n.map(s=>b.createContext(s));return function(l){const c=(l==null?void 0:l[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,ML(i,...t)]}function ML(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(o)[`__scope${d}`];return{...l,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var qt=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},AL=tx[" useId ".trim().toString()]||(()=>{}),jL=0;function Qr(e){const[t,n]=b.useState(AL());return qt(()=>{n(r=>r??String(jL++))},[e]),t?`radix-${t}`:""}var RL=tx[" useInsertionEffect ".trim().toString()]||qt;function Fo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=PL({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const h=b.useRef(e!==void 0);b.useEffect(()=>{const f=h.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"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.`),h.current=l},[l,r])}const d=b.useCallback(h=>{var f;if(l){const g=OL(h)?h(e):h;g!==e&&((f=s.current)==null||f.call(s,g))}else o(h)},[l,e,o,s]);return[c,d]}function PL({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),o=b.useRef(t);return RL(()=>{o.current=t},[t]),b.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function OL(e){return typeof e=="function"}function IL(e){const t=DL(e),n=b.forwardRef((r,i)=>{const{children:o,...s}=r,l=b.Children.toArray(o),c=l.find(LL);if(c){const d=c.props.children,h=l.map(f=>f===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function DL(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const s=FL(i),l=zL(o,i.props);return i.type!==b.Fragment&&(l.ref=r?qi(r,s):s),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _L=Symbol("radix.slottable");function LL(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_L}function zL(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const c=o(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function FL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $L=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ve=$L.reduce((e,t)=>{const n=IL(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:s,...l}=i,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $C(e,t){e&&zc.flushSync(()=>e.dispatchEvent(t))}function ln(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function BL(e,t=globalThis==null?void 0:globalThis.document){const n=ln(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var VL="DismissableLayer",Jg="dismissableLayer.update",HL="dismissableLayer.pointerDownOutside",UL="dismissableLayer.focusOutside",tb,BC=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bc=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...c}=e,d=b.useContext(BC),[h,f]=b.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=b.useState({}),v=et(t,D=>f(D)),w=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(S),T=h?w.indexOf(h):-1,N=d.layersWithOutsidePointerEventsDisabled.size>0,R=T>=C,I=KL(D=>{const O=D.target,B=[...d.branches].some(_=>_.contains(O));!R||B||(i==null||i(D),s==null||s(D),D.defaultPrevented||l==null||l())},g),j=GL(D=>{const O=D.target;[...d.branches].some(_=>_.contains(O))||(o==null||o(D),s==null||s(D),D.defaultPrevented||l==null||l())},g);return BL(D=>{T===d.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},g),b.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(tb=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),nb(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=tb)}},[h,g,n,d]),b.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),nb())},[h,d]),b.useEffect(()=>{const D=()=>y({});return document.addEventListener(Jg,D),()=>document.removeEventListener(Jg,D)},[]),p.jsx(Ve.div,{...c,ref:v,style:{pointerEvents:N?R?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,j.onFocusCapture),onBlurCapture:we(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,I.onPointerDownCapture)})});Bc.displayName=VL;var WL="DismissableLayerBranch",qL=b.forwardRef((e,t)=>{const n=b.useContext(BC),r=b.useRef(null),i=et(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),p.jsx(Ve.div,{...e,ref:i})});qL.displayName=WL;function KL(e,t=globalThis==null?void 0:globalThis.document){const n=ln(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let c=function(){VC(HL,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function GL(e,t=globalThis==null?void 0:globalThis.document){const n=ln(e),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&VC(UL,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nb(){const e=new CustomEvent(Jg);document.dispatchEvent(e)}function VC(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$C(i,o):i.dispatchEvent(o)}var Im="focusScope.autoFocusOnMount",Dm="focusScope.autoFocusOnUnmount",rb={bubbles:!1,cancelable:!0},YL="FocusScope",rh=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[l,c]=b.useState(null),d=ln(i),h=ln(o),f=b.useRef(null),g=et(t,w=>c(w)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let w=function(N){if(y.paused||!l)return;const R=N.target;l.contains(R)?f.current=R:Co(f.current,{select:!0})},S=function(N){if(y.paused||!l)return;const R=N.relatedTarget;R!==null&&(l.contains(R)||Co(f.current,{select:!0}))},C=function(N){if(document.activeElement===document.body)for(const I of N)I.removedNodes.length>0&&Co(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const T=new MutationObserver(C);return l&&T.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),T.disconnect()}}},[r,l,y.paused]),b.useEffect(()=>{if(l){ob.add(y);const w=document.activeElement;if(!l.contains(w)){const C=new CustomEvent(Im,rb);l.addEventListener(Im,d),l.dispatchEvent(C),C.defaultPrevented||(JL(t3(HC(l)),{select:!0}),document.activeElement===w&&Co(l))}return()=>{l.removeEventListener(Im,d),setTimeout(()=>{const C=new CustomEvent(Dm,rb);l.addEventListener(Dm,h),l.dispatchEvent(C),C.defaultPrevented||Co(w??document.body,{select:!0}),l.removeEventListener(Dm,h),ob.remove(y)},0)}}},[l,d,h,y]);const v=b.useCallback(w=>{if(!n&&!r||y.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(S&&C){const T=w.currentTarget,[N,R]=XL(T);N&&R?!w.shiftKey&&C===R?(w.preventDefault(),n&&Co(N,{select:!0})):w.shiftKey&&C===N&&(w.preventDefault(),n&&Co(R,{select:!0})):C===T&&w.preventDefault()}},[n,r,y.paused]);return p.jsx(Ve.div,{tabIndex:-1,...s,ref:g,onKeyDown:v})});rh.displayName=YL;function JL(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Co(r,{select:t}),document.activeElement!==n)return}function XL(e){const t=HC(e),n=ib(t,e),r=ib(t.reverse(),e);return[n,r]}function HC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ib(e,t){for(const n of e)if(!QL(n,{upTo:t}))return n}function QL(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ZL(e){return e instanceof HTMLInputElement&&"select"in e}function Co(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZL(e)&&t&&e.select()}}var ob=e3();function e3(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sb(e,t),e.unshift(t)},remove(t){var n;e=sb(e,t),(n=e[0])==null||n.resume()}}}function sb(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function t3(e){return e.filter(t=>t.tagName!=="A")}var n3="Portal",Vc=b.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,o]=b.useState(!1);qt(()=>o(!0),[]);const s=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?nx.createPortal(p.jsx(Ve.div,{...r,ref:t}),s):null});Vc.displayName=n3;function r3(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Un=e=>{const{present:t,children:n}=e,r=i3(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=et(r.ref,o3(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};Un.displayName="Presence";function i3(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),o=b.useRef("none"),s=e?"mounted":"unmounted",[l,c]=r3(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=dd(r.current);o.current=l==="mounted"?d:"none"},[l]),qt(()=>{const d=r.current,h=i.current;if(h!==e){const g=o.current,y=dd(d);e?c("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),qt(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,f=y=>{const w=dd(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(c("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=y=>{y.target===t&&(o.current=dd(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:b.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function dd(e){return(e==null?void 0:e.animationName)||"none"}function o3(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _m=0;function fx(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lb()),document.body.insertAdjacentElement("beforeend",e[1]??lb()),_m++,()=>{_m===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_m--}},[])}function lb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var pi=function(){return pi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},pi.apply(this,arguments)};function UC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function s3(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ld="right-scroll-bar-position",zd="width-before-scroll-bar",l3="with-scroll-bars-hidden",a3="--removed-body-scroll-bar-size";function Lm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function c3(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var u3=typeof window<"u"?b.useLayoutEffect:b.useEffect,ab=new WeakMap;function d3(e,t){var n=c3(null,function(r){return e.forEach(function(i){return Lm(i,r)})});return u3(function(){var r=ab.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(l){o.has(l)||Lm(l,null)}),o.forEach(function(l){i.has(l)||Lm(l,s)})}ab.set(n,e)},[e]),n}function f3(e){return e}function h3(e,t){t===void 0&&(t=f3);var n=[],r=!1,i={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]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(o),s=n}var c=function(){var h=s;s=[],h.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){s.push(h),d()},filter:function(h){return s=s.filter(h),n}}}};return i}function p3(e){e===void 0&&(e={});var t=h3(null);return t.options=pi({async:!0,ssr:!1},e),t}var WC=function(e){var t=e.sideCar,n=UC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,pi({},n))};WC.isSideCarExport=!0;function m3(e,t){return e.useMedium(t),WC}var qC=p3(),zm=function(){},ih=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:zm,onWheelCapture:zm,onTouchMoveCapture:zm}),i=r[0],o=r[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,f=e.shards,g=e.sideCar,y=e.noRelative,v=e.noIsolation,w=e.inert,S=e.allowPinchZoom,C=e.as,T=C===void 0?"div":C,N=e.gapMode,R=UC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=g,j=d3([n,t]),D=pi(pi({},R),i);return b.createElement(b.Fragment,null,h&&b.createElement(I,{sideCar:qC,removeScrollBar:d,shards:f,noRelative:y,noIsolation:v,inert:w,setCallbacks:o,allowPinchZoom:!!S,lockRef:n,gapMode:N}),s?b.cloneElement(b.Children.only(l),pi(pi({},D),{ref:j})):b.createElement(T,pi({},D,{className:c,ref:j}),l))});ih.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ih.classNames={fullWidth:zd,zeroRight:Ld};var g3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function y3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=g3();return t&&e.setAttribute("nonce",t),e}function x3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var w3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=y3())&&(x3(t,n),v3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b3=function(){var e=w3();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},KC=function(){var e=b3(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},k3={left:0,top:0,right:0,gap:0},Fm=function(e){return parseInt(e||"",10)||0},S3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Fm(n),Fm(r),Fm(i)]},C3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return k3;var t=S3(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},E3=KC(),Al="data-scroll-locked",N3=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
396
|
+
.`.concat(l3,` {
|
|
397
|
+
overflow: hidden `).concat(r,`;
|
|
398
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
399
|
+
}
|
|
400
|
+
body[`).concat(Al,`] {
|
|
401
|
+
overflow: hidden `).concat(r,`;
|
|
402
|
+
overscroll-behavior: contain;
|
|
403
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
404
|
+
padding-left: `.concat(i,`px;
|
|
405
|
+
padding-top: `).concat(o,`px;
|
|
406
|
+
padding-right: `).concat(s,`px;
|
|
407
|
+
margin-left:0;
|
|
408
|
+
margin-top:0;
|
|
409
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
410
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.`).concat(Ld,` {
|
|
414
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.`).concat(zd,` {
|
|
418
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.`).concat(Ld," .").concat(Ld,` {
|
|
422
|
+
right: 0 `).concat(r,`;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.`).concat(zd," .").concat(zd,` {
|
|
426
|
+
margin-right: 0 `).concat(r,`;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
body[`).concat(Al,`] {
|
|
430
|
+
`).concat(a3,": ").concat(l,`px;
|
|
431
|
+
}
|
|
432
|
+
`)},cb=function(){var e=parseInt(document.body.getAttribute(Al)||"0",10);return isFinite(e)?e:0},T3=function(){b.useEffect(function(){return document.body.setAttribute(Al,(cb()+1).toString()),function(){var e=cb()-1;e<=0?document.body.removeAttribute(Al):document.body.setAttribute(Al,e.toString())}},[])},M3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;T3();var o=b.useMemo(function(){return C3(i)},[i]);return b.createElement(E3,{styles:N3(o,!t,i,n?"":"!important")})},Xg=!1;if(typeof window<"u")try{var fd=Object.defineProperty({},"passive",{get:function(){return Xg=!0,!0}});window.addEventListener("test",fd,fd),window.removeEventListener("test",fd,fd)}catch{Xg=!1}var ml=Xg?{passive:!1}:!1,A3=function(e){return e.tagName==="TEXTAREA"},GC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!A3(e)&&n[t]==="visible")},j3=function(e){return GC(e,"overflowY")},R3=function(e){return GC(e,"overflowX")},ub=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=YC(e,r);if(i){var o=JC(e,r),s=o[1],l=o[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},P3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},O3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},YC=function(e,t){return e==="v"?j3(t):R3(t)},JC=function(e,t){return e==="v"?P3(t):O3(t)},I3=function(e,t){return e==="h"&&t==="rtl"?-1:1},D3=function(e,t,n,r,i){var o=I3(e,window.getComputedStyle(t).direction),s=o*r,l=n.target,c=t.contains(l),d=!1,h=s>0,f=0,g=0;do{if(!l)break;var y=JC(e,l),v=y[0],w=y[1],S=y[2],C=w-S-o*v;(v||C)&&YC(e,l)&&(f+=C,g+=v);var T=l.parentNode;l=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(f)<1||!h&&Math.abs(g)<1)&&(d=!0),d},hd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},db=function(e){return[e.deltaX,e.deltaY]},fb=function(e){return e&&"current"in e?e.current:e},_3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},L3=function(e){return`
|
|
433
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
434
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
435
|
+
`)},z3=0,gl=[];function F3(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(z3++)[0],o=b.useState(KC)[0],s=b.useRef(e);b.useEffect(function(){s.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=s3([e.lockRef.current],(e.shards||[]).map(fb),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=b.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!s.current.allowPinchZoom;var C=hd(w),T=n.current,N="deltaX"in w?w.deltaX:T[0]-C[0],R="deltaY"in w?w.deltaY:T[1]-C[1],I,j=w.target,D=Math.abs(N)>Math.abs(R)?"h":"v";if("touches"in w&&D==="h"&&j.type==="range")return!1;var O=window.getSelection(),B=O&&O.anchorNode,_=B?B===j||B.contains(j):!1;if(_)return!1;var V=ub(D,j);if(!V)return!0;if(V?I=D:(I=D==="v"?"h":"v",V=ub(D,j)),!V)return!1;if(!r.current&&"changedTouches"in w&&(N||R)&&(r.current=I),!I)return!0;var U=r.current||I;return D3(U,S,w,U==="h"?N:R)},[]),c=b.useCallback(function(w){var S=w;if(!(!gl.length||gl[gl.length-1]!==o)){var C="deltaY"in S?db(S):hd(S),T=t.current.filter(function(I){return I.name===S.type&&(I.target===S.target||S.target===I.shadowParent)&&_3(I.delta,C)})[0];if(T&&T.should){S.cancelable&&S.preventDefault();return}if(!T){var N=(s.current.shards||[]).map(fb).filter(Boolean).filter(function(I){return I.contains(S.target)}),R=N.length>0?l(S,N[0]):!s.current.noIsolation;R&&S.cancelable&&S.preventDefault()}}},[]),d=b.useCallback(function(w,S,C,T){var N={name:w,delta:S,target:C,should:T,shadowParent:$3(C)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(R){return R!==N})},1)},[]),h=b.useCallback(function(w){n.current=hd(w),r.current=void 0},[]),f=b.useCallback(function(w){d(w.type,db(w),w.target,l(w,e.lockRef.current))},[]),g=b.useCallback(function(w){d(w.type,hd(w),w.target,l(w,e.lockRef.current))},[]);b.useEffect(function(){return gl.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",c,ml),document.addEventListener("touchmove",c,ml),document.addEventListener("touchstart",h,ml),function(){gl=gl.filter(function(w){return w!==o}),document.removeEventListener("wheel",c,ml),document.removeEventListener("touchmove",c,ml),document.removeEventListener("touchstart",h,ml)}},[]);var y=e.removeScrollBar,v=e.inert;return b.createElement(b.Fragment,null,v?b.createElement(o,{styles:L3(i)}):null,y?b.createElement(M3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const B3=m3(qC,F3);var oh=b.forwardRef(function(e,t){return b.createElement(ih,pi({},e,{ref:t,sideCar:B3}))});oh.classNames=ih.classNames;var V3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yl=new WeakMap,pd=new WeakMap,md={},$m=0,XC=function(e){return e&&(e.host||XC(e.parentNode))},H3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=XC(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},U3=function(e,t,n,r){var i=H3(t,Array.isArray(e)?e:[e]);md[n]||(md[n]=new WeakMap);var o=md[n],s=[],l=new Set,c=new Set(i),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};i.forEach(d);var h=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(g){if(l.has(g))h(g);else try{var y=g.getAttribute(r),v=y!==null&&y!=="false",w=(yl.get(g)||0)+1,S=(o.get(g)||0)+1;yl.set(g,w),o.set(g,S),s.push(g),w===1&&v&&pd.set(g,!0),S===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",g,C)}})};return h(t),l.clear(),$m++,function(){s.forEach(function(f){var g=yl.get(f)-1,y=o.get(f)-1;yl.set(f,g),o.set(f,y),g||(pd.has(f)||f.removeAttribute(r),pd.delete(f)),y||f.removeAttribute(n)}),$m--,$m||(yl=new WeakMap,yl=new WeakMap,pd=new WeakMap,md={})}},hx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=V3(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),U3(r,i,n,"aria-hidden")):function(){return null}};function W3(e){const t=q3(e),n=b.forwardRef((r,i)=>{const{children:o,...s}=r,l=b.Children.toArray(o),c=l.find(G3);if(c){const d=c.props.children,h=l.map(f=>f===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function q3(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const s=J3(i),l=Y3(o,i.props);return i.type!==b.Fragment&&(l.ref=r?qi(r,s):s),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var K3=Symbol("radix.slottable");function G3(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===K3}function Y3(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const c=o(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function J3(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sh="Dialog",[QC]=ni(sh),[X3,ri]=QC(sh),ZC=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,l=b.useRef(null),c=b.useRef(null),[d,h]=Fo({prop:r,defaultProp:i??!1,onChange:o,caller:sh});return p.jsx(X3,{scope:t,triggerRef:l,contentRef:c,contentId:Qr(),titleId:Qr(),descriptionId:Qr(),open:d,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(f=>!f),[h]),modal:s,children:n})};ZC.displayName=sh;var eE="DialogTrigger",Q3=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ri(eE,n),o=et(t,i.triggerRef);return p.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":gx(i.open),...r,ref:o,onClick:we(e.onClick,i.onOpenToggle)})});Q3.displayName=eE;var px="DialogPortal",[Z3,tE]=QC(px,{forceMount:void 0}),nE=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=ri(px,t);return p.jsx(Z3,{scope:t,forceMount:n,children:b.Children.map(r,s=>p.jsx(Un,{present:n||o.open,children:p.jsx(Vc,{asChild:!0,container:i,children:s})}))})};nE.displayName=px;var Jd="DialogOverlay",rE=b.forwardRef((e,t)=>{const n=tE(Jd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ri(Jd,e.__scopeDialog);return o.modal?p.jsx(Un,{present:r||o.open,children:p.jsx(t4,{...i,ref:t})}):null});rE.displayName=Jd;var e4=W3("DialogOverlay.RemoveScroll"),t4=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ri(Jd,n);return p.jsx(oh,{as:e4,allowPinchZoom:!0,shards:[i.contentRef],children:p.jsx(Ve.div,{"data-state":gx(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ms="DialogContent",iE=b.forwardRef((e,t)=>{const n=tE(Ms,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ri(Ms,e.__scopeDialog);return p.jsx(Un,{present:r||o.open,children:o.modal?p.jsx(n4,{...i,ref:t}):p.jsx(r4,{...i,ref:t})})});iE.displayName=Ms;var n4=b.forwardRef((e,t)=>{const n=ri(Ms,e.__scopeDialog),r=b.useRef(null),i=et(t,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return hx(o)},[]),p.jsx(oE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&o.preventDefault()}),onFocusOutside:we(e.onFocusOutside,o=>o.preventDefault())})}),r4=b.forwardRef((e,t)=>{const n=ri(Ms,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return p.jsx(oE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),oE=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,l=ri(Ms,n),c=b.useRef(null),d=et(t,c);return fx(),p.jsxs(p.Fragment,{children:[p.jsx(rh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:p.jsx(Bc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":gx(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(i4,{titleId:l.titleId}),p.jsx(s4,{contentRef:c,descriptionId:l.descriptionId})]})]})}),mx="DialogTitle",sE=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ri(mx,n);return p.jsx(Ve.h2,{id:i.titleId,...r,ref:t})});sE.displayName=mx;var lE="DialogDescription",aE=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ri(lE,n);return p.jsx(Ve.p,{id:i.descriptionId,...r,ref:t})});aE.displayName=lE;var cE="DialogClose",uE=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ri(cE,n);return p.jsx(Ve.button,{type:"button",...r,ref:t,onClick:we(e.onClick,()=>i.onOpenChange(!1))})});uE.displayName=cE;function gx(e){return e?"open":"closed"}var dE="DialogTitleWarning",[rQ,fE]=TL(dE,{contentName:Ms,titleName:mx,docsSlug:"dialog"}),i4=({titleId:e})=>{const t=fE(dE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
436
|
+
|
|
437
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
438
|
+
|
|
439
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},o4="DialogDescriptionWarning",s4=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fE(o4).contentName}}.`;return b.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},l4=ZC,a4=nE,hE=rE,pE=iE,mE=sE,gE=aE,c4=uE;function u4(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var d4=["color"],f4=b.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=u4(e,d4);return b.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),b.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const Rn=l4,h4=a4,yE=b.forwardRef(({className:e,...t},n)=>p.jsx(hE,{ref:n,className:Pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));yE.displayName=hE.displayName;const bn=b.forwardRef(({className:e,children:t,hideCloseButton:n,...r},i)=>p.jsxs(h4,{children:[p.jsx(yE,{}),p.jsxs(pE,{ref:i,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-4 sm:p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...r,children:[t,!n&&p.jsxs(c4,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[p.jsx(f4,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bn.displayName=pE.displayName;const kn=({className:e,...t})=>p.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kn.displayName="DialogHeader";const zr=({className:e,...t})=>p.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zr.displayName="DialogFooter";const Sn=b.forwardRef(({className:e,...t},n)=>p.jsx(mE,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Sn.displayName=mE.displayName;const Bn=b.forwardRef(({className:e,...t},n)=>p.jsx(gE,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Bn.displayName=gE.displayName;function xE({nestId:e,nestName:t,open:n,onOpenChange:r,onDeleted:i}){const[o,s]=b.useState(""),[l,c]=b.useState(!1),[d,h]=b.useState(null);b.useEffect(()=>{n&&(s(""),h(null),c(!1))},[n]);const f=async()=>{c(!0),h(null);try{await i_(e),i()}catch(g){h((g==null?void 0:g.message)??"Failed to delete this nest. You may not have permission, or the server may be unreachable."),c(!1)}};return p.jsx(Rn,{open:n,onOpenChange:g=>{!g&&l||r(g)},children:p.jsxs(bn,{className:"sm:max-w-[440px]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{className:"flex items-center gap-2 text-red-700",children:[p.jsx(_l,{className:"h-4 w-4"}),"Delete nest"]}),p.jsxs(Bn,{children:["You're about to permanently delete"," ",p.jsx("strong",{className:"text-foreground",children:t}),". This cannot be undone."]})]}),p.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-900 space-y-1",children:[p.jsx("p",{className:"font-medium",children:"This will remove:"}),p.jsxs("ul",{className:"list-disc list-inside space-y-0.5",children:[p.jsx("li",{children:"All documents and version history"}),p.jsx("li",{children:"Stewardship assignments and review-queue entries"}),p.jsx("li",{children:"Collaborator access and linked API keys"}),p.jsx("li",{children:"The nest folder on disk"})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(an,{htmlFor:"delete-nest-confirm",className:"text-xs",children:["Type ",p.jsx("strong",{className:"font-mono",children:t})," to confirm:"]}),p.jsx($n,{id:"delete-nest-confirm",value:o,onChange:g=>s(g.target.value),placeholder:t,disabled:l,autoComplete:"off"})]}),d&&p.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-2 text-xs text-red-900",children:d}),p.jsxs(zr,{className:"gap-2",children:[p.jsx(ve,{variant:"outline",onClick:()=>r(!1),disabled:l,children:"Cancel"}),p.jsx(ve,{variant:"destructive",onClick:f,disabled:l||o!==t,children:l?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Deleting..."]}):p.jsxs(p.Fragment,{children:[p.jsx(_l,{className:"h-3.5 w-3.5 mr-2"}),"Delete nest"]})})]})]})})}function p4({onSelectNest:e}){var D;const{adminStatus:t,authMode:n,isAdmin:r}=Fs(),i=((D=t==null?void 0:t.me)==null?void 0:D.email)??null,[o,s]=b.useState([]),[l,c]=b.useState(null),[d,h]=b.useState(!0),[f,g]=b.useState(!1),[y,v]=b.useState(""),[w,S]=b.useState(""),[C,T]=b.useState(null),N=typeof window<"u"?window.location.origin:"http://localhost:3838",R=async()=>{h(!0);try{const[O,B]=await Promise.all([n_(),o_().catch(()=>null)]);s(O.nests),c(B)}catch{}finally{h(!1)}};b.useEffect(()=>{R()},[i]);const I=async O=>{if(O.preventDefault(),!!y.trim())try{await r_(y,w),v(""),S(""),g(!1),R()}catch{}},j=(O,B)=>{T({id:O,name:B})};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs(Bt,{className:"bg-gradient-to-br from-blue-50 to-indigo-50 border-blue-200",children:[p.jsx(on,{className:"pb-3",children:p.jsxs("div",{className:"flex items-start justify-between",children:[p.jsxs("div",{children:[p.jsx(sn,{className:"text-lg",children:"Your Community Server"}),p.jsxs(Ar,{children:["Running at"," ",p.jsx("code",{className:"text-xs bg-white/60 px-1.5 py-0.5 rounded font-mono",children:N}),p.jsx(m4,{value:N})]})]}),p.jsxs("div",{className:"flex gap-6 text-center",children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-2xl font-bold",children:(l==null?void 0:l.nests)??o.length}),p.jsx("div",{className:"text-xs text-muted-foreground",children:"Nests"})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-2xl font-bold",children:l?l.documents:"—"}),p.jsx("div",{className:"text-xs text-muted-foreground",children:"Documents"})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-2xl font-bold",children:l?l.users:"—"}),p.jsx("div",{className:"text-xs text-muted-foreground",children:"Users"})]})]})]})}),p.jsx(Vt,{className:"pt-0",children:p.jsxs("div",{className:"grid md:grid-cols-3 gap-3 text-xs",children:[p.jsx(Bm,{icon:p.jsx(tC,{className:"h-4 w-4"}),title:"Hootie",desc:"Settings → Vault → Remote Server → paste URL"}),p.jsx(Bm,{icon:p.jsx(lC,{className:"h-4 w-4"}),title:"Claude Desktop",desc:"Add MCP endpoint per nest via Connect button"}),p.jsx(Bm,{icon:p.jsx(uC,{className:"h-4 w-4"}),title:"CLI",desc:`ctx --server ${N}`,mono:!0})]})})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-xl font-semibold",children:"Nests"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Shared knowledge vaults for your team"})]}),p.jsxs(ve,{onClick:()=>g(!0),children:[p.jsx(Gg,{className:"h-4 w-4 mr-2"}),"New Nest"]})]}),f&&p.jsx(Bt,{children:p.jsx(Vt,{className:"pt-6",children:p.jsxs("form",{onSubmit:I,className:"space-y-3",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx(an,{children:"Name"}),p.jsx($n,{placeholder:"Team Knowledge",value:y,onChange:O=>v(O.target.value),autoFocus:!0})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(an,{children:"Description (optional)"}),p.jsx($n,{placeholder:"Shared docs for the engineering team",value:w,onChange:O=>S(O.target.value)})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(ve,{type:"submit",children:"Create Nest"}),p.jsx(ve,{type:"button",variant:"outline",onClick:()=>g(!1),children:"Cancel"})]})]})})}),d?p.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading..."}):o.length===0?p.jsx(Bt,{children:p.jsxs(Vt,{className:"text-center py-12",children:[p.jsx(TI,{className:"h-12 w-12 mx-auto text-muted-foreground mb-3"}),p.jsx("p",{className:"font-medium",children:"No nests yet"}),p.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your first nest to start sharing knowledge with your team"}),p.jsxs(ve,{onClick:()=>g(!0),children:[p.jsx(Gg,{className:"h-4 w-4 mr-2"}),"Create First Nest"]})]})}):p.jsx(p.Fragment,{children:p.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:o.map(O=>{const B=O.user_id===S_,_=()=>e(O.id,O.name,O.is_owner??(O.permission??"owner")==="owner",B),V=O.permission??"owner",U=O.is_owner??V==="owner",Z=!U,K=U||B&&n!=="open"&&r,W=V==="admin"?"Admin":V==="write"?"Editor":V==="read"?"Viewer":null,X=V==="admin"?tr:V==="write"?th:V==="read"?$c:null;return p.jsxs("div",{role:"button",tabIndex:0,onClick:_,onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&(te.preventDefault(),_())},className:`relative text-left p-4 rounded-lg border bg-card hover:bg-secondary/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${B?"border-dashed border-amber-300":"border-border"}`,children:[K&&p.jsx("button",{type:"button","aria-label":`Delete nest ${O.name}`,title:"Delete nest",onClick:te=>{te.stopPropagation(),j(O.id,O.name)},className:"absolute top-2 right-2 p-1.5 rounded-md text-muted-foreground hover:text-red-600 hover:bg-red-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:p.jsx(_l,{className:"h-3.5 w-3.5"})}),p.jsxs("div",{className:"flex items-start gap-3 pr-7",children:[p.jsx("div",{className:`p-2 rounded-md ${B?"bg-amber-100":"bg-primary/10"}`,children:B?p.jsx(zI,{className:"h-5 w-5 text-amber-700"}):p.jsx(zo,{className:"h-5 w-5 text-primary"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("h3",{className:"font-medium truncate",children:O.name}),O.description&&p.jsx("p",{className:"text-sm text-muted-foreground truncate mt-0.5",children:O.description}),Z&&p.jsxs("p",{className:"flex items-center gap-1 mt-1 text-xs text-blue-700 truncate",title:O.owner_email?`Shared by ${O.owner_email}`:"Shared with you",children:[p.jsx(sx,{className:"h-3 w-3 shrink-0"}),p.jsxs("span",{className:"truncate",children:["Shared by"," ",p.jsx("span",{className:"font-medium",children:O.owner_email||"unknown user"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground flex-wrap",children:[B&&p.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-50 text-amber-800 border border-amber-200",title:"Owned by the anonymous admin — no stewardship applied",children:"Ungoverned"}),Z&&W&&X&&p.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded border ${V==="read"?"bg-slate-50 text-slate-700 border-slate-200":V==="write"?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-purple-50 text-purple-700 border-purple-200"}`,title:V==="read"?"View only — you can read but not edit":V==="write"?"Editor — you can read and edit documents":"Admin — full access except deleting the nest",children:[p.jsx(X,{className:"h-3 w-3"}),W]}),p.jsx("span",{className:`px-1.5 py-0.5 rounded ${O.visibility==="public"?"bg-green-100 text-green-700":"bg-secondary text-secondary-foreground"}`,children:O.visibility}),p.jsx("span",{children:new Date(O.created_at).toLocaleDateString()})]})]})]})]},O.id)})})}),C&&p.jsx(xE,{nestId:C.id,nestName:C.name,open:!0,onOpenChange:O=>{O||T(null)},onDeleted:async()=>{T(null),await R()}})]})}function Bm({icon:e,title:t,desc:n,mono:r}){return p.jsxs("div",{className:"flex items-start gap-2 p-2 rounded bg-white/40",children:[p.jsx("div",{className:"text-muted-foreground mt-0.5",children:e}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"font-medium text-foreground",children:t}),p.jsx("div",{className:`text-muted-foreground ${r?"font-mono text-[10px]":""} truncate`,children:n})]})]})}function m4({value:e}){const[t,n]=b.useState(!1);return p.jsx("button",{onClick:async r=>{r.stopPropagation(),await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1200)},className:"ml-1 inline-flex items-center hover:text-foreground",children:t?p.jsx(zs,{className:"h-3 w-3 text-green-600"}):p.jsx(Fc,{className:"h-3 w-3"})})}function hb(e){const t=g4(e),n=b.forwardRef((r,i)=>{const{children:o,...s}=r,l=b.Children.toArray(o),c=l.find(x4);if(c){const d=c.props.children,h=l.map(f=>f===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function g4(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const s=w4(i),l=v4(o,i.props);return i.type!==b.Fragment&&(l.ref=r?qi(r,s):s),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y4=Symbol("radix.slottable");function x4(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===y4}function v4(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const c=o(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function w4(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function yx(e){const t=e+"CollectionProvider",[n,r]=ni(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=w=>{const{scope:S,children:C}=w,T=ce.useRef(null),N=ce.useRef(new Map).current;return p.jsx(i,{scope:S,itemMap:N,collectionRef:T,children:C})};s.displayName=t;const l=e+"CollectionSlot",c=hb(l),d=ce.forwardRef((w,S)=>{const{scope:C,children:T}=w,N=o(l,C),R=et(S,N.collectionRef);return p.jsx(c,{ref:R,children:T})});d.displayName=l;const h=e+"CollectionItemSlot",f="data-radix-collection-item",g=hb(h),y=ce.forwardRef((w,S)=>{const{scope:C,children:T,...N}=w,R=ce.useRef(null),I=et(S,R),j=o(h,C);return ce.useEffect(()=>(j.itemMap.set(R,{ref:R,...N}),()=>void j.itemMap.delete(R))),p.jsx(g,{[f]:"",ref:I,children:T})});y.displayName=h;function v(w){const S=o(e+"CollectionConsumer",w);return ce.useCallback(()=>{const T=S.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((j,D)=>N.indexOf(j.ref.current)-N.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:s,Slot:d,ItemSlot:y},v,r]}var b4=b.createContext(void 0);function Hc(e){const t=b.useContext(b4);return e||t||"ltr"}var Vm="rovingFocusGroup.onEntryFocus",k4={bubbles:!1,cancelable:!0},Uc="RovingFocusGroup",[Qg,vE,S4]=yx(Uc),[C4,lh]=ni(Uc,[S4]),[E4,N4]=C4(Uc),wE=b.forwardRef((e,t)=>p.jsx(Qg.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Qg.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(T4,{...e,ref:t})})}));wE.displayName=Uc;var T4=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,g=b.useRef(null),y=et(t,g),v=Hc(o),[w,S]=Fo({prop:s,defaultProp:l??null,onChange:c,caller:Uc}),[C,T]=b.useState(!1),N=ln(d),R=vE(n),I=b.useRef(!1),[j,D]=b.useState(0);return b.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(Vm,N),()=>O.removeEventListener(Vm,N)},[N]),p.jsx(E4,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:w,onItemFocus:b.useCallback(O=>S(O),[S]),onItemShiftTab:b.useCallback(()=>T(!0),[]),onFocusableItemAdd:b.useCallback(()=>D(O=>O+1),[]),onFocusableItemRemove:b.useCallback(()=>D(O=>O-1),[]),children:p.jsx(Ve.div,{tabIndex:C||j===0?-1:0,"data-orientation":r,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{I.current=!0}),onFocus:we(e.onFocus,O=>{const B=!I.current;if(O.target===O.currentTarget&&B&&!C){const _=new CustomEvent(Vm,k4);if(O.currentTarget.dispatchEvent(_),!_.defaultPrevented){const V=R().filter(X=>X.focusable),U=V.find(X=>X.active),Z=V.find(X=>X.id===w),W=[U,Z,...V].filter(Boolean).map(X=>X.ref.current);SE(W,h)}}I.current=!1}),onBlur:we(e.onBlur,()=>T(!1))})})}),bE="RovingFocusGroupItem",kE=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...l}=e,c=Qr(),d=o||c,h=N4(bE,n),f=h.currentTabStopId===d,g=vE(n),{onFocusableItemAdd:y,onFocusableItemRemove:v,currentTabStopId:w}=h;return b.useEffect(()=>{if(r)return y(),()=>v()},[r,y,v]),p.jsx(Qg.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:p.jsx(Ve.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:we(e.onMouseDown,S=>{r?h.onItemFocus(d):S.preventDefault()}),onFocus:we(e.onFocus,()=>h.onItemFocus(d)),onKeyDown:we(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const C=j4(S,h.orientation,h.dir);if(C!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(R=>R.focusable).map(R=>R.ref.current);if(C==="last")N.reverse();else if(C==="prev"||C==="next"){C==="prev"&&N.reverse();const R=N.indexOf(S.currentTarget);N=h.loop?R4(N,R+1):N.slice(R+1)}setTimeout(()=>SE(N))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:w!=null}):s})})});kE.displayName=bE;var M4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function A4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function j4(e,t,n){const r=A4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return M4[r]}function SE(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function R4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CE=wE,EE=kE,ah="Tabs",[P4]=ni(ah,[lh]),NE=lh(),[O4,xx]=P4(ah),TE=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,h=Hc(l),[f,g]=Fo({prop:r,onChange:i,defaultProp:o??"",caller:ah});return p.jsx(O4,{scope:n,baseId:Qr(),value:f,onValueChange:g,orientation:s,dir:h,activationMode:c,children:p.jsx(Ve.div,{dir:h,"data-orientation":s,...d,ref:t})})});TE.displayName=ah;var ME="TabsList",AE=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=xx(ME,n),s=NE(n);return p.jsx(CE,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:p.jsx(Ve.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});AE.displayName=ME;var jE="TabsTrigger",RE=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=xx(jE,n),l=NE(n),c=IE(s.baseId,r),d=DE(s.baseId,r),h=r===s.value;return p.jsx(EE,{asChild:!0,...l,focusable:!i,active:h,children:p.jsx(Ve.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...o,ref:t,onMouseDown:we(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:we(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const f=s.activationMode!=="manual";!h&&!i&&f&&s.onValueChange(r)})})})});RE.displayName=jE;var PE="TabsContent",OE=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,l=xx(PE,n),c=IE(l.baseId,r),d=DE(l.baseId,r),h=r===l.value,f=b.useRef(h);return b.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),p.jsx(Un,{present:i||h,children:({present:g})=>p.jsx(Ve.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:g&&o})})});OE.displayName=PE;function IE(e,t){return`${e}-trigger-${t}`}function DE(e,t){return`${e}-content-${t}`}var I4=TE,_E=AE,LE=RE,zE=OE;const FE=I4,vx=b.forwardRef(({className:e,...t},n)=>p.jsx(_E,{ref:n,className:Pe("inline-flex min-h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));vx.displayName=_E.displayName;const zi=b.forwardRef(({className:e,...t},n)=>p.jsx(LE,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));zi.displayName=LE.displayName;const Fi=b.forwardRef(({className:e,...t},n)=>p.jsx(zE,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Fi.displayName=zE.displayName;const D4=["top","right","bottom","left"],$o=Math.min,dr=Math.max,Xd=Math.round,gd=Math.floor,gi=e=>({x:e,y:e}),_4={left:"right",right:"left",bottom:"top",top:"bottom"};function Zg(e,t,n){return dr(e,$o(t,n))}function Ui(e,t){return typeof e=="function"?e(t):e}function Wi(e){return e.split("-")[0]}function Gl(e){return e.split("-")[1]}function wx(e){return e==="x"?"y":"x"}function bx(e){return e==="y"?"height":"width"}function mi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function kx(e){return wx(mi(e))}function L4(e,t,n){n===void 0&&(n=!1);const r=Gl(e),i=kx(e),o=bx(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Qd(s)),[s,Qd(s)]}function z4(e){const t=Qd(e);return[ey(e),t,ey(t)]}function ey(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const pb=["left","right"],mb=["right","left"],F4=["top","bottom"],$4=["bottom","top"];function B4(e,t,n){switch(e){case"top":case"bottom":return n?t?mb:pb:t?pb:mb;case"left":case"right":return t?F4:$4;default:return[]}}function V4(e,t,n,r){const i=Gl(e);let o=B4(Wi(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(ey)))),o}function Qd(e){const t=Wi(e);return _4[t]+e.slice(t.length)}function H4(e){return{top:0,right:0,bottom:0,left:0,...e}}function $E(e){return typeof e!="number"?H4(e):{top:e,right:e,bottom:e,left:e}}function Zd(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gb(e,t,n){let{reference:r,floating:i}=e;const o=mi(t),s=kx(t),l=bx(s),c=Wi(t),d=o==="y",h=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[l]/2-i[l]/2;let y;switch(c){case"top":y={x:h,y:r.y-i.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:f};break;case"left":y={x:r.x-i.width,y:f};break;default:y={x:r.x,y:r.y}}switch(Gl(t)){case"start":y[s]-=g*(n&&d?-1:1);break;case"end":y[s]+=g*(n&&d?-1:1);break}return y}async function U4(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:y=0}=Ui(t,e),v=$E(y),S=l[g?f==="floating"?"reference":"floating":f],C=Zd(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(S)))==null||n?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),T=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),R=await(o.isElement==null?void 0:o.isElement(N))?await(o.getScale==null?void 0:o.getScale(N))||{x:1,y:1}:{x:1,y:1},I=Zd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:T,offsetParent:N,strategy:c}):T);return{top:(C.top-I.top+v.top)/R.y,bottom:(I.bottom-C.bottom+v.bottom)/R.y,left:(C.left-I.left+v.left)/R.x,right:(I.right-C.right+v.right)/R.x}}const W4=50,q4=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:U4},c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:f}=gb(d,r,c),g=r,y=0;const v={};for(let w=0;w<o.length;w++){const S=o[w];if(!S)continue;const{name:C,fn:T}=S,{x:N,y:R,data:I,reset:j}=await T({x:h,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:v,rects:d,platform:l,elements:{reference:e,floating:t}});h=N??h,f=R??f,v[C]={...v[C],...I},j&&y<W4&&(y++,typeof j=="object"&&(j.placement&&(g=j.placement),j.rects&&(d=j.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):j.rects),{x:h,y:f}=gb(d,g,c)),w=-1)}return{x:h,y:f,placement:g,strategy:i,middlewareData:v}},K4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=Ui(e,t)||{};if(d==null)return{};const f=$E(h),g={x:n,y:r},y=kx(i),v=bx(y),w=await s.getDimensions(d),S=y==="y",C=S?"top":"left",T=S?"bottom":"right",N=S?"clientHeight":"clientWidth",R=o.reference[v]+o.reference[y]-g[y]-o.floating[v],I=g[y]-o.reference[y],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let D=j?j[N]:0;(!D||!await(s.isElement==null?void 0:s.isElement(j)))&&(D=l.floating[N]||o.floating[v]);const O=R/2-I/2,B=D/2-w[v]/2-1,_=$o(f[C],B),V=$o(f[T],B),U=_,Z=D-w[v]-V,K=D/2-w[v]/2+O,W=Zg(U,K,Z),X=!c.arrow&&Gl(i)!=null&&K!==W&&o.reference[v]/2-(K<U?_:V)-w[v]/2<0,te=X?K<U?K-U:K-Z:0;return{[y]:g[y]+te,data:{[y]:W,centerOffset:K-W-te,...X&&{alignmentOffset:te}},reset:X}}}),G4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...S}=Ui(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=Wi(i),T=mi(l),N=Wi(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(d.floating)),I=g||(N||!w?[Qd(l)]:z4(l)),j=v!=="none";!g&&j&&I.push(...V4(l,w,v,R));const D=[l,...I],O=await c.detectOverflow(t,S),B=[];let _=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&B.push(O[C]),f){const K=L4(i,s,R);B.push(O[K[0]],O[K[1]])}if(_=[..._,{placement:i,overflows:B}],!B.every(K=>K<=0)){var V,U;const K=(((V=o.flip)==null?void 0:V.index)||0)+1,W=D[K];if(W&&(!(f==="alignment"?T!==mi(W):!1)||_.every(q=>mi(q.placement)===T?q.overflows[0]>0:!0)))return{data:{index:K,overflows:_},reset:{placement:W}};let X=(U=_.filter(te=>te.overflows[0]<=0).sort((te,q)=>te.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!X)switch(y){case"bestFit":{var Z;const te=(Z=_.filter(q=>{if(j){const Y=mi(q.placement);return Y===T||Y==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(Y=>Y>0).reduce((Y,A)=>Y+A,0)]).sort((q,Y)=>q[1]-Y[1])[0])==null?void 0:Z[0];te&&(X=te);break}case"initialPlacement":X=l;break}if(i!==X)return{reset:{placement:X}}}return{}}}};function yb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xb(e){return D4.some(t=>e[t]>=0)}const Y4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=Ui(e,t);switch(i){case"referenceHidden":{const s=await r.detectOverflow(t,{...o,elementContext:"reference"}),l=yb(s,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:xb(l)}}}case"escaped":{const s=await r.detectOverflow(t,{...o,altBoundary:!0}),l=yb(s,n.floating);return{data:{escapedOffsets:l,escaped:xb(l)}}}default:return{}}}}},BE=new Set(["left","top"]);async function J4(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Wi(n),l=Gl(n),c=mi(n)==="y",d=BE.has(s)?-1:1,h=o&&c?-1:1,f=Ui(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(y=l==="end"?v*-1:v),c?{x:y*h,y:g*d}:{x:g*d,y:y*h}}const X4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=t,c=await J4(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Q4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:C=>{let{x:T,y:N}=C;return{x:T,y:N}}},...d}=Ui(e,t),h={x:n,y:r},f=await o.detectOverflow(t,d),g=mi(Wi(i)),y=wx(g);let v=h[y],w=h[g];if(s){const C=y==="y"?"top":"left",T=y==="y"?"bottom":"right",N=v+f[C],R=v-f[T];v=Zg(N,v,R)}if(l){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",N=w+f[C],R=w-f[T];w=Zg(N,w,R)}const S=c.fn({...t,[y]:v,[g]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[y]:s,[g]:l}}}}}},Z4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Ui(e,t),h={x:n,y:r},f=mi(i),g=wx(f);let y=h[g],v=h[f];const w=Ui(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const N=g==="y"?"height":"width",R=o.reference[g]-o.floating[N]+S.mainAxis,I=o.reference[g]+o.reference[N]-S.mainAxis;y<R?y=R:y>I&&(y=I)}if(d){var C,T;const N=g==="y"?"width":"height",R=BE.has(Wi(i)),I=o.reference[f]-o.floating[N]+(R&&((C=s.offset)==null?void 0:C[f])||0)+(R?0:S.crossAxis),j=o.reference[f]+o.reference[N]+(R?0:((T=s.offset)==null?void 0:T[f])||0)-(R?S.crossAxis:0);v<I?v=I:v>j&&(v=j)}return{[g]:y,[f]:v}}}},e5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Ui(e,t),h=await s.detectOverflow(t,d),f=Wi(i),g=Gl(i),y=mi(i)==="y",{width:v,height:w}=o.floating;let S,C;f==="top"||f==="bottom"?(S=f,C=g===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(C=f,S=g==="end"?"top":"bottom");const T=w-h.top-h.bottom,N=v-h.left-h.right,R=$o(w-h[S],T),I=$o(v-h[C],N),j=!t.middlewareData.shift;let D=R,O=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=T),j&&!g){const _=dr(h.left,0),V=dr(h.right,0),U=dr(h.top,0),Z=dr(h.bottom,0);y?O=v-2*(_!==0||V!==0?_+V:dr(h.left,h.right)):D=w-2*(U!==0||Z!==0?U+Z:dr(h.top,h.bottom))}await c({...t,availableWidth:O,availableHeight:D});const B=await s.getDimensions(l.floating);return v!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function ch(){return typeof window<"u"}function Yl(e){return VE(e)?(e.nodeName||"").toLowerCase():"#document"}function hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vi(e){var t;return(t=(VE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function VE(e){return ch()?e instanceof Node||e instanceof hr(e).Node:!1}function ei(e){return ch()?e instanceof Element||e instanceof hr(e).Element:!1}function Ki(e){return ch()?e instanceof HTMLElement||e instanceof hr(e).HTMLElement:!1}function vb(e){return!ch()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hr(e).ShadowRoot}function Wc(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ti(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function t5(e){return/^(table|td|th)$/.test(Yl(e))}function uh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const n5=/transform|translate|scale|rotate|perspective|filter/,r5=/paint|layout|strict|content/,ps=e=>!!e&&e!=="none";let Hm;function Sx(e){const t=ei(e)?ti(e):e;return ps(t.transform)||ps(t.translate)||ps(t.scale)||ps(t.rotate)||ps(t.perspective)||!Cx()&&(ps(t.backdropFilter)||ps(t.filter))||n5.test(t.willChange||"")||r5.test(t.contain||"")}function i5(e){let t=Bo(e);for(;Ki(t)&&!Ll(t);){if(Sx(t))return t;if(uh(t))return null;t=Bo(t)}return null}function Cx(){return Hm==null&&(Hm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hm}function Ll(e){return/^(html|body|#document)$/.test(Yl(e))}function ti(e){return hr(e).getComputedStyle(e)}function dh(e){return ei(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bo(e){if(Yl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vb(e)&&e.host||vi(e);return vb(t)?t.host:t}function HE(e){const t=Bo(e);return Ll(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ki(t)&&Wc(t)?t:HE(t)}function vc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=HE(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=hr(i);if(o){const l=ty(s);return t.concat(s,s.visualViewport||[],Wc(i)?i:[],l&&n?vc(l):[])}else return t.concat(i,vc(i,[],n))}function ty(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function UE(e){const t=ti(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ki(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,l=Xd(n)!==o||Xd(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ex(e){return ei(e)?e:e.contextElement}function jl(e){const t=Ex(e);if(!Ki(t))return gi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=UE(t);let s=(o?Xd(n.width):n.width)/r,l=(o?Xd(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const o5=gi(0);function WE(e){const t=hr(e);return!Cx()||!t.visualViewport?o5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function s5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hr(e)?!1:t}function As(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ex(e);let s=gi(1);t&&(r?ei(r)&&(s=jl(r)):s=jl(e));const l=s5(o,n,r)?WE(o):gi(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,h=i.width/s.x,f=i.height/s.y;if(o){const g=hr(o),y=r&&ei(r)?hr(r):r;let v=g,w=ty(v);for(;w&&r&&y!==v;){const S=jl(w),C=w.getBoundingClientRect(),T=ti(w),N=C.left+(w.clientLeft+parseFloat(T.paddingLeft))*S.x,R=C.top+(w.clientTop+parseFloat(T.paddingTop))*S.y;c*=S.x,d*=S.y,h*=S.x,f*=S.y,c+=N,d+=R,v=hr(w),w=ty(v)}}return Zd({width:h,height:f,x:c,y:d})}function fh(e,t){const n=dh(e).scrollLeft;return t?t.left+n:As(vi(e)).left+n}function qE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-fh(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function l5(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=vi(r),l=t?uh(t.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=gi(1);const h=gi(0),f=Ki(r);if((f||!f&&!o)&&((Yl(r)!=="body"||Wc(s))&&(c=dh(r)),f)){const y=As(r);d=jl(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const g=s&&!f&&!o?qE(s,c):gi(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-c.scrollTop*d.y+h.y+g.y}}function a5(e){return Array.from(e.getClientRects())}function c5(e){const t=vi(e),n=dh(e),r=e.ownerDocument.body,i=dr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=dr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+fh(e);const l=-n.scrollTop;return ti(r).direction==="rtl"&&(s+=dr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}const wb=25;function u5(e,t){const n=hr(e),r=vi(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const h=Cx();(!h||h&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const d=fh(r);if(d<=0){const h=r.ownerDocument,f=h.body,g=getComputedStyle(f),y=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-y);v<=wb&&(o-=v)}else d<=wb&&(o+=d);return{width:o,height:s,x:l,y:c}}function d5(e,t){const n=As(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ki(e)?jl(e):gi(1),s=e.clientWidth*o.x,l=e.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function bb(e,t,n){let r;if(t==="viewport")r=u5(e,n);else if(t==="document")r=c5(vi(e));else if(ei(t))r=d5(t,n);else{const i=WE(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Zd(r)}function KE(e,t){const n=Bo(e);return n===t||!ei(n)||Ll(n)?!1:ti(n).position==="fixed"||KE(n,t)}function f5(e,t){const n=t.get(e);if(n)return n;let r=vc(e,[],!1).filter(l=>ei(l)&&Yl(l)!=="body"),i=null;const o=ti(e).position==="fixed";let s=o?Bo(e):e;for(;ei(s)&&!Ll(s);){const l=ti(s),c=Sx(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Wc(s)&&!c&&KE(e,s))?r=r.filter(h=>h!==s):i=l,s=Bo(s)}return t.set(e,r),r}function h5(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?uh(t)?[]:f5(t,this._c):[].concat(n),r],l=bb(t,s[0],i);let c=l.top,d=l.right,h=l.bottom,f=l.left;for(let g=1;g<s.length;g++){const y=bb(t,s[g],i);c=dr(y.top,c),d=$o(y.right,d),h=$o(y.bottom,h),f=dr(y.left,f)}return{width:d-f,height:h-c,x:f,y:c}}function p5(e){const{width:t,height:n}=UE(e);return{width:t,height:n}}function m5(e,t,n){const r=Ki(t),i=vi(t),o=n==="fixed",s=As(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=gi(0);function d(){c.x=fh(i)}if(r||!r&&!o)if((Yl(t)!=="body"||Wc(i))&&(l=dh(t)),r){const y=As(t,!0,o,t);c.x=y.x+t.clientLeft,c.y=y.y+t.clientTop}else i&&d();o&&!r&&i&&d();const h=i&&!r&&!o?qE(i,l):gi(0),f=s.left+l.scrollLeft-c.x-h.x,g=s.top+l.scrollTop-c.y-h.y;return{x:f,y:g,width:s.width,height:s.height}}function Um(e){return ti(e).position==="static"}function kb(e,t){if(!Ki(e)||ti(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vi(e)===n&&(n=n.ownerDocument.body),n}function GE(e,t){const n=hr(e);if(uh(e))return n;if(!Ki(e)){let i=Bo(e);for(;i&&!Ll(i);){if(ei(i)&&!Um(i))return i;i=Bo(i)}return n}let r=kb(e,t);for(;r&&t5(r)&&Um(r);)r=kb(r,t);return r&&Ll(r)&&Um(r)&&!Sx(r)?n:r||i5(e)||n}const g5=async function(e){const t=this.getOffsetParent||GE,n=this.getDimensions,r=await n(e.floating);return{reference:m5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function y5(e){return ti(e).direction==="rtl"}const x5={convertOffsetParentRelativeRectToViewportRelativeRect:l5,getDocumentElement:vi,getClippingRect:h5,getOffsetParent:GE,getElementRects:g5,getClientRects:a5,getDimensions:p5,getScale:jl,isElement:ei,isRTL:y5};function YE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function v5(e,t){let n=null,r;const i=vi(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const d=e.getBoundingClientRect(),{left:h,top:f,width:g,height:y}=d;if(l||t(),!g||!y)return;const v=gd(f),w=gd(i.clientWidth-(h+g)),S=gd(i.clientHeight-(f+y)),C=gd(h),N={rootMargin:-v+"px "+-w+"px "+-S+"px "+-C+"px",threshold:dr(0,$o(1,c))||1};let R=!0;function I(j){const D=j[0].intersectionRatio;if(D!==c){if(!R)return s();D?s(!1,D):r=setTimeout(()=>{s(!1,1e-7)},1e3)}D===1&&!YE(d,e.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(I,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,N)}n.observe(e)}return s(!0),o}function w5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Ex(e),h=i||o?[...d?vc(d):[],...t?vc(t):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const f=d&&l?v5(d,n):null;let g=-1,y=null;s&&(y=new ResizeObserver(C=>{let[T]=C;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(t)})),n()}),d&&!c&&y.observe(d),t&&y.observe(t));let v,w=c?As(e):null;c&&S();function S(){const C=As(e);w&&!YE(w,C)&&n(),w=C,v=requestAnimationFrame(S)}return n(),()=>{var C;h.forEach(T=>{i&&T.removeEventListener("scroll",n),o&&T.removeEventListener("resize",n)}),f==null||f(),(C=y)==null||C.disconnect(),y=null,c&&cancelAnimationFrame(v)}}const b5=X4,k5=Q4,S5=G4,C5=e5,E5=Y4,Sb=K4,N5=Z4,T5=(e,t,n)=>{const r=new Map,i={platform:x5,...n},o={...i.platform,_c:r};return q4(e,t,{...i,platform:o})};var M5=typeof document<"u",A5=function(){},Fd=M5?b.useLayoutEffect:A5;function ef(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ef(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ef(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function JE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cb(e,t){const n=JE(e);return Math.round(t*n)/n}function Wm(e){const t=b.useRef(e);return Fd(()=>{t.current=e}),t}function j5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[h,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=b.useState(r);ef(g,r)||y(r);const[v,w]=b.useState(null),[S,C]=b.useState(null),T=b.useCallback(q=>{q!==j.current&&(j.current=q,w(q))},[]),N=b.useCallback(q=>{q!==D.current&&(D.current=q,C(q))},[]),R=o||v,I=s||S,j=b.useRef(null),D=b.useRef(null),O=b.useRef(h),B=c!=null,_=Wm(c),V=Wm(i),U=Wm(d),Z=b.useCallback(()=>{if(!j.current||!D.current)return;const q={placement:t,strategy:n,middleware:g};V.current&&(q.platform=V.current),T5(j.current,D.current,q).then(Y=>{const A={...Y,isPositioned:U.current!==!1};K.current&&!ef(O.current,A)&&(O.current=A,zc.flushSync(()=>{f(A)}))})},[g,t,n,V,U]);Fd(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[d]);const K=b.useRef(!1);Fd(()=>(K.current=!0,()=>{K.current=!1}),[]),Fd(()=>{if(R&&(j.current=R),I&&(D.current=I),R&&I){if(_.current)return _.current(R,I,Z);Z()}},[R,I,Z,_,B]);const W=b.useMemo(()=>({reference:j,floating:D,setReference:T,setFloating:N}),[T,N]),X=b.useMemo(()=>({reference:R,floating:I}),[R,I]),te=b.useMemo(()=>{const q={position:n,left:0,top:0};if(!X.floating)return q;const Y=Cb(X.floating,h.x),A=Cb(X.floating,h.y);return l?{...q,transform:"translate("+Y+"px, "+A+"px)",...JE(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:A}},[n,l,X.floating,h.x,h.y]);return b.useMemo(()=>({...h,update:Z,refs:W,elements:X,floatingStyles:te}),[h,Z,W,X,te])}const R5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Sb({element:r.current,padding:i}).fn(n):{}:r?Sb({element:r,padding:i}).fn(n):{}}}},P5=(e,t)=>{const n=b5(e);return{name:n.name,fn:n.fn,options:[e,t]}},O5=(e,t)=>{const n=k5(e);return{name:n.name,fn:n.fn,options:[e,t]}},I5=(e,t)=>({fn:N5(e).fn,options:[e,t]}),D5=(e,t)=>{const n=S5(e);return{name:n.name,fn:n.fn,options:[e,t]}},_5=(e,t)=>{const n=C5(e);return{name:n.name,fn:n.fn,options:[e,t]}},L5=(e,t)=>{const n=E5(e);return{name:n.name,fn:n.fn,options:[e,t]}},z5=(e,t)=>{const n=R5(e);return{name:n.name,fn:n.fn,options:[e,t]}};var F5="Arrow",XE=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return p.jsx(Ve.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});XE.displayName=F5;var $5=XE;function QE(e){const[t,n]=b.useState(void 0);return qt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,l;if("borderBoxSize"in o){const c=o.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Nx="Popper",[ZE,Jl]=ni(Nx),[B5,eN]=ZE(Nx),tN=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return p.jsx(B5,{scope:t,anchor:r,onAnchorChange:i,children:n})};tN.displayName=Nx;var nN="PopperAnchor",rN=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=eN(nN,n),s=b.useRef(null),l=et(t,s),c=b.useRef(null);return b.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||s.current,d!==c.current&&o.onAnchorChange(c.current)}),r?null:p.jsx(Ve.div,{...i,ref:l})});rN.displayName=nN;var Tx="PopperContent",[V5,H5]=ZE(Tx),iN=b.forwardRef((e,t)=>{var ne,oe,me,Ce,Ae,Fe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:v,...w}=e,S=eN(Tx,n),[C,T]=b.useState(null),N=et(t,it=>T(it)),[R,I]=b.useState(null),j=QE(R),D=(j==null?void 0:j.width)??0,O=(j==null?void 0:j.height)??0,B=r+(o!=="center"?"-"+o:""),_=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},V=Array.isArray(d)?d:[d],U=V.length>0,Z={padding:_,boundary:V.filter(W5),altBoundary:U},{refs:K,floatingStyles:W,placement:X,isPositioned:te,middlewareData:q}=j5({strategy:"fixed",placement:B,whileElementsMounted:(...it)=>w5(...it,{animationFrame:y==="always"}),elements:{reference:S.anchor},middleware:[P5({mainAxis:i+O,alignmentAxis:s}),c&&O5({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?I5():void 0,...Z}),c&&D5({...Z}),_5({...Z,apply:({elements:it,rects:lt,availableWidth:_t,availableHeight:Mt})=>{const{width:dt,height:ir}=lt.reference,pt=it.floating.style;pt.setProperty("--radix-popper-available-width",`${_t}px`),pt.setProperty("--radix-popper-available-height",`${Mt}px`),pt.setProperty("--radix-popper-anchor-width",`${dt}px`),pt.setProperty("--radix-popper-anchor-height",`${ir}px`)}}),R&&z5({element:R,padding:l}),q5({arrowWidth:D,arrowHeight:O}),g&&L5({strategy:"referenceHidden",...Z})]}),[Y,A]=lN(X),z=ln(v);qt(()=>{te&&(z==null||z())},[te,z]);const Q=(ne=q.arrow)==null?void 0:ne.x,P=(oe=q.arrow)==null?void 0:oe.y,fe=((me=q.arrow)==null?void 0:me.centerOffset)!==0,[ue,re]=b.useState();return qt(()=>{C&&re(window.getComputedStyle(C).zIndex)},[C]),p.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:te?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Ce=q.transformOrigin)==null?void 0:Ce.x,(Ae=q.transformOrigin)==null?void 0:Ae.y].join(" "),...((Fe=q.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(V5,{scope:n,placedSide:Y,onArrowChange:I,arrowX:Q,arrowY:P,shouldHideArrow:fe,children:p.jsx(Ve.div,{"data-side":Y,"data-align":A,...w,ref:N,style:{...w.style,animation:te?void 0:"none"}})})})});iN.displayName=Tx;var oN="PopperArrow",U5={top:"bottom",right:"left",bottom:"top",left:"right"},sN=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=H5(oN,r),s=U5[o.placedSide];return p.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:p.jsx($5,{...i,ref:n,style:{...i.style,display:"block"}})})});sN.displayName=oN;function W5(e){return e!==null}var q5=e=>({name:"transformOrigin",options:e,fn(t){var S,C,T;const{placement:n,rects:r,middlewareData:i}=t,s=((S=i.arrow)==null?void 0:S.centerOffset)!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,h]=lN(n),f={start:"0%",center:"50%",end:"100%"}[h],g=(((C=i.arrow)==null?void 0:C.x)??0)+l/2,y=(((T=i.arrow)==null?void 0:T.y)??0)+c/2;let v="",w="";return d==="bottom"?(v=s?f:`${g}px`,w=`${-c}px`):d==="top"?(v=s?f:`${g}px`,w=`${r.floating.height+c}px`):d==="right"?(v=`${-c}px`,w=s?f:`${y}px`):d==="left"&&(v=`${r.floating.width+c}px`,w=s?f:`${y}px`),{data:{x:v,y:w}}}});function lN(e){const[t,n="center"]=e.split("-");return[t,n]}var Mx=tN,Ax=rN,jx=iN,Rx=sN,K5=Symbol("radix.slottable");function G5(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=K5,t}var aN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Y5="VisuallyHidden",cN=b.forwardRef((e,t)=>p.jsx(Ve.span,{...e,ref:t,style:{...aN,...e.style}}));cN.displayName=Y5;var J5=cN,[hh]=ni("Tooltip",[Jl]),ph=Jl(),uN="TooltipProvider",X5=700,ny="tooltip.open",[Q5,Px]=hh(uN),dN=e=>{const{__scopeTooltip:t,delayDuration:n=X5,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,s=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),p.jsx(Q5,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:o})};dN.displayName=uN;var wc="Tooltip",[Z5,qc]=hh(wc),fN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:l}=e,c=Px(wc,e.__scopeTooltip),d=ph(t),[h,f]=b.useState(null),g=Qr(),y=b.useRef(0),v=s??c.disableHoverableContent,w=l??c.delayDuration,S=b.useRef(!1),[C,T]=Fo({prop:r,defaultProp:i??!1,onChange:D=>{D?(c.onOpen(),document.dispatchEvent(new CustomEvent(ny))):c.onClose(),o==null||o(D)},caller:wc}),N=b.useMemo(()=>C?S.current?"delayed-open":"instant-open":"closed",[C]),R=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,S.current=!1,T(!0)},[T]),I=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),j=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{S.current=!0,T(!0),y.current=0},w)},[w,T]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),p.jsx(Mx,{...d,children:p.jsx(Z5,{scope:t,contentId:g,open:C,stateAttribute:N,trigger:h,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?j():R()},[c.isOpenDelayedRef,j,R]),onTriggerLeave:b.useCallback(()=>{v?I():(window.clearTimeout(y.current),y.current=0)},[I,v]),onOpen:R,onClose:I,disableHoverableContent:v,children:n})})};fN.displayName=wc;var ry="TooltipTrigger",hN=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=qc(ry,n),o=Px(ry,n),s=ph(n),l=b.useRef(null),c=et(t,l,i.onTriggerChange),d=b.useRef(!1),h=b.useRef(!1),f=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx(Ax,{asChild:!0,...s,children:p.jsx(Ve.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:we(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:we(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:we(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:we(e.onBlur,i.onClose),onClick:we(e.onClick,i.onClose)})})});hN.displayName=ry;var Ox="TooltipPortal",[ez,tz]=hh(Ox,{forceMount:void 0}),pN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=qc(Ox,t);return p.jsx(ez,{scope:t,forceMount:n,children:p.jsx(Un,{present:n||o.open,children:p.jsx(Vc,{asChild:!0,container:i,children:r})})})};pN.displayName=Ox;var zl="TooltipContent",mN=b.forwardRef((e,t)=>{const n=tz(zl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=qc(zl,e.__scopeTooltip);return p.jsx(Un,{present:r||s.open,children:s.disableHoverableContent?p.jsx(gN,{side:i,...o,ref:t}):p.jsx(nz,{side:i,...o,ref:t})})}),nz=b.forwardRef((e,t)=>{const n=qc(zl,e.__scopeTooltip),r=Px(zl,e.__scopeTooltip),i=b.useRef(null),o=et(t,i),[s,l]=b.useState(null),{trigger:c,onClose:d}=n,h=i.current,{onPointerInTransitChange:f}=r,g=b.useCallback(()=>{l(null),f(!1)},[f]),y=b.useCallback((v,w)=>{const S=v.currentTarget,C={x:v.clientX,y:v.clientY},T=lz(C,S.getBoundingClientRect()),N=az(C,T),R=cz(w.getBoundingClientRect()),I=dz([...N,...R]);l(I),f(!0)},[f]);return b.useEffect(()=>()=>g(),[g]),b.useEffect(()=>{if(c&&h){const v=S=>y(S,h),w=S=>y(S,c);return c.addEventListener("pointerleave",v),h.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",v),h.removeEventListener("pointerleave",w)}}},[c,h,y,g]),b.useEffect(()=>{if(s){const v=w=>{const S=w.target,C={x:w.clientX,y:w.clientY},T=(c==null?void 0:c.contains(S))||(h==null?void 0:h.contains(S)),N=!uz(C,s);T?g():N&&(g(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,h,s,d,g]),p.jsx(gN,{...e,ref:o})}),[rz,iz]=hh(wc,{isInside:!1}),oz=G5("TooltipContent"),gN=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...l}=e,c=qc(zl,n),d=ph(n),{onClose:h}=c;return b.useEffect(()=>(document.addEventListener(ny,h),()=>document.removeEventListener(ny,h)),[h]),b.useEffect(()=>{if(c.trigger){const f=g=>{const y=g.target;y!=null&&y.contains(c.trigger)&&h()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,h]),p.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:h,children:p.jsxs(jx,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(oz,{children:r}),p.jsx(rz,{scope:n,isInside:!0,children:p.jsx(J5,{id:c.contentId,role:"tooltip",children:i||r})})]})})});mN.displayName=zl;var yN="TooltipArrow",sz=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ph(n);return iz(yN,n).isInside?null:p.jsx(Rx,{...i,...r,ref:t})});sz.displayName=yN;function lz(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function az(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function cz(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function uz(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const l=t[o],c=t[s],d=l.x,h=l.y,f=c.x,g=c.y;h>r!=g>r&&n<(f-d)*(r-h)/(g-h)+d&&(i=!i)}return i}function dz(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),fz(t)}function fz(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var hz=dN,pz=fN,mz=hN,gz=pN,xN=mN;const yz=({children:e,delayDuration:t=0})=>p.jsx(hz,{delayDuration:t,children:e}),xz=pz,vz=mz,vN=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(gz,{children:p.jsx(xN,{ref:r,sideOffset:t,className:Pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...n})}));vN.displayName=xN.displayName;const Di="<paste-your-api-key-here>";function wz({isOpen:e,onClose:t,nestId:n,nestName:r}){const{authenticated:i,authMode:o}=Fs(),s=typeof window<"u"?window.location.origin:"http://localhost:3838",l=`${s}/nests/${n}/mcp`,[c,d]=b.useState(null),[h,f]=b.useState(null),[g,y]=b.useState(null),[v,w]=b.useState(null),[S,C]=b.useState(null),[T,N]=b.useState(null),[R,I]=b.useState(null);b.useEffect(()=>{if(!e){N(null),I(null);return}if(!i||o==="open"){d(!1);return}let Z=!1;return(async()=>{C("loading");try{const{keys:K}=await QD();if(Z)return;const W=K[0];d(!!W),f((W==null?void 0:W.key_prefix)??null)}catch(K){Z||(N(K.message),d(!1))}finally{Z||C(null)}})(),()=>{Z=!0}},[e,i,o]);const j=async()=>{N(null),C("mint");try{const{api_key:Z,key_prefix:K}=await ZD({nest_id:n,label:`connect:${qm(r)}`});f(K),d(!0),w("generated"),y(Z),I("generated")}catch(Z){N(Z.message)}finally{C(null)}},D=async()=>{N(null),C("rotate");try{const{api_key:Z,key_prefix:K}=await e_({nest_id:n,label:`connect:${qm(r)}`});f(K),d(!0),w("rotated"),y(Z),I("rotated")}catch(Z){N(Z.message)}finally{C(null)}};b.useEffect(()=>{if(!R)return;const Z=setTimeout(()=>I(null),6e3);return()=>clearTimeout(Z)},[R]);const O=()=>{y(null),w(null)},B=JSON.stringify({mcpServers:{[qm(r)]:{type:"http",url:l,headers:{Authorization:`Bearer ${Di}`}}}},null,2),_=`ctx --server ${s} --nest ${n} --key ${Di} query "type:document"`,V=o==="open",U=!i&&o==="key";return p.jsxs(p.Fragment,{children:[p.jsx(Rn,{open:e,onOpenChange:t,children:p.jsxs(bn,{className:"sm:max-w-[640px] max-h-[85vh] flex flex-col",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{children:["Connect to ",r]}),p.jsx(Bn,{children:"Point your tools at this nest to read, write, and query context."})]}),U&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900",children:[p.jsx(Or,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),p.jsx("span",{children:"You're not logged in. Login from the header to generate an API key for external clients."})]}),V&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900",children:[p.jsx(Or,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),p.jsxs("span",{children:["Server is in ",p.jsx("strong",{children:"open"})," mode — anyone on the network can read/write without a key. The snippets below omit the Authorization header."]})]}),T&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-2 text-xs text-red-900",children:[p.jsx(Or,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),p.jsx("span",{children:T})]}),i&&!V&&p.jsxs("div",{className:"rounded-md border bg-card p-3 space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p.jsx(XI,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"font-medium",children:"External-client API key"})]}),c?p.jsx(yz,{delayDuration:200,children:p.jsxs(xz,{children:[p.jsx(vz,{asChild:!0,children:p.jsx(ve,{variant:"outline",size:"sm",onClick:D,disabled:S!==null,"aria-label":"Rotate API key — invalidates the current key and mints a fresh one",children:S==="rotate"?p.jsx(Ct,{className:"h-3.5 w-3.5 animate-spin"}):p.jsxs(p.Fragment,{children:[p.jsx(xc,{className:"h-3.5 w-3.5 mr-1"}),"Rotate"]})})}),p.jsx(vN,{side:"left",className:"max-w-[260px]",children:p.jsx("p",{className:"text-xs",children:"Mints a fresh API key and immediately invalidates the current one. Use only if the existing key is lost or compromised — external clients will need the new value to keep working."})})]})}):p.jsx(ve,{size:"sm",onClick:j,disabled:S!==null,children:S==="mint"?p.jsx(Ct,{className:"h-3.5 w-3.5 animate-spin"}):"Generate Key"})]}),c&&R&&p.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-green-700",children:[p.jsx(Hi,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),p.jsxs("span",{children:[R==="rotated"?"Key rotated":"Key generated"," · new prefix"," ",p.jsx("code",{className:"font-mono",children:h}),R==="rotated"&&" · previous key revoked","."]})]}),c&&!R&&p.jsxs("p",{className:"text-xs text-muted-foreground",children:["Active key prefix:"," ",p.jsx("code",{className:"font-mono",children:h}),"."]}),!c&&p.jsx("p",{className:"text-xs text-muted-foreground",children:"No key yet. Generate one to use the snippets below. You'll see the plaintext exactly once."})]}),p.jsx("div",{className:"flex-1 overflow-y-auto",children:p.jsxs(FE,{defaultValue:"hootie",className:"w-full",children:[p.jsxs(vx,{className:"grid w-full grid-cols-4",children:[p.jsxs(zi,{value:"hootie",children:[p.jsx(tC,{className:"h-3.5 w-3.5 mr-1"}),"Hootie"]}),p.jsxs(zi,{value:"claude",children:[p.jsx(lC,{className:"h-3.5 w-3.5 mr-1"}),"Claude"]}),p.jsx(zi,{value:"mcp",children:"MCP"}),p.jsxs(zi,{value:"cli",children:[p.jsx(uC,{className:"h-3.5 w-3.5 mr-1"}),"CLI"]})]}),p.jsxs(Fi,{value:"hootie",className:"space-y-4 pt-4",children:[p.jsxs("div",{children:[p.jsxs("p",{className:"text-sm mb-3",children:["In Hootie, open"," ",p.jsx("strong",{children:"Settings → ContextNest Vault → Remote Server"})," ","and paste:"]}),p.jsx(xl,{label:"Server URL",value:s}),!V&&p.jsx(xl,{label:"API Key (paste your generated key)",value:Di})]}),p.jsxs("ol",{className:"text-xs text-muted-foreground space-y-1 list-decimal list-inside",children:[p.jsx("li",{children:"Open Hootie"}),p.jsx("li",{children:"Click the gear icon (Settings)"}),p.jsx("li",{children:"Scroll to ContextNest Vault"}),p.jsx("li",{children:'Switch tab to "Remote Server"'}),p.jsxs("li",{children:["Paste the URL",!V&&" + your API Key"," ","above, click Test Vault"]})]})]}),p.jsxs(Fi,{value:"claude",className:"space-y-4 pt-4",children:[p.jsxs("div",{children:[p.jsxs("p",{className:"text-sm mb-3",children:["Add this to your"," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"claude_desktop_config.json"}),!V&&p.jsxs(p.Fragment,{children:[" ","(replace"," ",p.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:Di})," ","with your generated key):"]})]}),p.jsx(xl,{label:"Config",value:B,multiline:!0}),p.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Location:"," ",p.jsx("code",{className:"text-[10px]",children:"%APPDATA%\\Claude\\claude_desktop_config.json"})," ","(Windows) or"," ",p.jsx("code",{className:"text-[10px]",children:"~/Library/Application Support/Claude/claude_desktop_config.json"})," ","(Mac)"]})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Restart Claude Desktop after editing. The nest's 16 context tools will appear in the tools panel."})]}),p.jsxs(Fi,{value:"mcp",className:"space-y-4 pt-4",children:[p.jsxs("div",{children:[p.jsxs("p",{className:"text-sm mb-3",children:["Streamable HTTP MCP endpoint with 16 tools (9 content + 7 governance).",!V&&p.jsxs(p.Fragment,{children:[" ","Pass your API key in an"," ",p.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:"Authorization"})," ","header."]})]}),p.jsx(xl,{label:"MCP Endpoint",value:l}),!V&&p.jsx(xl,{label:"Authorization header",value:`Bearer ${Di}`})]}),p.jsxs("div",{className:"text-xs text-muted-foreground space-y-2",children:[p.jsx("p",{className:"font-medium",children:"Available tools:"}),p.jsxs("div",{className:"grid grid-cols-2 gap-x-4 font-mono text-[11px]",children:[p.jsx("span",{children:"context_init"}),p.jsx("span",{children:"context_stewards"}),p.jsx("span",{children:"context_overview"}),p.jsx("span",{children:"context_review_queue"}),p.jsx("span",{children:"context_search"}),p.jsx("span",{children:"context_submit_review"}),p.jsx("span",{children:"context_query"}),p.jsx("span",{children:"context_approve"}),p.jsx("span",{children:"context_get"}),p.jsx("span",{children:"context_reject"}),p.jsx("span",{children:"context_list"}),p.jsx("span",{children:"context_versions"}),p.jsx("span",{children:"context_resolve"}),p.jsx("span",{children:"context_assign_steward"}),p.jsx("span",{children:"context_create"}),p.jsx("span",{children:"context_update"})]})]})]}),p.jsxs(Fi,{value:"cli",className:"space-y-4 pt-4",children:[p.jsxs("div",{children:[p.jsxs("p",{className:"text-sm mb-3",children:["Use"," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"ctx"})," ","pointed at this server:"]}),p.jsx(xl,{label:"Example query",value:_})]}),p.jsxs("div",{className:"text-xs text-muted-foreground space-y-2",children:[p.jsx("p",{className:"font-medium",children:"Common commands:"}),p.jsxs("div",{className:"space-y-1 font-mono text-[11px]",children:[p.jsxs("div",{children:["ctx --server ",s," --nest ",n,!V&&` --key ${Di}`," ",'query "#architecture"']}),p.jsxs("div",{children:["ctx --server ",s," --nest ",n,!V&&` --key ${Di}`,' add "My Doc" content.md']}),p.jsxs("div",{children:["ctx --server ",s," --nest ",n,!V&&` --key ${Di}`," ","publish"]})]}),p.jsxs("p",{className:"pt-2",children:["Install:"," ",p.jsx("code",{className:"text-[11px] bg-muted px-1 py-0.5 rounded",children:"npm i -g @promptowl/contextnest-cli"})]})]})]})]})}),p.jsx("div",{className:"border-t pt-3",children:p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsx("span",{children:"Nest ID:"}),p.jsx("code",{className:"flex-1 bg-muted px-2 py-1 rounded text-[11px] font-mono truncate",children:n}),p.jsx(wN,{value:n})]})})]})}),g&&v&&p.jsx(bz,{apiKey:g,kind:v,onClose:O})]})}function bz({apiKey:e,kind:t,onClose:n}){const[r,i]=b.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return p.jsx(Rn,{open:!0,onOpenChange:n,children:p.jsxs(bn,{className:"sm:max-w-[480px]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{className:"flex items-center gap-2",children:[p.jsx(ED,{className:"h-4 w-4 text-amber-700"}),t==="generated"?"API key generated":"API key rotated"]}),p.jsxs(Bn,{children:["This key is shown ",p.jsx("strong",{children:"only once"}),". Copy it now and store it somewhere safe (password manager, secrets vault). It cannot be retrieved again — if you lose it, rotate to mint a new one.",t==="rotated"&&p.jsxs(p.Fragment,{children:[" ","Your previous key has been invalidated and will stop working immediately."]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"flex-1 bg-muted px-3 py-2 rounded text-xs font-mono break-all",children:e}),p.jsx(ve,{size:"sm",variant:"outline",onClick:o,children:r?p.jsx(zs,{className:"h-3.5 w-3.5 text-green-600"}):p.jsx(Fc,{className:"h-3.5 w-3.5"})})]}),p.jsxs("p",{className:"text-xs text-muted-foreground",children:["Paste it into Hootie / Claude Desktop / CLI wherever the snippets in the Connect dialog show"," ",p.jsx("code",{className:"text-[11px]",children:Di}),"."]})]}),p.jsx("div",{className:"flex justify-end pt-2",children:p.jsx(ve,{onClick:n,children:"I've saved it — close"})})]})})}function xl({label:e,value:t,multiline:n}){return p.jsxs("div",{className:"mb-3",children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e}),p.jsx(wN,{value:t})]}),p.jsx("pre",{className:`${n?"p-3":"px-3 py-2"} bg-muted rounded text-xs font-mono ${n?"whitespace-pre overflow-x-auto":"truncate"}`,children:t})]})}function wN({value:e}){const[t,n]=b.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return p.jsx(ve,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:r,children:t?p.jsx(zs,{className:"h-3 w-3 text-green-600"}):p.jsx(Fc,{className:"h-3 w-3"})})}function qm(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"nest"}function bN(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var mh="Switch",[kz]=ni(mh),[Sz,Cz]=kz(mh),kN=b.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:l,value:c="on",onCheckedChange:d,form:h,...f}=e,[g,y]=b.useState(null),v=et(t,N=>y(N)),w=b.useRef(!1),S=g?h||!!g.closest("form"):!0,[C,T]=Fo({prop:i,defaultProp:o??!1,onChange:d,caller:mh});return p.jsxs(Sz,{scope:n,checked:C,disabled:l,children:[p.jsx(Ve.button,{type:"button",role:"switch","aria-checked":C,"aria-required":s,"data-state":NN(C),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:v,onClick:we(e.onClick,N=>{T(R=>!R),S&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),S&&p.jsx(EN,{control:g,bubbles:!w.current,name:r,value:c,checked:C,required:s,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});kN.displayName=mh;var SN="SwitchThumb",CN=b.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Cz(SN,n);return p.jsx(Ve.span,{"data-state":NN(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});CN.displayName=SN;var Ez="SwitchBubbleInput",EN=b.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const s=b.useRef(null),l=et(s,o),c=bN(n),d=QE(t);return b.useEffect(()=>{const h=s.current;if(!h)return;const f=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&y){const v=new Event("click",{bubbles:r});y.call(h,n),h.dispatchEvent(v)}},[c,n,r]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});EN.displayName=Ez;function NN(e){return e?"checked":"unchecked"}var TN=kN,Nz=CN;const MN=b.forwardRef(({className:e,...t},n)=>p.jsx(TN,{className:Pe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-lg border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:p.jsx(Nz,{className:Pe("pointer-events-none block h-4 w-4 rounded-lg bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));MN.displayName=TN.displayName;const Tz=nh("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-warning/50 text-warning dark:border-warning [&>svg]:text-warning"}},defaultVariants:{variant:"default"}}),Fr=b.forwardRef(({className:e,variant:t,...n},r)=>p.jsx("div",{ref:r,role:"alert",className:Pe(Tz({variant:t}),e),...n}));Fr.displayName="Alert";const Mz=b.forwardRef(({className:e,...t},n)=>p.jsx("h5",{ref:n,className:Pe("mb-1 font-medium leading-none tracking-tight",e),...t}));Mz.displayName="AlertTitle";const $r=b.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Pe("text-sm [&_p]:leading-relaxed",e),...t}));$r.displayName="AlertDescription";function Az({nestId:e,nestName:t,stewardshipEnabled:n,onClose:r,onChanged:i}){const[o,s]=b.useState(n),[l,c]=b.useState(!1),[d,h]=b.useState(null),f=async()=>{if(o===n){r();return}c(!0),h(null);try{if((await t_(e,{stewardship_enabled:o})).stewardship_enabled!==o){h("Server did not accept the change. You may not have permission to change this setting."),c(!1);return}i()}catch(g){h(g.message),c(!1)}};return p.jsx(Rn,{open:!0,onOpenChange:r,children:p.jsxs(bn,{className:"sm:max-w-[500px]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{children:["Settings: ",t]}),p.jsx(Bn,{children:"Admin controls for this nest. Changes apply to all future documents."})]}),p.jsxs("div",{className:"space-y-4 py-2",children:[d&&p.jsxs(Fr,{variant:"destructive",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:d})]}),p.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs(an,{className:"flex items-center gap-2 text-sm font-medium",children:[p.jsx(tr,{className:"h-4 w-4"}),"Stewardship & Approval Workflow"]}),p.jsxs("p",{className:"text-xs text-muted-foreground",children:["Require steward approval before documents become AI-ready. New documents will start as ",p.jsx("strong",{children:"drafts"}),". This also changes what “publishing” means in this nest: with stewardship on, the document editor shows",p.jsx("em",{children:" Publish (requires approval)"}),"; with it off, saving auto-publishes and an ",p.jsx("em",{children:"Auto-published"})," badge appears next to the title."]})]}),p.jsx(MN,{checked:o,onCheckedChange:s})]}),!o&&p.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground pt-2 border-t",children:[p.jsx(Kg,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),p.jsxs("div",{children:[p.jsx("strong",{className:"text-foreground",children:"Currently off."})," New documents are auto-approved and immediately available to AI. Versioning is still on — every edit creates a new version."]})]}),o&&p.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground pt-2 border-t",children:[p.jsx(Kg,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),p.jsxs("div",{children:[p.jsx("strong",{className:"text-foreground",children:"When enabled:"})," New documents start as drafts. Assigned stewards must approve before they're available to AI queries. Existing approved documents stay approved."]})]})]})]}),p.jsxs(zr,{children:[p.jsx(ve,{variant:"outline",onClick:r,disabled:l,children:"Cancel"}),p.jsx(ve,{onClick:f,disabled:l,children:l?p.jsx(Ct,{className:"h-4 w-4 animate-spin"}):"Save Settings"})]})]})})}function iy(e,[t,n]){return Math.min(n,Math.max(t,e))}function jz(e){const t=Rz(e),n=b.forwardRef((r,i)=>{const{children:o,...s}=r,l=b.Children.toArray(o),c=l.find(Oz);if(c){const d=c.props.children,h=l.map(f=>f===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Rz(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const s=Dz(i),l=Iz(o,i.props);return i.type!==b.Fragment&&(l.ref=r?qi(r,s):s),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pz=Symbol("radix.slottable");function Oz(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pz}function Iz(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const c=o(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Dz(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _z=[" ","Enter","ArrowUp","ArrowDown"],Lz=[" ","Enter"],js="Select",[gh,yh,zz]=yx(js),[Xl]=ni(js,[zz,Jl]),xh=Jl(),[Fz,Ko]=Xl(js),[$z,Bz]=Xl(js),AN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:l,onValueChange:c,dir:d,name:h,autoComplete:f,disabled:g,required:y,form:v}=e,w=xh(t),[S,C]=b.useState(null),[T,N]=b.useState(null),[R,I]=b.useState(!1),j=Hc(d),[D,O]=Fo({prop:r,defaultProp:i??!1,onChange:o,caller:js}),[B,_]=Fo({prop:s,defaultProp:l,onChange:c,caller:js}),V=b.useRef(null),U=S?v||!!S.closest("form"):!0,[Z,K]=b.useState(new Set),W=Array.from(Z).map(X=>X.props.value).join(";");return p.jsx(Mx,{...w,children:p.jsxs(Fz,{required:y,scope:t,trigger:S,onTriggerChange:C,valueNode:T,onValueNodeChange:N,valueNodeHasChildren:R,onValueNodeHasChildrenChange:I,contentId:Qr(),value:B,onValueChange:_,open:D,onOpenChange:O,dir:j,triggerPointerDownPosRef:V,disabled:g,children:[p.jsx(gh.Provider,{scope:t,children:p.jsx($z,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(X=>{K(te=>new Set(te).add(X))},[]),onNativeOptionRemove:b.useCallback(X=>{K(te=>{const q=new Set(te);return q.delete(X),q})},[]),children:n})}),U?p.jsxs(ZN,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:f,value:B,onChange:X=>_(X.target.value),disabled:g,form:v,children:[B===void 0?p.jsx("option",{value:""}):null,Array.from(Z)]},W):null]})})};AN.displayName=js;var jN="SelectTrigger",RN=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=xh(n),s=Ko(jN,n),l=s.disabled||r,c=et(t,s.onTriggerChange),d=yh(n),h=b.useRef("touch"),[f,g,y]=tT(w=>{const S=d().filter(N=>!N.disabled),C=S.find(N=>N.value===s.value),T=nT(S,w,C);T!==void 0&&s.onValueChange(T.value)}),v=w=>{l||(s.onOpenChange(!0),y()),w&&(s.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return p.jsx(Ax,{asChild:!0,...o,children:p.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":eT(s.value)?"":void 0,...i,ref:c,onClick:we(i.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&v(w)}),onPointerDown:we(i.onPointerDown,w=>{h.current=w.pointerType;const S=w.target;S.hasPointerCapture(w.pointerId)&&S.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(v(w),w.preventDefault())}),onKeyDown:we(i.onKeyDown,w=>{const S=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(S&&w.key===" ")&&_z.includes(w.key)&&(v(),w.preventDefault())})})})});RN.displayName=jN;var PN="SelectValue",ON=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...l}=e,c=Ko(PN,n),{onValueNodeHasChildrenChange:d}=c,h=o!==void 0,f=et(t,c.onValueNodeChange);return qt(()=>{d(h)},[d,h]),p.jsx(Ve.span,{...l,ref:f,style:{pointerEvents:"none"},children:eT(c.value)?p.jsx(p.Fragment,{children:s}):o})});ON.displayName=PN;var Vz="SelectIcon",IN=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return p.jsx(Ve.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});IN.displayName=Vz;var Hz="SelectPortal",DN=e=>p.jsx(Vc,{asChild:!0,...e});DN.displayName=Hz;var Rs="SelectContent",_N=b.forwardRef((e,t)=>{const n=Ko(Rs,e.__scopeSelect),[r,i]=b.useState();if(qt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?zc.createPortal(p.jsx(LN,{scope:e.__scopeSelect,children:p.jsx(gh.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),o):null}return p.jsx(zN,{...e,ref:t})});_N.displayName=Rs;var Yr=10,[LN,Go]=Xl(Rs),Uz="SelectContentImpl",Wz=jz("SelectContent.RemoveScroll"),zN=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:g,collisionPadding:y,sticky:v,hideWhenDetached:w,avoidCollisions:S,...C}=e,T=Ko(Rs,n),[N,R]=b.useState(null),[I,j]=b.useState(null),D=et(t,ne=>R(ne)),[O,B]=b.useState(null),[_,V]=b.useState(null),U=yh(n),[Z,K]=b.useState(!1),W=b.useRef(!1);b.useEffect(()=>{if(N)return hx(N)},[N]),fx();const X=b.useCallback(ne=>{const[oe,...me]=U().map(Fe=>Fe.ref.current),[Ce]=me.slice(-1),Ae=document.activeElement;for(const Fe of ne)if(Fe===Ae||(Fe==null||Fe.scrollIntoView({block:"nearest"}),Fe===oe&&I&&(I.scrollTop=0),Fe===Ce&&I&&(I.scrollTop=I.scrollHeight),Fe==null||Fe.focus(),document.activeElement!==Ae))return},[U,I]),te=b.useCallback(()=>X([O,N]),[X,O,N]);b.useEffect(()=>{Z&&te()},[Z,te]);const{onOpenChange:q,triggerPointerDownPosRef:Y}=T;b.useEffect(()=>{if(N){let ne={x:0,y:0};const oe=Ce=>{var Ae,Fe;ne={x:Math.abs(Math.round(Ce.pageX)-(((Ae=Y.current)==null?void 0:Ae.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((Fe=Y.current)==null?void 0:Fe.y)??0))}},me=Ce=>{ne.x<=10&&ne.y<=10?Ce.preventDefault():N.contains(Ce.target)||q(!1),document.removeEventListener("pointermove",oe),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",me,{capture:!0})}}},[N,q,Y]),b.useEffect(()=>{const ne=()=>q(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[q]);const[A,z]=tT(ne=>{const oe=U().filter(Ae=>!Ae.disabled),me=oe.find(Ae=>Ae.ref.current===document.activeElement),Ce=nT(oe,ne,me);Ce&&setTimeout(()=>Ce.ref.current.focus())}),Q=b.useCallback((ne,oe,me)=>{const Ce=!W.current&&!me;(T.value!==void 0&&T.value===oe||Ce)&&(B(ne),Ce&&(W.current=!0))},[T.value]),P=b.useCallback(()=>N==null?void 0:N.focus(),[N]),fe=b.useCallback((ne,oe,me)=>{const Ce=!W.current&&!me;(T.value!==void 0&&T.value===oe||Ce)&&V(ne)},[T.value]),ue=r==="popper"?oy:FN,re=ue===oy?{side:l,sideOffset:c,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:g,collisionPadding:y,sticky:v,hideWhenDetached:w,avoidCollisions:S}:{};return p.jsx(LN,{scope:n,content:N,viewport:I,onViewportChange:j,itemRefCallback:Q,selectedItem:O,onItemLeave:P,itemTextRefCallback:fe,focusSelectedItem:te,selectedItemText:_,position:r,isPositioned:Z,searchRef:A,children:p.jsx(oh,{as:Wz,allowPinchZoom:!0,children:p.jsx(rh,{asChild:!0,trapped:T.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:we(i,ne=>{var oe;(oe=T.trigger)==null||oe.focus({preventScroll:!0}),ne.preventDefault()}),children:p.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:p.jsx(ue,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ne=>ne.preventDefault(),...C,...re,onPlaced:()=>K(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:we(C.onKeyDown,ne=>{const oe=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!oe&&ne.key.length===1&&z(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Ce=U().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Ae=ne.target,Fe=Ce.indexOf(Ae);Ce=Ce.slice(Fe+1)}setTimeout(()=>X(Ce)),ne.preventDefault()}})})})})})})});zN.displayName=Uz;var qz="SelectItemAlignedPosition",FN=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ko(Rs,n),s=Go(Rs,n),[l,c]=b.useState(null),[d,h]=b.useState(null),f=et(t,D=>h(D)),g=yh(n),y=b.useRef(!1),v=b.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:C,focusSelectedItem:T}=s,N=b.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&w&&S&&C){const D=o.trigger.getBoundingClientRect(),O=d.getBoundingClientRect(),B=o.valueNode.getBoundingClientRect(),_=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ae=_.left-O.left,Fe=B.left-Ae,it=D.left-Fe,lt=D.width+it,_t=Math.max(lt,O.width),Mt=window.innerWidth-Yr,dt=iy(Fe,[Yr,Math.max(Yr,Mt-_t)]);l.style.minWidth=lt+"px",l.style.left=dt+"px"}else{const Ae=O.right-_.right,Fe=window.innerWidth-B.right-Ae,it=window.innerWidth-D.right-Fe,lt=D.width+it,_t=Math.max(lt,O.width),Mt=window.innerWidth-Yr,dt=iy(Fe,[Yr,Math.max(Yr,Mt-_t)]);l.style.minWidth=lt+"px",l.style.right=dt+"px"}const V=g(),U=window.innerHeight-Yr*2,Z=w.scrollHeight,K=window.getComputedStyle(d),W=parseInt(K.borderTopWidth,10),X=parseInt(K.paddingTop,10),te=parseInt(K.borderBottomWidth,10),q=parseInt(K.paddingBottom,10),Y=W+X+Z+q+te,A=Math.min(S.offsetHeight*5,Y),z=window.getComputedStyle(w),Q=parseInt(z.paddingTop,10),P=parseInt(z.paddingBottom,10),fe=D.top+D.height/2-Yr,ue=U-fe,re=S.offsetHeight/2,ne=S.offsetTop+re,oe=W+X+ne,me=Y-oe;if(oe<=fe){const Ae=V.length>0&&S===V[V.length-1].ref.current;l.style.bottom="0px";const Fe=d.clientHeight-w.offsetTop-w.offsetHeight,it=Math.max(ue,re+(Ae?P:0)+Fe+te),lt=oe+it;l.style.height=lt+"px"}else{const Ae=V.length>0&&S===V[0].ref.current;l.style.top="0px";const it=Math.max(fe,W+w.offsetTop+(Ae?Q:0)+re)+me;l.style.height=it+"px",w.scrollTop=oe-fe+w.offsetTop}l.style.margin=`${Yr}px 0`,l.style.minHeight=A+"px",l.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[g,o.trigger,o.valueNode,l,d,w,S,C,o.dir,r]);qt(()=>N(),[N]);const[R,I]=b.useState();qt(()=>{d&&I(window.getComputedStyle(d).zIndex)},[d]);const j=b.useCallback(D=>{D&&v.current===!0&&(N(),T==null||T(),v.current=!1)},[N,T]);return p.jsx(Gz,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:j,children:p.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:p.jsx(Ve.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});FN.displayName=qz;var Kz="SelectPopperPosition",oy=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Yr,...o}=e,s=xh(n);return p.jsx(jx,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});oy.displayName=Kz;var[Gz,Ix]=Xl(Rs,{}),sy="SelectViewport",$N=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Go(sy,n),s=Ix(sy,n),l=et(t,o.onViewportChange),c=b.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(gh.Slot,{scope:n,children:p.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:we(i.onScroll,d=>{const h=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=s;if(g!=null&&g.current&&f){const y=Math.abs(c.current-h.scrollTop);if(y>0){const v=window.innerHeight-Yr*2,w=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),C=Math.max(w,S);if(C<v){const T=C+y,N=Math.min(v,T),R=T-N;f.style.height=N+"px",f.style.bottom==="0px"&&(h.scrollTop=R>0?R:0,f.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});$N.displayName=sy;var BN="SelectGroup",[Yz,Jz]=Xl(BN),Xz=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Qr();return p.jsx(Yz,{scope:n,id:i,children:p.jsx(Ve.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Xz.displayName=BN;var VN="SelectLabel",HN=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Jz(VN,n);return p.jsx(Ve.div,{id:i.id,...r,ref:t})});HN.displayName=VN;var tf="SelectItem",[Qz,UN]=Xl(tf),WN=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,l=Ko(tf,n),c=Go(tf,n),d=l.value===r,[h,f]=b.useState(o??""),[g,y]=b.useState(!1),v=et(t,T=>{var N;return(N=c.itemRefCallback)==null?void 0:N.call(c,T,r,i)}),w=Qr(),S=b.useRef("touch"),C=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(Qz,{scope:n,value:r,disabled:i,textId:w,isSelected:d,onItemTextChange:b.useCallback(T=>{f(N=>N||((T==null?void 0:T.textContent)??"").trim())},[]),children:p.jsx(gh.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:p.jsx(Ve.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:v,onFocus:we(s.onFocus,()=>y(!0)),onBlur:we(s.onBlur,()=>y(!1)),onClick:we(s.onClick,()=>{S.current!=="mouse"&&C()}),onPointerUp:we(s.onPointerUp,()=>{S.current==="mouse"&&C()}),onPointerDown:we(s.onPointerDown,T=>{S.current=T.pointerType}),onPointerMove:we(s.onPointerMove,T=>{var N;S.current=T.pointerType,i?(N=c.onItemLeave)==null||N.call(c):S.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,T=>{var N;T.currentTarget===document.activeElement&&((N=c.onItemLeave)==null||N.call(c))}),onKeyDown:we(s.onKeyDown,T=>{var R;((R=c.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(Lz.includes(T.key)&&C(),T.key===" "&&T.preventDefault())})})})})});WN.displayName=tf;var Ya="SelectItemText",qN=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Ko(Ya,n),l=Go(Ya,n),c=UN(Ya,n),d=Bz(Ya,n),[h,f]=b.useState(null),g=et(t,C=>f(C),c.onItemTextChange,C=>{var T;return(T=l.itemTextRefCallback)==null?void 0:T.call(l,C,c.value,c.disabled)}),y=h==null?void 0:h.textContent,v=b.useMemo(()=>p.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=d;return qt(()=>(w(v),()=>S(v)),[w,S,v]),p.jsxs(p.Fragment,{children:[p.jsx(Ve.span,{id:c.textId,...o,ref:g}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?zc.createPortal(o.children,s.valueNode):null]})});qN.displayName=Ya;var KN="SelectItemIndicator",GN=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return UN(KN,n).isSelected?p.jsx(Ve.span,{"aria-hidden":!0,...r,ref:t}):null});GN.displayName=KN;var ly="SelectScrollUpButton",YN=b.forwardRef((e,t)=>{const n=Go(ly,e.__scopeSelect),r=Ix(ly,e.__scopeSelect),[i,o]=b.useState(!1),s=et(t,r.onScrollButtonChange);return qt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;o(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?p.jsx(XN,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});YN.displayName=ly;var ay="SelectScrollDownButton",JN=b.forwardRef((e,t)=>{const n=Go(ay,e.__scopeSelect),r=Ix(ay,e.__scopeSelect),[i,o]=b.useState(!1),s=et(t,r.onScrollButtonChange);return qt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<d;o(h)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?p.jsx(XN,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});JN.displayName=ay;var XN=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Go("SelectScrollButton",n),s=b.useRef(null),l=yh(n),c=b.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),qt(()=>{var h;const d=l().find(f=>f.ref.current===document.activeElement);(h=d==null?void 0:d.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),p.jsx(Ve.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:we(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:we(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:we(i.onPointerLeave,()=>{c()})})}),Zz="SelectSeparator",QN=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(Ve.div,{"aria-hidden":!0,...r,ref:t})});QN.displayName=Zz;var cy="SelectArrow",eF=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=xh(n),o=Ko(cy,n),s=Go(cy,n);return o.open&&s.position==="popper"?p.jsx(Rx,{...i,...r,ref:t}):null});eF.displayName=cy;var tF="SelectBubbleInput",ZN=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=b.useRef(null),o=et(r,i),s=bN(t);return b.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&h){const f=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(f)}},[s,t]),p.jsx(Ve.select,{...n,style:{...aN,...n.style},ref:o,defaultValue:t})});ZN.displayName=tF;function eT(e){return e===""||e===void 0}function tT(e){const t=ln(e),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(s=>{const l=n.current+s;t(l),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function nT(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=nF(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const c=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function nF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rF=AN,rT=RN,iF=ON,oF=IN,sF=DN,iT=_N,lF=$N,oT=HN,sT=WN,aF=qN,cF=GN,lT=YN,aT=JN,cT=QN;const nc=rF,rc=iF,Rl=b.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(rT,{ref:r,className:Pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,p.jsx(oF,{asChild:!0,children:p.jsx(ix,{className:"h-4 w-4 opacity-50"})})]}));Rl.displayName=rT.displayName;const uT=b.forwardRef(({className:e,...t},n)=>p.jsx(lT,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(gI,{className:"h-4 w-4"})}));uT.displayName=lT.displayName;const dT=b.forwardRef(({className:e,...t},n)=>p.jsx(aT,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(ix,{className:"h-4 w-4"})}));dT.displayName=aT.displayName;const Pl=b.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>p.jsx(sF,{children:p.jsxs(iT,{ref:i,className:Pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[p.jsx(uT,{}),p.jsx(lF,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),p.jsx(dT,{})]})}));Pl.displayName=iT.displayName;const uF=b.forwardRef(({className:e,...t},n)=>p.jsx(oT,{ref:n,className:Pe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));uF.displayName=oT.displayName;const zn=b.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(sT,{ref:r,className:Pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(cF,{children:p.jsx(zs,{className:"h-4 w-4"})})}),p.jsx(aF,{children:t})]}));zn.displayName=sT.displayName;const dF=b.forwardRef(({className:e,...t},n)=>p.jsx(cT,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));dF.displayName=cT.displayName;const fF=nh("inline-flex items-center rounded-sm border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-muted text-foreground hover:bg-muted/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80 dark:text-destructive-foreground",outline:"text-foreground dark:text-foreground",success:"bg-green-100 text-green-700 border-green-200 dark:bg-green-900/50 dark:text-green-300 dark:border-green-700",warning:"bg-amber-100 text-amber-700 border-amber-200 dark:bg-amber-900/50 dark:text-amber-300 dark:border-amber-700",info:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/50 dark:text-blue-300 dark:border-blue-700",rejected:"bg-red-100 text-red-700 border-red-200 dark:bg-red-900/50 dark:text-red-300 dark:border-red-700",neutral:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-700 dark:text-gray-200 dark:border-gray-600"}},defaultVariants:{variant:"default"}});function Ir({className:e,variant:t,...n}){return p.jsx("div",{className:Pe(fF({variant:t}),e),...n})}function hF(e,t=[]){let n=[];function r(o,s){const l=b.createContext(s);l.displayName=o+"Context";const c=n.length;n=[...n,s];const d=f=>{var C;const{scope:g,children:y,...v}=f,w=((C=g==null?void 0:g[e])==null?void 0:C[c])||l,S=b.useMemo(()=>v,Object.values(v));return p.jsx(w.Provider,{value:S,children:y})};d.displayName=o+"Provider";function h(f,g){var w;const y=((w=g==null?void 0:g[e])==null?void 0:w[c])||l,v=b.useContext(y);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[d,h]}const i=()=>{const o=n.map(s=>b.createContext(s));return function(l){const c=(l==null?void 0:l[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,pF(i,...t)]}function pF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(o)[`__scope${d}`];return{...l,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var mF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dx=mF.reduce((e,t)=>{const n=dx(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:s,...l}=i,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Km={exports:{}},Gm={};/**
|
|
440
|
+
* @license React
|
|
441
|
+
* use-sync-external-store-shim.production.js
|
|
442
|
+
*
|
|
443
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
444
|
+
*
|
|
445
|
+
* This source code is licensed under the MIT license found in the
|
|
446
|
+
* LICENSE file in the root directory of this source tree.
|
|
447
|
+
*/var Eb;function gF(){if(Eb)return Gm;Eb=1;var e=Lc();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function l(f,g){var y=g(),v=r({inst:{value:y,getSnapshot:g}}),w=v[0].inst,S=v[1];return o(function(){w.value=y,w.getSnapshot=g,c(w)&&S({inst:w})},[f,y,g]),i(function(){return c(w)&&S({inst:w}),f(function(){c(w)&&S({inst:w})})},[f]),s(y),y}function c(f){var g=f.getSnapshot;f=f.value;try{var y=g();return!n(f,y)}catch{return!0}}function d(f,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,Gm}var Nb;function fT(){return Nb||(Nb=1,Km.exports=gF()),Km.exports}var _x=fT();function yF(){return _x.useSyncExternalStore(xF,()=>!0,()=>!1)}function xF(){return()=>{}}var Lx="Avatar",[vF]=hF(Lx),[wF,hT]=vF(Lx),pT=b.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=b.useState("idle");return p.jsx(wF,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:p.jsx(Dx.span,{...r,ref:t})})});pT.displayName=Lx;var mT="AvatarImage",gT=b.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=hT(mT,n),l=bF(r,o),c=ln(d=>{i(d),s.onImageLoadingStatusChange(d)});return qt(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?p.jsx(Dx.img,{...o,ref:t,src:r}):null});gT.displayName=mT;var yT="AvatarFallback",xT=b.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=hT(yT,n),[s,l]=b.useState(r===void 0);return b.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),s&&o.imageLoadingStatus!=="loaded"?p.jsx(Dx.span,{...i,ref:t}):null});xT.displayName=yT;function Tb(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function bF(e,{referrerPolicy:t,crossOrigin:n}){const r=yF(),i=b.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,l]=b.useState(()=>Tb(o,e));return qt(()=>{l(Tb(o,e))},[o,e]),qt(()=>{const c=f=>()=>{l(f)};if(!o)return;const d=c("loaded"),h=c("error");return o.addEventListener("load",d),o.addEventListener("error",h),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",d),o.removeEventListener("error",h)}},[o,n,t]),s}var vT=pT,wT=gT,bT=xT;const Vo=b.forwardRef(({className:e,...t},n)=>p.jsx(vT,{ref:n,className:Pe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Vo.displayName=vT.displayName;const kF=b.forwardRef(({className:e,...t},n)=>p.jsx(wT,{ref:n,className:Pe("aspect-square h-full w-full",e),...t}));kF.displayName=wT.displayName;const Ho=b.forwardRef(({className:e,...t},n)=>p.jsx(bT,{ref:n,className:Pe("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ho.displayName=bT.displayName;function SF(e){const t=CF(e),n=b.forwardRef((r,i)=>{const{children:o,...s}=r,l=b.Children.toArray(o),c=l.find(NF);if(c){const d=c.props.children,h=l.map(f=>f===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function CF(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const s=MF(i),l=TF(o,i.props);return i.type!==b.Fragment&&(l.ref=r?qi(r,s):s),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EF=Symbol("radix.slottable");function NF(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EF}function TF(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const c=o(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function MF(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uy=["Enter"," "],AF=["ArrowDown","PageUp","Home"],kT=["ArrowUp","PageDown","End"],jF=[...AF,...kT],RF={ltr:[...uy,"ArrowRight"],rtl:[...uy,"ArrowLeft"]},PF={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Kc="Menu",[bc,OF,IF]=yx(Kc),[Bs,ST]=ni(Kc,[IF,Jl,lh]),vh=Jl(),CT=lh(),[DF,Vs]=Bs(Kc),[_F,Gc]=Bs(Kc),ET=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,l=vh(t),[c,d]=b.useState(null),h=b.useRef(!1),f=ln(o),g=Hc(i);return b.useEffect(()=>{const y=()=>{h.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>h.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),p.jsx(Mx,{...l,children:p.jsx(DF,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:d,children:p.jsx(_F,{scope:t,onClose:b.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:h,dir:g,modal:s,children:r})})})};ET.displayName=Kc;var LF="MenuAnchor",zx=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=vh(n);return p.jsx(Ax,{...i,...r,ref:t})});zx.displayName=LF;var Fx="MenuPortal",[zF,NT]=Bs(Fx,{forceMount:void 0}),TT=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Vs(Fx,t);return p.jsx(zF,{scope:t,forceMount:n,children:p.jsx(Un,{present:n||o.open,children:p.jsx(Vc,{asChild:!0,container:i,children:r})})})};TT.displayName=Fx;var Dr="MenuContent",[FF,$x]=Bs(Dr),MT=b.forwardRef((e,t)=>{const n=NT(Dr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Vs(Dr,e.__scopeMenu),s=Gc(Dr,e.__scopeMenu);return p.jsx(bc.Provider,{scope:e.__scopeMenu,children:p.jsx(Un,{present:r||o.open,children:p.jsx(bc.Slot,{scope:e.__scopeMenu,children:s.modal?p.jsx($F,{...i,ref:t}):p.jsx(BF,{...i,ref:t})})})})}),$F=b.forwardRef((e,t)=>{const n=Vs(Dr,e.__scopeMenu),r=b.useRef(null),i=et(t,r);return b.useEffect(()=>{const o=r.current;if(o)return hx(o)},[]),p.jsx(Bx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:we(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),BF=b.forwardRef((e,t)=>{const n=Vs(Dr,e.__scopeMenu);return p.jsx(Bx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),VF=SF("MenuContent.ScrollLock"),Bx=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:g,onDismiss:y,disableOutsideScroll:v,...w}=e,S=Vs(Dr,n),C=Gc(Dr,n),T=vh(n),N=CT(n),R=OF(n),[I,j]=b.useState(null),D=b.useRef(null),O=et(t,D,S.onContentChange),B=b.useRef(0),_=b.useRef(""),V=b.useRef(0),U=b.useRef(null),Z=b.useRef("right"),K=b.useRef(0),W=v?oh:b.Fragment,X=v?{as:VF,allowPinchZoom:!0}:void 0,te=Y=>{var ne,oe;const A=_.current+Y,z=R().filter(me=>!me.disabled),Q=document.activeElement,P=(ne=z.find(me=>me.ref.current===Q))==null?void 0:ne.textValue,fe=z.map(me=>me.textValue),ue=e$(fe,A,P),re=(oe=z.find(me=>me.textValue===ue))==null?void 0:oe.ref.current;(function me(Ce){_.current=Ce,window.clearTimeout(B.current),Ce!==""&&(B.current=window.setTimeout(()=>me(""),1e3))})(A),re&&setTimeout(()=>re.focus())};b.useEffect(()=>()=>window.clearTimeout(B.current),[]),fx();const q=b.useCallback(Y=>{var z,Q;return Z.current===((z=U.current)==null?void 0:z.side)&&n$(Y,(Q=U.current)==null?void 0:Q.area)},[]);return p.jsx(FF,{scope:n,searchRef:_,onItemEnter:b.useCallback(Y=>{q(Y)&&Y.preventDefault()},[q]),onItemLeave:b.useCallback(Y=>{var A;q(Y)||((A=D.current)==null||A.focus(),j(null))},[q]),onTriggerLeave:b.useCallback(Y=>{q(Y)&&Y.preventDefault()},[q]),pointerGraceTimerRef:V,onPointerGraceIntentChange:b.useCallback(Y=>{U.current=Y},[]),children:p.jsx(W,{...X,children:p.jsx(rh,{asChild:!0,trapped:i,onMountAutoFocus:we(o,Y=>{var A;Y.preventDefault(),(A=D.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:p.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:g,onDismiss:y,children:p.jsx(CE,{asChild:!0,...N,dir:C.dir,orientation:"vertical",loop:r,currentTabStopId:I,onCurrentTabStopIdChange:j,onEntryFocus:we(c,Y=>{C.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(jx,{role:"menu","aria-orientation":"vertical","data-state":UT(S.open),"data-radix-menu-content":"",dir:C.dir,...T,...w,ref:O,style:{outline:"none",...w.style},onKeyDown:we(w.onKeyDown,Y=>{const z=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,Q=Y.ctrlKey||Y.altKey||Y.metaKey,P=Y.key.length===1;z&&(Y.key==="Tab"&&Y.preventDefault(),!Q&&P&&te(Y.key));const fe=D.current;if(Y.target!==fe||!jF.includes(Y.key))return;Y.preventDefault();const re=R().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);kT.includes(Y.key)&&re.reverse(),QF(re)}),onBlur:we(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(B.current),_.current="")}),onPointerMove:we(e.onPointerMove,kc(Y=>{const A=Y.target,z=K.current!==Y.clientX;if(Y.currentTarget.contains(A)&&z){const Q=Y.clientX>K.current?"right":"left";Z.current=Q,K.current=Y.clientX}}))})})})})})})});MT.displayName=Dr;var HF="MenuGroup",Vx=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ve.div,{role:"group",...r,ref:t})});Vx.displayName=HF;var UF="MenuLabel",AT=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ve.div,{...r,ref:t})});AT.displayName=UF;var nf="MenuItem",Mb="menu.itemSelect",wh=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=b.useRef(null),s=Gc(nf,e.__scopeMenu),l=$x(nf,e.__scopeMenu),c=et(t,o),d=b.useRef(!1),h=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(Mb,{bubbles:!0,cancelable:!0});f.addEventListener(Mb,y=>r==null?void 0:r(y),{once:!0}),$C(f,g),g.defaultPrevented?d.current=!1:s.onClose()}};return p.jsx(jT,{...i,ref:c,disabled:n,onClick:we(e.onClick,h),onPointerDown:f=>{var g;(g=e.onPointerDown)==null||g.call(e,f),d.current=!0},onPointerUp:we(e.onPointerUp,f=>{var g;d.current||(g=f.currentTarget)==null||g.click()}),onKeyDown:we(e.onKeyDown,f=>{const g=l.searchRef.current!=="";n||g&&f.key===" "||uy.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});wh.displayName=nf;var jT=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=$x(nf,n),l=CT(n),c=b.useRef(null),d=et(t,c),[h,f]=b.useState(!1),[g,y]=b.useState("");return b.useEffect(()=>{const v=c.current;v&&y((v.textContent??"").trim())},[o.children]),p.jsx(bc.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:p.jsx(EE,{asChild:!0,...l,focusable:!r,children:p.jsx(Ve.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:we(e.onPointerMove,kc(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:we(e.onPointerLeave,kc(v=>s.onItemLeave(v))),onFocus:we(e.onFocus,()=>f(!0)),onBlur:we(e.onBlur,()=>f(!1))})})})}),WF="MenuCheckboxItem",RT=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return p.jsx(_T,{scope:e.__scopeMenu,checked:n,children:p.jsx(wh,{role:"menuitemcheckbox","aria-checked":rf(n)?"mixed":n,...i,ref:t,"data-state":Ux(n),onSelect:we(i.onSelect,()=>r==null?void 0:r(rf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});RT.displayName=WF;var PT="MenuRadioGroup",[qF,KF]=Bs(PT,{value:void 0,onValueChange:()=>{}}),OT=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=ln(r);return p.jsx(qF,{scope:e.__scopeMenu,value:n,onValueChange:o,children:p.jsx(Vx,{...i,ref:t})})});OT.displayName=PT;var IT="MenuRadioItem",DT=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=KF(IT,e.__scopeMenu),o=n===i.value;return p.jsx(_T,{scope:e.__scopeMenu,checked:o,children:p.jsx(wh,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Ux(o),onSelect:we(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});DT.displayName=IT;var Hx="MenuItemIndicator",[_T,GF]=Bs(Hx,{checked:!1}),LT=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=GF(Hx,n);return p.jsx(Un,{present:r||rf(o.checked)||o.checked===!0,children:p.jsx(Ve.span,{...i,ref:t,"data-state":Ux(o.checked)})})});LT.displayName=Hx;var YF="MenuSeparator",zT=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});zT.displayName=YF;var JF="MenuArrow",FT=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=vh(n);return p.jsx(Rx,{...i,...r,ref:t})});FT.displayName=JF;var XF="MenuSub",[iQ,$T]=Bs(XF),Ja="MenuSubTrigger",BT=b.forwardRef((e,t)=>{const n=Vs(Ja,e.__scopeMenu),r=Gc(Ja,e.__scopeMenu),i=$T(Ja,e.__scopeMenu),o=$x(Ja,e.__scopeMenu),s=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=o,d={__scopeMenu:e.__scopeMenu},h=b.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return b.useEffect(()=>h,[h]),b.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),p.jsx(zx,{asChild:!0,...d,children:p.jsx(jT,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":UT(n.open),...e,ref:qi(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)==null||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:we(e.onPointerMove,kc(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:we(e.onPointerLeave,kc(f=>{var y,v;h();const g=(y=n.content)==null?void 0:y.getBoundingClientRect();if(g){const w=(v=n.content)==null?void 0:v.dataset.side,S=w==="right",C=S?-5:5,T=g[S?"left":"right"],N=g[S?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+C,y:f.clientY},{x:T,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:T,y:g.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:we(e.onKeyDown,f=>{var y;const g=o.searchRef.current!=="";e.disabled||g&&f.key===" "||RF[r.dir].includes(f.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),f.preventDefault())})})})});BT.displayName=Ja;var VT="MenuSubContent",HT=b.forwardRef((e,t)=>{const n=NT(Dr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Vs(Dr,e.__scopeMenu),s=Gc(Dr,e.__scopeMenu),l=$T(VT,e.__scopeMenu),c=b.useRef(null),d=et(t,c);return p.jsx(bc.Provider,{scope:e.__scopeMenu,children:p.jsx(Un,{present:r||o.open,children:p.jsx(bc.Slot,{scope:e.__scopeMenu,children:p.jsx(Bx,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:d,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var f;s.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:we(e.onFocusOutside,h=>{h.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:we(e.onEscapeKeyDown,h=>{s.onClose(),h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{var y;const f=h.currentTarget.contains(h.target),g=PF[s.dir].includes(h.key);f&&g&&(o.onOpenChange(!1),(y=l.trigger)==null||y.focus(),h.preventDefault())})})})})})});HT.displayName=VT;function UT(e){return e?"open":"closed"}function rf(e){return e==="indeterminate"}function Ux(e){return rf(e)?"indeterminate":e?"checked":"unchecked"}function QF(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ZF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function e$(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=ZF(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const c=s.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function t$(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const l=t[o],c=t[s],d=l.x,h=l.y,f=c.x,g=c.y;h>r!=g>r&&n<(f-d)*(r-h)/(g-h)+d&&(i=!i)}return i}function n$(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return t$(n,t)}function kc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var r$=ET,i$=zx,o$=TT,s$=MT,l$=Vx,a$=AT,c$=wh,u$=RT,d$=OT,f$=DT,h$=LT,p$=zT,m$=FT,g$=BT,y$=HT,bh="DropdownMenu",[x$]=ni(bh,[ST]),Wn=ST(),[v$,WT]=x$(bh),qT=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:l=!0}=e,c=Wn(t),d=b.useRef(null),[h,f]=Fo({prop:i,defaultProp:o??!1,onChange:s,caller:bh});return p.jsx(v$,{scope:t,triggerId:Qr(),triggerRef:d,contentId:Qr(),open:h,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(g=>!g),[f]),modal:l,children:p.jsx(r$,{...c,open:h,onOpenChange:f,dir:r,modal:l,children:n})})};qT.displayName=bh;var KT="DropdownMenuTrigger",GT=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=WT(KT,n),s=Wn(n);return p.jsx(i$,{asChild:!0,...s,children:p.jsx(Ve.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:qi(t,o.triggerRef),onPointerDown:we(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:we(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});GT.displayName=KT;var w$="DropdownMenuPortal",YT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Wn(t);return p.jsx(o$,{...r,...n})};YT.displayName=w$;var JT="DropdownMenuContent",XT=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=WT(JT,n),o=Wn(n),s=b.useRef(!1);return p.jsx(s$,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:we(e.onCloseAutoFocus,l=>{var c;s.current||(c=i.triggerRef.current)==null||c.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:we(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;(!i.modal||h)&&(s.current=!0)}),style:{...e.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)"}})});XT.displayName=JT;var b$="DropdownMenuGroup",k$=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(l$,{...i,...r,ref:t})});k$.displayName=b$;var S$="DropdownMenuLabel",QT=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(a$,{...i,...r,ref:t})});QT.displayName=S$;var C$="DropdownMenuItem",ZT=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(c$,{...i,...r,ref:t})});ZT.displayName=C$;var E$="DropdownMenuCheckboxItem",e2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(u$,{...i,...r,ref:t})});e2.displayName=E$;var N$="DropdownMenuRadioGroup",T$=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(d$,{...i,...r,ref:t})});T$.displayName=N$;var M$="DropdownMenuRadioItem",t2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(f$,{...i,...r,ref:t})});t2.displayName=M$;var A$="DropdownMenuItemIndicator",n2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(h$,{...i,...r,ref:t})});n2.displayName=A$;var j$="DropdownMenuSeparator",r2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(p$,{...i,...r,ref:t})});r2.displayName=j$;var R$="DropdownMenuArrow",P$=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(m$,{...i,...r,ref:t})});P$.displayName=R$;var O$="DropdownMenuSubTrigger",i2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(g$,{...i,...r,ref:t})});i2.displayName=O$;var I$="DropdownMenuSubContent",o2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Wn(n);return p.jsx(y$,{...i,...r,ref:t,style:{...e.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)"}})});o2.displayName=I$;var D$=qT,_$=GT,L$=YT,s2=XT,l2=QT,a2=ZT,c2=e2,u2=t2,d2=n2,f2=r2,h2=i2,p2=o2;const m2=D$,g2=_$,z$=b.forwardRef(({className:e,inset:t,children:n,...r},i)=>p.jsxs(h2,{ref:i,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,p.jsx(rC,{className:"ml-auto h-4 w-4"})]}));z$.displayName=h2.displayName;const F$=b.forwardRef(({className:e,...t},n)=>p.jsx(p2,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",e),...t}));F$.displayName=p2.displayName;const Wx=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(L$,{children:p.jsx(s2,{ref:r,sideOffset:t,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",e),...n})}));Wx.displayName=s2.displayName;const of=b.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(a2,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));of.displayName=a2.displayName;const $$=b.forwardRef(({className:e,children:t,checked:n,...r},i)=>p.jsxs(c2,{ref:i,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(d2,{children:p.jsx(zs,{className:"h-4 w-4"})})}),t]}));$$.displayName=c2.displayName;const B$=b.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(u2,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(d2,{children:p.jsx(bI,{className:"h-2 w-2 fill-current"})})}),t]}));B$.displayName=u2.displayName;const V$=b.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(l2,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));V$.displayName=l2.displayName;const dy=b.forwardRef(({className:e,...t},n)=>p.jsx(f2,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));dy.displayName=f2.displayName;const H$={document:{label:"Document",icon:zo},tag:{label:"Tag",icon:cC},nest:{label:"Nest",icon:nC}};function U$({stewards:e,loading:t=!1,showScope:n=!1,className:r,onAddSteward:i,onRemove:o,compact:s=!1}){const[l,c]=b.useState(null),d=async g=>{if(o){c(g);try{await o(g)}finally{c(null)}}},h=g=>{const y=H$[g.scope];let v="";return g.scope==="tag"?v=g.tagName||"":g.scope==="document"&&(v=g.nodePattern||""),p.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[p.jsx(y.icon,{className:"h-3 w-3"}),p.jsx("span",{children:y.label}),v&&p.jsxs("span",{className:"opacity-75",children:[": ",v]})]})},f=g=>(g.userEmail[0]||"?").toUpperCase();return t?p.jsx("div",{className:Pe("flex items-center justify-center py-4",r),children:p.jsx(Ct,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.length===0?p.jsxs("div",{className:Pe("text-center py-4",r),children:[p.jsx(tr,{className:"h-8 w-8 mx-auto text-muted-foreground mb-2"}),p.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"No stewards assigned"}),i&&p.jsxs(ve,{variant:"outline",size:"sm",onClick:i,children:[p.jsx(Ml,{className:"h-4 w-4 mr-2"}),"Assign Steward"]})]}):s?p.jsxs("div",{className:Pe("flex items-center gap-1",r),children:[p.jsx(tr,{className:"h-4 w-4 text-muted-foreground"}),p.jsx("div",{className:"flex -space-x-2",children:e.slice(0,3).map(g=>p.jsx(Vo,{className:"h-6 w-6 border-2 border-background",children:p.jsx(Ho,{className:"text-[10px]",children:f(g)})},g.id))}),e.length>3&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",e.length-3]}),i&&p.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:i,children:p.jsx(Ml,{className:"h-3 w-3"})})]}):p.jsxs("div",{className:Pe("space-y-2",r),children:[e.map(g=>p.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg border bg-card",children:[p.jsx(Vo,{className:"h-8 w-8",children:p.jsx(Ho,{children:f(g)})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("p",{className:"font-medium text-sm truncate",children:g.userEmail}),n&&h(g),p.jsx("div",{className:"flex items-center gap-1 mt-1",children:p.jsx(Ir,{variant:"secondary",className:"text-[10px] px-1.5 py-0 capitalize",children:g.role})})]}),o&&p.jsxs(m2,{children:[p.jsx(g2,{asChild:!0,children:p.jsx(ve,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:l===g.id,children:l===g.id?p.jsx(Ct,{className:"h-4 w-4 animate-spin"}):p.jsx(AI,{className:"h-4 w-4"})})}),p.jsx(Wx,{align:"end",children:p.jsxs(of,{className:"text-destructive",onClick:()=>d(g.id),children:[p.jsx(_l,{className:"h-4 w-4 mr-2"}),"Remove"]})})]})]},g.id)),i&&p.jsxs(ve,{variant:"outline",className:"w-full",onClick:i,children:[p.jsx(Ml,{className:"h-4 w-4 mr-2"}),"Add Steward"]})]})}const yd={nest:{label:"Entire Nest",icon:nC,placeholder:""},tag:{label:"Tag",icon:cC,placeholder:"e.g., #architecture"},document:{label:"Document",icon:zo,placeholder:"e.g., nodes/getting-started"}};function W$({isOpen:e,onClose:t,nestId:n,onSubmit:r}){const[i,o]=b.useState(""),[s,l]=b.useState("tag"),[c,d]=b.useState(""),[h,f]=b.useState("reviewer"),[g,y]=b.useState(!1),[v,w]=b.useState(null),[S,C]=b.useState([]),[T,N]=b.useState(!1);b.useEffect(()=>{if(!e||s!=="document"||T)return;let D=!1;return N(!0),lx(n).then(O=>{if(D)return;const B=Array.isArray(O==null?void 0:O.nodes)?O.nodes:[];C(B)}).catch(O=>{console.error("[StewardAssignmentModal] documents fetch failed",O)}).finally(()=>{D||N(!1)}),()=>{D=!0}},[e,s,n]);const R=async()=>{if(!i.trim()){w("Please enter an email");return}if(s!=="nest"&&!c.trim()){w(`Please specify the ${s} target`);return}y(!0),w(null);try{await r({email:i.trim(),scope:s,target:s==="nest"?void 0:c.trim(),role:h}),I()}catch(D){w(D instanceof Error?D.message:"Failed to assign steward")}finally{y(!1)}},I=()=>{g||(o(""),l("tag"),d(""),f("reviewer"),w(null),C([]),t())},j=yd[s].icon;return p.jsx(Rn,{open:e,onOpenChange:I,children:p.jsxs(bn,{className:"sm:max-w-[500px]",children:[p.jsxs(kn,{children:[p.jsx(Sn,{children:"Assign Context Steward"}),p.jsx(Bn,{children:"Stewards can approve or reject documents within their assigned scope, ensuring quality context is available for AI."})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[v&&p.jsxs(Fr,{variant:"destructive",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:v})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(an,{htmlFor:"email",children:"Steward Email"}),p.jsx($n,{id:"email",type:"email",placeholder:"reviewer@acme.com",value:i,onChange:D=>o(D.target.value),disabled:g})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(an,{children:"Scope"}),p.jsxs(nc,{value:s,onValueChange:D=>{l(D),d("")},disabled:g,children:[p.jsx(Rl,{children:p.jsx(rc,{})}),p.jsx(Pl,{children:Object.entries(yd).map(([D,O])=>{const B=O.icon;return p.jsx(zn,{value:D,children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(B,{className:"h-4 w-4"}),O.label]})},D)})})]})]}),s!=="nest"&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs(an,{htmlFor:"target",children:[p.jsx(j,{className:"h-4 w-4 inline mr-2"}),s==="tag"?"Tag":`${yd[s].label}`]}),s==="tag"?p.jsx($n,{id:"target",placeholder:yd.tag.placeholder,value:c,onChange:D=>d(D.target.value),disabled:g}):p.jsxs(nc,{value:c,onValueChange:d,disabled:g||T,children:[p.jsx(Rl,{id:"target",children:p.jsx(rc,{placeholder:T?"Loading documents...":S.length===0?"No documents in this nest":"Select a document"})}),p.jsx(Pl,{children:S.map(D=>p.jsx(zn,{value:D.id,children:p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{children:D.title}),p.jsx("span",{className:"text-xs text-muted-foreground",children:D.id})]})},D.id))})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:s==="tag"?"Steward approves any document with this tag.":"Steward governs this specific document."})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(an,{children:"Role"}),p.jsxs(nc,{value:h,onValueChange:D=>f(D),disabled:g,children:[p.jsx(Rl,{children:p.jsx(rc,{})}),p.jsxs(Pl,{children:[p.jsx(zn,{value:"editor",children:"Editor — can edit but not approve"}),p.jsx(zn,{value:"reviewer",children:"Reviewer — can approve/reject"}),p.jsx(zn,{value:"viewer",children:"Viewer — read-only access"})]})]})]})]}),p.jsxs(zr,{children:[p.jsx(ve,{variant:"outline",onClick:I,disabled:g,children:"Cancel"}),p.jsxs(ve,{onClick:R,disabled:g||!i.trim(),children:[g?p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(Ml,{className:"h-4 w-4 mr-2"}),"Assign Steward"]})]})]})})}const q$={low:{label:"Low",className:"bg-gray-100 text-gray-600"},normal:{label:"Normal",className:"bg-blue-100 text-blue-600"},high:{label:"High",className:"bg-amber-100 text-amber-600",icon:U1},urgent:{label:"Urgent",className:"bg-red-100 text-red-600",icon:U1}};function K$(e){const t=new Date(e),r=new Date().getTime()-t.getTime();return r<6e4?"Just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:r<6048e5?`${Math.floor(r/864e5)}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function G$({requests:e,loading:t=!1,error:n=null,className:r,showHeader:i=!0,onRefresh:o,onSelect:s}){return t?p.jsxs(Bt,{className:r,children:[i&&p.jsx(on,{className:"pb-3",children:p.jsx(sn,{className:"text-lg",children:"Review Queue"})}),p.jsx(Vt,{children:p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(Ct,{className:"h-6 w-6 animate-spin text-muted-foreground"})})})]}):n?p.jsxs(Bt,{className:r,children:[i&&p.jsx(on,{className:"pb-3",children:p.jsx(sn,{className:"text-lg",children:"Review Queue"})}),p.jsx(Vt,{children:p.jsxs("div",{className:"text-center py-4 text-sm text-destructive",children:[n,o&&p.jsx(ve,{variant:"ghost",size:"sm",onClick:o,className:"ml-2",children:p.jsx(xc,{className:"h-4 w-4"})})]})})]}):p.jsxs(Bt,{className:r,children:[i&&p.jsx(on,{className:"pb-3",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx(sn,{className:"text-lg",children:"Review Queue"}),p.jsx(Ar,{children:"Documents awaiting your approval"})]}),o&&p.jsx(ve,{variant:"ghost",size:"icon",onClick:o,className:"h-8 w-8",children:p.jsx(xc,{className:"h-4 w-4"})})]})}),p.jsx(Vt,{children:e.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[p.jsx(Hi,{className:"h-10 w-10 text-green-500 mb-3"}),p.jsx("p",{className:"text-sm font-medium",children:"All caught up!"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"No documents awaiting review"})]}):p.jsx("div",{className:"space-y-2",children:e.map(l=>{var h;const c=q$[l.priority],d=c.icon;return p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors group",onClick:()=>s==null?void 0:s(l),children:[p.jsx(zo,{className:"h-5 w-5 text-blue-500 flex-shrink-0"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-medium truncate",children:l.nodeId}),p.jsxs(Ir,{variant:"secondary",className:Pe("text-[10px] px-1.5 py-0",c.className),children:[d&&p.jsx(d,{className:"h-3 w-3 mr-1"}),c.label]})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-1",children:[p.jsxs("span",{children:["v",l.version]}),p.jsx("span",{children:"•"}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(Vo,{className:"h-4 w-4",children:p.jsx(Ho,{className:"text-[8px]",children:((h=l.requestedBy[0])==null?void 0:h.toUpperCase())||"?"})}),p.jsx("span",{children:l.requestedBy})]}),p.jsx("span",{children:"•"}),p.jsx(qd,{className:"h-3 w-3"}),p.jsx("span",{children:K$(l.requestedAt)})]}),l.requestNote&&p.jsxs("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:["“",l.requestNote,"”"]})]}),p.jsx(rC,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]},l.id)})})})]})}const kh=b.forwardRef(({className:e,...t},n)=>p.jsx("textarea",{className:Pe("flex min-h-[82px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));kh.displayName="Textarea";function y2({documentTitle:e,version:t,onApprove:n,onReject:r,className:i}){const[o,s]=b.useState(null),[l,c]=b.useState(""),[d,h]=b.useState(!1),[f,g]=b.useState(null),y=async()=>{if(o){if(o==="reject"&&!l.trim()){g("Please provide feedback explaining why this document is being rejected.");return}h(!0),g(null);try{o==="approve"?await n(l||void 0):await r(l),v()}catch(w){g(w instanceof Error?w.message:`Failed to ${o} document`)}finally{h(!1)}}},v=()=>{d||(s(null),c(""),g(null))};return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:i,children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(ve,{variant:"outline",className:"border-green-200 text-green-700 hover:bg-green-50 hover:text-green-800",onClick:()=>s("approve"),children:[p.jsx(Hi,{className:"h-4 w-4 mr-2"})," Approve"]}),p.jsxs(ve,{variant:"outline",className:"border-red-200 text-red-700 hover:bg-red-50 hover:text-red-800",onClick:()=>s("reject"),children:[p.jsx(Ug,{className:"h-4 w-4 mr-2"})," Request Changes"]})]})}),p.jsx(Rn,{open:!!o,onOpenChange:v,children:p.jsxs(bn,{className:"sm:max-w-[425px]",children:[p.jsxs(kn,{children:[p.jsx(Sn,{children:o==="approve"?"Approve Document":"Request Changes"}),p.jsx(Bn,{children:o==="approve"?`Approve "${e}" (v${t}). This version will become the official AI context for this document.`:`Request changes for "${e}" (v${t}). The author will be notified with your feedback.`})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[f&&p.jsxs(Fr,{variant:"destructive",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:f})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(an,{htmlFor:"review-note",children:[p.jsx(cD,{className:"h-4 w-4 inline mr-2"}),o==="approve"?"Note (optional)":"Feedback (required)"]}),p.jsx(kh,{id:"review-note",placeholder:o==="approve"?"Add any notes for the author...":"Explain what changes are needed...",value:l,onChange:w=>c(w.target.value),disabled:d,className:"min-h-[100px]"}),o==="reject"&&p.jsx("p",{className:"text-xs text-muted-foreground",children:"Providing clear feedback helps authors make the right changes."})]})]}),p.jsxs(zr,{children:[p.jsx(ve,{variant:"outline",onClick:v,disabled:d,children:"Cancel"}),p.jsxs(ve,{onClick:y,disabled:d,className:o==="approve"?"bg-green-600 hover:bg-green-700":"bg-red-600 hover:bg-red-700",children:[d?p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}):o==="approve"?p.jsx(Hi,{className:"h-4 w-4 mr-2"}):p.jsx(Ug,{className:"h-4 w-4 mr-2"}),o==="approve"?"Approve":"Request Changes"]})]})]})})]})}function x2({isOpen:e,onClose:t,documentTitle:n,currentVersion:r,onSubmit:i}){const[o,s]=b.useState(""),[l,c]=b.useState("normal"),[d,h]=b.useState(!1),[f,g]=b.useState(null),y=async()=>{h(!0),g(null);try{await i(o,l),v()}catch(w){g(w instanceof Error?w.message:"Failed to submit for review")}finally{h(!1)}},v=()=>{d||(s(""),c("normal"),g(null),t())};return p.jsx(Rn,{open:e,onOpenChange:v,children:p.jsxs(bn,{className:"sm:max-w-[425px]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{children:["Publish “",n,"” (requires approval)"]}),p.jsxs(Bn,{children:["Publishing in this nest goes through stewardship. Version ",r,"will move to ",p.jsx("strong",{children:"pending review"}),"; once a steward approves it, this version becomes the AI-readable copy."]})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[f&&p.jsxs(Fr,{variant:"destructive",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:f})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(an,{htmlFor:"priority",children:"Priority"}),p.jsxs(nc,{value:l,onValueChange:w=>c(w),disabled:d,children:[p.jsx(Rl,{id:"priority",children:p.jsx(rc,{placeholder:"Select priority"})}),p.jsxs(Pl,{children:[p.jsx(zn,{value:"low",children:"Low"}),p.jsx(zn,{value:"normal",children:"Normal"}),p.jsx(zn,{value:"high",children:"High"}),p.jsx(zn,{value:"urgent",children:"Urgent"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(an,{htmlFor:"note",children:"Note for Reviewer (optional)"}),p.jsx(kh,{id:"note",placeholder:"Add context or specific areas to review...",value:o,onChange:w=>s(w.target.value),disabled:d,className:"min-h-[100px]"})]})]}),p.jsxs(zr,{children:[p.jsx(ve,{variant:"outline",onClick:v,disabled:d,children:"Cancel"}),p.jsxs(ve,{onClick:y,disabled:d,children:[d?p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(ox,{className:"h-4 w-4 mr-2"}),"Submit for approval"]})]})]})})}function Y$(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var qx="ScrollArea",[v2]=ni(qx),[J$,Br]=v2(qx),w2=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[l,c]=b.useState(null),[d,h]=b.useState(null),[f,g]=b.useState(null),[y,v]=b.useState(null),[w,S]=b.useState(null),[C,T]=b.useState(0),[N,R]=b.useState(0),[I,j]=b.useState(!1),[D,O]=b.useState(!1),B=et(t,V=>c(V)),_=Hc(i);return p.jsx(J$,{scope:n,type:r,dir:_,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:h,content:f,onContentChange:g,scrollbarX:y,onScrollbarXChange:v,scrollbarXEnabled:I,onScrollbarXEnabledChange:j,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:D,onScrollbarYEnabledChange:O,onCornerWidthChange:T,onCornerHeightChange:R,children:p.jsx(Ve.div,{dir:_,...s,ref:B,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});w2.displayName=qx;var b2="ScrollAreaViewport",k2=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=Br(b2,n),l=b.useRef(null),c=et(t,l,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),p.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});k2.displayName=b2;var wi="ScrollAreaScrollbar",Kx=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Br(wi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,l=e.orientation==="horizontal";return b.useEffect(()=>(l?o(!0):s(!0),()=>{l?o(!1):s(!1)}),[l,o,s]),i.type==="hover"?p.jsx(X$,{...r,ref:t,forceMount:n}):i.type==="scroll"?p.jsx(Q$,{...r,ref:t,forceMount:n}):i.type==="auto"?p.jsx(S2,{...r,ref:t,forceMount:n}):i.type==="always"?p.jsx(Gx,{...r,ref:t}):null});Kx.displayName=wi;var X$=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Br(wi,e.__scopeScrollArea),[o,s]=b.useState(!1);return b.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),s(!0)},h=()=>{c=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),p.jsx(Un,{present:n||o,children:p.jsx(S2,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Q$=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Br(wi,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Ch(()=>c("SCROLL_END"),100),[l,c]=Y$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,i.scrollHideDelay,c]),b.useEffect(()=>{const d=i.viewport,h=o?"scrollLeft":"scrollTop";if(d){let f=d[h];const g=()=>{const y=d[h];f!==y&&(c("SCROLL"),s()),f=y};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[i.viewport,o,c,s]),p.jsx(Un,{present:n||l!=="hidden",children:p.jsx(Gx,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:we(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),S2=b.forwardRef((e,t)=>{const n=Br(wi,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=b.useState(!1),l=e.orientation==="horizontal",c=Ch(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?d:h)}},10);return Fl(n.viewport,c),Fl(n.content,c),p.jsx(Un,{present:r||o,children:p.jsx(Gx,{"data-state":o?"visible":"hidden",...i,ref:t})})}),Gx=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Br(wi,e.__scopeScrollArea),o=b.useRef(null),s=b.useRef(0),[l,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=M2(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function f(g,y){return iB(g,s.current,l,y)}return n==="horizontal"?p.jsx(Z$,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollLeft,y=Ab(g,l,i.dir);o.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=f(g,i.dir))}}):n==="vertical"?p.jsx(eB,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollTop,y=Ab(g,l);o.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=f(g))}}):null}),Z$=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Br(wi,e.__scopeScrollArea),[s,l]=b.useState(),c=b.useRef(null),d=et(t,c,o.onScrollbarXChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),p.jsx(E2,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sh(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,f)=>{if(o.viewport){const g=o.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),j2(g,f)&&h.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:lf(s.paddingLeft),paddingEnd:lf(s.paddingRight)}})}})}),eB=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Br(wi,e.__scopeScrollArea),[s,l]=b.useState(),c=b.useRef(null),d=et(t,c,o.onScrollbarYChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),p.jsx(E2,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sh(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,f)=>{if(o.viewport){const g=o.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),j2(g,f)&&h.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:lf(s.paddingTop),paddingEnd:lf(s.paddingBottom)}})}})}),[tB,C2]=v2(wi),E2=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:h,onResize:f,...g}=e,y=Br(wi,n),[v,w]=b.useState(null),S=et(t,B=>w(B)),C=b.useRef(null),T=b.useRef(""),N=y.viewport,R=r.content-r.viewport,I=ln(h),j=ln(c),D=Ch(f,10);function O(B){if(C.current){const _=B.clientX-C.current.left,V=B.clientY-C.current.top;d({x:_,y:V})}}return b.useEffect(()=>{const B=_=>{const V=_.target;(v==null?void 0:v.contains(V))&&I(_,R)};return document.addEventListener("wheel",B,{passive:!1}),()=>document.removeEventListener("wheel",B,{passive:!1})},[N,v,R,I]),b.useEffect(j,[r,j]),Fl(v,D),Fl(y.content,D),p.jsx(tB,{scope:n,scrollbar:v,hasThumb:i,onThumbChange:ln(o),onThumbPointerUp:ln(s),onThumbPositionChange:j,onThumbPointerDown:ln(l),children:p.jsx(Ve.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:we(e.onPointerDown,B=>{B.button===0&&(B.target.setPointerCapture(B.pointerId),C.current=v.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),O(B))}),onPointerMove:we(e.onPointerMove,O),onPointerUp:we(e.onPointerUp,B=>{const _=B.target;_.hasPointerCapture(B.pointerId)&&_.releasePointerCapture(B.pointerId),document.body.style.webkitUserSelect=T.current,y.viewport&&(y.viewport.style.scrollBehavior=""),C.current=null})})})}),sf="ScrollAreaThumb",N2=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=C2(sf,e.__scopeScrollArea);return p.jsx(Un,{present:n||i.hasThumb,children:p.jsx(nB,{ref:t,...r})})}),nB=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=Br(sf,n),s=C2(sf,n),{onThumbPositionChange:l}=s,c=et(t,f=>s.onThumbChange(f)),d=b.useRef(void 0),h=Ch(()=>{d.current&&(d.current(),d.current=void 0)},100);return b.useEffect(()=>{const f=o.viewport;if(f){const g=()=>{if(h(),!d.current){const y=oB(f,l);d.current=y,l()}};return l(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[o.viewport,h,l]),p.jsx(Ve.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:we(e.onPointerDownCapture,f=>{const y=f.target.getBoundingClientRect(),v=f.clientX-y.left,w=f.clientY-y.top;s.onThumbPointerDown({x:v,y:w})}),onPointerUp:we(e.onPointerUp,s.onThumbPointerUp)})});N2.displayName=sf;var Yx="ScrollAreaCorner",T2=b.forwardRef((e,t)=>{const n=Br(Yx,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.jsx(rB,{...e,ref:t}):null});T2.displayName=Yx;var rB=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Br(Yx,n),[o,s]=b.useState(0),[l,c]=b.useState(0),d=!!(o&&l);return Fl(i.scrollbarX,()=>{var f;const h=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(h),c(h)}),Fl(i.scrollbarY,()=>{var f;const h=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(h),s(h)}),d?p.jsx(Ve.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function lf(e){return e?parseInt(e,10):0}function M2(e,t){const n=e/t;return isNaN(n)?0:n}function Sh(e){const t=M2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function iB(e,t,n,r="ltr"){const i=Sh(n),o=i/2,s=t||o,l=i-s,c=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,f=r==="ltr"?[0,h]:[h*-1,0];return A2([c,d],f)(e)}function Ab(e,t,n="ltr"){const r=Sh(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,l=o-r,c=n==="ltr"?[0,s]:[s*-1,0],d=iy(e,c);return A2([0,s],[0,l])(d)}function A2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function j2(e,t){return e>0&&e<t}var oB=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,l=n.top!==o.top;(s||l)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Ch(e,t){const n=ln(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Fl(e,t){const n=ln(t);qt(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var R2=w2,sB=k2,lB=T2;const fy=b.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(R2,{ref:r,className:Pe("relative overflow-hidden",e),...n,children:[p.jsx(sB,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(P2,{}),p.jsx(lB,{})]}));fy.displayName=R2.displayName;const P2=b.forwardRef(({className:e,orientation:t="vertical",...n},r)=>p.jsx(Kx,{ref:r,orientation:t,className:Pe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:p.jsx(N2,{className:"relative flex-1 rounded-full bg-border"})}));P2.displayName=Kx.displayName;function jb(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function aB({versions:e,currentVersion:t,approvedVersion:n,loading:r=!1,onRestore:i,className:o}){var w;const[s,l]=b.useState(null),[c,d]=b.useState(null),[h,f]=b.useState(!1),g=async()=>{if(!(!c||!i)){f(!0);try{await i(c),d(null)}finally{f(!1)}}};if(r)return p.jsxs(Bt,{className:o,children:[p.jsx(on,{className:"pb-3",children:p.jsxs(sn,{className:"text-sm font-medium flex items-center gap-2",children:[p.jsx(qg,{className:"h-4 w-4"}),"Version History"]})}),p.jsx(Vt,{children:p.jsx("div",{className:"flex items-center justify-center py-4",children:p.jsx(Ct,{className:"h-5 w-5 animate-spin text-muted-foreground"})})})]});const y=(w=e.find(S=>S.version===t))==null?void 0:w.status,v=y==="approved"?"bg-green-100 text-green-800 border-green-200":y==="rejected"?"bg-red-100 text-red-800 border-red-200":y==="pending_review"?"bg-amber-100 text-amber-800 border-amber-200":"bg-muted text-muted-foreground";return p.jsxs(Bt,{className:o,children:[p.jsx(on,{className:"pb-3",children:p.jsxs(sn,{className:"text-sm font-medium flex items-center gap-2",children:[p.jsx(qg,{className:"h-4 w-4"}),"Version History",y&&p.jsx(Ir,{variant:"outline",className:`text-[10px] ${v}`,children:y.replace("_"," ")}),p.jsxs(Ir,{variant:"secondary",className:"text-[10px] ml-auto",children:["v",t]})]})}),p.jsx(Vt,{children:e.length===0?p.jsx("div",{className:"text-center py-4 text-sm text-muted-foreground",children:"No version history"}):p.jsx(fy,{className:"h-[60vh] max-h-[480px] pr-2",children:p.jsx("div",{className:"space-y-1",children:e.map(S=>{const C=S.version===n;return p.jsxs("div",{className:`flex items-center justify-between p-2 rounded hover:bg-muted/50 group ${C?"bg-green-50 border border-green-200":""}`,children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:["Version ",S.version,C&&p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-green-700",children:[p.jsx(Hi,{className:"h-3 w-3"})," AI-active"]})]}),p.jsxs("div",{className:"text-xs text-muted-foreground break-words",children:[jb(S.editedAt)," · ",S.editedBy,S.changeNote&&` · ${S.changeNote}`]}),S.resolvedBy&&p.jsxs("div",{className:"text-xs text-muted-foreground break-words",children:[S.resolutionStatus==="rejected"?"Rejected by":"Approved by"," ",p.jsx("span",{className:"font-medium",children:S.resolvedBy})]})]}),p.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[S.content&&p.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>l(S),children:p.jsx($c,{className:"h-3.5 w-3.5"})}),i&&S.version!==t&&p.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>d(S.version),children:p.jsx(V1,{className:"h-3.5 w-3.5"})})]})]},S.version)})})})}),p.jsx(Rn,{open:!!s,onOpenChange:()=>l(null),children:p.jsxs(bn,{className:"max-w-2xl max-h-[80vh]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{children:["Version ",s==null?void 0:s.version," Preview"]}),p.jsxs(Bn,{children:[s&&jb(s.editedAt),(s==null?void 0:s.changeNote)&&` · ${s.changeNote}`]})]}),p.jsx(fy,{className:"max-h-[50vh]",children:p.jsx("pre",{className:"text-sm whitespace-pre-wrap font-mono p-4 bg-muted/30 rounded",children:(s==null?void 0:s.content)||"(no content)"})}),p.jsxs(zr,{children:[p.jsx(ve,{variant:"outline",onClick:()=>l(null),children:"Close"}),i&&s&&s.version!==t&&p.jsxs(ve,{onClick:()=>{d(s.version),l(null)},children:[p.jsx(V1,{className:"h-4 w-4 mr-2"}),"Restore This Version"]})]})]})}),p.jsx(Rn,{open:!!c,onOpenChange:()=>d(null),children:p.jsxs(bn,{children:[p.jsxs(kn,{children:[p.jsxs(Sn,{children:["Restore Version ",c,"?"]}),p.jsxs(Bn,{children:["This will create a new version with the content from version ",c,". Your current content will be saved in the version history."]})]}),p.jsxs(zr,{children:[p.jsx(ve,{variant:"outline",onClick:()=>d(null),disabled:h,children:"Cancel"}),p.jsx(ve,{onClick:g,disabled:h,children:h?"Restoring...":"Restore"})]})]})})]})}const Rb={draft:{label:"Draft",icon:DI,className:"bg-gray-100 text-gray-700 border-gray-200"},pending_review:{label:"Pending Review",icon:qd,className:"bg-amber-100 text-amber-700 border-amber-200"},approved:{label:"Approved",icon:Hi,className:"bg-green-100 text-green-700 border-green-200"},published:{label:"Published",icon:Hi,className:"bg-green-100 text-green-700 border-green-200"},rejected:{label:"Rejected",icon:Ug,className:"bg-red-100 text-red-700 border-red-200"},external_edit_pending:{label:"External Edit",icon:Kd,className:"bg-orange-100 text-orange-700 border-orange-200"}};function cB({status:e,approvedVersion:t,currentVersion:n,showIcon:r=!0,size:i="default",className:o}){const s=Rb[e]||Rb.draft,l=s.icon,c=(e==="approved"||e==="published")&&t&&n&&t<n;return p.jsxs(Ir,{variant:"outline",className:Pe("!rounded-sm",s.className,i==="sm"&&"text-[10px] px-1.5 py-0",o),children:[r&&p.jsx(l,{className:Pe("mr-1",i==="sm"?"h-3 w-3":"h-3.5 w-3.5")}),s.label,c&&p.jsxs("span",{className:"ml-1 text-[10px] opacity-75",children:["(v",t,")"]})]})}function uB({patch:e,className:t}){const n=e.split(/\r?\n/);return p.jsx("pre",{className:Pe("rounded-md border bg-background text-xs leading-relaxed overflow-x-auto","max-h-96",t),"data-testid":"diff-viewer",children:n.map((r,i)=>p.jsx("div",{className:dB(r),children:p.jsx("code",{className:"block px-3 whitespace-pre",children:r||" "})},i))})}function dB(e){return e.startsWith("+++")||e.startsWith("---")?"bg-muted/60 text-muted-foreground font-semibold":e.startsWith("@@")?"bg-blue-100/60 dark:bg-blue-950/40 text-blue-900 dark:text-blue-200":e.startsWith("+")?"bg-green-100/60 dark:bg-green-950/40 text-green-900 dark:text-green-200":e.startsWith("-")?"bg-red-100/60 dark:bg-red-950/40 text-red-900 dark:text-red-200":"text-foreground/80"}function fB({nestId:e,nodeId:t,pending:n,onResolved:r}){const[i,o]=b.useState(null),[s,l]=b.useState(!1),[c,d]=b.useState(""),[h,f]=b.useState(null),[g,y]=b.useState(null),v=async()=>{o("approve"),y(null);try{await v_(e,t,n.suggestion_id),r()}catch(C){y(C.message||"Approval failed")}finally{o(null)}},w=async()=>{if(!c.trim()){y("Rejection reason is required");return}o("reject"),y(null);try{await w_(e,t,n.suggestion_id,c.trim()),r()}catch(C){y(C.message||"Rejection failed")}finally{o(null)}},S=async()=>{if(h){f(null);return}o("view"),y(null);try{const{entry:C}=await x_(e,t,n.suggestion_id);f(C)}catch(C){y(C.message||"Failed to load diff")}finally{o(null)}};return p.jsxs(Fr,{className:"border-orange-300 bg-orange-50 dark:bg-orange-950/30",children:[p.jsx(Kd,{className:"h-4 w-4 text-orange-700 dark:text-orange-400"}),p.jsxs($r,{className:"space-y-3",children:[p.jsxs("div",{children:[p.jsx("strong",{className:"text-orange-900 dark:text-orange-200",children:"This file was edited outside the app."})," ",p.jsxs("span",{className:"text-sm text-orange-800/90 dark:text-orange-300/90",children:["Detected ",new Date(n.detected_at).toLocaleString()," ·"," ",p.jsx("code",{className:"text-xs",children:n.source}),". The displayed content is the last approved version; the on-disk change is staged for review."]})]}),g&&p.jsx("div",{className:"text-sm text-red-700 dark:text-red-400",children:g}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsxs(ve,{size:"sm",onClick:v,disabled:i!==null,"data-testid":"external-edit-approve",children:[i==="approve"?p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Approve change"]}),p.jsx(ve,{size:"sm",variant:"outline",onClick:()=>l(C=>!C),disabled:i!==null,"data-testid":"external-edit-reject-toggle",children:"Reject"}),p.jsxs(ve,{size:"sm",variant:"ghost",onClick:S,disabled:i!==null,"data-testid":"external-edit-view-diff",children:[i==="view"?p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}):null,h?"Hide diff":"View diff"]})]}),s&&p.jsxs("div",{className:"space-y-2 pt-1",children:[p.jsx(kh,{value:c,onChange:C=>d(C.target.value),placeholder:"Reason for rejecting this external edit (required, kept in audit log)",rows:2,"data-testid":"external-edit-reject-reason"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(ve,{size:"sm",variant:"destructive",onClick:w,disabled:i!==null||!c.trim(),"data-testid":"external-edit-reject-confirm",children:[i==="reject"?p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Confirm reject"]}),p.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>{l(!1),d("")},disabled:i!==null,children:"Cancel"})]})]}),(h==null?void 0:h.patch)&&p.jsx("div",{className:"pt-2",children:p.jsx(uB,{patch:h.patch})})]})]})}function yn(e){this.content=e}yn.prototype={constructor:yn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new yn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new yn(n)},addToStart:function(e,t){return new yn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new yn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new yn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=yn.from(e),e.size?new yn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=yn.from(e),e.size?new yn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=yn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};yn.from=function(e){if(e instanceof yn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new yn(t)};function O2(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=O2(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function I2(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),l=t.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,h=Math.min(s.text.length,l.text.length);for(;d<h&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=I2(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class ae{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let c=this.content[s],d=l+c.nodeSize;if(d>t&&r(c,i+l,o||null,s)!==!1&&c.content.size){let h=l+1;c.nodesBetween(Math.max(0,t-h),Math.min(c.content.size,n-h),r,i+h)}l=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(t,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new ae(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,s=0;s<n;o++){let l=this.content[o],c=s+l.nodeSize;c>t&&((s<t||c>n)&&(l.isText?l=l.cut(Math.max(0,t-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,t-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new ae(r,i)}cutByIndex(t,n){return t==n?ae.empty:t==0&&n==this.content.length?this:new ae(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new ae(i,o)}addToStart(t){return new ae([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new ae(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.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(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return O2(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return I2(this,t,n,r)}findIndex(t){if(t==0)return xd(0,t);if(t==this.size)return xd(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t?xd(n+1,o):xd(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return ae.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ae(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return ae.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new ae(n||t,r)}static from(t){if(!t)return ae.empty;if(t instanceof ae)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new ae([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ae.empty=new ae([],0);const Ym={index:0,offset:0};function xd(e,t){return Ym.index=e,Ym.offset=t,Ym}function af(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!af(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!af(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let ft=class hy{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&af(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return hy.none;if(t instanceof hy)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ft.none=[];class cf extends Error{}class ke{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=_2(this.content,t+this.openStart,n);return r&&new ke(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ke(D2(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ke.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ke(ae.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ke(t,r,i)}}ke.empty=new ke(ae.empty,0,0);function D2(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(i==t||o.isText){if(l!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(D2(o.content,t-i-1,n-i-1)))}function _2(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=_2(s.content,t-o-1,n,s);return l&&e.replaceChild(i,s.copy(l))}function hB(e,t,n){if(n.openStart>e.depth)throw new cf("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new cf("Inconsistent open depths");return L2(e,t,n,0)}function L2(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=L2(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,l=s.content;return Cs(s,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}else{let{start:s,end:l}=pB(n,e);return Cs(o,F2(e,s,l,t,r))}else return Cs(o,uf(e,t,r))}function z2(e,t){if(!t.type.compatibleContent(e.type))throw new cf("Cannot join "+t.type.name+" onto "+e.type.name)}function py(e,t,n){let r=e.node(n);return z2(r,t.node(n)),r}function Ss(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ic(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Ss(e.nodeAfter,r),o++));for(let l=o;l<s;l++)Ss(i.child(l),r);t&&t.depth==n&&t.textOffset&&Ss(t.nodeBefore,r)}function Cs(e,t){return e.type.checkContent(t),e.copy(t)}function F2(e,t,n,r,i){let o=e.depth>i&&py(e,t,i+1),s=r.depth>i&&py(n,r,i+1),l=[];return ic(null,e,i,l),o&&s&&t.index(i)==n.index(i)?(z2(o,s),Ss(Cs(o,F2(e,t,n,r,i+1)),l)):(o&&Ss(Cs(o,uf(e,t,i+1)),l),ic(t,n,i,l),s&&Ss(Cs(s,uf(n,r,i+1)),l)),ic(r,null,i,l),new ae(l)}function uf(e,t,n){let r=[];if(ic(null,e,n,r),e.depth>n){let i=py(e,t,n+1);Ss(Cs(i,uf(e,t,n+1)),r)}return ic(t,null,n,r),new ae(r)}function pB(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(ae.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Sc{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return ft.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new df(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Sc(n,r,o)}static resolveCached(t,n){let r=Pb.get(t);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else Pb.set(t,r=new mB);let i=r.elts[r.i]=Sc.resolve(t,n);return r.i=(r.i+1)%gB,i}}class mB{constructor(){this.elts=[],this.i=0}}const gB=12,Pb=new WeakMap;class df{constructor(t,n,r){this.$from=t,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 yB=Object.create(null);let Oo=class my{constructor(t,n,r,i=ft.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||ae.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&af(this.attrs,n||t.defaultAttrs||yB)&&ft.sameSet(this.marks,r||ft.none)}copy(t=null){return t==this.content?this:new my(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new my(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ke.empty;let i=this.resolve(t),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new ke(d,i.depth-s,o.depth-s)}replace(t,n,r){return hB(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Sc.resolveCached(this,t)}resolveNoCache(t){return Sc.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),$2(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=ae.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=ft.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!ft.sameSet(t,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 t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,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(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=ae.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Oo.prototype.text=void 0;class ff extends Oo{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):$2(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new ff(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ff(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function $2(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ps{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new xB(t,n);if(r.next==null)return Ps.empty;let i=B2(r);r.next&&r.err("Unexpected trailing text");let o=EB(CB(i));return NB(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(t,r);if(c&&(!n||c.validEnd))return ae.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:h,next:f}=s.next[d];if(!(h.isText||h.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let g=o(f,l.concat(h));if(g)return g}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return o}).join(`
|
|
448
|
+
`)}}Ps.empty=new Ps(!0);class xB{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function B2(e){let t=[];do t.push(vB(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function vB(e){let t=[];do t.push(wB(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function wB(e){let t=SB(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=bB(e,t);else break;return t}function Ob(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function bB(e,t){let n=Ob(e),r=n;return e.eat(",")&&(e.next!="}"?r=Ob(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function kB(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function SB(e){if(e.eat("(")){let t=B2(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=kB(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function CB(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,l,c){let d={term:c,to:l};return t[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let h=n();i(o(s.expr,c),h),c=h}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let h=n();r(c,h),i(o(s.expr,c),h),c=h}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function V2(e,t){return t-e}function Ib(e,t){let n=[];return r(t),n.sort(V2);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:c}=o[s];!l&&n.indexOf(c)==-1&&r(c)}}}function EB(e){let t=Object.create(null);return n(Ib(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let h=0;h<i.length;h++)i[h][0]==l&&(d=i[h][1]);Ib(e,c).forEach(h=>{d||i.push([l,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let o=t[r.join(",")]=new Ps(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(V2);o.next.push({type:i[s][0],next:t[l.join(",")]||n(l)})}return o}}function NB(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function H2(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function U2(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function W2(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function q2(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new MB(e,r,t[r]);return n}let Db=class K2{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=q2(t,r.attrs),this.defaultAttrs=H2(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ps.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:U2(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Oo(this,this.computeAttrs(t),ae.from(n),ft.setFrom(r))}createChecked(t=null,n,r){return n=ae.from(n),this.checkContent(n),new Oo(this,this.computeAttrs(t),n,ft.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=ae.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(ae.empty,!0);return o?new Oo(this,t,n.append(o),ft.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){W2(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:ft.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,s)=>r[o]=new K2(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function TB(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class MB{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?TB(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Eh{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=q2(t,i.attrs),this.excluded=null;let o=H2(this.attrs);this.instance=o?new ft(this,o):null}create(t=null){return!t&&this.instance?this.instance:new ft(this,U2(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new Eh(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){W2(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}let G2=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=yn.from(t.nodes),n.marks=yn.from(t.marks||{}),this.nodes=Db.compile(this.spec.nodes,this),this.marks=Eh.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Ps.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?_b(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:_b(this,s.split(" "))}this.nodeFromJSON=i=>Oo.fromJSON(this,i),this.markFromJSON=i=>ft.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Db){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new ff(r,r.defaultAttrs,t,ft.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}};function _b(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let l in e.marks){let c=e.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function AB(e){return e.tag!=null}function jB(e){return e.style!=null}class Io{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(AB(i))this.tags.push(i);else if(jB(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new zb(this,n,!1);return r.addAll(t,ft.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new zb(this,n,!0);return r.addAll(t,ft.none,n.from,n.to),ke.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(OB(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(t);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||l.length>t.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Fb(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Fb(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Io(t,Io.schemaRules(t)))}}const Y2={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},RB={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},J2={ol:!0,ul:!0},Cc=1,gy=2,oc=4;function Lb(e,t,n){return t!=null?(t?Cc:0)|(t==="full"?gy:0):e&&e.whitespace=="pre"?Cc|gy:n&~oc}class vd{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=ft.none,this.match=o||(s&oc?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ae.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Cc)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=ae.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(ae.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Y2.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class zb{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Lb(null,n.preserveWhitespace,0)|(r?oc:0);i?o=new vd(i.type,i.attrs,ft.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new vd(null,null,ft.none,!0,null,s):o=new vd(t.schema.topNodeType,null,ft.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&gy?"full":this.localPreserveWS||(i.options&Cc)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
449
|
+
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(s.linebreakReplacement.create(),n,!0),l[c]&&this.insertNode(s.text(l[c]),n,!/\S/.test(l[c]));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 l=i.content[i.content.length-1],c=t.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),l;J2.hasOwnProperty(s)&&this.parser.normalizeLists&&PB(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(l=this.parser.matchTag(t,this,r));e:if(c?c.ignore:RB.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let d,h=this.needsBlock;if(Y2.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let f=c&&c.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),d&&this.sync(o),this.needsBlock=h}else{let d=this.readStyles(t,n);d&&this.addElementByRule(t,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
450
|
+
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let c=this.parser.matchStyle(o,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,r),this.findAround(t,c,!1)}o&&this.sync(l)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,l=i==null?null:t.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n,r){let i,o;for(let s=this.open,l=0;s>=0;s--){let c=this.nodes[s],d=c.findWrapping(t);if(d&&(!i||i.length>d.length+l)&&(i=d,o=c,!d.length))break;if(c.solid){if(r)break;l+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let s=ft.none;for(let l of i.concat(t.marks))(o.type?o.type.allowsMarkType(l.type):$b(l.type,t.type))&&(s=l.addToSet(s));return o.content.push(t.mark(s)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r,!1);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let l=Lb(t,o,s.options);s.options&oc&&s.content.length==0&&(l|=oc);let c=ft.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):$b(d.type,t))?(c=d.addToSet(c),!1):!0),this.nodes.push(new vd(t,n,c,i,null,l)),this.open++,r}closeExtra(t=!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(t));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(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Cc)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let h=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!h||h.name!=d&&!h.isInGroup(d))return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.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 PB(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&J2.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function OB(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Fb(e){let t={};for(let n in e)t[n]=e[n];return t}function $b(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=l=>{o.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:h}=l.edge(c);if(d==t||o.indexOf(h)<0&&s(h))return!0}};if(s(i.contentMatch))return!0}}class Hs{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Jm(n).createDocumentFragment());let i=r,o=[];return t.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],h=this.serializeMark(d,s.isInline,n);h&&(o.push([d,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=$d(Jm(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&$d(Jm(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return $d(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Hs(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Bb(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return Bb(t.marks)}}function Bb(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Jm(e){return e.document||window.document}const Vb=new WeakMap;function IB(e){let t=Vb.get(e);return t===void 0&&Vb.set(e,t=DB(e)),t}function DB(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function $d(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=IB(r))&&o.indexOf(t)>-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 s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,c=n?e.createElementNS(n,i):e.createElement(i),d=t[1],h=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){h=2;for(let f in d)if(d[f]!=null){let g=f.indexOf(" ");g>0?c.setAttributeNS(f.slice(0,g),f.slice(g+1),d[f]):f=="style"&&c.style?c.style.cssText=d[f]:c.setAttribute(f,d[f])}}for(let f=h;f<t.length;f++){let g=t[f];if(g===0){if(f<t.length-1||f>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:y,contentDOM:v}=$d(e,g,n,r);if(c.appendChild(y),v){if(l)throw new RangeError("Multiple content holes");l=v}}}return{dom:c,contentDOM:l}}const X2=65535,Q2=Math.pow(2,16);function _B(e,t){return e+t*Q2}function Hb(e){return e&X2}function LB(e){return(e-(e&X2))/Q2}const Z2=1,eM=2,Bd=4,tM=8;class yy{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&tM)>0}get deletedBefore(){return(this.delInfo&(Z2|Bd))>0}get deletedAfter(){return(this.delInfo&(eM|Bd))>0}get deletedAcross(){return(this.delInfo&Bd)>0}}class fr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&fr.empty)return fr.empty}recover(t){let n=0,r=Hb(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+LB(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>t)break;let d=this.ranges[l+o],h=this.ranges[l+s],f=c+d;if(t<=f){let g=d?t==c?-1:t==f?1:n:n,y=c+i+(g<0?0:h);if(r)return y;let v=t==(n<0?c:f)?null:_B(l/3,t-c),w=t==c?eM:t==f?Z2:Bd;return(n<0?t!=c:t!=f)&&(w|=tM),new yy(y,w,v)}i+=h-d}return r?t+i:new yy(t+i,0,null)}touches(t,n){let r=0,i=Hb(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>t)break;let d=this.ranges[l+o],h=c+d;if(t<=h&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],h=this.ranges[i+r];t(l,l+d,c,c+h),o+=h-d}}invert(){return new fr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?fr.empty:new fr(t<0?[0,-t,0]:[0,0,t])}}fr.empty=new fr([]);class Ec{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Ec(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Ec;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],l=s.mapResult(t,n);if(l.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,t=this._maps[c].recover(l.recover);continue}}i|=l.delInfo,t=l.pos}return r?t:new yy(t,i,null)}}const Xm=Object.create(null);class On{getMap(){return fr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Xm[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Xm)throw new RangeError("Duplicate use of step JSON ID "+t);return Xm[t]=n,n.prototype.jsonID=t,n}}class Ut{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Ut(t,null)}static fail(t){return new Ut(null,t)}static fromReplace(t,n,r,i){try{return Ut.ok(t.replace(n,r,i))}catch(o){if(o instanceof cf)return Ut.fail(o.message);throw o}}}function Jx(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Jx(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return ae.fromArray(r)}class jo extends On{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ke(Jx(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ut.fromReplace(t,this.from,this.to,o)}invert(){return new Xr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new jo(n.pos,r.pos,this.mark)}merge(t){return t instanceof jo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new jo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new jo(n.from,n.to,t.markFromJSON(n.mark))}}On.jsonID("addMark",jo);class Xr extends On{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ke(Jx(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Ut.fromReplace(t,this.from,this.to,r)}invert(){return new jo(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Xr(n.pos,r.pos,this.mark)}merge(t){return t instanceof Xr&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Xr(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Xr(n.from,n.to,t.markFromJSON(n.mark))}}On.jsonID("removeMark",Xr);class Ro extends On{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ut.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ut.fromReplace(t,this.pos,this.pos+1,new ke(ae.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ro(this.pos,n.marks[i]);return new Ro(this.pos,this.mark)}}return new Os(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ro(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ro(n.pos,t.markFromJSON(n.mark))}}On.jsonID("addNodeMark",Ro);class Os extends On{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ut.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ut.fromReplace(t,this.pos,this.pos+1,new ke(ae.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ro(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Os(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Os(n.pos,t.markFromJSON(n.mark))}}On.jsonID("removeNodeMark",Os);class Ht extends On{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&xy(t,this.from,this.to)?Ut.fail("Structure replace would overwrite content"):Ut.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new fr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ht(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&Ht.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Ht(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Ht)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ke.empty:new ke(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Ht(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ke.empty:new ke(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Ht(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ht(n.from,n.to,ke.fromJSON(t,n.slice),!!n.structure)}}Ht.MAP_BIAS=1;On.jsonID("replace",Ht);class cn extends On{constructor(t,n,r,i,o,s,l=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(t){if(this.structure&&(xy(t,this.from,this.gapFrom)||xy(t,this.gapTo,this.to)))return Ut.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ut.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ut.fromReplace(t,this.from,this.to,r):Ut.fail("Content does not fit in gap")}getMap(){return new fr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new cn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new cn(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,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 cn(n.from,n.to,n.gapFrom,n.gapTo,ke.fromJSON(t,n.slice),n.insert,!!n.structure)}}On.jsonID("replaceAround",cn);function xy(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function zB(e,t,n,r){let i=[],o=[],s,l;e.doc.nodesBetween(t,n,(c,d,h)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&h.type.allowsMarkType(r.type)){let g=Math.max(d,t),y=Math.min(d+c.nodeSize,n),v=r.addToSet(f);for(let w=0;w<f.length;w++)f[w].isInSet(v)||(s&&s.to==g&&s.mark.eq(f[w])?s.to=y:i.push(s=new Xr(g,y,f[w])));l&&l.to==g?l.to=y:o.push(l=new jo(g,y,r))}}),i.forEach(c=>e.step(c)),o.forEach(c=>e.step(c))}function FB(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof Eh){let d=s.marks,h;for(;h=r.isInSet(d);)(c||(c=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let h=0;h<c.length;h++){let f=c[h],g;for(let y=0;y<i.length;y++){let v=i[y];v.step==o-1&&f.eq(i[y].style)&&(g=v)}g?(g.to=d,g.step=o):i.push({style:f,from:Math.max(l,t),to:d,step:o})}}}),i.forEach(s=>e.step(new Xr(s.from,s.to,s.style)))}function Xx(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],l=t+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),h=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Ht(l,h,ke.empty));else{r=f;for(let g=0;g<d.marks.length;g++)n.allowsMarkType(d.marks[g].type)||e.step(new Xr(l,h,d.marks[g]));if(i&&d.isText&&n.whitespace!="pre"){let g,y=/\r?\n|\r/g,v;for(;g=y.exec(d.text);)v||(v=new ke(ae.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Ht(l+g.index,l+g.index+g[0].length,v))}}l=h}if(!r.validEnd){let c=r.fillBefore(ae.empty,!0);e.replace(l,l,new ke(c,0,0))}for(let c=s.length-1;c>=0;c--)e.step(s[c])}function $B(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ql(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),l=e.$from.index(r)+i,c=e.$to.indexAfter(r)-o;if(r<e.depth&&s.canReplace(l,c,n))return r;if(r==0||s.type.spec.isolating||!$B(s,l,c))break;l&&(i=1),c<s.childCount&&(o=1)}return null}function BB(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),l=i.after(o+1),c=s,d=l,h=ae.empty,f=0;for(let v=o,w=!1;v>n;v--)w||r.index(v)>0?(w=!0,h=ae.from(r.node(v).copy(h)),f++):c--;let g=ae.empty,y=0;for(let v=o,w=!1;v>n;v--)w||i.after(v+1)<i.end(v)?(w=!0,g=ae.from(i.node(v).copy(g)),y++):d++;e.step(new cn(c,d,s,l,new ke(h.append(g),f,y),h.size-f,!0))}function Qx(e,t,n=null,r=e){let i=VB(e,t),o=i&&HB(r,t);return o?i.map(Ub).concat({type:t,attrs:n}).concat(o.map(Ub)):null}function Ub(e){return{type:e,attrs:null}}function VB(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}function HB(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let c=(s.length?s[s.length-1]:t).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:s}function UB(e,t,n){let r=ae.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ae.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new cn(i,o,i,o,new ke(r,0,0),n.length,!0))}function WB(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,l)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&qB(e.doc,e.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let y=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);y&&!v?d=!1:!y&&v&&(d=!0)}d===!1&&rM(e,s,l,o),Xx(e,e.mapping.slice(o).map(l,1),r,void 0,d===null);let h=e.mapping.slice(o),f=h.map(l,1),g=h.map(l+s.nodeSize,1);return e.step(new cn(f,g,f+1,g-1,new ke(ae.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&nM(e,s,l,o),!1}})}function nM(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function rM(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(`
|
|
451
|
+
`))}})}function qB(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function KB(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new cn(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ke(ae.from(s),0,0),1,!0))}function Bi(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,h=n-2;d>o;d--,h--){let f=i.node(d),g=i.index(d);if(f.type.spec.isolating)return!1;let y=f.content.cutByIndex(g,f.childCount),v=r&&r[h+1];v&&(y=y.replaceChild(0,v.type.create(v.attrs)));let w=r&&r[h]||f;if(!f.canReplace(g+1,f.childCount)||!w.type.validContent(y))return!1}let l=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(l,l,c?c.type:i.node(o+1).type)}function GB(e,t,n=1,r){let i=e.doc.resolve(t),o=ae.empty,s=ae.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=ae.from(i.node(l).copy(o));let h=r&&r[d];s=ae.from(h?h.type.create(h.attrs,s):i.node(l).copy(s))}e.step(new Ht(t,t,new ke(o.append(s),n,n),!0))}function Yo(e,t){let n=e.resolve(t),r=n.index();return iM(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function YB(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function iM(e,t){return!!(e&&t&&!e.isLeaf&&YB(e,t))}function Nh(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&iM(o,s)&&r.node(i).canReplace(l,l+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function JB(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let h=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);h&&!f?r=!1:!h&&f&&(r=!0)}let l=e.steps.length;if(r===!1){let h=e.doc.resolve(t+n);rM(e,h.node(),h.before(),l)}s.inlineContent&&Xx(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=e.mapping.slice(l),d=c.map(t-n);if(e.step(new Ht(d,c.map(t+n,-1),ke.empty,!0)),r===!0){let h=e.doc.resolve(d);nM(e,h.node(),h.before(),e.steps.length)}return e}function XB(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function oM(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0),d=r.node(s),h=!1;if(o==1)h=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);h=f&&d.canReplaceWith(c,c,f[0])}if(h)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Th(e,t,n=t,r=ke.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return sM(i,o,r)?new Ht(t,n,r):new QB(i,o,r).fit()}function sM(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class QB{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ae.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=ae.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let c=new ke(o,s,l);return t>-1?new cn(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Ht(r.pos,i.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Qm(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],h,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(ae.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(n==2&&s&&(h=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:h};if(o&&d.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Qm(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ke(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Qm(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ke(Xa(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ke(Xa(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let w=0;w<o.length;w++)this.openFrontierNode(o[w]);let s=this.unplaced,l=r?r.content:s.content,c=s.openStart-t,d=0,h=[],{match:f,type:g}=this.frontier[n];if(i){for(let w=0;w<i.childCount;w++)h.push(i.child(w));f=f.matchFragment(i)}let y=l.size+t-(s.content.size-s.openEnd);for(;d<l.childCount;){let w=l.child(d),S=f.matchType(w.type);if(!S)break;d++,(d>1||c==0||w.content.size)&&(f=S,h.push(lM(w.mark(g.allowedMarks(w.marks)),d==1?c:0,d==l.childCount?y:-1)))}let v=d==l.childCount;v||(y=-1),this.placed=Qa(this.placed,n,ae.from(h)),this.frontier[n].match=f,v&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,S=l;w<y;w++){let C=S.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),S=C.content}this.unplaced=v?t==0?ke.empty:new ke(Xa(s.content,t-1,1),t-1,y<0?s.openEnd:t-1):new ke(Xa(s.content,t,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Zm(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=Zm(t,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],h=Zm(t,l,d,c,!0);if(!h||h.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Qa(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Qa(this.placed,this.depth,ae.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ae.empty,!0);n.childCount&&(this.placed=Qa(this.placed,this.frontier.length,n))}}function Xa(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Xa(e.firstChild.content,t-1,n)))}function Qa(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Qa(e.lastChild.content,t-1,n)))}function Qm(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function lM(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,lM(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(ae.empty,!0)))),e.copy(r)}function Zm(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!ZB(n,o.content,s)?l:null}function ZB(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function e6(e){return e.spec.defining||e.spec.definingForContent}function t6(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(sM(i,o,r))return e.step(new Ht(t,n,r));let s=cM(i,o);s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let g=i.depth,y=i.pos-1;g>0;g--,y--){let v=i.node(g).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;s.indexOf(g)>-1?l=g:i.before(g)==y&&s.splice(1,0,-g)}let c=s.indexOf(l),d=[],h=r.openStart;for(let g=r.content,y=0;;y++){let v=g.firstChild;if(d.push(v),y==r.openStart)break;g=v.content}for(let g=h-1;g>=0;g--){let y=d[g],v=e6(y.type);if(v&&!y.sameMarkup(i.node(Math.abs(l)-1)))h=g;else if(v||!y.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let y=(g+h+1)%(r.openStart+1),v=d[y];if(v)for(let w=0;w<s.length;w++){let S=s[(w+c)%s.length],C=!0;S<0&&(C=!1,S=-S);let T=i.node(S-1),N=i.index(S-1);if(T.canReplaceWith(N,N,v.type,v.marks))return e.replace(i.before(S),C?o.after(S):n,new ke(aM(r.content,0,r.openStart,y),y,r.openEnd))}}let f=e.steps.length;for(let g=s.length-1;g>=0&&(e.replace(t,n,r),!(e.steps.length>f));g--){let y=s[g];y<0||(t=i.before(y),n=o.after(y))}}function aM(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(aM(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(ae.empty,!0))}return e}function n6(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=XB(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new ke(ae.from(r),0,0))}function r6(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let s=r.sharedDepth(n),l=!1;for(let c=r.depth;c>s;c--)r.node(c).type.spec.isolating&&(l=!0);for(let c=i.depth;c>s;c--)i.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=r.depth;c>0&&t==r.start(c);c--)t=r.before(c);for(let c=i.depth;c>0&&n==i.start(c);c--)n=i.before(c);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=cM(r,i);for(let s=0;s<o.length;s++){let l=o[s],c=s==o.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return e.delete(r.start(l),i.end(l));if(l>0&&(c||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return e.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function cM(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Ol extends On{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ut.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ut.fromReplace(t,this.pos,this.pos+1,new ke(ae.from(i),0,n.isLeaf?0:1))}getMap(){return fr.empty}invert(t){return new Ol(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ol(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ol(n.pos,n.attr,n.value)}}On.jsonID("attr",Ol);class Nc extends On{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Ut.ok(r)}getMap(){return fr.empty}invert(t){return new Nc(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Nc(n.attr,n.value)}}On.jsonID("docAttr",Nc);let $l=class extends Error{};$l=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};$l.prototype=Object.create(Error.prototype);$l.prototype.constructor=$l;$l.prototype.name="TransformError";class uM{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ec}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new $l(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((o,s,l,c)=>{t=Math.min(t,l),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ke.empty){let i=Th(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ke(ae.from(r),0,0))}delete(t,n){return this.replace(t,n,ke.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return t6(this,t,n,r),this}replaceRangeWith(t,n,r){return n6(this,t,n,r),this}deleteRange(t,n){return r6(this,t,n),this}lift(t,n){return BB(this,t,n),this}join(t,n=1){return JB(this,t,n),this}wrap(t,n){return UB(this,t,n),this}setBlockType(t,n=t,r,i=null){return WB(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return KB(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Ol(t,n,r)),this}setDocAttribute(t,n){return this.step(new Nc(t,n)),this}addNodeMark(t,n){return this.step(new Ro(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof ft)n.isInSet(r.marks)&&this.step(new Os(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new Os(t,o)),i=o.removeFromSet(i);for(let l=s.length-1;l>=0;l--)this.step(s[l])}return this}split(t,n=1,r){return GB(this,t,n,r),this}addMark(t,n,r){return zB(this,t,n,r),this}removeMark(t,n,r){return FB(this,t,n,r),this}clearIncompatible(t,n,r){return Xx(this,t,n,r),this}}const eg=Object.create(null);class Ye{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new i6(t.min(n),t.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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ke.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let o=t.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:c,$to:d}=s[l],h=t.mapping.slice(o);t.replaceRange(h.map(c.pos),h.map(d.pos),l?ke.empty:n),l==0&&Kb(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],c=t.mapping.slice(r),d=c.map(s.pos),h=c.map(l.pos);o?t.deleteRange(d,h):(t.replaceRangeWith(d,h,n),Kb(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Be(t):Sl(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let s=n<0?Sl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Sl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new pr(t.node(0))}static atStart(t){return Sl(t,t,0,0,1)||new pr(t)}static atEnd(t){return Sl(t,t,t.content.size,t.childCount,-1)||new pr(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=eg[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in eg)throw new RangeError("Duplicate use of selection JSON ID "+t);return eg[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Be.between(this.$anchor,this.$head).getBookmark()}}Ye.prototype.visible=!0;class i6{constructor(t,n){this.$from=t,this.$to=n}}let Wb=!1;function qb(e){!Wb&&!e.parent.inlineContent&&(Wb=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Be extends Ye{constructor(t,n=t){qb(t),qb(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ye.near(r);let i=t.resolve(n.map(this.anchor));return new Be(i.parent.inlineContent?i:r,r)}replace(t,n=ke.empty){if(super.replace(t,n),n==ke.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Mh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Be(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=Ye.findFrom(n,r,!0)||Ye.findFrom(n,-r,!0);if(o)n=o.$head;else return Ye.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Ye.findFrom(t,-r,!0)||Ye.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Be(t,n)}}Ye.jsonID("text",Be);class Mh{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Mh(t.map(this.anchor),t.map(this.head))}resolve(t){return Be.between(t.resolve(this.anchor),t.resolve(this.head))}}class Ie extends Ye{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Ye.near(o):new Ie(o)}content(){return new ke(ae.from(this.node),0,0)}eq(t){return t instanceof Ie&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Zx(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ie(t.resolve(n.anchor))}static create(t,n){return new Ie(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Ie.prototype.visible=!1;Ye.jsonID("node",Ie);class Zx{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Mh(r,r):new Zx(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Ie.isSelectable(r)?new Ie(n):Ye.near(n)}}class pr extends Ye{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ke.empty){if(n==ke.empty){t.delete(0,t.doc.content.size);let r=Ye.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new pr(t)}map(t){return new pr(t)}eq(t){return t instanceof pr}getBookmark(){return o6}}Ye.jsonID("all",pr);const o6={map(){return this},resolve(e){return new pr(e)}};function Sl(e,t,n,r,i,o=!1){if(t.inlineContent)return Be.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let l=t.child(s);if(l.isAtom){if(!o&&Ie.isSelectable(l))return Ie.create(e,n-(i<0?l.nodeSize:0))}else{let c=Sl(e,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Kb(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Ht||i instanceof cn))return;let o=e.mapping.maps[r],s;o.forEach((l,c,d,h)=>{s==null&&(s=h)}),e.setSelection(Ye.near(e.doc.resolve(s),n))}const Gb=1,wd=2,Yb=4;class s6 extends uM{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Gb)&~wd,this.storedMarks=null,this}get selectionSet(){return(this.updated&Gb)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=wd,this}ensureMarks(t){return ft.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&wd)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~wd,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ft.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Ye.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Yb,this}get scrolledIntoView(){return(this.updated&Yb)>0}}function Jb(e,t){return!t||!e?e:e.bind(t)}class Za{constructor(t,n,r){this.name=t,this.init=Jb(n.init,r),this.apply=Jb(n.apply,r)}}const l6=[new Za("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Za("selection",{init(e,t){return e.selection||Ye.atStart(t.doc)},apply(e){return e.selection}}),new Za("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Za("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class tg{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=l6.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 Za(r.key,r.spec.state,r))})}}class Tl{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let c=i?i[s].n:0,d=i?i[s].state:this,h=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,r);if(h&&r.filterTransaction(h,s)){if(h.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(h),r=r.applyInner(h),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Tl(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new s6(this)}static create(t){let n=new tg(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Tl(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new tg(this.schema,t.plugins),r=n.fields,i=new Tl(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new tg(t.schema,t.plugins),o=new Tl(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Oo.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=Ye.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(c,t,n[l],o);return}}o[s.name]=s.init(t,o)}}),o}}function dM(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=dM(i,t,{})),n[r]=i}return n}class xt{constructor(t){this.spec=t,this.props={},t.props&&dM(t.props,this,this.props),this.key=t.key?t.key.key:fM("plugin")}getState(t){return t[this.key]}}const ng=Object.create(null);function fM(e){return e in ng?e+"$"+ ++ng[e]:(ng[e]=0,e+"$")}class Pt{constructor(t="key"){this.key=fM(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const ev=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function hM(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const pM=(e,t,n)=>{let r=hM(e,n);if(!r)return!1;let i=tv(r);if(!i){let s=r.blockRange(),l=s&&Ql(s);return l==null?!1:(t&&t(e.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(SM(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Bl(o,"end")||Ie.isSelectable(o)))for(let s=r.depth;;s--){let l=Th(e.doc,r.before(s),r.after(s),ke.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(Bl(o,"end")?Ye.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Ie.create(c.doc,i.pos-o.nodeSize)),t(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},a6=(e,t,n)=>{let r=hM(e,n);if(!r)return!1;let i=tv(r);return i?mM(e,i,t):!1},c6=(e,t,n)=>{let r=yM(e,n);if(!r)return!1;let i=nv(r);return i?mM(e,i,t):!1};function mM(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let h=i.lastChild;if(!h)return!1;i=h}let s=t.nodeAfter,l=s,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let h=l.firstChild;if(!h)return!1;l=h}let d=Th(e.doc,o,c,ke.empty);if(!d||d.from!=o||d instanceof Ht&&d.slice.size>=c-o)return!1;if(n){let h=e.tr.step(d);h.setSelection(Be.create(h.doc,o)),n(h.scrollIntoView())}return!0}function Bl(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const gM=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=tv(r)}let s=o&&o.nodeBefore;return!s||!Ie.isSelectable(s)?!1:(t&&t(e.tr.setSelection(Ie.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function tv(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function yM(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const xM=(e,t,n)=>{let r=yM(e,n);if(!r)return!1;let i=nv(r);if(!i)return!1;let o=i.nodeAfter;if(SM(e,i,t,1))return!0;if(r.parent.content.size==0&&(Bl(o,"start")||Ie.isSelectable(o))){let s=Th(e.doc,r.before(),r.after(),ke.empty);if(s&&s.slice.size<s.to-s.from){if(t){let l=e.tr.step(s);l.setSelection(Bl(o,"start")?Ye.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):Ie.create(l.doc,l.mapping.map(i.pos))),t(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},vM=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=nv(r)}let s=o&&o.nodeAfter;return!s||!Ie.isSelectable(s)?!1:(t&&t(e.tr.setSelection(Ie.create(e.doc,o.pos)).scrollIntoView()),!0)};function nv(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const u6=(e,t)=>{let n=e.selection,r=n instanceof Ie,i;if(r){if(n.node.isTextblock||!Yo(e.doc,n.from))return!1;i=n.from}else if(i=Nh(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(Ie.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},d6=(e,t)=>{let n=e.selection,r;if(n instanceof Ie){if(n.node.isTextblock||!Yo(e.doc,n.to))return!1;r=n.to}else if(r=Nh(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},f6=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Ql(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},wM=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
452
|
+
`).scrollIntoView()),!0)};function rv(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const h6=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=rv(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let l=n.after(),c=e.tr.replaceWith(l,l,s.createAndFill());c.setSelection(Ye.near(c.doc.resolve(l),1)),t(c.scrollIntoView())}return!0},bM=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof pr||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=rv(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(s,o.createAndFill());l.setSelection(Be.create(l.doc,s+1)),t(l.scrollIntoView())}return!0},kM=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Bi(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ql(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function p6(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof Ie&&t.selection.node.isBlock)return!r.parentOffset||!Bi(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,c=!1,d=!1;for(let y=r.depth;;y--)if(r.node(y).isBlock){c=r.end(y)==r.pos+(r.depth-y),d=r.start(y)==r.pos-(r.depth-y),l=rv(r.node(y-1).contentMatchAt(r.indexAfter(y-1))),o.unshift(c&&l?{type:l}:null),s=y;break}else{if(y==1)return!1;o.unshift(null)}let h=t.tr;(t.selection instanceof Be||t.selection instanceof pr)&&h.deleteSelection();let f=h.mapping.map(r.pos),g=Bi(h.doc,f,o.length,o);if(g||(o[0]=l?{type:l}:null,g=Bi(h.doc,f,o.length,o)),!g)return!1;if(h.split(f,o.length,o),!c&&d&&r.node(s).type!=l){let y=h.mapping.map(r.before(s)),v=h.doc.resolve(y);l&&r.node(s-1).canReplaceWith(v.index(),v.index()+1,l)&&h.setNodeMarkup(h.mapping.map(r.before(s)),l)}return n&&n(h.scrollIntoView()),!0}}const m6=p6(),g6=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(Ie.create(e.doc,i))),!0)};function y6(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||Yo(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function SM(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,l,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&y6(e,t,n))return!0;let d=!c&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let y=t.pos+o.nodeSize,v=ae.empty;for(let C=s.length-1;C>=0;C--)v=ae.from(s[C].create(null,v));v=ae.from(i.copy(v));let w=e.tr.step(new cn(t.pos-1,y,t.pos,y,new ke(v,1,0),s.length,!0)),S=w.doc.resolve(y+2*s.length);S.nodeAfter&&S.nodeAfter.type==i.type&&Yo(w.doc,S.pos)&&w.join(S.pos),n(w.scrollIntoView())}return!0}let h=o.type.spec.isolating||r>0&&c?null:Ye.findFrom(t,1),f=h&&h.$from.blockRange(h.$to),g=f&&Ql(f);if(g!=null&&g>=t.depth)return n&&n(e.tr.lift(f,g).scrollIntoView()),!0;if(d&&Bl(o,"start",!0)&&Bl(i,"end")){let y=i,v=[];for(;v.push(y),!y.isTextblock;)y=y.lastChild;let w=o,S=1;for(;!w.isTextblock;w=w.firstChild)S++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){let C=ae.empty;for(let N=v.length-1;N>=0;N--)C=ae.from(v[N].copy(C));let T=e.tr.step(new cn(t.pos-v.length,t.pos+o.nodeSize,t.pos+S,t.pos+o.nodeSize-S,new ke(C,v.length,0),0,!0));n(T.scrollIntoView())}return!0}}return!1}function CM(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Be.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const x6=CM(-1),v6=CM(1);function w6(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Qx(s,e,t);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Xb(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[o];n.doc.nodesBetween(s,l,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)i=!0;else{let h=n.doc.resolve(d),f=h.index();i=h.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[s];o.setBlockType(l,c,e,t)}r(o.scrollIntoView())}return!0}}function iv(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}iv(ev,pM,gM);iv(ev,xM,vM);iv(wM,bM,kM,m6);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function b6(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let l=r?n.tr:null;return k6(l,s,e,t)?(r&&r(l.scrollIntoView()),!0):!1}}function k6(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=s.resolve(t.start-2);o=new df(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new df(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let l=Qx(o,n,r,t);return l?(e&&S6(e,t,l,i,n),!0):!1}function S6(e,t,n,r,i){let o=ae.empty;for(let h=n.length-1;h>=0;h--)o=ae.from(n[h].type.create(n[h].attrs,o));e.step(new cn(t.start-(r?2:0),t.end,t.start,t.end,new ke(o,0,0),n.length,!0));let s=0;for(let h=0;h<n.length;h++)n[h].type==i&&(s=h+1);let l=n.length-s,c=t.start+n.length-(r?2:0),d=t.parent;for(let h=t.startIndex,f=t.endIndex,g=!0;h<f;h++,g=!1)!g&&Bi(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=d.child(h).nodeSize;return e}function C6(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?E6(t,n,e,o):N6(t,n,o):!0:!1}}function E6(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new cn(o-1,s,o,s,new ke(ae.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new df(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=Ql(r);if(l==null)return!1;i.lift(r,l);let c=i.doc.resolve(i.mapping.map(o,-1)-1);return Yo(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function N6(e,t,n){let r=e.tr,i=n.parent;for(let y=n.end,v=n.endIndex-1,w=n.startIndex;v>w;v--)y-=i.child(v).nodeSize,r.delete(y-1,y+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),h=o.index(-1);if(!d.canReplace(h+(l?0:1),h+1,s.content.append(c?ae.empty:ae.from(i))))return!1;let f=o.pos,g=f+s.nodeSize;return r.step(new cn(f-(l?1:0),g+(c?1:0),f+1,g-1,new ke((l?ae.empty:ae.from(i.copy(ae.empty))).append(c?ae.empty:ae.from(i.copy(ae.empty))),l?0:1,c?0:1),l?0:1)),t(r.scrollIntoView()),!0}function T6(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,c=l.child(s-1);if(c.type!=e)return!1;if(n){let d=c.lastChild&&c.lastChild.type==l.type,h=ae.from(d?e.create():null),f=new ke(ae.from(e.create(null,ae.from(l.type.create(null,h)))),d?3:1,0),g=o.start,y=o.end;n(t.tr.step(new cn(g-(d?3:1),y,g,y,f,1,!0)).scrollIntoView())}return!0}}const xn=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Vl=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let vy=null;const Li=function(e,t,n){let r=vy||(vy=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},M6=function(){vy=null},Is=function(e,t,n,r){return n&&(Qb(e,t,n,r,-1)||Qb(e,t,n,r,1))},A6=/^(img|br|input|textarea|hr)$/i;function Qb(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Pr(e))){let s=e.parentNode;if(!s||s.nodeType!=1||Yc(e)||A6.test(e.nodeName)||e.contentEditable=="false")return!1;t=xn(e)+(i<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[t+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=i;else return!1;else e=s,t=i<0?Pr(e):0}else return!1}}function Pr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function j6(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Pr(e)}else if(e.parentNode&&!Yc(e))t=xn(e),e=e.parentNode;else return null}}function R6(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Yc(e))t=xn(e)+1,e=e.parentNode;else return null}}function P6(e,t,n){for(let r=t==0,i=t==Pr(e);r||i;){if(e==n)return!0;let o=xn(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==Pr(e)}}function Yc(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Ah=function(e){return e.focusNode&&Is(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ys(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function O6(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function I6(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Pr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Pr(r.startContainer),r.startOffset)}}}const yi=typeof navigator<"u"?navigator:null,Zb=typeof document<"u"?document:null,Jo=yi&&yi.userAgent||"",wy=/Edge\/(\d+)/.exec(Jo),EM=/MSIE \d/.exec(Jo),by=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jo),nr=!!(EM||by||wy),Do=EM?document.documentMode:by?+by[1]:wy?+wy[1]:0,_r=!nr&&/gecko\/(\d+)/i.test(Jo);_r&&+(/Firefox\/(\d+)/.exec(Jo)||[0,0])[1];const ky=!nr&&/Chrome\/(\d+)/.exec(Jo),wn=!!ky,NM=ky?+ky[1]:0,Pn=!nr&&!!yi&&/Apple Computer/.test(yi.vendor),Hl=Pn&&(/Mobile\/\w+/.test(Jo)||!!yi&&yi.maxTouchPoints>2),jr=Hl||(yi?/Mac/.test(yi.platform):!1),TM=yi?/Win/.test(yi.platform):!1,$i=/Android \d/.test(Jo),Jc=!!Zb&&"webkitFontSmoothing"in Zb.documentElement.style,D6=Jc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _6(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Pi(e,t){return typeof e=="number"?e:e[t]}function L6(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function ek(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(s.nodeType!=1){s=Vl(s);continue}let l=s,c=l==o.body,d=c?_6(o):L6(l),h=0,f=0;if(t.top<d.top+Pi(r,"top")?f=-(d.top-t.top+Pi(i,"top")):t.bottom>d.bottom-Pi(r,"bottom")&&(f=t.bottom-t.top>d.bottom-d.top?t.top+Pi(i,"top")-d.top:t.bottom-d.bottom+Pi(i,"bottom")),t.left<d.left+Pi(r,"left")?h=-(d.left-t.left+Pi(i,"left")):t.right>d.right-Pi(r,"right")&&(h=t.right-d.right+Pi(i,"right")),h||f)if(c)o.defaultView.scrollBy(h,f);else{let y=l.scrollLeft,v=l.scrollTop;f&&(l.scrollTop+=f),h&&(l.scrollLeft+=h);let w=l.scrollLeft-y,S=l.scrollTop-v;t={left:t.left-w,top:t.top-S,right:t.right-w,bottom:t.bottom-S}}let g=c?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(g))break;s=g=="absolute"?s.offsetParent:Vl(s)}}function z6(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let l=e.root.elementFromPoint(o,s);if(!l||l==e.dom||!e.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=n-20){r=l,i=c.top;break}}return{refDOM:r,refTop:i,stack:MM(e.dom)}}function MM(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Vl(r));return t}function F6({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;AM(n,r==0?0:r-t)}function AM(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let vl=null;function $6(e){if(e.setActive)return e.setActive();if(vl)return e.focus(vl);let t=MM(e);e.focus(vl==null?{get preventScroll(){return vl={preventScroll:!0},!0}}:void 0),vl||(vl=!1,AM(t,0))}function jM(e,t){let n,r=2e8,i,o=0,s=t.top,l=t.top,c,d;for(let h=e.firstChild,f=0;h;h=h.nextSibling,f++){let g;if(h.nodeType==1)g=h.getClientRects();else if(h.nodeType==3)g=Li(h).getClientRects();else continue;for(let y=0;y<g.length;y++){let v=g[y];if(v.top<=s&&v.bottom>=l){s=Math.max(v.bottom,s),l=Math.min(v.top,l);let w=v.left>t.left?v.left-t.left:v.right<t.left?t.left-v.right:0;if(w<r){n=h,r=w,i=w&&n.nodeType==3?{left:v.right<t.left?v.right:v.left,top:t.top}:t,h.nodeType==1&&w&&(o=f+(t.left>=(v.left+v.right)/2?1:0));continue}}else v.top>t.top&&!c&&v.left<=t.left&&v.right>=t.left&&(c=h,d={left:Math.max(v.left,Math.min(v.right,t.left)),top:v.top});!n&&(t.left>=v.right&&t.top>=v.top||t.left>=v.left&&t.top>=v.bottom)&&(o=f+1)}}return!n&&c&&(n=c,i=d,r=0),n&&n.nodeType==3?B6(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:jM(n,i)}function B6(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let s=Eo(r,1);if(s.top!=s.bottom&&ov(t,s)){i={node:e,offset:o+(t.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function ov(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function V6(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function H6(e,t,n){let{node:r,offset:i}=jM(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function U6(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let l=e.docView.nearestDesc(o,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!s&&c.left>r.left||c.top>r.top?i=l.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;o=l.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function RM(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=e.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(ov(t,d))return RM(s,t,d)}}if((o=(o+1)%r)==i)break}return e}function W6(e,t){let n=e.dom.ownerDocument,r,i=0,o=I6(n,t.left,t.top);o&&({node:r,offset:i}=o);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),l;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=e.dom.getBoundingClientRect();if(!ov(t,d)||(s=RM(e.dom,t,d),!s))return null}if(Pn)for(let d=s;r&&d;d=Vl(d))d.draggable&&(r=void 0);if(s=V6(s,t),r){if(_r&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let h=r.childNodes[i],f;h.nodeName=="IMG"&&(f=h.getBoundingClientRect()).right<=t.left&&f.bottom>t.top&&i++}let d;Jc&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?l=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=U6(e,r,i,t))}l==null&&(l=H6(e,s,t));let c=e.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function tk(e){return e.top<e.bottom||e.left<e.right}function Eo(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(tk(r))return r}return Array.prototype.find.call(n,tk)||e.getBoundingClientRect()}const q6=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function PM(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=Jc||_r;if(r.nodeType==3)if(s&&(q6.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Eo(Li(r,i,i),n);if(_r&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Eo(Li(r,i-1,i-1),-1);if(d.top==c.top){let h=Eo(Li(r,i,i+1),-1);if(h.top!=c.top)return Fa(h,h.left<d.left)}}return c}else{let c=i,d=i,h=n<0?1:-1;return n<0&&!i?(d++,h=-1):n>=0&&i==r.nodeValue.length?(c--,h=1):n<0?c--:d++,Fa(Eo(Li(r,c,d),h),h<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Pr(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return rg(c.getBoundingClientRect(),!1)}if(o==null&&i<Pr(r)){let c=r.childNodes[i];if(c.nodeType==1)return rg(c.getBoundingClientRect(),!0)}return rg(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Pr(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Li(c,Pr(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return Fa(Eo(d,1),!1)}if(o==null&&i<Pr(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Li(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return Fa(Eo(d,-1),!0)}return Fa(Eo(r.nodeType==3?Li(r):r,-n),n>=0)}function Fa(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function rg(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function OM(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function K6(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return OM(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=e.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=PM(e,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=Li(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let h=c[d];if(h.bottom>h.top+1&&(n=="up"?s.top-h.top>(h.bottom-s.top)*2:h.bottom-s.bottom>(s.bottom-h.top)*2))return!1}}return!0})}const G6=/[\u0590-\u08ac]/;function Y6(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=e.domSelection();return l?!G6.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:OM(e,t,()=>{let{focusNode:c,focusOffset:d,anchorNode:h,anchorOffset:f}=e.domSelectionRange(),g=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:v,focusOffset:w}=e.domSelectionRange(),S=v&&!y.contains(v.nodeType==1?v:v.parentNode)||c==v&&d==w;try{l.collapse(h,f),c&&(c!=h||d!=f)&&l.extend&&l.extend(c,d)}catch{}return g!=null&&(l.caretBidiLevel=g),S}):r.pos==r.start()||r.pos==r.end()}let nk=null,rk=null,ik=!1;function J6(e,t,n){return nk==t&&rk==n?ik:(nk=t,rk=n,ik=n=="up"||n=="down"?K6(e,t,n):Y6(e,t,n))}const Lr=0,ok=1,xs=2,xi=3;class Xc{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Lr,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.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(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,s;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>xn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let l=i.children[s];if(l.size){i=l;break}}return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>t||s instanceof DM){i=t-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof IM&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?xn(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?xn(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,l=0;;l++){let c=this.children[l],d=s+c.size;if(i==-1&&t<=d){let h=s+c.border;if(t>=h&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,h);t=s;for(let f=l;f>0;f--){let g=this.children[f-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){i=xn(g.dom)+1;break}t-=g.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let h=l+1;h<this.children.length;h++){let f=this.children[h];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=xn(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),s=Math.max(t,n);for(let y=0,v=0;y<this.children.length;y++){let w=this.children[y],S=v+w.size;if(o>v&&s<S)return w.setSelection(t-v-w.border,n-v-w.border,r,i);v=S}let l=this.domFromPos(t,t?-1:1),c=n==t?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),h=r.domSelectionRange(),f=!1;if((_r||Pn)&&t==n){let{node:y,offset:v}=l;if(y.nodeType==3){if(f=!!(v&&y.nodeValue[v-1]==`
|
|
453
|
+
`),f&&v==y.nodeValue.length)for(let w=y,S;w;w=w.parentNode){if(S=w.nextSibling){S.nodeName=="BR"&&(l=c={node:S.parentNode,offset:xn(S)+1});break}let C=w.pmViewDesc;if(C&&C.node&&C.node.isBlock)break}}else{let w=y.childNodes[v-1];f=w&&(w.nodeName=="BR"||w.contentEditable=="false")}}if(_r&&h.focusNode&&h.focusNode!=c.node&&h.focusNode.nodeType==1){let y=h.focusNode.childNodes[h.focusOffset];y&&y.contentEditable=="false"&&(i=!0)}if(!(i||f&&Pn)&&Is(l.node,l.offset,h.anchorNode,h.anchorOffset)&&Is(c.node,c.offset,h.focusNode,h.focusOffset))return;let g=!1;if((d.extend||t==n)&&!(f&&_r)){d.collapse(l.node,l.offset);try{t!=n&&d.extend(c.node,c.offset),g=!0}catch{}}if(!g){if(t>n){let v=l;l=c,c=v}let y=document.createRange();y.setEnd(c.node,c.offset),y.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(y)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let l=r+o.border,c=s-o.border;if(t>=l&&n<=c){this.dirty=t==r||n==s?xs:ok,t==l&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=xi:o.markDirty(t-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?xs:xi}r=s}this.dirty=xs}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?xs:ok;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class IM extends Xc{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Lr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class X6 extends Xc{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Ds extends Xc{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Hs.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Ds(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&xi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=xi&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Lr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Lr}}slice(t,n,r){let i=Ds.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Cy(o,n,s,r)),t>0&&(o=Cy(o,0,t,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class _o extends Xc{constructor(t,n,r,i,o,s,l,c,d){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(t,n,r,i,o,s){let l=o.nodeViews[n.type.name],c,d=l&&l(n,o,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,i),h=d&&d.dom,f=d&&d.contentDOM;if(n.isText){if(!h)h=document.createTextNode(n.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:f}=Hs.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));let g=h;return h=zM(h,r,n),d?c=new Q6(t,n,r,i,h,f||null,g,d,o,s+1):n.isText?new jh(t,n,r,i,h,g,o):new _o(t,n,r,i,h,f||null,g,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.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)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>ae.empty)}return t}matchesNode(t,n,r){return this.dirty==Lr&&t.eq(this.node)&&hf(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,c=new eV(this,s&&s.node,t);rV(this.node,this.innerDeco,(d,h,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,t,h):d.type.side>=0&&!f&&c.syncToMarks(h==this.node.childCount?ft.none:this.node.child(h).marks,r,t,h),c.placeWidget(d,t,i)},(d,h,f,g)=>{c.syncToMarks(d.marks,r,t,g);let y;c.findNodeMatch(d,h,f,g)||l&&t.state.selection.from>i&&t.state.selection.to<i+d.nodeSize&&(y=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,h,f,y,t)||c.updateNextNode(d,h,f,t,g,i)||c.addNode(d,h,f,t,i),i+=d.nodeSize}),c.syncToMarks([],r,t,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==xs)&&(s&&this.protectLocalComposition(t,s),_M(this.contentDOM,this.children,t),Hl&&iV(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Be)||r<n||i>n+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=oV(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new X6(this,o,n,i);t.input.compositionNodes.push(s),this.children=Cy(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==xi||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Lr}updateOuterDeco(t){if(hf(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=LM(this.dom,this.nodeDOM,Sy(this.outerDeco,this.node,n),Sy(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}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 sk(e,t,n,r,i){zM(r,t,e);let o=new _o(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class jh extends _o{constructor(t,n,r,i,o,s,l){super(t,n,r,i,o,null,s,l,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==xi||this.dirty!=Lr&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Lr||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Lr,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new jh(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=xi)}get domAtom(){return!1}isText(t){return this.node.text==t}}class DM extends Xc{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Lr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Q6 extends _o{constructor(t,n,r,i,o,s,l,c,d,h){super(t,n,r,i,o,s,l,d,h),this.spec=c}update(t,n,r,i){if(this.dirty==xi)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function _M(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],l=s.dom;if(l.parentNode==e){for(;l!=r;)r=lk(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(l,r);if(s instanceof Ds){let c=r?r.previousSibling:e.lastChild;_M(s.contentDOM,s.children,n),r=c?c.nextSibling:e.firstChild}}for(;r;)r=lk(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const sc=function(e){e&&(this.nodeName=e)};sc.prototype=Object.create(null);const vs=[new sc];function Sy(e,t,n){if(e.length==0)return vs;let r=n?vs[0]:new sc,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new sc(s.nodeName));for(let l in s){let c=s[l];c!=null&&(n&&i.length==1&&i.push(r=new sc(t.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+c:l=="style"?r.style=(r.style?r.style+";":"")+c:l!="nodeName"&&(r[l]=c))}}}return i}function LM(e,t,n,r){if(n==vs&&r==vs)return t;let i=t;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let c;l&&l.nodeName==s.nodeName&&i!=e&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=vs[0]),i=c}Z6(i,l||vs[0],s)}return i}function Z6(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function zM(e,t,n){return LM(e,e,vs,Sy(t,n,e.nodeType!=1))}function hf(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function lk(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class eV{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=tV(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let o=0,s=this.stack.length>>1,l=Math.min(s,t.length);for(;o<l&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=Lr,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let c=-1,d=this.top.children.length;i<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let h=this.index;h<d;h++){let f=this.top.children[h];if(f.matchesMark(t[s])&&!this.isLocked(f.dom)){c=h;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let h=Ds.create(this.top,t[s],n,r);this.top.children.splice(this.index,0,h),this.top=h,this.changed=!0}this.index=0,s++}}findNodeMatch(t,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(t,n,r)&&!this.preMatch.matched.has(d)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let s=this.top.children[i];return s.dirty==xi&&s.dom==s.contentDOM&&(s.dirty=xs),s.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof _o){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let h=c.dom,f,g=this.isLocked(h)&&!(t.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==t.text&&c.dirty!=xi&&hf(n,c.outerDeco));if(!g&&c.update(t,n,r,i))return this.destroyBetween(this.index,l),c.dom!=h&&(this.changed=!0),this.index++,!0;if(!g&&(f=this.recreateWrapper(c,t,n,r,i,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=xs,f.updateChildren(i,s+1),f.dirty=Lr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!hf(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let l=_o.create(this.top,n,r,i,o,s);if(l.contentDOM){l.children=t.children,t.children=[];for(let c of l.children)c.parent=l}return t.destroy(),l}addNode(t,n,r,i,o){let s=_o.create(this.top,t,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new IM(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Ds;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof jh)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Pn||wn)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new DM(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function tV(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Ds)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=l.node;if(c){if(c!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function nV(e,t){return e.type.side-t.type.side}function rV(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let d=0;d<e.childCount;d++){let h=e.child(d);r(h,i,t.forChild(o,h),d),o+=h.nodeSize}return}let s=0,l=[],c=null;for(let d=0;;){let h,f;for(;s<i.length&&i[s].to==o;){let S=i[s++];S.widget&&(h?(f||(f=[h])).push(S):h=S)}if(h)if(f){f.sort(nV);for(let S=0;S<f.length;S++)n(f[S],d,!!c)}else n(h,d,!!c);let g,y;if(c)y=-1,g=c,c=null;else if(d<e.childCount)y=d,g=e.child(d++);else break;for(let S=0;S<l.length;S++)l[S].to<=o&&l.splice(S--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let v=o+g.nodeSize;if(g.isText){let S=v;s<i.length&&i[s].from<S&&(S=i[s].from);for(let C=0;C<l.length;C++)l[C].to<S&&(S=l[C].to);S<v&&(c=g.cut(S-o),g=g.cut(0,S-o),v=S,y=-1)}else for(;s<i.length&&i[s].to<v;)s++;let w=g.isInline&&!g.isLeaf?l.filter(S=>!S.inline):l.slice();r(g,w,t.forChild(o,g),y),o=v}}function iV(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function oV(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let c=s.text;for(;i<e.childCount;){let d=e.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=n){if(o>=r&&c.slice(r-t.length-l,r-l)==t)return r-t.length;let d=l<r?c.lastIndexOf(t,r-l-1):-1;if(d>=0&&d+t.length+l>=n)return l+d;if(n==r&&c.length>=r+t.length-l&&c.slice(r-l,r-l+t.length)==t)return r}}return-1}function Cy(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let c=e[s],d=l,h=l+=c.size;d>=n||h<=t?o.push(c):(d<t&&o.push(c.slice(0,t-d,r)),i&&(o.push(i),i=void 0),h>n&&o.push(c.slice(n-d,c.size,r)))}return o}function sv(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),c,d;if(Ah(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&Ie.isSelectable(f)&&i.parent&&!(f.isInline&&P6(n.focusNode,n.focusOffset,i.dom))){let g=i.posBefore;d=new Ie(s==g?l:r.resolve(g))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,g=s;for(let y=0;y<n.rangeCount;y++){let v=n.getRangeAt(y);f=Math.min(f,e.docView.posFromDOM(v.startContainer,v.startOffset,1)),g=Math.max(g,e.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(f<0)return null;[c,s]=g==e.state.selection.anchor?[g,f]:[f,g],l=r.resolve(s)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let h=r.resolve(c);if(!d){let f=t=="pointer"||e.state.selection.head<l.pos&&!o?1:-1;d=lv(e,h,l,f)}return d}function FM(e){return e.editable?e.hasFocus():BM(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Vi(e,t=!1){let n=e.state.selection;if($M(e,n),!!FM(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&wn){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Is(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)lV(e);else{let{anchor:r,head:i}=n,o,s;ak&&!(n instanceof Be)&&(n.$from.parent.inlineContent||(o=ck(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=ck(e,n.to))),e.docView.setSelection(r,i,e,t),ak&&(o&&uk(o),s&&uk(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&sV(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const ak=Pn||wn&&NM<63;function ck(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Pn&&i&&i.contentEditable=="false")return ig(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return ig(i);if(o)return ig(o)}}function ig(e){return e.contentEditable="true",Pn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function uk(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function sV(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!FM(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function lV(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,xn(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&nr&&Do<=11&&(n.disabled=!0,n.disabled=!1)}function $M(e,t){if(t instanceof Ie){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(dk(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else dk(e)}function dk(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function lv(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Be.between(t,n,r)}function fk(e){return e.editable&&!e.hasFocus()?!1:BM(e)}function BM(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function aV(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Is(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Ey(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Ye.findFrom(o,t)}function No(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function hk(e,t,n){let r=e.state.selection;if(r instanceof Be)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return No(e,new Be(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=Ey(e.state,t);return i&&i instanceof Ie?No(e,i):!1}else if(!(jr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(l))&&!s.contentDOM?Ie.isSelectable(o)?No(e,new Ie(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Jc?No(e,new Be(e.state.doc.resolve(t<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ie&&r.node.isInline)return No(e,new Be(t>0?r.$to:r.$from));{let i=Ey(e.state,t);return i?No(e,i):!1}}}function pf(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function lc(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function wl(e,t){return t<0?cV(e):uV(e)}function cV(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(_r&&n.nodeType==1&&r<pf(n)&&lc(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(lc(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(VM(n))break;{let l=n.previousSibling;for(;l&&lc(l,-1);)i=n.parentNode,o=xn(l),l=l.previousSibling;if(l)n=l,r=pf(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Ny(e,n,r):i&&Ny(e,i,o)}function uV(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=pf(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(lc(l,1))o=n,s=++r;else break}else{if(VM(n))break;{let l=n.nextSibling;for(;l&&lc(l,1);)o=l.parentNode,s=xn(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=pf(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&Ny(e,o,s)}function VM(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function dV(e,t){for(;e&&t==e.childNodes.length&&!Yc(e);)t=xn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function fV(e,t){for(;e&&!t&&!Yc(e);)t=xn(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Ny(e,t,n){if(t.nodeType!=3){let o,s;(s=dV(t,n))?(t=s,n=0):(o=fV(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Ah(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Vi(e)},50)}function pk(e,t){let n=e.state.doc.resolve(t);if(!(wn||TM)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function mk(e,t,n){let r=e.state.selection;if(r instanceof Be&&!r.empty||n.indexOf("s")>-1||jr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=Ey(e.state,t);if(s&&s instanceof Ie)return No(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,l=r instanceof pr?Ye.near(s,t):Ye.findFrom(s,t);return l?No(e,l):!1}return!1}function gk(e,t){if(!(e.state.selection instanceof Be))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function yk(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function hV(e){if(!Pn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;yk(e,r,"true"),setTimeout(()=>yk(e,r,"false"),20)}return!1}function pV(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function mV(e,t){let n=t.keyCode,r=pV(t);if(n==8||jr&&n==72&&r=="c")return gk(e,-1)||wl(e,-1);if(n==46&&!t.shiftKey||jr&&n==68&&r=="c")return gk(e,1)||wl(e,1);if(n==13||n==27)return!0;if(n==37||jr&&n==66&&r=="c"){let i=n==37?pk(e,e.state.selection.from)=="ltr"?-1:1:-1;return hk(e,i,r)||wl(e,i)}else if(n==39||jr&&n==70&&r=="c"){let i=n==39?pk(e,e.state.selection.from)=="ltr"?1:-1:1;return hk(e,i,r)||wl(e,i)}else{if(n==38||jr&&n==80&&r=="c")return mk(e,-1,r)||wl(e,-1);if(n==40||jr&&n==78&&r=="c")return hV(e)||mk(e,1,r)||wl(e,1);if(r==(jr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function av(e,t){e.someProp("transformCopied",y=>{t=y(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let s=e.someProp("clipboardSerializer")||Hs.fromSchema(e.state.schema),l=GM(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,h,f=0;for(;d&&d.nodeType==1&&(h=KM[d.nodeName.toLowerCase()]);){for(let y=h.length-1;y>=0;y--){let v=l.createElement(h[y]);for(;c.firstChild;)v.appendChild(c.firstChild);c.appendChild(v),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let g=e.someProp("clipboardTextSerializer",y=>y(t,e))||t.content.textBetween(0,t.content.size,`
|
|
454
|
+
|
|
455
|
+
`);return{dom:c,text:g,slice:t}}function HM(e,t,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!t)return null;let c=!!t&&(r||o||!n);if(c){if(e.someProp("transformPastedText",g=>{t=g(t,o||r,e)}),o)return l=new ke(ae.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
456
|
+
`))),0,0),e.someProp("transformPasted",g=>{l=g(l,e,!0)}),l;let f=e.someProp("clipboardTextParser",g=>g(t,i,r,e));if(f)l=f;else{let g=i.marks(),{schema:y}=e.state,v=Hs.fromSchema(y);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(w=>{let S=s.appendChild(document.createElement("p"));w&&S.appendChild(v.serializeNode(y.text(w,g)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=vV(n),Jc&&wV(s);let d=s&&s.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let f=+h[3];f>0;f--){let g=s.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;s=g}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||Io.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||h),context:i,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!gV.test(g.parentNode.nodeName)?{ignore:!0}:null}})),h)l=bV(xk(l,+h[1],+h[2]),h[4]);else if(l=ke.maxOpen(yV(l.content,i),!0),l.openStart||l.openEnd){let f=0,g=0;for(let y=l.content.firstChild;f<l.openStart&&!y.type.spec.isolating;f++,y=y.firstChild);for(let y=l.content.lastChild;g<l.openEnd&&!y.type.spec.isolating;g++,y=y.lastChild);l=xk(l,f,g)}return e.someProp("transformPasted",f=>{l=f(l,e,c)}),l}const gV=/^(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 yV(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(l=>{if(!s)return;let c=i.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&o.length&&WM(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=qM(s[s.length-1],o.length));let h=UM(l,c);s.push(h),i=i.matchType(h.type),o=c}}),s)return ae.from(s)}return e}function UM(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,ae.from(e));return e}function WM(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=WM(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(ae.from(UM(n,e,i+1))))}}function qM(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,qM(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(ae.empty,!0);return e.copy(n.append(r))}function Ty(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,l=s.content;return e.childCount>1&&(o=0),i<r-1&&(l=Ty(l,t,n,r,i+1,o)),i>=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(ae.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function xk(e,t,n){return t<e.openStart&&(e=new ke(Ty(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ke(Ty(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const KM={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 vk=null;function GM(){return vk||(vk=document.implementation.createHTMLDocument("title"))}let og=null;function xV(e){let t=window.trustedTypes;return t?(og||(og=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),og.createHTML(e)):e}function vV(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=GM().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&KM[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=xV(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function wV(e){let t=e.querySelectorAll(wn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function bV(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let l=r.length-2;l>=0;l-=2){let c=n.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;i=ae.from(c.create(r[l+1],i)),o++,s++}return new ke(i,o,s)}const Vn={},Hn={},kV={touchstart:!0,touchmove:!0};class SV{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 CV(e){for(let t in Vn){let n=Vn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{NV(e,r)&&!cv(e,r)&&(e.editable||!(r.type in Hn))&&n(e,r)},kV[t]?{passive:!0}:void 0)}Pn&&e.dom.addEventListener("input",()=>null),My(e)}function Po(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function EV(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function My(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>cv(e,r))})}function cv(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function NV(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function TV(e,t){!cv(e,t)&&Vn[t.type]&&(e.editable||!(t.type in Hn))&&Vn[t.type](e,t)}Hn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!JM(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!($i&&wn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Hl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ys(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||mV(e,n)?n.preventDefault():Po(e,"key")};Hn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Hn.keypress=(e,t)=>{let n=t;if(JM(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||jr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Be)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,i,o))&&e.dispatch(o()),n.preventDefault()}};function Rh(e){return{left:e.clientX,top:e.clientY}}function MV(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function uv(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,l=>s>o.depth?l(e,n,o.nodeAfter,o.before(s),i,!0):l(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Il(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function AV(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Ie.isSelectable(r)?(Il(e,new Ie(n)),!0):!1}function jV(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Ie&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(Ie.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Il(e,Ie.create(e.state.doc,i)),!0):!1}function RV(e,t,n,r,i){return uv(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?jV(e,n):AV(e,n))}function PV(e,t,n,r){return uv(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function OV(e,t,n,r){return uv(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||IV(e,n,r)}function IV(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Il(e,Be.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Il(e,Be.create(r,l+1,l+1+s.content.size));else if(Ie.isSelectable(s))Il(e,Ie.create(r,l));else continue;return!0}}function dv(e){return mf(e)}const YM=jr?"metaKey":"ctrlKey";Vn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=dv(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&MV(n,e.input.lastClick)&&!n[YM]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=e.posAtCoords(Rh(n));s&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new DV(e,s,n,!!r)):(o=="doubleClick"?PV:OV)(e,s.pos,s.inside,n)?n.preventDefault():Po(e,"pointer"))};class DV{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[YM],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let h=t.state.doc.resolve(n.pos);o=h.parent,s=h.depth?h.before():0}const l=i?null:r.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=t.state;r.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof Ie&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&_r&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Po(t,"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(()=>Vi(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Rh(t))),this.updateAllowDefault(t),this.allowDefault||!n?Po(this.view,"pointer"):RV(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Pn&&this.mightDrag&&!this.mightDrag.node.isAtom||wn&&!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)?(Il(this.view,Ye.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Po(this.view,"pointer")}move(t){this.updateAllowDefault(t),Po(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Vn.touchstart=e=>{e.input.lastTouch=Date.now(),dv(e),Po(e,"pointer")};Vn.touchmove=e=>{e.input.lastTouch=Date.now(),Po(e,"pointer")};Vn.contextmenu=e=>dv(e);function JM(e,t){return e.composing?!0:Pn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const _V=$i?5e3:-1;Hn.compositionstart=Hn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Be&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||wn&&TM&&LV(e)))e.markCursor=e.state.storedMarks||n.marks(),mf(e,!0),e.markCursor=null;else if(mf(e,!t.selection.empty),_r&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=e.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}XM(e,_V)};function LV(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Hn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,XM(e,20))};function XM(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>mf(e),t))}function QM(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=FV());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function zV(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=j6(t.focusNode,t.focusOffset),r=R6(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function FV(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function mf(e,t=!1){if(!($i&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),QM(e),t||e.docView&&e.docView.dirty){let n=sv(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function $V(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Tc=nr&&Do<15||Hl&&D6<604;Vn.copy=Hn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Tc?null:n.clipboardData,s=r.content(),{dom:l,text:c}=av(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):$V(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function BV(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function VV(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Mc(e,r.value,null,i,t):Mc(e,r.textContent,r.innerHTML,i,t)},50)}function Mc(e,t,n,r,i){let o=HM(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,i,o||ke.empty)))return!0;if(!o)return!1;let s=BV(o),l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ZM(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Hn.paste=(e,t)=>{let n=t;if(e.composing&&!$i)return;let r=Tc?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Mc(e,ZM(r),r.getData("text/html"),i,n)?n.preventDefault():VV(e,n)};class eA{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const HV=jr?"altKey":"ctrlKey";function tA(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[HV]}Vn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Rh(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Ie?i.to-1:i.to))){if(r&&r.mightDrag)s=Ie.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(s=Ie.create(e.state.doc,f.posBefore))}}let l=(s||e.state.selection).content(),{dom:c,text:d,slice:h}=av(e,l);(!n.dataTransfer.files.length||!wn||NM>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Tc?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Tc||n.dataTransfer.setData("text/plain",d),e.dragging=new eA(h,tA(e,n),s)};Vn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Hn.dragover=Hn.dragenter=(e,t)=>t.preventDefault();Hn.drop=(e,t)=>{try{UV(e,t,e.dragging)}finally{e.dragging=null}};function UV(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Rh(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",y=>{o=y(o,e,!1)}):o=HM(e,ZM(t.dataTransfer),Tc?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&tA(e,t));if(e.someProp("handleDrop",y=>y(e,t,o||ke.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let l=o?oM(e.state.doc,i.pos,o):i.pos;l==null&&(l=i.pos);let c=e.state.tr;if(s){let{node:y}=n;y?y.replace(c):c.deleteSelection()}let d=c.mapping.map(l),h=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=c.doc;if(h?c.replaceRangeWith(d,d,o.content.firstChild):c.replaceRange(d,d,o),c.doc.eq(f))return;let g=c.doc.resolve(d);if(h&&Ie.isSelectable(o.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new Ie(g));else{let y=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((v,w,S,C)=>y=C),c.setSelection(lv(e,g,c.doc.resolve(y)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}Vn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Vi(e)},20))};Vn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Vn.beforeinput=(e,t)=>{if(wn&&$i&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ys(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Hn)Vn[e]=Hn[e];function Ac(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class gf{constructor(t,n){this.toDOM=t,this.spec=n||Es,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Wt(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof gf&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ac(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Lo{constructor(t,n){this.attrs=t,this.spec=n||Es}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Wt(o,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Lo&&Ac(this.attrs,t.attrs)&&Ac(this.spec,t.spec)}static is(t){return t.type instanceof Lo}destroy(){}}class fv{constructor(t,n){this.attrs=t,this.spec=n||Es}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let s=t.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Wt(o.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof fv&&Ac(this.attrs,t.attrs)&&Ac(this.spec,t.spec)}destroy(){}}class Wt{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Wt(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Wt(t,t,new gf(n,r))}static inline(t,n,r,i){return new Wt(t,n,new Lo(r,i))}static node(t,n,r,i){return new Wt(t,n,new fv(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Lo}get widget(){return this.type instanceof gf}}const Cl=[],Es={};class yt{constructor(t,n){this.local=t.length?t:Cl,this.children=n.length?n:Cl}static create(t,n){return n.length?yf(n,t,0,Es):An}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=t&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let l=this.children[s]+1;this.children[s+2].findInner(t-l,n-l,r,i+l,o)}}map(t,n,r){return this==An||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Es)}mapInner(t,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(t,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?WV(this.children,s||[],t,n,r,i,o):s?new yt(s.sort(Ns),Cl):An}add(t,n){return n.length?this==An?yt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((l,c)=>{let d=c+r,h;if(h=rA(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(l,h,d+1):i.splice(o,0,c,c+l.nodeSize,yf(h,l,d+1,Es)),o+=3}});let s=nA(o?iA(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(t,s[l])||s.splice(l--,1);return new yt(s.length?this.local.concat(s).sort(Ns):this.local,i||this.children)}remove(t){return t.length==0||this==An?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+n,c=r[o+1]+n;for(let h=0,f;h<t.length;h++)(f=t[h])&&f.from>l&&f.to<c&&(t[h]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,l+1);d!=An?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<t.length;o++)if(s=t[o])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new yt(i,r):An}forChild(t,n){if(this==An)return this;if(n.isLeaf)return yt.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=t){this.children[l]==t&&(r=this.children[l+2]);break}let o=t+1,s=o+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<s&&c.to>o&&c.type instanceof Lo){let d=Math.max(o,c.from)-o,h=Math.min(s,c.to)-o;d<h&&(i||(i=[])).push(c.copy(d,h))}}if(i){let l=new yt(i.sort(Ns),Cl);return r?new Ao([l,r]):l}return r||An}eq(t){if(this==t)return!0;if(!(t instanceof yt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return hv(this.localsInner(t))}localsInner(t){if(this==An)return Cl;if(t.inlineContent||!this.local.some(Lo.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Lo||n.push(this.local[r]);return n}forEachSet(t){t(this)}}yt.empty=new yt([],[]);yt.removeOverlap=hv;const An=yt.empty;class Ao{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,Es));return Ao.from(r)}forChild(t,n){if(n.isLeaf)return yt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=An&&(o instanceof Ao?r=r.concat(o.members):r.push(o))}return Ao.from(r)}eq(t){if(!(t instanceof Ao)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?hv(r?n:n.sort(Ns)):Cl}static from(t){switch(t.length){case 0:return An;case 1:return t[0];default:return new Ao(t.every(n=>n instanceof yt)?t:t.reduce((n,r)=>n.concat(r instanceof yt?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function WV(e,t,n,r,i,o,s){let l=e.slice();for(let d=0,h=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((g,y,v,w)=>{let S=w-v-(y-g);for(let C=0;C<l.length;C+=3){let T=l[C+1];if(T<0||g>T+h-f)continue;let N=l[C]+h-f;y>=N?l[C+1]=g<=N?-2:-1:g>=h&&S&&(l[C]+=S,l[C+1]+=S)}f+=S}),h=n.maps[d].map(h,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let h=n.map(e[d]+o),f=h-i;if(f<0||f>=r.content.size){c=!0;continue}let g=n.map(e[d+1]+o,-1),y=g-i,{index:v,offset:w}=r.content.findIndex(f),S=r.maybeChild(v);if(S&&w==f&&w+S.nodeSize==y){let C=l[d+2].mapInner(n,S,h+1,e[d]+o+1,s);C!=An?(l[d]=f,l[d+1]=y,l[d+2]=C):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=qV(l,e,t,n,i,o,s),h=yf(d,r,0,s);t=h.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,g=0;f<h.children.length;f+=3){let y=h.children[f];for(;g<l.length&&l[g]<y;)g+=3;l.splice(g,0,h.children[f],h.children[f+1],h.children[f+2])}}return new yt(t.sort(Ns),l)}function nA(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Wt(i.from+t,i.to+t,i.type))}return n}function qV(e,t,n,r,i,o,s){function l(c,d){for(let h=0;h<c.local.length;h++){let f=c.local[h].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(c.local[h].spec)}for(let h=0;h<c.children.length;h+=3)l(c.children[h+2],c.children[h]+d+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&l(e[c+2],t[c]+o+1);return n}function rA(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,s;o<e.length;o++)(s=e[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[o]=null);return i}function iA(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function yf(e,t,n,r){let i=[],o=!1;t.forEach((l,c)=>{let d=rA(e,l,c+n);if(d){o=!0;let h=yf(d,l,n+c+1,r);h!=An&&i.push(c,c+l.nodeSize,h)}});let s=nA(o?iA(e):e,-n).sort(Ns);for(let l=0;l<s.length;l++)s[l].type.valid(t,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new yt(s,i):An}function Ns(e,t){return e.from-t.from||e.to-t.to}function hv(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),wk(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),wk(t,i,r.copy(o.from,r.to)));break}}}return t}function wk(e,t,n){for(;t<e.length&&Ns(n,e[t])>0;)t++;e.splice(t,0,n)}function sg(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=An&&t.push(r)}),e.cursorWrapper&&t.push(yt.create(e.state.doc,[e.cursorWrapper.deco])),Ao.from(t)}const KV={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},GV=nr&&Do<=11;class YV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class JV{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new YV,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);nr&&Do<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Pn&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),GV&&(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,KV)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[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(fk(this.view)){if(this.suppressingSelectionUpdates)return Vi(this.view);if(nr&&Do<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Is(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Vl(o))n.add(o);for(let o=t.anchorNode;o;o=Vl(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&fk(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,c=[];if(t.editable)for(let h=0;h<n.length;h++){let f=this.registerMutation(n[h],c);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(c.some(h=>h.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let h of c)if(h.nodeName=="BR"&&h.parentNode){let f=h.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){h.parentNode.removeChild(h);break}f=f.firstChild}}}else if(_r&&c.length){let h=c.filter(f=>f.nodeName=="BR");if(h.length==2){let[f,g]=h;f.parentNode&&f.parentNode.parentNode==g.parentNode?g.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let g of h){let y=g.parentNode;y&&y.nodeName=="LI"&&(!f||ZV(t,f)!=y)&&g.remove()}}}let d=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Ah(r)&&(d=sv(t))&&d.eq(Ye.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Vi(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),XV(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,eH(t,c)),this.handleDOMChange(o,s,l,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Vi(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let h=0;h<t.addedNodes.length;h++){let f=t.addedNodes[h];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(nr&&Do<=11&&t.addedNodes.length)for(let h=0;h<t.addedNodes.length;h++){let{previousSibling:f,nextSibling:g}=t.addedNodes[h];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!g||Array.prototype.indexOf.call(t.addedNodes,g)<0)&&(o=g)}let s=i&&i.parentNode==t.target?xn(i)+1:0,l=r.localPosFromDOM(t.target,s,-1),c=o&&o.parentNode==t.target?xn(o):t.target.childNodes.length,d=r.localPosFromDOM(t.target,c,1);return{from:l,to:d}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let bk=new WeakMap,kk=!1;function XV(e){if(!bk.has(e)&&(bk.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=_r,kk)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."),kk=!0}}function Sk(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return Is(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function QV(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return Sk(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Sk(e,n):null}function ZV(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function eH(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let s=o.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let l=s;for(;;){let c=l.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;l=c}l.insertBefore(o,l.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function tH(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d,h=c.anchorNode;if(h&&e.dom.contains(h.nodeType==1?h:h.parentNode)&&(d=[{node:h,offset:c.anchorOffset}],Ah(c)||d.push({node:c.focusNode,offset:c.focusOffset})),wn&&e.input.lastKeyCode===8)for(let S=o;S>i;S--){let C=r.childNodes[S-1],T=C.pmViewDesc;if(C.nodeName=="BR"&&!T){o=S;break}if(!T||T.size)break}let f=e.state.doc,g=e.someProp("domParser")||Io.fromSchema(e.state.schema),y=f.resolve(s),v=null,w=g.parse(r,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:i,to:o,preserveWhitespace:y.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:nH,context:y});if(d&&d[0].pos!=null){let S=d[0].pos,C=d[1]&&d[1].pos;C==null&&(C=S),v={anchor:S+s,head:C+s}}return{doc:w,sel:v,from:s,to:l}}function nH(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Pn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||Pn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const rH=/^(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 iH(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let D=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,O=sv(e,D);if(O&&!e.state.selection.eq(O)){if(wn&&$i&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",_=>_(e,ys(13,"Enter"))))return;let B=e.state.tr.setSelection(O);D=="pointer"?B.setMeta("pointer",!0):D=="key"&&B.scrollIntoView(),o&&B.setMeta("composition",o),e.dispatch(B)}return}let s=e.state.doc.resolve(t),l=s.sharedDepth(n);t=s.before(l+1),n=e.state.doc.resolve(n).after(l+1);let c=e.state.selection,d=tH(e,t,n),h=e.state.doc,f=h.slice(d.from,d.to),g,y;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(g=e.state.selection.to,y="end"):(g=e.state.selection.from,y="start"),e.input.lastKeyCode=null;let v=lH(f.content,d.doc.content,d.from,g,y);if(v&&e.input.domChangeCount++,(Hl&&e.input.lastIOSEnter>Date.now()-225||$i)&&i.some(D=>D.nodeType==1&&!rH.test(D.nodeName))&&(!v||v.endA>=v.endB)&&e.someProp("handleKeyDown",D=>D(e,ys(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!v)if(r&&c instanceof Be&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))v={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let D=Ck(e,e.state.doc,d.sel);if(D&&!D.eq(e.state.selection)){let O=e.state.tr.setSelection(D);o&&O.setMeta("composition",o),e.dispatch(O)}}return}e.state.selection.from<e.state.selection.to&&v.start==v.endB&&e.state.selection instanceof Be&&(v.start>e.state.selection.from&&v.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?v.start=e.state.selection.from:v.endA<e.state.selection.to&&v.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(v.endB+=e.state.selection.to-v.endA,v.endA=e.state.selection.to)),nr&&Do<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>d.from&&d.doc.textBetween(v.start-d.from-1,v.start-d.from+1)==" "&&(v.start--,v.endA--,v.endB--);let w=d.doc.resolveNoCache(v.start-d.from),S=d.doc.resolveNoCache(v.endB-d.from),C=h.resolve(v.start),T=w.sameParent(S)&&w.parent.inlineContent&&C.end()>=v.endA;if((Hl&&e.input.lastIOSEnter>Date.now()-225&&(!T||i.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!T&&w.pos<d.doc.content.size&&(!w.sameParent(S)||!w.parent.inlineContent)&&w.pos<S.pos&&!/\S/.test(d.doc.textBetween(w.pos,S.pos,"","")))&&e.someProp("handleKeyDown",D=>D(e,ys(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>v.start&&sH(h,v.start,v.endA,w,S)&&e.someProp("handleKeyDown",D=>D(e,ys(8,"Backspace")))){$i&&wn&&e.domObserver.suppressSelectionUpdates();return}wn&&v.endB==v.start&&(e.input.lastChromeDelete=Date.now()),$i&&!T&&w.start()!=S.start()&&S.parentOffset==0&&w.depth==S.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==v.endA&&(v.endB-=2,S=d.doc.resolveNoCache(v.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(D){return D(e,ys(13,"Enter"))})},20));let N=v.start,R=v.endA,I=D=>{let O=D||e.state.tr.replace(N,R,d.doc.slice(v.start-d.from,v.endB-d.from));if(d.sel){let B=Ck(e,O.doc,d.sel);B&&!(wn&&e.composing&&B.empty&&(v.start!=v.endB||e.input.lastChromeDelete<Date.now()-100)&&(B.head==N||B.head==O.mapping.map(R)-1)||nr&&B.empty&&B.head==N)&&O.setSelection(B)}return o&&O.setMeta("composition",o),O.scrollIntoView()},j;if(T)if(w.pos==S.pos){nr&&Do<=11&&w.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Vi(e),20));let D=I(e.state.tr.delete(N,R)),O=h.resolve(v.start).marksAcross(h.resolve(v.endA));O&&D.ensureMarks(O),e.dispatch(D)}else if(v.endA==v.endB&&(j=oH(w.parent.content.cut(w.parentOffset,S.parentOffset),C.parent.content.cut(C.parentOffset,v.endA-C.start())))){let D=I(e.state.tr);j.type=="add"?D.addMark(N,R,j.mark):D.removeMark(N,R,j.mark),e.dispatch(D)}else if(w.parent.child(w.index()).isText&&w.index()==S.index()-(S.textOffset?0:1)){let D=w.parent.textBetween(w.parentOffset,S.parentOffset),O=()=>I(e.state.tr.insertText(D,N,R));e.someProp("handleTextInput",B=>B(e,N,R,D,O))||e.dispatch(O())}else e.dispatch(I());else e.dispatch(I())}function Ck(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:lv(e,t.resolve(n.anchor),t.resolve(n.head))}function oH(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,l,c;for(let h=0;h<r.length;h++)i=r[h].removeFromSet(i);for(let h=0;h<n.length;h++)o=n[h].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",c=h=>h.mark(l.addToSet(h.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",c=h=>h.mark(l.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<t.childCount;h++)d.push(c(t.child(h)));if(ae.from(d).eq(e))return{mark:l,type:s}}function sH(e,t,n,r,i){if(n-t<=i.pos-r.pos||lg(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&n==t+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(lg(o,!0,!0));return!s.parent.isTextblock||s.pos>n||lg(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function lg(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function lH(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,l));r-=s+c-o}if(s<o&&e.size<t.size){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<t.size&&Ek(t.textBetween(o-1,o+1))&&(o+=c?1:-1),l=o+(l-s),s=o}else if(l<o){let c=r<=o&&r>=l?o-r:0;o-=c,o&&o<e.size&&Ek(e.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function Ek(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class oA{constructor(t,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 SV,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(jk),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Mk(this),Tk(this),this.nodeViews=Ak(this),this.docView=sk(this.state.doc,Nk(this),sg(this),this.dom,this),this.domObserver=new JV(this,(r,i,o,s)=>iH(this,r,i,o,s)),this.domObserver.start(),CV(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&My(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(jk),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&(QM(this),s=!0),this.state=t;let l=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let y=Ak(this);cH(y,this.nodeViews)&&(this.nodeViews=y,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&My(this),this.editable=Mk(this),Tk(this);let c=sg(this),d=Nk(this),h=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,d,c);(f||!t.selection.eq(i.selection))&&(s=!0);let g=h=="preserve"&&s&&this.dom.style.overflowAnchor==null&&z6(this);if(s){this.domObserver.stop();let y=f&&(nr||wn)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&aH(i.selection,t.selection);if(f){let v=wn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=zV(this)),(o||!this.docView.update(t.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=sk(t.doc,d,c,this.dom,this)),v&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(y=!0)}y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&aV(this))?Vi(this,y):($M(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():g&&F6(g)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ie){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&ek(this,n.getBoundingClientRect(),t)}else ek(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.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,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&o<this.state.doc.content.size&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new eA(t.slice,t.move,i<0?void 0:Ie.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[t];if(l!=null&&(i=n?n(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[t];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(nr){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&$6(this.dom),Vi(this),this.domObserver.start()}get root(){let t=this._root;if(t==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 t||document}updateRoot(){this._root=null}posAtCoords(t){return W6(this,t)}coordsAtPos(t,n=1){return PM(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return J6(this,n||this.state,t)}pasteHTML(t,n){return Mc(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Mc(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return av(this,t)}destroy(){this.docView&&(EV(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],sg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,M6())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return TV(this,t)}domSelectionRange(){let t=this.domSelection();return t?Pn&&this.root.nodeType===11&&O6(this.dom.ownerDocument)==this.dom&&QV(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}oA.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Nk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Wt.node(0,e.state.doc.content.size,t)]}function Tk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Wt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Mk(e){return!e.someProp("editable",t=>t(e.state)===!1)}function aH(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Ak(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function cH(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function jk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Uo={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:"'"},xf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},uH=typeof navigator<"u"&&/Mac/.test(navigator.platform),dH=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var vn=0;vn<10;vn++)Uo[48+vn]=Uo[96+vn]=String(vn);for(var vn=1;vn<=24;vn++)Uo[vn+111]="F"+vn;for(var vn=65;vn<=90;vn++)Uo[vn]=String.fromCharCode(vn+32),xf[vn]=String.fromCharCode(vn);for(var ag in Uo)xf.hasOwnProperty(ag)||(xf[ag]=Uo[ag]);function fH(e){var t=uH&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||dH&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?xf:Uo)[e.keyCode]||e.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 hH=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),pH=typeof navigator<"u"&&/Win/.test(navigator.platform);function mH(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<t.length-1;l++){let c=t[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))hH?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function gH(e){let t=Object.create(null);for(let n in e)t[mH(n)]=e[n];return t}function cg(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function yH(e){return new xt({props:{handleKeyDown:sA(e)}})}function sA(e){let t=gH(e);return function(n,r){let i=fH(r),o,s=t[cg(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=t[cg(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(pH&&r.ctrlKey&&r.altKey)&&(o=Uo[r.keyCode])&&o!=i){let l=t[cg(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var xH=Object.defineProperty,pv=(e,t)=>{for(var n in t)xH(e,n,{get:t[n],enumerable:!0})};function Ph(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Oh=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([s,l])=>[s,(...d)=>{const h=l(...d)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],l=!!e,c=e||i.tr,d=()=>(!l&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),s.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(n).map(([f,g])=>[f,(...v)=>{const w=this.buildProps(c,t),S=g(...v)(w);return s.push(S),h}])),run:d};return h}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...d)=>c(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:Ph({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)(s)]))}};return s}},lA={};pv(lA,{blur:()=>vH,clearContent:()=>wH,clearNodes:()=>bH,command:()=>kH,createParagraphNear:()=>SH,cut:()=>CH,deleteCurrentNode:()=>EH,deleteNode:()=>NH,deleteRange:()=>TH,deleteSelection:()=>MH,enter:()=>AH,exitCode:()=>jH,extendMarkRange:()=>RH,first:()=>PH,focus:()=>IH,forEach:()=>DH,insertContent:()=>_H,insertContentAt:()=>FH,joinBackward:()=>VH,joinDown:()=>BH,joinForward:()=>HH,joinItemBackward:()=>UH,joinItemForward:()=>WH,joinTextblockBackward:()=>qH,joinTextblockForward:()=>KH,joinUp:()=>$H,keyboardShortcut:()=>YH,lift:()=>JH,liftEmptyBlock:()=>XH,liftListItem:()=>QH,newlineInCode:()=>ZH,resetAttributes:()=>e8,scrollIntoView:()=>t8,selectAll:()=>n8,selectNodeBackward:()=>r8,selectNodeForward:()=>i8,selectParentNode:()=>o8,selectTextblockEnd:()=>s8,selectTextblockStart:()=>l8,setContent:()=>a8,setMark:()=>A8,setMeta:()=>j8,setNode:()=>R8,setNodeSelection:()=>P8,setTextDirection:()=>O8,setTextSelection:()=>I8,sinkListItem:()=>D8,splitBlock:()=>_8,splitListItem:()=>L8,toggleList:()=>F8,toggleMark:()=>$8,toggleNode:()=>B8,toggleWrap:()=>V8,undoInputRule:()=>H8,unsetAllMarks:()=>U8,unsetMark:()=>W8,unsetTextDirection:()=>q8,updateAttributes:()=>K8,wrapIn:()=>G8,wrapInList:()=>Y8});var vH=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),wH=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),bH=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:h}=t,f=d.resolve(h.map(c)),g=d.resolve(h.map(c+l.nodeSize)),y=f.blockRange(g);if(!y)return;const v=Ql(y);if(l.type.isTextblock){const{defaultType:w}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(y.start,w)}(v||v===0)&&t.lift(y,v)})}),!0},kH=e=>t=>e(t),SH=()=>({state:e,dispatch:t})=>bM(e,t),CH=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new Be(r.doc.resolve(Math.max(s-1,0)))),!0},EH=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const l=i.before(o),c=i.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1};function Kt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var NH=e=>({tr:t,state:n,dispatch:r})=>{const i=Kt(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const c=o.before(s),d=o.after(s);t.delete(c,d).scrollIntoView()}return!0}return!1},TH=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},MH=()=>({state:e,dispatch:t})=>ev(e,t),AH=()=>({commands:e})=>e.keyboardShortcut("Enter"),jH=()=>({state:e,dispatch:t})=>h6(e,t);function mv(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function vf(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:mv(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function aA(e,t,n={}){return e.find(r=>r.type===t&&vf(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Rk(e,t,n={}){return!!aA(e,t,n)}function gv(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(d=>d.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(d=>d.type===t))return;if(!n){const d=r.node.marks.find(h=>h.type===t);d&&(n=d.attrs)}if(!aA([...r.node.marks],t,n))return;let o=r.index,s=e.start()+r.offset,l=o+1,c=s+r.node.nodeSize;for(;o>0&&Rk([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;l<e.parent.childCount&&Rk([...e.parent.child(l).marks],t,n);)c+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:c}}function Gi(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var RH=(e,t)=>({tr:n,state:r,dispatch:i})=>{const o=Gi(e,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:h}=l;if(i){const f=gv(c,o,t);if(f&&f.from<=d&&f.to>=h){const g=Be.create(s,f.from,f.to);n.setSelection(g)}}return!0},PH=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function cA(e){return e instanceof Be}function ws(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function uA(e,t=null){if(!t)return null;const n=Ye.atStart(e),r=Ye.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Be.create(e,ws(0,i,o),ws(e.content.size,i,o)):Be.create(e,ws(t,i,o),ws(t,i,o))}function Pk(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function wf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function OH(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var IH=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{(wf()||Pk())&&r.dom.focus(),OH()&&!wf()&&!Pk()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(o&&e===null&&!cA(n.state.selection))return s(),!0;const l=uA(i.doc,e)||n.state.selection,c=n.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},DH=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),_H=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),dA=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&dA(r)}return e};function bd(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return dA(n)}function jc(e,t,n){if(e instanceof Oo||e instanceof ae)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return ae.fromArray(e.map(l=>t.nodeFromJSON(l)));const s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),jc("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const c=new G2({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Io.fromSchema(c).parseSlice(bd(e),n.parseOptions):Io.fromSchema(c).parse(bd(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=Io.fromSchema(t);return n.slice?o.parseSlice(bd(e),n.parseOptions).content:o.parse(bd(e),n.parseOptions)}return jc("",t,n)}function LH(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Ht||i instanceof cn))return;const o=e.mapping.maps[r];let s=0;o.forEach((l,c,d,h)=>{s===0&&(s=h)}),e.setSelection(Ye.near(e.doc.resolve(s),n))}var zH=e=>!("type"in e),FH=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const c=S=>{o.emit("contentError",{editor:o,error:S,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{jc(t,o.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(S){c(S)}try{l=jc(t,o.schema,{parseOptions:d,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(S){return c(S),!1}let{from:h,to:f}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},g=!0,y=!0;if((zH(l)?l:[l]).forEach(S=>{S.check(),g=g?S.isText&&S.marks.length===0:!1,y=y?S.isBlock:!1}),h===f&&y){const{parent:S}=r.doc.resolve(h);S.isTextblock&&!S.type.spec.code&&!S.childCount&&(h-=1,f+=1)}let w;if(g){if(Array.isArray(t))w=t.map(S=>S.text||"").join("");else if(t instanceof ae){let S="";t.forEach(C=>{C.text&&(S+=C.text)}),w=S}else typeof t=="object"&&t&&t.text?w=t.text:w=t;r.insertText(w,h,f)}else{w=l;const S=r.doc.resolve(h),C=S.node(),T=S.parentOffset===0,N=C.isText||C.isTextblock,R=C.content.size>0;T&&N&&R&&y&&(h=Math.max(0,h-1)),r.replaceWith(h,f,w)}n.updateSelection&&LH(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:w}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:w})}return!0},$H=()=>({state:e,dispatch:t})=>u6(e,t),BH=()=>({state:e,dispatch:t})=>d6(e,t),VH=()=>({state:e,dispatch:t})=>pM(e,t),HH=()=>({state:e,dispatch:t})=>xM(e,t),UH=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Nh(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},WH=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Nh(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},qH=()=>({state:e,dispatch:t})=>a6(e,t),KH=()=>({state:e,dispatch:t})=>c6(e,t);function fA(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function GH(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<t.length-1;l+=1){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))wf()||fA()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}var YH=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=GH(e).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const h=d.map(r.mapping);h&&i&&r.maybeStep(h)}),!0};function Wo(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?Kt(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(f,g)=>{if(f.isText)return;const y=Math.max(r,g),v=Math.min(i,g+f.nodeSize);l.push({node:f,from:y,to:v})});const c=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>vf(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,g)=>f+g.to-g.from,0)>=c}var JH=(e,t={})=>({state:n,dispatch:r})=>{const i=Kt(e,n.schema);return Wo(n,i,t)?f6(n,r):!1},XH=()=>({state:e,dispatch:t})=>kM(e,t),QH=e=>({state:t,dispatch:n})=>{const r=Kt(e,t.schema);return C6(r)(t,n)},ZH=()=>({state:e,dispatch:t})=>wM(e,t);function Ih(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Ok(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var e8=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Ih(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(o=Kt(e,r.schema)),l==="mark"&&(s=Gi(e,r.schema));let c=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(h,f)=>{o&&o===h.type&&(c=!0,i&&n.setNodeMarkup(f,void 0,Ok(h.attrs,t))),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&(c=!0,i&&n.addMark(f,f+h.nodeSize,s.create(Ok(g.attrs,t))))})})}),c},t8=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),n8=()=>({tr:e,dispatch:t})=>{if(t){const n=new pr(e.doc);e.setSelection(n)}return!0},r8=()=>({state:e,dispatch:t})=>gM(e,t),i8=()=>({state:e,dispatch:t})=>vM(e,t),o8=()=>({state:e,dispatch:t})=>g6(e,t),s8=()=>({state:e,dispatch:t})=>v6(e,t),l8=()=>({state:e,dispatch:t})=>x6(e,t);function Ay(e,t,n={},r={}){return jc(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var a8=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{const{doc:c}=o;if(r.preserveWhitespace!=="full"){const d=Ay(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function hA(e,t){const n=Gi(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,c=>{s.push(...c.marks)});const l=s.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function pA(e,t){const n=new uM(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function c8(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function u8(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function d8(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Dh(e){return t=>d8(t.$from,e)}function Oe(e,t,n){return e.config[t]===void 0&&e.parent?Oe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Oe(e.parent,t,n):null}):e.config[t]}function yv(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Oe(t,"addExtensions",n);return r?[t,...yv(r())]:t}).flat(10)}function xv(e,t){const n=Hs.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function mA(e){return typeof e=="function"}function ut(e,t=void 0,...n){return mA(e)?t?e.bind(t)(...n):e(...n):e}function f8(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Ul(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function gA(e){const t=[],{nodeExtensions:n,markExtensions:r}=Ul(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(d=>d.name!=="text").map(d=>d.name),l=r.map(d=>d.name),c=[...s,...l];return e.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage,extensions:i},f=Oe(d,"addGlobalAttributes",h);if(!f)return;f().forEach(y=>{let v;Array.isArray(y.types)?v=y.types:y.types==="*"?v=c:y.types==="nodes"?v=s:y.types==="marks"?v=l:v=[],v.forEach(w=>{Object.entries(y.attributes).forEach(([S,C])=>{t.push({type:w,name:S,attribute:{...o,...C}})})})})}),i.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage},f=Oe(d,"addAttributes",h);if(!f)return;const g=f();Object.entries(g).forEach(([y,v])=>{const w={...o,...v};typeof(w==null?void 0:w.default)=="function"&&(w.default=w.default()),w!=null&&w.isRequired&&(w==null?void 0:w.default)===void 0&&delete w.default,t.push({type:d.name,name:y,attribute:w})})}),t}function h8(e){const t=[];let n="",r=!1,i=!1,o=0;const s=e.length;for(let l=0;l<s;l+=1){const c=e[l];if(c==="'"&&!i){r=!r,n+=c;continue}if(c==='"'&&!r){i=!i,n+=c;continue}if(!r&&!i){if(c==="("){o+=1,n+=c;continue}if(c===")"&&o>0){o-=1,n+=c;continue}if(c===";"&&o===0){t.push(n),n="";continue}}n+=c}return n&&t.push(n),t}function Ik(e){const t=[],n=h8(e||""),r=n.length;for(let i=0;i<r;i+=1){const o=n[i],s=o.indexOf(":");if(s===-1)continue;const l=o.slice(0,s).trim(),c=o.slice(s+1).trim();l&&c&&t.push([l,c])}return t}function Gt(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(h=>!c.includes(h));r[i]=[...c,...d].join(" ")}else if(i==="style"){const l=new Map([...Ik(r[i]),...Ik(o)]);r[i]=Array.from(l.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else r[i]=o}),r},{})}function Rc(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Gt(n,r),{})}function p8(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function Dk(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):p8(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function _k(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&f8(n)?!1:n!=null))}function Lk(e){var t,n;const r={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function m8(e,t){var n;const r=gA(e),{nodeExtensions:i,markExtensions:o}=Ul(e),s=(n=i.find(d=>Oe(d,"topNode")))==null?void 0:n.name,l=Object.fromEntries(i.map(d=>{const h=r.filter(C=>C.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:t},g=e.reduce((C,T)=>{const N=Oe(T,"extendNodeSchema",f);return{...C,...N?N(d):{}}},{}),y=_k({...g,content:ut(Oe(d,"content",f)),marks:ut(Oe(d,"marks",f)),group:ut(Oe(d,"group",f)),inline:ut(Oe(d,"inline",f)),atom:ut(Oe(d,"atom",f)),selectable:ut(Oe(d,"selectable",f)),draggable:ut(Oe(d,"draggable",f)),code:ut(Oe(d,"code",f)),whitespace:ut(Oe(d,"whitespace",f)),linebreakReplacement:ut(Oe(d,"linebreakReplacement",f)),defining:ut(Oe(d,"defining",f)),isolating:ut(Oe(d,"isolating",f)),attrs:Object.fromEntries(h.map(Lk))}),v=ut(Oe(d,"parseHTML",f));v&&(y.parseDOM=v.map(C=>Dk(C,h)));const w=Oe(d,"renderHTML",f);w&&(y.toDOM=C=>w({node:C,HTMLAttributes:Rc(C,h)}));const S=Oe(d,"renderText",f);return S&&(y.toText=S),[d.name,y]})),c=Object.fromEntries(o.map(d=>{const h=r.filter(S=>S.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:t},g=e.reduce((S,C)=>{const T=Oe(C,"extendMarkSchema",f);return{...S,...T?T(d):{}}},{}),y=_k({...g,inclusive:ut(Oe(d,"inclusive",f)),excludes:ut(Oe(d,"excludes",f)),group:ut(Oe(d,"group",f)),spanning:ut(Oe(d,"spanning",f)),code:ut(Oe(d,"code",f)),attrs:Object.fromEntries(h.map(Lk))}),v=ut(Oe(d,"parseHTML",f));v&&(y.parseDOM=v.map(S=>Dk(S,h)));const w=Oe(d,"renderHTML",f);return w&&(y.toDOM=S=>w({mark:S,HTMLAttributes:Rc(S,h)})),[d.name,y]}));return new G2({topNode:s,nodes:l,marks:c})}function g8(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function ac(e){return e.sort((n,r)=>{const i=Oe(n,"priority")||100,o=Oe(r,"priority")||100;return i>o?-1:i<o?1:0})}function yA(e){const t=ac(yv(e)),n=g8(t.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.`),t}function xA(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
|
|
457
|
+
|
|
458
|
+
`,textSerializers:s={}}=n||{};let l="";return e.nodesBetween(r,i,(c,d,h,f)=>{var g;c.isBlock&&d>r&&(l+=o);const y=s==null?void 0:s[c.type.name];if(y)return h&&(l+=y({node:c,pos:d,parent:h,index:f,range:t})),!1;c.isText&&(l+=(g=c==null?void 0:c.text)==null?void 0:g.slice(Math.max(r,d)-d,i-d))}),l}function y8(e,t){const n={from:0,to:e.content.size};return xA(e,n,t)}function vA(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function x8(e,t){const n=Kt(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function wA(e,t){const n=Ih(typeof t=="string"?t:t.name,e.schema);return n==="node"?x8(e,t):n==="mark"?hA(e,t):{}}function v8(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function w8(e){const t=v8(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function bA(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,c)=>{s.push({from:l,to:c})});else{const{from:l,to:c}=n[o];if(l===void 0||c===void 0)return;s.push({from:l,to:c})}s.forEach(({from:l,to:c})=>{const d=t.slice(o).map(l,-1),h=t.slice(o).map(c),f=t.invert().map(d,-1),g=t.invert().map(h);r.push({oldRange:{from:f,to:g},newRange:{from:d,to:h}})})}),w8(r)}function vv(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),s=gv(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}var b8=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const l=i.node(o);(l==null?void 0:l.type.name)===t?s=l:o-=1}return[s,o]};function $a(e,t){return t.nodes[e]||t.marks[e]||null}function Vd(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var k8=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,l)=>{var c,d;const h=((d=(c=i.type.spec).toText)==null?void 0:d.call(c,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?h:h.slice(0,Math.max(0,r-o))}),n};function jy(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Gi(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>vf(f.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:f,$to:g})=>{const y=f.pos,v=g.pos;e.doc.nodesBetween(y,v,(w,S)=>{if(o&&w.inlineContent&&!w.type.allowsMarkType(o))return!1;if(!w.isText&&!w.marks.length)return;const C=Math.max(y,S),T=Math.min(v,S+w.nodeSize),N=T-C;s+=N,l.push(...w.marks.map(R=>({mark:R,from:C,to:T})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>vf(f.mark.attrs,n,{strict:!1})).reduce((f,g)=>f+g.to-g.from,0),d=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,g)=>f+g.to-g.from,0);return(c>0?c+d:c)>=s}function S8(e,t,n={}){if(!t)return Wo(e,null,n)||jy(e,null,n);const r=Ih(t,e.schema);return r==="node"?Wo(e,t,n):r==="mark"?jy(e,t,n):!1}var C8=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=Dh(l=>l.type.name===t)(e.selection);if(!o)return!1;const s=e.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},E8=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function zk(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function ug(e,t){const{nodeExtensions:n}=Ul(t),r=n.find(s=>s.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ut(Oe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function _h(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return!/\S/.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(_h(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function kA(e){return e instanceof Ie}var SA=class CA{constructor(t){this.position=t}static fromJSON(t){return new CA(t.position)}toJSON(){return{position:this.position}}};function N8(e,t){const n=t.mapping.mapResult(e.position);return{position:new SA(n.pos),mapResult:n}}function T8(e){return new SA(e)}function M8(e,t,n){var r;const{selection:i}=t;let o=null;if(cA(i)&&(o=i.$cursor),o){const l=(r=e.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(d=>d.type.excludes(n)))}const{ranges:s}=i;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,c.pos,(h,f,g)=>{if(d)return!1;if(h.isInline){const y=!g||g.type.allowsMarkType(n),v=!!n.isInSet(h.marks)||!h.marks.some(w=>w.type.excludes(n));d=y&&v}return!d}),d})}var A8=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,c=Gi(e,r.schema);if(i)if(s){const d=hA(r,c);n.addStoredMark(c.create({...d,...t}))}else l.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(h,f,(g,y)=>{const v=Math.max(y,h),w=Math.min(y+g.nodeSize,f);g.marks.find(C=>C.type===c)?g.marks.forEach(C=>{c===C.type&&n.addMark(v,w,c.create({...C.attrs,...t}))}):n.addMark(v,w,c.create(t))})});return M8(r,n,c)},j8=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),R8=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Kt(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>Xb(o,{...s,...t})(n)?!0:l.clearNodes()).command(({state:l})=>Xb(o,{...s,...t})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},P8=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=ws(e,0,r.content.size),o=Ie.create(r,i);t.setSelection(o)}return!0},O8=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=r;let s,l;return typeof t=="number"?(s=t,l=t):t&&"from"in t&&"to"in t?(s=t.from,l=t.to):(s=o.from,l=o.to),i&&n.doc.nodesBetween(s,l,(c,d)=>{c.isText||n.setNodeMarkup(d,void 0,{...c.attrs,dir:e})}),!0},I8=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=Be.atStart(r).from,l=Be.atEnd(r).to,c=ws(i,s,l),d=ws(o,s,l),h=Be.create(r,c,d);t.setSelection(h)}return!0},D8=e=>({state:t,dispatch:n})=>{const r=Kt(e,t.schema);return T6(r)(t,n)};function Fk(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}var _8=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:l,$to:c}=o,d=i.extensionManager.attributes,h=Vd(d,l.node().type.name,l.node().attrs);if(o instanceof Ie&&o.node.isBlock)return!l.parentOffset||!Bi(s,l.pos)?!1:(r&&(e&&Fk(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,g=l.depth===0?void 0:c8(l.node(-1).contentMatchAt(l.indexAfter(-1)));let y=f&&g?[{type:g,attrs:h}]:void 0,v=Bi(t.doc,t.mapping.map(l.pos),1,y);if(!y&&!v&&Bi(t.doc,t.mapping.map(l.pos),1,g?[{type:g}]:void 0)&&(v=!0,y=g?[{type:g,attrs:h}]:void 0),r){if(v&&(o instanceof Be&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,y),g&&!f&&!l.parentOffset&&l.parent.type!==g)){const w=t.mapping.map(l.before()),S=t.doc.resolve(w);l.node(-1).canReplaceWith(S.index(),S.index()+1,g)&&t.setNodeMarkup(t.mapping.map(l.before()),g)}e&&Fk(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return v},L8=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=Kt(e,r.schema),{$from:c,$to:d}=r.selection,h=r.selection.node;if(h&&h.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==l)return!1;const g=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let C=ae.empty;const T=c.index(-1)?1:c.index(-2)?2:3;for(let O=c.depth-T;O>=c.depth-3;O-=1)C=ae.from(c.node(O).copy(C));const N=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,R={...Vd(g,c.node().type.name,c.node().attrs),...t},I=((s=l.contentMatch.defaultType)==null?void 0:s.createAndFill(R))||void 0;C=C.append(ae.from(l.createAndFill(null,I)||void 0));const j=c.before(c.depth-(T-1));n.replace(j,c.after(-N),new ke(C,4-T,0));let D=-1;n.doc.nodesBetween(j,n.doc.content.size,(O,B)=>{if(D>-1)return!1;O.isTextblock&&O.content.size===0&&(D=B+1)}),D>-1&&n.setSelection(Be.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const y=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,v={...Vd(g,f.type.name,f.attrs),...t},w={...Vd(g,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,d.pos);const S=y?[{type:l,attrs:v},{type:y,attrs:w}]:[{type:l,attrs:v}];if(!Bi(n.doc,c.pos,2))return!1;if(i){const{selection:C,storedMarks:T}=r,{splittableMarks:N}=o.extensionManager,R=T||C.$to.parentOffset&&C.$from.marks();if(n.split(c.pos,2,S).scrollIntoView(),!R||!i)return!0;const I=R.filter(j=>N.includes(j.type.name));n.ensureMarks(I)}return!0},dg=(e,t)=>{const n=Dh(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Yo(e.doc,n.pos)&&e.join(n.pos),!0},fg=(e,t)=>{const n=Dh(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Yo(e.doc,r)&&e.join(r),!0};function z8(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Be.between(r,i)}var F8=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:c,commands:d,can:h})=>{const{extensions:f,splittableMarks:g}=i.extensionManager,y=Kt(e,s.schema),v=Kt(t,s.schema),{selection:w,storedMarks:S}=s,{$from:C,$to:T}=w,N=C.blockRange(T),R=S||w.$to.parentOffset&&w.$from.marks();if(!N)return!1;const I=Dh(Z=>ug(Z.type.name,f))(w),j=w.from===0&&w.to===s.doc.content.size,D=s.doc.content.content,O=D.length===1?D[0]:null,B=j&&O&&ug(O.type.name,f)?{node:O,pos:0}:null,_=I??B,V=!!I&&N.depth>=1&&N.depth-I.depth<=1,U=!!B;if((V||U)&&_){if(_.node.type===y)return j&&U?c().command(({tr:Z,dispatch:K})=>{const W=z8(Z);return W?(Z.setSelection(W),K&&K(Z),!0):!1}).liftListItem(v).run():d.liftListItem(v);if(ug(_.node.type.name,f)&&y.validContent(_.node.content))return c().command(()=>(o.setNodeMarkup(_.pos,y),!0)).command(()=>dg(o,y)).command(()=>fg(o,y)).run()}return!n||!R||!l?c().command(()=>h().wrapInList(y,r)?!0:d.clearNodes()).wrapInList(y,r).command(()=>dg(o,y)).command(()=>fg(o,y)).run():c().command(()=>{const Z=h().wrapInList(y,r),K=R.filter(W=>g.includes(W.type.name));return o.ensureMarks(K),Z?!0:d.clearNodes()}).wrapInList(y,r).command(()=>dg(o,y)).command(()=>fg(o,y)).run()},$8=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Gi(e,r.schema);return jy(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},B8=(e,t,n={})=>({state:r,commands:i})=>{const o=Kt(e,r.schema),s=Kt(t,r.schema),l=Wo(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?i.setNode(s,c):i.setNode(o,{...c,...n})},V8=(e,t={})=>({state:n,commands:r})=>{const i=Kt(e,n.schema);return Wo(n,i,t)?r.lift(i):r.wrapIn(i,t)},H8=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const s=e.tr,l=o.transform;for(let c=l.steps.length-1;c>=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(o.text){const c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,c))}else s.delete(o.from,o.to)}return!0}}return!1},U8=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},W8=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,c=Gi(e,r.schema),{$from:d,empty:h,ranges:f}=l;if(!i)return!0;if(h&&s){let{from:g,to:y}=l;const v=(o=d.marks().find(S=>S.type===c))==null?void 0:o.attrs,w=gv(d,c,v);w&&(g=w.from,y=w.to),n.removeMark(g,y,c)}else f.forEach(g=>{n.removeMark(g.$from.pos,g.$to.pos,c)});return n.removeStoredMark(c),!0},q8=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let o,s;return typeof e=="number"?(o=e,s=e):e&&"from"in e&&"to"in e?(o=e.from,s=e.to):(o=i.from,s=i.to),r&&t.doc.nodesBetween(o,s,(l,c)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,t.setNodeMarkup(c,void 0,d)}),!0},K8=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Ih(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(o=Kt(e,r.schema)),l==="mark"&&(s=Gi(e,r.schema));let c=!1;return n.selection.ranges.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;let g,y,v,w;n.selection.empty?r.doc.nodesBetween(h,f,(S,C)=>{o&&o===S.type&&(c=!0,v=Math.max(C,h),w=Math.min(C+S.nodeSize,f),g=C,y=S)}):r.doc.nodesBetween(h,f,(S,C)=>{C<h&&o&&o===S.type&&(c=!0,v=Math.max(C,h),w=Math.min(C+S.nodeSize,f),g=C,y=S),C>=h&&C<=f&&(o&&o===S.type&&(c=!0,i&&n.setNodeMarkup(C,void 0,{...S.attrs,...t})),s&&S.marks.length&&S.marks.forEach(T=>{if(s===T.type&&(c=!0,i)){const N=Math.max(C,h),R=Math.min(C+S.nodeSize,f);n.addMark(N,R,s.create({...T.attrs,...t}))}}))}),y&&(g!==void 0&&i&&n.setNodeMarkup(g,void 0,{...y.attrs,...t}),s&&y.marks.length&&y.marks.forEach(S=>{s===S.type&&i&&n.addMark(v,w,s.create({...S.attrs,...t}))}))}),c},G8=(e,t={})=>({state:n,dispatch:r})=>{const i=Kt(e,n.schema);return w6(i,t)(n,r)},Y8=(e,t={})=>({state:n,dispatch:r})=>{const i=Kt(e,n.schema);return b6(i,t)(n,r)},J8=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Lh=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},X8=(e,t)=>{if(mv(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,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 kd(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||(t=d.nodeBefore||d.nodeAfter)!=null&&t.marks.find(g=>g.type.spec.code))return!1;let h=!1;const f=k8(d)+o;return s.forEach(g=>{if(h)return;const y=X8(f,g.find);if(!y)return;const v=c.state.tr,w=Ph({state:c.state,transaction:v}),S={from:r-(y[0].length-o.length),to:i},{commands:C,chain:T,can:N}=new Oh({editor:n,state:w});g.handler({state:w,range:S,match:y,commands:C,chain:T,can:N})===null||!v.steps.length||(g.undoable&&v.setMeta(l,{transform:v,from:r,to:i,text:o}),c.dispatch(v),h=!0)}),h}function Q8(e){const{editor:t,rules:n}=e,r=new xt({state:{init(){return null},apply(i,o,s){const l=i.getMeta(r);if(l)return l;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:h}=c;typeof h=="string"?h=h:h=xv(ae.from(h),s.schema);const{from:f}=c,g=f+h.length;kd({editor:t,from:f,to:g,text:h,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return kd({editor:t,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&kd({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?kd({editor:t,from:s.pos,to:s.pos,text:`
|
|
459
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Z8(e){return Object.prototype.toString.call(e).slice(8,-1)}function Sd(e){return Z8(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function EA(e,t){const n={...e};return Sd(e)&&Sd(t)&&Object.keys(t).forEach(r=>{Sd(t[r])&&Sd(e[r])?n[r]=EA(e[r],t[r]):n[r]=t[r]}),n}var wv=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...ut(Oe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ut(Oe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>EA(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Us=class NA extends wv{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new NA(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const c=s.find(d=>(d==null?void 0:d.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function e9(e){return typeof e=="number"}var t9=class{constructor(e){this.find=e.find,this.handler=e.handler}},n9=(e,t,n)=>{if(mv(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function r9(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:c,chain:d,can:h}=new Oh({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(y,v)=>{var w,S,C,T,N;if((S=(w=y.type)==null?void 0:w.spec)!=null&&S.code||!(y.isText||y.isTextblock||y.isInline))return;const R=(N=(T=(C=y.content)==null?void 0:C.size)!=null?T:y.nodeSize)!=null?N:0,I=Math.max(r,v),j=Math.min(i,v+R);if(I>=j)return;const D=y.isText?y.text||"":y.textBetween(I-v,j-v,void 0,"");n9(D,o.find,s).forEach(B=>{if(B.index===void 0)return;const _=I+B.index+1,V=_+B[0].length,U={from:n.tr.mapping.map(_),to:n.tr.mapping.map(V)},Z=o.handler({state:n,range:U,match:B,commands:c,chain:d,can:h,pasteEvent:s,dropEvent:l});f.push(Z)})}),f.every(y=>y!==null)}var Cd=null,i9=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function o9(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:h,from:f,to:g,rule:y,pasteEvt:v})=>{const w=h.tr,S=Ph({state:h,transaction:w});if(!(!r9({editor:t,state:S,from:Math.max(f-1,0),to:g.b-1,rule:y,pasteEvent:v,dropEvent:l})||!w.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,w}};return n.map(h=>new xt({view(f){const g=v=>{var w;r=(w=f.dom.parentElement)!=null&&w.contains(v.target)?f.dom.parentElement:null,r&&(Cd=t)},y=()=>{Cd&&(Cd=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",y),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",y)}}},props:{handleDOMEvents:{drop:(f,g)=>{if(o=r===f.dom.parentElement,l=g,!o){const y=Cd;y!=null&&y.isEditable&&setTimeout(()=>{const v=y.state.selection;v&&y.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(f,g)=>{var y;const v=(y=g.clipboardData)==null?void 0:y.getData("text/html");return s=g,i=!!(v!=null&&v.includes("data-pm-slice")),!1}}},appendTransaction:(f,g,y)=>{const v=f[0],w=v.getMeta("uiEvent")==="paste"&&!i,S=v.getMeta("uiEvent")==="drop"&&!o,C=v.getMeta("applyPasteRules"),T=!!C;if(!w&&!S&&!T)return;if(T){let{text:I}=C;typeof I=="string"?I=I:I=xv(ae.from(I),y.schema);const{from:j}=C,D=j+I.length,O=i9(I);return c({rule:h,state:y,from:j,to:{b:D},pasteEvt:O})}const N=g.doc.content.findDiffStart(y.doc.content),R=g.doc.content.findDiffEnd(y.doc.content);if(!(!e9(N)||!R||N===R.b))return c({rule:h,state:y,from:N,to:R,pasteEvt:s})}}))}var zh=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=yA(e),this.schema=m8(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:$a(t.name,this.schema)},r=Oe(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return ac([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:$a(r.name,this.schema)},o=[],s=Oe(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&Oe(r,"exitable",i)&&(l.ArrowRight=()=>Us.handleExit({editor:e,mark:r})),s){const g=Object.fromEntries(Object.entries(s()).map(([y,v])=>[y,()=>v({editor:e})]));l={...l,...g}}const c=yH(l);o.push(c);const d=Oe(r,"addInputRules",i);if(zk(r,e.options.enableInputRules)&&d){const g=d();if(g&&g.length){const y=Q8({editor:e,rules:g}),v=Array.isArray(y)?y:[y];o.push(...v)}}const h=Oe(r,"addPasteRules",i);if(zk(r,e.options.enablePasteRules)&&h){const g=h();if(g&&g.length){const y=o9({editor:e,rules:g});o.push(...y)}}const f=Oe(r,"addProseMirrorPlugins",i);if(f){const g=f();o.push(...g)}return o})}get attributes(){return gA(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ul(this.extensions);return Object.fromEntries(t.filter(n=>!!Oe(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Kt(n.name,this.schema)},o=Oe(n,"addNodeView",i);if(!o)return[];const s=o();if(!s)return[];const l=(c,d,h,f,g)=>{const y=Rc(c,r);return s({node:c,view:d,getPos:h,decorations:f,innerDecorations:g,editor:e,extension:n,HTMLAttributes:y})};return[n.name,l]}))}dispatchTransaction(e){const{editor:t}=this;return ac([...this.extensions].reverse()).reduceRight((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:$a(i.name,this.schema)},s=Oe(i,"dispatchTransaction",o);return s?l=>{s.call(o,{transaction:l,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return ac([...this.extensions]).reduce((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:$a(i.name,this.schema)},s=Oe(i,"transformPastedHTML",o);return s?(l,c)=>{const d=r(l,c);return s.call(o,d)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=Ul(this.extensions);return Object.fromEntries(t.filter(n=>!!Oe(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Gi(n.name,this.schema)},o=Oe(n,"addMarkView",i);if(!o)return[];const s=(l,c,d)=>{const h=Rc(l,r);return o()({mark:l,view:c,inline:d,editor:e,extension:n,HTMLAttributes:h,updateAttributes:f=>{v9(l,e,f)}})};return[n.name,s]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){const n=t.parent;n.child===t&&(n.child=null),t=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:$a(t.name,this.schema)};t.type==="mark"&&((n=ut(Oe(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const i=Oe(t,"onBeforeCreate",r),o=Oe(t,"onCreate",r),s=Oe(t,"onUpdate",r),l=Oe(t,"onSelectionUpdate",r),c=Oe(t,"onTransaction",r),d=Oe(t,"onFocus",r),h=Oe(t,"onBlur",r),f=Oe(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),f&&this.editor.on("destroy",f)})}};zh.resolve=yA;zh.sort=ac;zh.flatten=yv;var s9={};pv(s9,{ClipboardTextSerializer:()=>MA,Commands:()=>AA,Delete:()=>jA,Drop:()=>RA,Editable:()=>PA,FocusEvents:()=>IA,Keymap:()=>DA,Paste:()=>_A,Tabindex:()=>LA,TextDirection:()=>zA,focusEventsPluginKey:()=>OA});var Et=class TA extends wv{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new TA(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},MA=Et.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new xt({key:new Pt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(h=>h.$from.pos)),l=Math.max(...o.map(h=>h.$to.pos)),c=vA(n);return xA(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),AA=Et.create({name:"commands",addCommands(){return{...lA}}}),jA=Et.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const o=()=>{var s,l,c,d;if((d=(c=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,e))!=null?d:e.getMeta("y-sync$"))return;const h=pA(e.before,[e,...t]);bA(h).forEach(y=>{h.mapping.mapResult(y.oldRange.from).deletedAfter&&h.mapping.mapResult(y.oldRange.to).deletedBefore&&h.before.nodesBetween(y.oldRange.from,y.oldRange.to,(v,w)=>{const S=w+v.nodeSize-2,C=y.oldRange.from<=w&&S<=y.oldRange.to;this.editor.emit("delete",{type:"node",node:v,from:w,to:S,newFrom:h.mapping.map(w),newTo:h.mapping.map(S),deletedRange:y.oldRange,newRange:y.newRange,partial:!C,editor:this.editor,transaction:e,combinedTransform:h})})});const g=h.mapping;h.steps.forEach((y,v)=>{var w,S;if(y instanceof Xr){const C=g.slice(v).map(y.from,-1),T=g.slice(v).map(y.to),N=g.invert().map(C,-1),R=g.invert().map(T),I=C>0?(w=h.doc.nodeAt(C-1))==null?void 0:w.marks.some(D=>D.eq(y.mark)):!1,j=(S=h.doc.nodeAt(T))==null?void 0:S.marks.some(D=>D.eq(y.mark));this.editor.emit("delete",{type:"mark",mark:y.mark,from:y.from,to:y.to,deletedRange:{from:N,to:R},newRange:{from:C,to:T},partial:!!(j||I),editor:this.editor,transaction:e,combinedTransform:h})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),RA=Et.create({name:"drop",addProseMirrorPlugins(){return[new xt({key:new Pt("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),PA=Et.create({name:"editable",addProseMirrorPlugins(){return[new xt({key:new Pt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),OA=new Pt("focusEvents"),IA=Et.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new xt({key:OA,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),DA=Et.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:h,$anchor:f}=c,{pos:g,parent:y}=f,v=f.parent.isTextblock&&g>0?l.doc.resolve(g-1):f,w=v.parent.type.spec.isolating,S=f.pos-f.parentOffset,C=w&&v.parent.childCount===1?S===f.pos:Ye.atStart(d).from===g;return!h||!y.type.isTextblock||y.textContent.length||!C||C&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return wf()||fA()?o:i},addProseMirrorPlugins(){return[new xt({key:new Pt("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(w=>w.getMeta("composition")))return;const r=e.some(w=>w.docChanged)&&!t.doc.eq(n.doc),i=e.some(w=>w.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=t.selection,c=Ye.atStart(t.doc).from,d=Ye.atEnd(t.doc).to;if(o||!(s===c&&l===d)||!_h(n.doc))return;const g=n.tr,y=Ph({state:n,transaction:g}),{commands:v}=new Oh({editor:this.editor,state:y});if(v.clearNodes(),!!g.steps.length)return g}})]}}),_A=Et.create({name:"paste",addProseMirrorPlugins(){return[new xt({key:new Pt("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),LA=Et.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new xt({key:new Pt("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!=null?e:"0"}}}})]}}),zA=Et.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Ul(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new xt({key:new Pt("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),l9=class ec{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}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 t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){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},t)}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 t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new ec(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new ec(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new ec(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,l=this.pos+r+(o?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(l);if(!i&&!s&&c.depth<=this.depth)return;const d=new ec(c,this.editor,i,i||s?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){const c=s[l];if(o[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===t&&o.every(c=>n[c]===s.node.attrs[c])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},a9=`.ProseMirror {
|
|
460
|
+
position: relative;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.ProseMirror {
|
|
464
|
+
word-wrap: break-word;
|
|
465
|
+
white-space: pre-wrap;
|
|
466
|
+
white-space: break-spaces;
|
|
467
|
+
-webkit-font-variant-ligatures: none;
|
|
468
|
+
font-variant-ligatures: none;
|
|
469
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.ProseMirror [contenteditable="false"] {
|
|
473
|
+
white-space: normal;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
477
|
+
white-space: pre-wrap;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.ProseMirror pre {
|
|
481
|
+
white-space: pre-wrap;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
img.ProseMirror-separator {
|
|
485
|
+
display: inline !important;
|
|
486
|
+
border: none !important;
|
|
487
|
+
margin: 0 !important;
|
|
488
|
+
width: 0 !important;
|
|
489
|
+
height: 0 !important;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.ProseMirror-gapcursor {
|
|
493
|
+
display: none;
|
|
494
|
+
pointer-events: none;
|
|
495
|
+
position: absolute;
|
|
496
|
+
margin: 0;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.ProseMirror-gapcursor:after {
|
|
500
|
+
content: "";
|
|
501
|
+
display: block;
|
|
502
|
+
position: absolute;
|
|
503
|
+
top: -2px;
|
|
504
|
+
width: 20px;
|
|
505
|
+
border-top: 1px solid black;
|
|
506
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
@keyframes ProseMirror-cursor-blink {
|
|
510
|
+
to {
|
|
511
|
+
visibility: hidden;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.ProseMirror-hideselection *::selection {
|
|
516
|
+
background: transparent;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
520
|
+
background: transparent;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.ProseMirror-hideselection * {
|
|
524
|
+
caret-color: transparent;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
528
|
+
display: block;
|
|
529
|
+
}`;function c9(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var u9=class extends J8{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!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:N8,createMappablePosition:T8},this.setOptions(e),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:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=uA(t,this.options.autofocus);this.editorState=Tl.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){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(e),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 e=this.editorView.dom;e!=null&&e.editor&&delete e.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(e){console.warn("Failed to remove CSS element:",e)}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=c9(a9,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=mA(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const o=typeof i=="string"?`${i}$`:i.key;n=n.filter(s=>!s.key.startsWith(o))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;const o=[...this.options.enableCoreExtensions?[PA,MA.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),AA,IA,DA,LA.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),RA,_A,jA,zA.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new zh(o,this)}createCommandManager(){this.commandManager=new Oh({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Ay(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,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()}}),e=Ay(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new oA(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const c=this.view.dom;c.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(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var h;return(h=this.capturedTransaction)==null?void 0:h.step(d)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=s==null?void 0:s.getMeta("focus"),c=s==null?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),c&&this.emit("blur",{editor:this,event:c.event,transaction:s}),!(e.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return wA(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return S8(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return xv(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
|
|
530
|
+
|
|
531
|
+
`,textSerializers:n={}}=e||{};return y8(this.state.doc,{blockSeparator:t,textSerializers:{...vA(this.schema),...n}})}get isEmpty(){return _h(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new l9(t,this)}get $doc(){return this.$pos(0)}};function Wl(e){return new Lh({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ut(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],l=r[0];if(s){const c=l.search(/\S/),d=n.from+l.indexOf(s),h=d+s.length;if(vv(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(w=>w===e.type&&w!==y.mark.type)).filter(y=>y.to>d).length)return null;h<n.to&&o.delete(h,n.to),d>n.from&&o.delete(n.from+c,d);const g=n.from+c+s.length;o.addMark(n.from+c,g,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function d9(e){return new Lh({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ut(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let l=n.to;const c=e.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let h=s+d;h>l?h=l:l=h+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(h,l,c)}else if(r[0]){const d=e.type.isInline?s:s-1;o.insert(d,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()},undoable:e.undoable})}function Ry(e){return new Lh({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=ut(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function ql(e){return new Lh({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=ut(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&Qx(c,e.type,o);if(!d)return null;if(s.wrap(c,d),e.keepMarks&&e.editor){const{selection:f,storedMarks:g}=t,{splittableMarks:y}=e.editor.extensionManager,v=g||f.$to.parentOffset&&f.$from.marks();if(v){const w=v.filter(S=>y.includes(S.type.name));s.ensureMarks(w)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const h=s.doc.resolve(n.from-1).nodeBefore;h&&h.type===e.type&&Yo(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,h))&&s.join(n.from-1)},undoable:e.undoable})}function f9(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof Ie){const o=r.index();return r.parent.canReplaceWith(o,o+1,t)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(t))return!0;i-=1}return!1}var h9={};pv(h9,{createAtomBlockMarkdownSpec:()=>p9,createBlockMarkdownSpec:()=>m9,createInlineMarkdownSpec:()=>x9,parseAttributes:()=>bv,parseIndentedBlocks:()=>Py,renderNestedMarkdownContent:()=>Sv,serializeAttributes:()=>kv});function bv(e){if(!(e!=null&&e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,d=>(n.push(d),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const d=i.map(h=>h.trim().slice(1));t.class=d.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,d,h])=>{var f;const g=parseInt(((f=h.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),y=n[g];y&&(t[d]=y.slice(1,-1))});const c=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 c&&c.split(/\s+/).filter(Boolean).forEach(h=>{h.match(/^[a-zA-Z][\w-]*$/)&&(t[h]=!0)}),t}function kv(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function p9(e){const{nodeName:t,name:n,parseAttributes:r=bv,serializeAttributes:i=kv,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:l}=e,c=n||t,d=h=>{if(!l)return h;const f={};return l.forEach(g=>{g in h&&(f[g]=h[g])}),f};return{parseMarkdown:(h,f)=>{const g={...o,...h.attributes};return f.createNode(t,g,[])},markdownTokenizer:{name:t,level:"block",start(h){var f;const g=new RegExp(`^:::${c}(?:\\s|$)`,"m"),y=(f=h.match(g))==null?void 0:f.index;return y!==void 0?y:-1},tokenize(h,f,g){const y=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),v=h.match(y);if(!v)return;const w=v[1]||"",S=r(w);if(!s.find(T=>!(T in S)))return{type:t,raw:v[0],attributes:S}}},renderMarkdown:h=>{const f=d(h.attrs||{}),g=i(f),y=g?` {${g}}`:"";return`:::${c}${y} :::`}}}function m9(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=bv,serializeAttributes:o=kv,defaultAttributes:s={},content:l="block",allowedAttributes:c}=e,d=n||t,h=f=>{if(!c)return f;const g={};return c.forEach(y=>{y in f&&(g[y]=f[y])}),g};return{parseMarkdown:(f,g)=>{let y;if(r){const w=r(f);y=typeof w=="string"?[{type:"text",text:w}]:w}else l==="block"?y=g.parseChildren(f.tokens||[]):y=g.parseInline(f.tokens||[]);const v={...s,...f.attributes};return g.createNode(t,v,y)},markdownTokenizer:{name:t,level:"block",start(f){var g;const y=new RegExp(`^:::${d}`,"m"),v=(g=f.match(y))==null?void 0:g.index;return v!==void 0?v:-1},tokenize(f,g,y){var v;const w=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),S=f.match(w);if(!S)return;const[C,T=""]=S,N=i(T);let R=1;const I=C.length;let j="";const D=/^:::([\w-]*)(\s.*)?/gm,O=f.slice(I);for(D.lastIndex=0;;){const B=D.exec(O);if(B===null)break;const _=B.index,V=B[1];if(!((v=B[2])!=null&&v.endsWith(":::"))){if(V)R+=1;else if(R-=1,R===0){const U=O.slice(0,_);j=U.trim();const Z=f.slice(0,I+_+B[0].length);let K=[];if(j)if(l==="block")for(K=y.blockTokens(U),K.forEach(W=>{W.text&&(!W.tokens||W.tokens.length===0)&&(W.tokens=y.inlineTokens(W.text))});K.length>0;){const W=K[K.length-1];if(W.type==="paragraph"&&(!W.text||W.text.trim()===""))K.pop();else break}else K=y.inlineTokens(j);return{type:t,raw:Z,attributes:N,content:j,tokens:K}}}}}},renderMarkdown:(f,g)=>{const y=h(f.attrs||{}),v=o(y),w=v?` {${v}}`:"",S=g.renderChildren(f.content||[],`
|
|
532
|
+
|
|
533
|
+
`);return`:::${d}${w}
|
|
534
|
+
|
|
535
|
+
${S}
|
|
536
|
+
|
|
537
|
+
:::`}}}function g9(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function y9(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function x9(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=g9,serializeAttributes:o=y9,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:c}=e,d=n||t,h=g=>{if(!c)return g;const y={};return c.forEach(v=>{const w=typeof v=="string"?v:v.name,S=typeof v=="string"?void 0:v.skipIfDefault;if(w in g){const C=g[w];if(S!==void 0&&C===S)return;y[w]=C}}),y},f=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(g,y)=>{const v={...s,...g.attributes};if(l)return y.createNode(t,v);const w=r?r(g):g.content||"";return w?y.createNode(t,v,[y.createTextNode(w)]):y.createNode(t,v,[])},markdownTokenizer:{name:t,level:"inline",start(g){const y=l?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),v=g.match(y),w=v==null?void 0:v.index;return w!==void 0?w:-1},tokenize(g,y,v){const w=l?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),S=g.match(w);if(!S)return;let C="",T="";if(l){const[,R]=S;T=R}else{const[,R,I]=S;T=R,C=I||""}const N=i(T.trim());return{type:t,raw:S[0],content:C.trim(),attributes:N}}},renderMarkdown:g=>{let y="";r?y=r(g):g.content&&g.content.length>0&&(y=g.content.filter(C=>C.type==="text").map(C=>C.text).join(""));const v=h(g.attrs||{}),w=o(v),S=w?` ${w}`:"";return l?`[${d}${S}]`:`[${d}${S}]${y}[/${d}]`}}}function Py(e,t,n){var r,i,o,s;const l=e.split(`
|
|
538
|
+
`),c=[];let d="",h=0;const f=t.baseIndentSize||2;for(;h<l.length;){const g=l[h],y=g.match(t.itemPattern);if(!y){if(c.length>0)break;if(g.trim()===""){h+=1,d=`${d}${g}
|
|
539
|
+
`;continue}else return}const v=t.extractItemData(y),{indentLevel:w,mainContent:S}=v;d=`${d}${g}
|
|
540
|
+
`;const C=[S];for(h+=1;h<l.length;){const I=l[h];if(I.trim()===""){const D=l.slice(h+1).findIndex(_=>_.trim()!=="");if(D===-1)break;if((((i=(r=l[h+1+D].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>w){C.push(I),d=`${d}${I}
|
|
541
|
+
`,h+=1;continue}else break}if((((s=(o=I.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>w)C.push(I),d=`${d}${I}
|
|
542
|
+
`,h+=1;else break}let T;const N=C.slice(1);if(N.length>0){const I=N.map(j=>j.slice(w+f)).join(`
|
|
543
|
+
`);I.trim()&&(t.customNestedParser?T=t.customNestedParser(I):T=n.blockTokens(I))}const R=t.createToken(v,T);c.push(R)}if(c.length!==0)return{items:c,raw:d}}function Sv(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[o,...s]=e.content,l=t.renderChildren([o]);let c=`${i}${l}`;return s&&s.length>0&&s.forEach((d,h)=>{var f,g;const y=(g=(f=t.renderChild)==null?void 0:f.call(t,d,h+1))!=null?g:t.renderChildren([d]);if(y!=null){const v=y.split(`
|
|
544
|
+
`).map(w=>w?t.indent(w):t.indent("")).join(`
|
|
545
|
+
`);c+=d.type==="paragraph"?`
|
|
546
|
+
|
|
547
|
+
${v}`:`
|
|
548
|
+
${v}`}}),c}function v9(e,t,n={}){const{state:r}=t,{doc:i,tr:o}=r,s=e;i.descendants((l,c)=>{const d=o.mapping.map(c),h=o.mapping.map(c)+l.nodeSize;let f=null;if(l.marks.forEach(y=>{if(y!==s)return!1;f=y}),!f)return;let g=!1;if(Object.keys(n).forEach(y=>{n[y]!==f.attrs[y]&&(g=!0)}),g){const y=e.type.create({...e.attrs,...n});o.removeMark(d,h,e.type),o.addMark(d,h,y)}}),o.docChanged&&t.view.dispatch(o)}var gr=class FA extends wv{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new FA(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function _s(e){return new t9({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=ut(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=t,l=r[r.length-1],c=r[0];let d=n.to;if(l){const h=c.search(/\S/),f=n.from+c.indexOf(l),g=f+l.length;if(vv(n.from,n.to,t.doc).filter(w=>w.mark.type.excluded.find(C=>C===e.type&&C!==w.mark.type)).filter(w=>w.to>f).length)return null;g<n.to&&s.delete(g,n.to),f>n.from&&s.delete(n.from+h,f),d=n.from+h+l.length,s.addMark(n.from+h,d,e.type.create(o||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})}const{getOwnPropertyNames:w9,getOwnPropertySymbols:b9}=Object,{hasOwnProperty:k9}=Object.prototype;function hg(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Ed(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),l=o.get(r);if(s&&l)return s===r&&l===n;o.set(n,r),o.set(r,n);const c=e(n,r,i);return o.delete(n),o.delete(r),c}}function S9(e){return e!=null?e[Symbol.toStringTag]:void 0}function $k(e){return w9(e).concat(b9(e))}const C9=Object.hasOwn||((e,t)=>k9.call(e,t));function Ws(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const E9="__v",N9="__o",T9="_owner",{getOwnPropertyDescriptor:Bk,keys:Vk}=Object;function M9(e,t){return e.byteLength===t.byteLength&&bf(new Uint8Array(e),new Uint8Array(t))}function A9(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function j9(e,t){return e.byteLength===t.byteLength&&bf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function R9(e,t){return Ws(e.getTime(),t.getTime())}function P9(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function O9(e,t){return e===t}function Hk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,l,c=0;for(;(s=o.next())&&!s.done;){const d=t.entries();let h=!1,f=0;for(;(l=d.next())&&!l.done;){if(i[f]){f++;continue}const g=s.value,y=l.value;if(n.equals(g[0],y[0],c,f,e,t,n)&&n.equals(g[1],y[1],g[0],y[0],e,t,n)){h=i[f]=!0;break}f++}if(!h)return!1;c++}return!0}const I9=Ws;function D9(e,t,n){const r=Vk(e);let i=r.length;if(Vk(t).length!==i)return!1;for(;i-- >0;)if(!$A(e,t,n,r[i]))return!1;return!0}function Ba(e,t,n){const r=$k(e);let i=r.length;if($k(t).length!==i)return!1;let o,s,l;for(;i-- >0;)if(o=r[i],!$A(e,t,n,o)||(s=Bk(e,o),l=Bk(t,o),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function _9(e,t){return Ws(e.valueOf(),t.valueOf())}function L9(e,t){return e.source===t.source&&e.flags===t.flags}function Uk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,l;for(;(s=o.next())&&!s.done;){const c=t.values();let d=!1,h=0;for(;(l=c.next())&&!l.done;){if(!i[h]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){d=i[h]=!0;break}h++}if(!d)return!1}return!0}function bf(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function z9(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function $A(e,t,n,r){return(r===T9||r===N9||r===E9)&&(e.$$typeof||t.$$typeof)?!0:C9(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const F9="[object ArrayBuffer]",$9="[object Arguments]",B9="[object Boolean]",V9="[object DataView]",H9="[object Date]",U9="[object Error]",W9="[object Map]",q9="[object Number]",K9="[object Object]",G9="[object RegExp]",Y9="[object Set]",J9="[object String]",X9={"[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},Q9="[object URL]",Z9=Object.prototype.toString;function e7({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:f,areTypedArraysEqual:g,areUrlsEqual:y,unknownTagComparators:v}){return function(S,C,T){if(S===C)return!0;if(S==null||C==null)return!1;const N=typeof S;if(N!==typeof C)return!1;if(N!=="object")return N==="number"?l(S,C,T):N==="function"?o(S,C,T):!1;const R=S.constructor;if(R!==C.constructor)return!1;if(R===Object)return c(S,C,T);if(Array.isArray(S))return t(S,C,T);if(R===Date)return r(S,C,T);if(R===RegExp)return h(S,C,T);if(R===Map)return s(S,C,T);if(R===Set)return f(S,C,T);const I=Z9.call(S);if(I===H9)return r(S,C,T);if(I===G9)return h(S,C,T);if(I===W9)return s(S,C,T);if(I===Y9)return f(S,C,T);if(I===K9)return typeof S.then!="function"&&typeof C.then!="function"&&c(S,C,T);if(I===Q9)return y(S,C,T);if(I===U9)return i(S,C,T);if(I===$9)return c(S,C,T);if(X9[I])return g(S,C,T);if(I===F9)return e(S,C,T);if(I===V9)return n(S,C,T);if(I===B9||I===q9||I===J9)return d(S,C,T);if(v){let j=v[I];if(!j){const D=S9(S);D&&(j=v[D])}if(j)return j(S,C,T)}return!1}}function t7({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:M9,areArraysEqual:n?Ba:A9,areDataViewsEqual:j9,areDatesEqual:R9,areErrorsEqual:P9,areFunctionsEqual:O9,areMapsEqual:n?hg(Hk,Ba):Hk,areNumbersEqual:I9,areObjectsEqual:n?Ba:D9,arePrimitiveWrappersEqual:_9,areRegExpsEqual:L9,areSetsEqual:n?hg(Uk,Ba):Uk,areTypedArraysEqual:n?hg(bf,Ba):bf,areUrlsEqual:z9,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Ed(r.areArraysEqual),o=Ed(r.areMapsEqual),s=Ed(r.areObjectsEqual),l=Ed(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return r}function n7(e){return function(t,n,r,i,o,s,l){return e(t,n,l)}}function r7({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(l,c){const{cache:d=e?new WeakMap:void 0,meta:h}=n();return t(l,c,{cache:d,equals:r,meta:h,strict:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,o)}}const i7=Xo();Xo({strict:!0});Xo({circular:!0});Xo({circular:!0,strict:!0});Xo({createInternalComparator:()=>Ws});Xo({strict:!0,createInternalComparator:()=>Ws});Xo({circular:!0,createInternalComparator:()=>Ws});Xo({circular:!0,createInternalComparator:()=>Ws,strict:!0});function Xo(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=t7(e),s=e7(o),l=n?n(s):n7(s);return r7({circular:t,comparator:s,createState:r,equals:l,strict:i})}var pg={exports:{}},mg={};/**
|
|
549
|
+
* @license React
|
|
550
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
551
|
+
*
|
|
552
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
553
|
+
*
|
|
554
|
+
* This source code is licensed under the MIT license found in the
|
|
555
|
+
* LICENSE file in the root directory of this source tree.
|
|
556
|
+
*/var Wk;function o7(){if(Wk)return mg;Wk=1;var e=Lc(),t=fT();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return mg.useSyncExternalStoreWithSelector=function(d,h,f,g,y){var v=o(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function C(j){if(!T){if(T=!0,N=j,j=g(j),y!==void 0&&w.hasValue){var D=w.value;if(y(D,j))return R=D}return R=j}if(D=R,r(N,j))return D;var O=g(j);return y!==void 0&&y(D,O)?(N=j,D):(N=j,R=O)}var T=!1,N,R,I=f===void 0?null:f;return[function(){return C(h())},I===null?void 0:function(){return C(I())}]},[h,f,g,y]);var S=i(d,v[0],v[1]);return s(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},mg}var qk;function s7(){return qk||(qk=1,pg.exports=o7()),pg.exports}var l7=s7(),a7=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},c7=({contentComponent:e})=>{const t=_x.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return p.jsx(p.Fragment,{children:Object.values(t)})};function u7(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:nx.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var d7=class extends ce.Component{constructor(e){super(e),this.editorContentRef=ce.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=u7(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return p.jsxs(p.Fragment,{children:[p.jsx("div",{ref:a7(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&p.jsx(c7,{contentComponent:e.contentComponent})]})}},f7=b.forwardRef((e,t)=>{const n=ce.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return ce.createElement(d7,{key:n,innerRef:t,...e})}),BA=ce.memo(f7),h7=typeof window<"u"?b.useLayoutEffect:b.useEffect,p7=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function m7(e){var t;const[n]=b.useState(()=>new p7(e.editor)),r=l7.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:i7);return h7(()=>n.watch(e.editor),[e.editor,n]),b.useDebugValue(r),r}var VA=typeof window>"u",g7=VA||!!(typeof window<"u"&&window.next),y7=class HA{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){var t;let n=(t=this.options.current.immediatelyRender)!=null?t:!0;return n&&(VA||g7)&&(n=!1),n?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)==null?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)==null?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)==null?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)==null?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)==null?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)==null?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)==null?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)==null?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)==null?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)==null?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)==null?void 0:o.call(i,...r)},onDelete:(...r)=>{var i,o;return(o=(i=this.options.current).onDelete)==null?void 0:o.call(i,...r)}};return new u9(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,o)=>{var s;return i===((s=n.extensions)==null?void 0:s[o])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?HA.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function x7(e={},t=[]){const n=b.useRef(e);n.current=e;const[r]=b.useState(()=>new y7(n)),i=_x.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return b.useDebugValue(i),b.useEffect(r.onRender(t)),m7({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&o===0?0:o+1}),i}var UA=b.createContext({editor:null});UA.Consumer;var v7=b.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),w7=()=>b.useContext(v7);ce.forwardRef((e,t)=>{const{onDragStart:n}=w7(),r=e.as||"div";return p.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});ce.createContext({markViewContentRef:()=>{}});var Cv=b.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Cv.displayName="TiptapContext";var b7=()=>b.useContext(Cv);function WA({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=b.useMemo(()=>({editor:r}),[r]),o=b.useMemo(()=>({editor:r}),[r]);return p.jsx(UA.Provider,{value:o,children:p.jsx(Cv.Provider,{value:i,children:n})})}WA.displayName="Tiptap";function qA({...e}){const{editor:t}=b7();return p.jsx(BA,{editor:t,...e})}qA.displayName="Tiptap.Content";Object.assign(WA,{Content:qA});var kf=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},k7=/^\s*>\s$/,S7=gr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return kf("blockquote",{...Gt(this.options.HTMLAttributes,e),children:kf("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach((i,o)=>{var s,l;const h=((l=(s=t.renderChild)==null?void 0:s.call(t,i,o))!=null?l:t.renderChildren([i])).split(`
|
|
557
|
+
`).map(f=>f.trim()===""?n:`${n} ${f}`);r.push(h.join(`
|
|
558
|
+
`))}),r.join(`
|
|
559
|
+
${n}
|
|
560
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ql({find:k7,type:this.type})]}}),C7=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,E7=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,N7=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,T7=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,M7=Us.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return kf("strong",{...Gt(this.options.HTMLAttributes,e),children:kf("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Wl({find:C7,type:this.type}),Wl({find:N7,type:this.type})]},addPasteRules(){return[_s({find:E7,type:this.type}),_s({find:T7,type:this.type})]}}),A7=/(^|[^`])`([^`]+)`(?!`)$/,j7=/(^|[^`])`([^`]+)`(?!`)/g,R7=Us.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Gt(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Wl({find:A7,type:this.type})]},addPasteRules(){return[_s({find:j7,type:this.type})]}}),gg=4,P7=/^```([a-z]+)?[\s\n]$/,O7=/^~~~([a-z]+)?[\s\n]$/,I7=gr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:gg,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const o=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Gt(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&((r=e.raw)==null?void 0:r.startsWith("~~~"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
|
|
561
|
+
`):r=`\`\`\`${i}
|
|
562
|
+
|
|
563
|
+
\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:gg,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;const l=" ".repeat(n);return s?e.commands.insertContent(l):e.commands.command(({tr:c})=>{const{from:d,to:h}=i,y=r.doc.textBetween(d,h,`
|
|
564
|
+
`,`
|
|
565
|
+
`).split(`
|
|
566
|
+
`).map(v=>l+v).join(`
|
|
567
|
+
`);return c.replaceWith(d,h,r.schema.text(y)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:gg,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type!==this.type?!1:s?e.commands.command(({tr:l})=>{var c;const{pos:d}=o,h=o.start(),f=o.end(),y=r.doc.textBetween(h,f,`
|
|
568
|
+
`,`
|
|
569
|
+
`).split(`
|
|
570
|
+
`);let v=0,w=0;const S=d-h;for(let j=0;j<y.length;j+=1){if(w+y[j].length>=S){v=j;break}w+=y[j].length+1}const T=((c=y[v].match(/^ */))==null?void 0:c[0])||"",N=Math.min(T.length,n);if(N===0)return!0;let R=h;for(let j=0;j<v;j+=1)R+=y[j].length+1;return l.delete(R,R+N),d-R<=N&&l.setSelection(Be.create(l.doc,R)),!0}):e.commands.command(({tr:l})=>{const{from:c,to:d}=i,g=r.doc.textBetween(c,d,`
|
|
571
|
+
`,`
|
|
572
|
+
`).split(`
|
|
573
|
+
`).map(y=>{var v;const w=((v=y.match(/^ */))==null?void 0:v[0])||"",S=Math.min(w.length,n);return y.slice(S)}).join(`
|
|
574
|
+
`);return l.replaceWith(c,d,r.schema.text(g)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
575
|
+
|
|
576
|
+
`);return!o||!s?!1:e.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?e.commands.command(({tr:d})=>(d.setSelection(Ye.near(r.resolve(l))),!0)):e.commands.exitCode()}}},addInputRules(){return[Ry({find:P7,type:this.type,getAttributes:e=>({language:e[1]})}),Ry({find:O7,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new xt({key:new Pt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:l}=e.state,c=l.text(n.replace(/\r\n?/g,`
|
|
577
|
+
`));return s.replaceSelectionWith(this.type.create({language:o},c)),s.selection.$from.parent.type!==this.type&&s.setSelection(Be.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),D7=gr.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
578
|
+
|
|
579
|
+
`):""}),_7=gr.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Gt(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
580
|
+
`},renderMarkdown:()=>`
|
|
581
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&c&&s){const f=c.filter(g=>l.includes(g.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),L7=gr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Gt(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Ry({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),z7=gr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Gt(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!f9(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return kA(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:l})=>{if(l){const{$to:c}=s.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(Be.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(Ie.create(s.doc,c.pos)):s.setSelection(Be.create(s.doc,c.pos));else{const h=o.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,f=h==null?void 0:h.create();f&&(s.insert(d,f),s.setSelection(Be.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[d9({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),F7=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,$7=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,B7=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,V7=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,H7=Us.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Gt(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wl({find:F7,type:this.type}),Wl({find:B7,type:this.type})]},addPasteRules(){return[_s({find:$7,type:this.type}),_s({find:V7,type:this.type})]}});const U7="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",W7="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Oy="numeric",Iy="ascii",Dy="alpha",cc="asciinumeric",tc="alphanumeric",_y="domain",KA="emoji",q7="scheme",K7="slashscheme",yg="whitespace";function G7(e,t){return e in t||(t[e]=[]),t[e]}function bs(e,t,n){t[Oy]&&(t[cc]=!0,t[tc]=!0),t[Iy]&&(t[cc]=!0,t[Dy]=!0),t[cc]&&(t[tc]=!0),t[Dy]&&(t[tc]=!0),t[tc]&&(t[_y]=!0),t[KA]&&(t[_y]=!0);for(const r in t){const i=G7(r,n);i.indexOf(e)<0&&i.push(e)}}function Y7(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function er(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}er.groups={};er.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],o=t.jr[r][1];if(o&&i.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||er.groups;let i;return t&&t.j?i=t:(i=new er(t),n&&r&&bs(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const o=e.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(e[s]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){r=r||er.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const o=t;let s,l=i.go(e);if(l?(s=new er,Object.assign(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new er,o){if(r)if(s.t&&typeof s.t=="string"){const c=Object.assign(Y7(s.t,r),n);bs(o,c,r)}else n&&bs(o,n,r);s.t=o}return i.j[e]=s,s}};const Je=(e,t,n,r,i)=>e.ta(t,n,r,i),jt=(e,t,n,r,i)=>e.tr(t,n,r,i),Kk=(e,t,n,r,i)=>e.ts(t,n,r,i),he=(e,t,n,r,i)=>e.tt(t,n,r,i),_i="WORD",Ly="UWORD",GA="ASCIINUMERICAL",YA="ALPHANUMERICAL",Pc="LOCALHOST",zy="TLD",Fy="UTLD",Hd="SCHEME",El="SLASH_SCHEME",Ev="NUM",$y="WS",Nv="NL",uc="OPENBRACE",dc="CLOSEBRACE",Sf="OPENBRACKET",Cf="CLOSEBRACKET",Ef="OPENPAREN",Nf="CLOSEPAREN",Tf="OPENANGLEBRACKET",Mf="CLOSEANGLEBRACKET",Af="FULLWIDTHLEFTPAREN",jf="FULLWIDTHRIGHTPAREN",Rf="LEFTCORNERBRACKET",Pf="RIGHTCORNERBRACKET",Of="LEFTWHITECORNERBRACKET",If="RIGHTWHITECORNERBRACKET",Df="FULLWIDTHLESSTHAN",_f="FULLWIDTHGREATERTHAN",Lf="AMPERSAND",zf="APOSTROPHE",Ff="ASTERISK",To="AT",$f="BACKSLASH",Bf="BACKTICK",Vf="CARET",ks="COLON",Tv="COMMA",Hf="DOLLAR",ui="DOT",Uf="EQUALS",Mv="EXCLAMATION",Mr="HYPHEN",fc="PERCENT",Wf="PIPE",qf="PLUS",Kf="POUND",hc="QUERY",Av="QUOTE",JA="FULLWIDTHMIDDLEDOT",jv="SEMI",di="SLASH",pc="TILDE",Gf="UNDERSCORE",XA="EMOJI",Yf="SYM";var QA=Object.freeze({__proto__:null,ALPHANUMERICAL:YA,AMPERSAND:Lf,APOSTROPHE:zf,ASCIINUMERICAL:GA,ASTERISK:Ff,AT:To,BACKSLASH:$f,BACKTICK:Bf,CARET:Vf,CLOSEANGLEBRACKET:Mf,CLOSEBRACE:dc,CLOSEBRACKET:Cf,CLOSEPAREN:Nf,COLON:ks,COMMA:Tv,DOLLAR:Hf,DOT:ui,EMOJI:XA,EQUALS:Uf,EXCLAMATION:Mv,FULLWIDTHGREATERTHAN:_f,FULLWIDTHLEFTPAREN:Af,FULLWIDTHLESSTHAN:Df,FULLWIDTHMIDDLEDOT:JA,FULLWIDTHRIGHTPAREN:jf,HYPHEN:Mr,LEFTCORNERBRACKET:Rf,LEFTWHITECORNERBRACKET:Of,LOCALHOST:Pc,NL:Nv,NUM:Ev,OPENANGLEBRACKET:Tf,OPENBRACE:uc,OPENBRACKET:Sf,OPENPAREN:Ef,PERCENT:fc,PIPE:Wf,PLUS:qf,POUND:Kf,QUERY:hc,QUOTE:Av,RIGHTCORNERBRACKET:Pf,RIGHTWHITECORNERBRACKET:If,SCHEME:Hd,SEMI:jv,SLASH:di,SLASH_SCHEME:El,SYM:Yf,TILDE:pc,TLD:zy,UNDERSCORE:Gf,UTLD:Fy,UWORD:Ly,WORD:_i,WS:$y});const Oi=/[a-z]/,Va=new RegExp("\\p{L}","u"),xg=new RegExp("\\p{Emoji}","u"),Ii=/\d/,vg=/\s/,Gk="\r",wg=`
|
|
582
|
+
`,J7="️",X7="",bg="";let Nd=null,Td=null;function Q7(e=[]){const t={};er.groups=t;const n=new er;Nd==null&&(Nd=Yk(U7)),Td==null&&(Td=Yk(W7)),he(n,"'",zf),he(n,"{",uc),he(n,"}",dc),he(n,"[",Sf),he(n,"]",Cf),he(n,"(",Ef),he(n,")",Nf),he(n,"<",Tf),he(n,">",Mf),he(n,"(",Af),he(n,")",jf),he(n,"「",Rf),he(n,"」",Pf),he(n,"『",Of),he(n,"』",If),he(n,"<",Df),he(n,">",_f),he(n,"&",Lf),he(n,"*",Ff),he(n,"@",To),he(n,"`",Bf),he(n,"^",Vf),he(n,":",ks),he(n,",",Tv),he(n,"$",Hf),he(n,".",ui),he(n,"=",Uf),he(n,"!",Mv),he(n,"-",Mr),he(n,"%",fc),he(n,"|",Wf),he(n,"+",qf),he(n,"#",Kf),he(n,"?",hc),he(n,'"',Av),he(n,"/",di),he(n,";",jv),he(n,"~",pc),he(n,"_",Gf),he(n,"\\",$f),he(n,"・",JA);const r=jt(n,Ii,Ev,{[Oy]:!0});jt(r,Ii,r);const i=jt(r,Oi,GA,{[cc]:!0}),o=jt(r,Va,YA,{[tc]:!0}),s=jt(n,Oi,_i,{[Iy]:!0});jt(s,Ii,i),jt(s,Oi,s),jt(i,Ii,i),jt(i,Oi,i);const l=jt(n,Va,Ly,{[Dy]:!0});jt(l,Oi),jt(l,Ii,o),jt(l,Va,l),jt(o,Ii,o),jt(o,Oi),jt(o,Va,o);const c=he(n,wg,Nv,{[yg]:!0}),d=he(n,Gk,$y,{[yg]:!0}),h=jt(n,vg,$y,{[yg]:!0});he(n,bg,h),he(d,wg,c),he(d,bg,h),jt(d,vg,h),he(h,Gk),he(h,wg),jt(h,vg,h),he(h,bg,h);const f=jt(n,xg,XA,{[KA]:!0});he(f,"#"),jt(f,xg,f),he(f,J7,f);const g=he(f,X7);he(g,"#"),jt(g,xg,f);const y=[[Oi,s],[Ii,i]],v=[[Oi,null],[Va,l],[Ii,o]];for(let w=0;w<Nd.length;w++)ko(n,Nd[w],zy,_i,y);for(let w=0;w<Td.length;w++)ko(n,Td[w],Fy,Ly,v);bs(zy,{tld:!0,ascii:!0},t),bs(Fy,{utld:!0,alpha:!0},t),ko(n,"file",Hd,_i,y),ko(n,"mailto",Hd,_i,y),ko(n,"http",El,_i,y),ko(n,"https",El,_i,y),ko(n,"ftp",El,_i,y),ko(n,"ftps",El,_i,y),bs(Hd,{scheme:!0,ascii:!0},t),bs(El,{slashscheme:!0,ascii:!0},t),e=e.sort((w,S)=>w[0]>S[0]?1:-1);for(let w=0;w<e.length;w++){const S=e[w][0],T=e[w][1]?{[q7]:!0}:{[K7]:!0};S.indexOf("-")>=0?T[_y]=!0:Oi.test(S)?Ii.test(S)?T[cc]=!0:T[Iy]=!0:T[Oy]=!0,Kk(n,S,S,T)}return Kk(n,"localhost",Pc,{ascii:!0}),n.jd=new er(Yf),{start:n,tokens:Object.assign({groups:t},QA)}}function ZA(e,t){const n=Z7(t.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let l=e,c=null,d=0,h=null,f=-1,g=-1;for(;s<r&&(c=l.go(n[s]));)l=c,l.accepts()?(f=0,g=0,h=l):f>=0&&(f+=n[s].length,g++),d+=n[s].length,o+=n[s].length,s++;o-=f,s-=g,d-=f,i.push({t:h.t,v:t.slice(o-d,o),s:o-d,e:o})}return i}function Z7(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function ko(e,t,n,r,i){let o;const s=t.length;for(let l=0;l<s-1;l++){const c=t[l];e.j[c]?o=e.j[c]:(o=new er(r),o.jr=i.slice(),e.j[c]=o),e=o}return o=new er(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function Yk(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Oc={defaultProtocol:"http",events:null,format:Jk,formatHref:Jk,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Rv(e,t=null){let n=Object.assign({},Oc);e&&(n=Object.assign(n,e instanceof Rv?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}Rv.prototype={o:Oc,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Oc[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function Jk(e){return e}function ej(e,t){this.t="token",this.v=e,this.tk=t}ej.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Oc.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},l=e.get("className",n,t),c=e.get("target",n,t),d=e.get("rel",n,t),h=e.getObj("attributes",n,t),f=e.getObj("events",n,t);return s.href=r,l&&(s.class=l),c&&(s.target=c),d&&(s.rel=d),h&&Object.assign(s,h),{tagName:i,attributes:s,content:o,eventListeners:f}}};function Fh(e,t){class n extends ej{constructor(i,o){super(i,o),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const eU=Fh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Xk=Fh("text"),tU=Fh("nl"),Md=Fh("url",{isLink:!0,toHref(e=Oc.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Pc&&e[1].t===ks}}),Tr=e=>new er(e);function nU({groups:e}){const t=e.domain.concat([Lf,Ff,To,$f,Bf,Vf,Hf,Uf,Mr,Ev,fc,Wf,qf,Kf,di,Yf,pc,Gf]),n=[zf,ks,Tv,ui,Mv,fc,hc,Av,jv,Tf,Mf,uc,dc,Cf,Sf,Ef,Nf,Af,jf,Rf,Pf,Of,If,Df,_f],r=[Lf,zf,Ff,$f,Bf,Vf,Hf,Uf,Mr,uc,dc,fc,Wf,qf,Kf,hc,di,Yf,pc,Gf],i=Tr(),o=he(i,pc);Je(o,r,o),Je(o,e.domain,o);const s=Tr(),l=Tr(),c=Tr();Je(i,e.domain,s),Je(i,e.scheme,l),Je(i,e.slashscheme,c),Je(s,r,o),Je(s,e.domain,s);const d=he(s,To);he(o,To,d),he(l,To,d),he(c,To,d);const h=he(o,ui);Je(h,r,o),Je(h,e.domain,o);const f=Tr();Je(d,e.domain,f),Je(f,e.domain,f);const g=he(f,ui);Je(g,e.domain,f);const y=Tr(eU);Je(g,e.tld,y),Je(g,e.utld,y),he(d,Pc,y);const v=he(f,Mr);he(v,Mr,v),Je(v,e.domain,f),Je(y,e.domain,f),he(y,ui,g),he(y,Mr,v);const w=he(s,Mr),S=he(s,ui);he(w,Mr,w),Je(w,e.domain,s),Je(S,r,o),Je(S,e.domain,s);const C=Tr(Md);Je(S,e.tld,C),Je(S,e.utld,C),Je(C,e.domain,s),Je(C,r,o),he(C,ui,S),he(C,Mr,w),he(C,To,d);const T=he(C,ks),N=Tr(Md);Je(T,e.numeric,N);const R=Tr(Md),I=Tr();Je(R,t,R),Je(R,n,I),Je(I,t,R),Je(I,n,I),he(C,di,R),he(N,di,R);const j=he(l,ks),D=he(c,ks),O=he(D,di),B=he(O,di);Je(l,e.domain,s),he(l,ui,S),he(l,Mr,w),Je(c,e.domain,s),he(c,ui,S),he(c,Mr,w),Je(j,e.domain,R),he(j,di,R),he(j,hc,R),Je(B,e.domain,R),Je(B,t,R),he(B,di,R);const _=[[uc,dc],[Sf,Cf],[Ef,Nf],[Tf,Mf],[Af,jf],[Rf,Pf],[Of,If],[Df,_f]];for(let V=0;V<_.length;V++){const[U,Z]=_[V],K=he(R,U);he(I,U,K);const W=Tr(Md);Je(K,t,W);const X=Tr();Je(K,n,X),he(K,Z,R),Je(W,t,W),Je(W,n,X),Je(X,t,W),Je(X,n,X),he(W,Z,R),he(X,Z,R)}return he(i,Pc,C),he(i,Nv,tU),{start:i,tokens:QA}}function rU(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=e,c=null,d=null,h=0,f=null,g=-1;for(;i<r&&!(c=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(d=c||l.go(n[i].t));)c=null,l=d,l.accepts()?(g=0,f=l):g>=0&&g++,i++,h++;if(g<0)i-=h,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(kg(Xk,t,s)),s=[]),i-=g,h-=g;const y=f.t,v=n.slice(i-h,i);o.push(kg(y,t,v))}}return s.length>0&&o.push(kg(Xk,t,s)),o}function kg(e,t,n){const r=n[0].s,i=n[n.length-1].e,o=t.slice(r,i);return new e(o,n)}const iU=typeof console<"u"&&console&&console.warn||(()=>{}),oU="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",bt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function sU(){return er.groups={},bt.scanner=null,bt.parser=null,bt.tokenQueue=[],bt.pluginQueue=[],bt.customSchemes=[],bt.initialized=!1,bt}function Qk(e,t=!1){if(bt.initialized&&iU(`linkifyjs: already initialized - will not register custom scheme "${e}" ${oU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|
|
583
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
584
|
+
2. Cannot start or end with "-"
|
|
585
|
+
3. "-" cannot repeat`);bt.customSchemes.push([e,t])}function lU(){bt.scanner=Q7(bt.customSchemes);for(let e=0;e<bt.tokenQueue.length;e++)bt.tokenQueue[e][1]({scanner:bt.scanner});bt.parser=nU(bt.scanner.tokens);for(let e=0;e<bt.pluginQueue.length;e++)bt.pluginQueue[e][1]({scanner:bt.scanner,parser:bt.parser});return bt.initialized=!0,bt}function Pv(e){return bt.initialized||lU(),rU(bt.parser.start,e,ZA(bt.scanner.start,e))}Pv.scan=ZA;function tj(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Rv(n),i=Pv(e),o=[];for(let s=0;s<i.length;s++){const l=i[s];l.isLink&&(!t||l.t===t)&&r.check(l)&&o.push(l.toFormattedObject(r))}return o}var Ov="[\0- -\u2029 ]",aU=new RegExp(Ov),cU=new RegExp(`${Ov}$`),uU=new RegExp(Ov,"g");function dU(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function fU(e){return new xt({key:new Pt("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=t.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=pA(n.doc,[...t]);if(bA(l).forEach(({newRange:d})=>{const h=u8(r.doc,d,y=>y.isTextblock);let f,g;if(h.length>1)f=h[0],g=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(h.length){const y=r.doc.textBetween(d.from,d.to," "," ");if(!cU.test(y))return;f=h[0],g=r.doc.textBetween(f.pos,d.to,void 0," ")}if(f&&g){const y=g.split(aU).filter(Boolean);if(y.length<=0)return!1;const v=y[y.length-1],w=f.pos+g.lastIndexOf(v);if(!v)return!1;const S=Pv(v).map(C=>C.toObject(e.defaultProtocol));if(!dU(S))return!1;S.filter(C=>C.isLink).map(C=>({...C,from:w+C.start+1,to:w+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>e.validate(C.value)).filter(C=>e.shouldAutoLink(C.value)).forEach(C=>{vv(C.from,C.to,r.doc).some(T=>T.mark.type===e.type)||s.addMark(C.from,C.to,e.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function hU(e){return new xt({key:new Pt("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const c=r.target;if(!c)return!1;const d=e.editor.view.dom;s=c.closest("a"),s&&!d.contains(s)&&(s=null)}if(!s)return!1;let l=!1;if(e.enableClickSelection&&(l=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const c=wA(t.state,e.type.name),d=(i=s.href)!=null?i:c.href,h=(o=s.target)!=null?o:c.target;d&&(window.open(d,h),l=!0)}return l}}})}function pU(e){return new xt({key:new Pt("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:o}=t,{selection:s}=o,{empty:l}=s;if(l)return!1;let c="";r.content.forEach(h=>{c+=h.textContent});const d=tj(c,{defaultProtocol:e.defaultProtocol}).find(h=>h.isLink&&h.value===c);return!c||!d||i!==void 0&&!i(d.value)?!1:e.editor.commands.setMark(e.type,{href:d.href})}}})}function ms(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(uU,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var nj=Us.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){Qk(e);return}Qk(e.scheme,e.optionalSlashes)})},onDestroy(){sU()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!ms(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const i=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!ms(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!ms(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Gt(this.options.HTMLAttributes,e),0]:["a",Gt(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;const s=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",l=(o=(i=e.attrs)==null?void 0:i.title)!=null?o:"",c=t.renderChildren(e);return l?`[${c}](${s} "${l}")`:`[${c}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ms(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ms(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[_s({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=tj(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!ms(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>{this.options.shouldAutoLink(o.value)&&t.push({text:o.value,data:{href:o.href},index:o.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(fU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!ms(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(hU({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(pU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),mU=nj,gU=Object.defineProperty,yU=(e,t)=>{for(var n in t)gU(e,n,{get:t[n],enumerable:!0})},xU="listItem",Zk="textStyle",eS=/^\s*([-+*])\s$/,rj=gr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Gt(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
586
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(xU,this.editor.getAttributes(Zk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ql({find:eS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ql({find:eS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Zk),editor:this.editor})),[e]}});function vU(e){var t,n;const r=(t=e.tokens)==null?void 0:t[0];return!!(e.text&&((n=e.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===e.text)}function wU(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var ij=gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Gt(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;let i=[];if(e.tokens&&e.tokens.length>0){if(vU(e))return{type:"listItem",content:[{type:"paragraph",content:wU(e.text||"",t)}]};if(e.tokens.some(s=>s.type==="paragraph"))i=r(e.tokens);else{const s=e.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:t.parseInline(s.tokens)}],e.tokens.length>1){const c=e.tokens.slice(1),d=r(c);i.push(...d)}}else i=r(e.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(e,t,n)=>Sv(e,t,r=>{var i,o;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((o=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:o.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bU={};yU(bU,{findListItemPos:()=>Qc,getNextListDepth:()=>Iv,handleBackspace:()=>By,handleDelete:()=>Vy,hasListBefore:()=>oj,hasListItemAfter:()=>kU,hasListItemBefore:()=>sj,listItemHasSubList:()=>lj,nextListIsDeeper:()=>aj,nextListIsHigher:()=>cj});var Qc=(e,t)=>{const{$from:n}=t.selection,r=Kt(e,t.schema);let i=null,o=n.depth,s=n.pos,l=null;for(;o>0&&l===null;)i=n.node(o),i.type===r?l=o:(o-=1,s-=1);return l===null?null:{$pos:t.doc.resolve(s),depth:l}},Iv=(e,t)=>{const n=Qc(e,t);if(!n)return!1;const[,r]=b8(t,e,n.$pos.pos+4);return r},oj=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},sj=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==e)},lj=(e,t,n)=>{if(!n)return!1;const r=Kt(e,t.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},By=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Wo(e.state,t)&&oj(e.state,t,n)){const{$anchor:l}=e.state.selection,c=e.state.doc.resolve(l.before()-1),d=[];c.node().descendants((g,y)=>{g.type.name===t&&d.push({node:g,pos:y})});const h=d.at(-1);if(!h)return!1;const f=e.state.doc.resolve(c.start()+h.pos+1);return e.chain().cut({from:l.start()-1,to:l.end()+1},f.end()).joinForward().run()}if(!Wo(e.state,t)||!E8(e.state))return!1;const r=Qc(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=lj(t,e.state,o);return sj(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},aj=(e,t)=>{const n=Iv(e,t),r=Qc(e,t);return!r||!n?!1:n>r.depth},cj=(e,t)=>{const n=Iv(e,t),r=Qc(e,t);return!r||!n?!1:n<r.depth},Vy=(e,t)=>{if(!Wo(e.state,t)||!C8(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:aj(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():cj(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},kU=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==e)},uj=Et.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Vy(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Vy(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&By(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&By(e,n,r)&&(t=!0)}),t}}}}),tS=/^(\s*)(\d+)\.\s+(.*)$/,SU=/^\s/;function CU(e){const t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function EU(e){const t=[],n=[];let r=!1;return e.forEach(i=>{if(r){n.push(i);return}if(i.trim()===""){r=!0,n.push(i);return}if(t.length>0&&CU(i)){r=!0,n.push(i);return}t.push(i)}),{paragraphLines:t,blockLines:n}}function NU(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],o=i.match(tS);if(!o)break;const[,s,l,c]=o,d=s.length,h=[c];let f=n+1;const g=[i];let y=!1;for(;f<e.length;){const v=e[f];if(v.match(tS))break;if(v.trim()==="")g.push(v),h.push(""),y=!0,f+=1;else if(v.match(SU))g.push(v),h.push(v.slice(d+2)),f+=1;else{if(y)break;g.push(v),h.push(v),f+=1}}t.push({indent:d,number:parseInt(l,10),content:h.join(`
|
|
587
|
+
`).trim(),contentLines:h,raw:g.join(`
|
|
588
|
+
`)}),r=f,n=f}return[t,r]}function dj(e,t,n){const r=[];let i=0;for(;i<e.length;){const o=e[i];if(o.indent===t){const{paragraphLines:s,blockLines:l}=EU(o.contentLines),c=s.join(`
|
|
589
|
+
`).trim(),d=[];c&&d.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const h=l.join(`
|
|
590
|
+
`).trim();if(h){const y=n.blockTokens(h);d.push(...y)}let f=i+1;const g=[];for(;f<e.length&&e[f].indent>t;)g.push(e[f]),f+=1;if(g.length>0){const y=Math.min(...g.map(w=>w.indent)),v=dj(g,y,n);d.push({type:"list",ordered:!0,start:g[0].number,items:v,raw:g.map(w=>w.raw).join(`
|
|
591
|
+
`)})}r.push({type:"list_item",raw:o.raw,tokens:d}),i=f}else i+=1}return r}function TU(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=t.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=t.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}var MU="listItem",nS="textStyle",rS=/^(\d+)\.\s$/,fj=gr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Gt(this.options.HTMLAttributes,n),0]:["ol",Gt(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?TU(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
592
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
|
|
593
|
+
`),[o,s]=NU(i);if(o.length===0)return;const l=dj(o,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:l,raw:i.slice(0,s).join(`
|
|
594
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(MU,this.editor.getAttributes(nS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ql({find:rS,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ql({find:rS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(nS)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),AU=/^\s*(\[([( |x])?\])\s$/,hj=gr.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Gt(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return Sv(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=f=>{var g,y;l.ariaLabel=((y=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:y.call(g,f,l.checked))||`Task item checkbox for ${f.textContent||"empty task item"}`};d(e),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",f=>f.preventDefault()),l.addEventListener("change",f=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:g}=f.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:y})=>{const v=n();if(typeof v!="number")return!1;const w=y.doc.nodeAt(v);return y.setNodeMarkup(v,void 0,{...w==null?void 0:w.attrs,checked:g}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,g)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,g])=>{i.setAttribute(f,g)}),i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,o.append(l,s),i.append(o,c),Object.entries(t).forEach(([f,g])=>{i.setAttribute(f,g)});let h=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:f=>{if(f.type!==this.type)return!1;i.dataset.checked=f.attrs.checked,l.checked=f.attrs.checked,d(f);const g=r.extensionManager.attributes,y=Rc(f,g),v=new Set(Object.keys(y)),w=this.options.HTMLAttributes;return h.forEach(S=>{v.has(S)||(S in w?i.setAttribute(S,w[S]):i.removeAttribute(S))}),Object.entries(y).forEach(([S,C])=>{C==null?S in w?i.setAttribute(S,w[S]):i.removeAttribute(S):i.setAttribute(S,C)}),h=v,!0}}}},addInputRules(){return[ql({find:AU,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),pj=gr.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Gt(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
595
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=o=>{const s=Py(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(o)},i=Py(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Et.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(rj.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(ij.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(uj.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(fj.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(hj.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(pj.configure(this.options.taskList)),e}});var Ad=" ",Sg=" ",jU=gr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Gt(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Ad||n[0].text===Ad||n[0].raw===Sg||n[0].text===Sg)&&r.length===1&&r[0].type==="text"&&(r[0].text===Ad||r[0].text===Sg)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,i;if(!e)return"";const o=Array.isArray(e.content)?e.content:[];if(o.length===0){const s=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((i=n==null?void 0:n.previousNode)==null?void 0:i.type)==="paragraph"&&s.length===0?Ad:""}return t.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),RU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,PU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,OU=Us.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Gt(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wl({find:RU,type:this.type})]},addPasteRules(){return[_s({find:PU,type:this.type})]}}),IU=gr.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),DU=Us.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Gt(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function _U(e={}){return new xt({view(t){return new LU(t,e)}})}class LU{constructor(t,n){var r;this.editorView=t,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(i=>{let o=s=>{this[i](s)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,l=o.height/i.offsetHeight;if(n){let f=t.nodeBefore,g=t.nodeAfter;if(f||g){let y=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(y){let v=y.getBoundingClientRect(),w=f?v.bottom:v.top;f&&g&&(w=(w+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let S=this.width/2*l;r={left:v.left,right:v.right,top:w-S,bottom:w+S}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*s;r={left:f.left-g,right:f.left+g,top:f.top,bottom:f.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.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 d,h;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,h=-pageYOffset;else{let f=c.getBoundingClientRect(),g=f.width/c.offsetWidth,y=f.height/c.offsetHeight;d=f.left-c.scrollLeft*g,h=f.top-c.scrollTop*y}this.element.style.left=(r.left-d)/s+"px",this.element.style.top=(r.top-h)/l+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=oM(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Rt extends Ye{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Rt.valid(r)?new Rt(r):Ye.near(r)}content(){return ke.empty}eq(t){return t instanceof Rt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Rt(t.resolve(n.pos))}getBookmark(){return new Dv(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!zU(t)||!FU(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Rt.valid(t))return t;let i=t.pos,o=null;for(let s=t.depth;;s--){let l=t.node(s);if(n>0?t.indexAfter(s)<l.childCount:t.index(s)>0){o=l.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;i+=n;let c=t.doc.resolve(i);if(Rt.valid(c))return c}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!Ie.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=t.doc.resolve(i);if(Rt.valid(l))return l}return null}}}Rt.prototype.visible=!1;Rt.findFrom=Rt.findGapCursorFrom;Ye.jsonID("gapcursor",Rt);class Dv{constructor(t){this.pos=t}map(t){return new Dv(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Rt.valid(n)?new Rt(n):Ye.near(n)}}function mj(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function zU(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||mj(i.type))return!0;if(i.inlineContent)return!1}}return!0}function FU(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||mj(i.type))return!0;if(i.inlineContent)return!1}}return!0}function $U(){return new xt({props:{decorations:UU,createSelectionBetween(e,t,n){return t.pos==n.pos&&Rt.valid(n)?new Rt(n):null},handleClick:VU,handleKeyDown:BU,handleDOMEvents:{beforeinput:HU}}})}const BU=sA({ArrowLeft:jd("horiz",-1),ArrowRight:jd("horiz",1),ArrowUp:jd("vert",-1),ArrowDown:jd("vert",1)});function jd(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let s=r.selection,l=t>0?s.$to:s.$from,c=s.empty;if(s instanceof Be){if(!o.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=r.doc.resolve(t>0?l.after():l.before())}let d=Rt.findGapCursorFrom(l,t,c);return d?(i&&i(r.tr.setSelection(new Rt(d))),!0):!1}}function VU(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Rt.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ie.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Rt(r))),!0)}function HU(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Rt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=ae.empty;for(let s=r.length-1;s>=0;s--)i=ae.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new ke(i,0,0));return o.setSelection(Be.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function UU(e){if(!(e.selection instanceof Rt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",yt.create(e.doc,[Wt.widget(e.selection.head,t,{key:"gapcursor"})])}var Jf=200,un=function(){};un.prototype.append=function(t){return t.length?(t=un.from(t),!this.length&&t||t.length<Jf&&this.leafAppend(t)||this.length<Jf&&t.leafPrepend(this)||this.appendInner(t)):this};un.prototype.prepend=function(t){return t.length?un.from(t).append(this):this};un.prototype.appendInner=function(t){return new WU(this,t)};un.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?un.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};un.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};un.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};un.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};un.from=function(t){return t instanceof un?t:t&&t.length?new gj(t):un.empty};var gj=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,l){for(var c=o;c<s;c++)if(i(this.values[c],l+c)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,l){for(var c=o-1;c>=s;c--)if(i(this.values[c],l+c)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=Jf)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=Jf)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(un);un.empty=new gj([]);var WU=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(un);const qU=500;class Jr{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,l,c,d=[],h=[];return this.items.forEach((f,g)=>{if(!f.step){i||(i=this.remapping(r,g+1),o=i.maps.length),o--,h.push(f);return}if(i){h.push(new fi(f.map));let y=f.step.map(i.slice(o)),v;y&&s.maybeStep(y).doc&&(v=s.mapping.maps[s.mapping.maps.length-1],d.push(new fi(v,void 0,void 0,d.length+h.length))),o--,v&&i.appendMap(v,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,c=new Jr(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(t,n,r,i){let o=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let h=0;h<t.steps.length;h++){let f=t.steps[h].invert(t.docs[h]),g=new fi(t.mapping.maps[h],f,n),y;(y=c&&c.merge(g))&&(g=y,h?o.pop():l=l.slice(0,l.length-1)),o.push(g),n&&(s++,n=void 0),i||(c=g)}let d=s-r.depth;return d>GU&&(l=KU(l,d),s-=d),new Jr(l.append(o),s)}remapping(t,n){let r=new Ec;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new Jr(this.items.append(t.map(n=>new fi(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,l=this.eventCount;this.items.forEach(g=>{g.selection&&l--},i);let c=n;this.items.forEach(g=>{let y=o.getMirror(--c);if(y==null)return;s=Math.min(s,y);let v=o.maps[y];if(g.step){let w=t.steps[y].invert(t.docs[y]),S=g.selection&&g.selection.map(o.slice(c+1,y));S&&l++,r.push(new fi(v,w,S))}else r.push(new fi(v))},i);let d=[];for(let g=n;g<s;g++)d.push(new fi(o.maps[g]));let h=this.items.slice(0,i).append(d).append(r),f=new Jr(h,l);return f.emptyItemCount()>qU&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=t)i.push(s),s.selection&&o++;else if(s.step){let c=s.step.map(n.slice(r)),d=c&&c.getMap();if(r--,d&&n.appendMap(d,r),c){let h=s.selection&&s.selection.map(n.slice(r));h&&o++;let f=new fi(d.invert(),c,h),g,y=i.length-1;(g=i.length&&i[y].merge(f))?i[y]=g:i.push(f)}}else s.map&&r--},this.items.length,0),new Jr(un.from(i.reverse()),o)}}Jr.empty=new Jr(un.empty,0);function KU(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class fi{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new fi(n.getMap().invert(),n,this.selection)}}}class Mo{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const GU=20;function YU(e,t,n,r){let i=n.getMeta(Ts),o;if(i)return i.historyState;n.getMeta(QU)&&(e=new Mo(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(Ts))return s.getMeta(Ts).redo?new Mo(e.done.addTransform(n,void 0,r,Ud(t)),e.undone,iS(n.mapping.maps),e.prevTime,e.prevComposition):new Mo(e.done,e.undone.addTransform(n,void 0,r,Ud(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=e.prevTime==0||!s&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-r.newGroupDelay||!JU(n,e.prevRanges)),d=s?Cg(e.prevRanges,n.mapping):iS(n.mapping.maps);return new Mo(e.done.addTransform(n,c?t.selection.getBookmark():void 0,r,Ud(t)),Jr.empty,d,n.time,l??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Mo(e.done.rebased(n,o),e.undone.rebased(n,o),Cg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Mo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Cg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function JU(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function iS(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function Cg(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function XU(e,t,n){let r=Ud(t),i=Ts.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),c=new Mo(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Ts,{redo:n,historyState:c})}let Eg=!1,oS=null;function Ud(e){let t=e.plugins;if(oS!=t){Eg=!1,oS=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Eg=!0;break}}return Eg}const Ts=new Pt("history"),QU=new Pt("closeHistory");function ZU(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new xt({key:Ts,state:{init(){return new Mo(Jr.empty,Jr.empty,null,0,-1)},apply(t,n,r){return YU(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?xj:r=="historyRedo"?vj:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function yj(e,t){return(n,r)=>{let i=Ts.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=XU(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const xj=yj(!1,!0),vj=yj(!0,!0);Et.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new xt({key:new Pt("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,l=0,c=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,c);return e=!0,d}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:t.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!t.getMeta("paste"))return!1;const l=t.selection.$head.pos,c=o-r,d=l-c,h=l;return t.deleteRange(d,h),!(this.storage.characters({node:t.doc})>r)}})]}});var eW=Et.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[_U(this.options)]}});Et.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new xt({key:new Pt("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return yt.create(e,[]);let s=0;this.options.mode==="deepest"&&e.descendants((c,d)=>{if(c.isText)return;if(!(i>=d&&i<=d+c.nodeSize-1))return!1;s+=1});let l=0;return e.descendants((c,d)=>{if(c.isText||!(i>=d&&i<=d+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(Wt.node(d,d+c.nodeSize,{class:this.options.className}))}),yt.create(e,o)}}})]}});var tW=Et.create({name:"gapCursor",addProseMirrorPlugins(){return[$U()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=ut(Oe(e,"allowGapCursor",n)))!=null?t:null}}}),sS="placeholder";function nW(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var rW=Et.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:sS,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${nW(this.options.dataAttribute)}`:`data-${sS}`;return[new xt({key:new Pt("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;const s=this.editor.isEmpty;return t.descendants((l,c)=>{const d=i>=c&&i<=c+l.nodeSize,h=!l.isLeaf&&_h(l);if(!l.type.isTextblock)return this.options.includeChildren;if((d||!this.options.showOnlyCurrent)&&h){const f=[this.options.emptyNodeClass];s&&f.push(this.options.emptyEditorClass);const g=Wt.node(c,c+l.nodeSize,{class:f.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:c,hasAnchor:d}):this.options.placeholder});o.push(g)}return this.options.includeChildren}),yt.create(t,o)}}})]}});Et.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new xt({key:new Pt("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||kA(n.selection)||e.view.dragging?null:yt.create(n.doc,[Wt.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});var iW="skipTrailingNode";function lS({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var oW=Et.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Pt(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new xt({key:t,appendTransaction:(i,o,s)=>{const{doc:l,tr:c,schema:d}=s,h=t.getState(s),f=l.content.size,g=d.nodes[n];if(!i.some(y=>y.getMeta(iW))&&h)return c.insert(f,g.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!lS({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!lS({node:s,types:r})}}})]}}),sW=Et.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>xj(e,t),redo:()=>({state:e,dispatch:t})=>vj(e,t)}},addProseMirrorPlugins(){return[ZU(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()}}}),lW=Et.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(M7.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(S7.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(rj.configure(this.options.bulletList)),this.options.code!==!1&&i.push(R7.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(I7.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(D7.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(eW.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(tW.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(_7.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(L7.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(sW.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(z7.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(H7.configure(this.options.italic)),this.options.listItem!==!1&&i.push(ij.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(uj.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(nj.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(fj.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(jU.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(OU.configure(this.options.strike)),this.options.text!==!1&&i.push(IU.configure(this.options.text)),this.options.underline!==!1&&i.push(DU.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(oW.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),aW=lW,cW=rW,uW=pj,dW=hj;const aS=/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,Rd=new Map,fW=Et.create({name:"wikiLink",addOptions(){return{onWikiLinkClick:void 0,checkExists:void 0}},addProseMirrorPlugins(){const{onWikiLinkClick:e,checkExists:t}=this.options;return[new xt({key:new Pt("wikiLink"),props:{decorations(n){const r=[],i=n.doc;return i.descendants((o,s)=>{var d;if(!o.isText||!o.text)return;const l=o.text;let c;for(aS.lastIndex=0;(c=aS.exec(l))!==null;){const h=c[0],f=c[1].trim(),g=((d=c[2])==null?void 0:d.trim())||f,y=s+c.index,v=Rd.get(f.toLowerCase()),w=(v==null?void 0:v.exists)??!t,S=v==null?void 0:v.id,C=w?"wiki-link-exists":"wiki-link-broken",T=w?`Open "${f}"`:`"${f}" not found in this nest`,N=y+2,R=y+h.length-2;r.push(Wt.inline(y,N,{class:"wiki-bracket-hidden"})),r.push(Wt.inline(N,R,{class:`wiki-link ${C}`,"data-wiki-title":f,"data-wiki-id":S||"","data-wiki-display":g,title:T})),r.push(Wt.inline(R,y+h.length,{class:"wiki-bracket-hidden"})),t&&!Rd.has(f.toLowerCase())&&(Rd.set(f.toLowerCase(),{exists:!1}),t(f).then(I=>{Rd.set(f.toLowerCase(),I)}).catch(()=>{}))}}),yt.create(i,r)},handleClick(n,r,i){const o=i.target;if(!o.classList.contains("wiki-link"))return!1;const s=o.getAttribute("data-wiki-title"),l=o.getAttribute("data-wiki-id")||null;return s&&e?(e(s,l),!0):!1}}})]}}),Pd=/\[([ xX])\]/g,hW=Et.create({name:"taskCheckbox",addProseMirrorPlugins(){return[new xt({key:new Pt("taskCheckbox"),props:{decorations(e){const t=[],n=e.doc;return n.descendants((r,i)=>{if(!r.isText||!r.text)return;const o=r.text;let s;for(Pd.lastIndex=0;(s=Pd.exec(o))!==null;){const l=s[1]==="x"||s[1]==="X",c=i+s.index,d=c+s[0].length;t.push(Wt.inline(c,d,{class:`task-checkbox ${l?"task-checked":"task-unchecked"}`,"data-task-checked":l?"true":"false"}))}}),yt.create(n,t)},handleClick(e,t,n){const r=n.target;if(!r.classList.contains("task-checkbox"))return!1;const i=r.getAttribute("data-task-checked")==="true",{state:o}=e,{doc:s}=o;let l=!1;return s.descendants((c,d)=>{if(l||!c.isText||!c.text)return;const h=c.text;let f;for(Pd.lastIndex=0;(f=Pd.exec(h))!==null;){const g=d+f.index,y=g+f[0].length;if(t>=g&&t<=y){const v=i?"[ ]":"[x]",w=o.tr.replaceWith(g,y,o.schema.text(v));return e.dispatch(w),l=!0,!1}}}),l}}})]}}),cS=/(?:^|\s)@(?:\(([^)]+)\)|([a-zA-Z0-9._@-]+))/g,pW=Et.create({name:"mention",addOptions(){return{onMentionClick:void 0}},addProseMirrorPlugins(){const{onMentionClick:e}=this.options;return[new xt({key:new Pt("mention"),props:{decorations(t){const n=[],r=t.doc;return r.descendants((i,o)=>{if(!i.isText||!i.text)return;const s=i.text;let l;for(cS.lastIndex=0;(l=cS.exec(s))!==null;){const c=l[0],d=l[1]||l[2],h=c.startsWith(" ")||c.startsWith(`
|
|
596
|
+
`)?1:0,f=o+l.index+h,g=f+c.length-h;n.push(Wt.inline(f,g,{class:"mention mention-user","data-mention-name":d}))}}),yt.create(r,n)},handleClick(t,n,r){const i=r.target;if(!i.classList.contains("mention"))return!1;const o=i.getAttribute("data-mention-name");return o&&e?(e(o),!0):!1}}})]}}),wj=b.forwardRef(function({content:t,onChange:n,onSave:r,nestId:i,onRequestDocLink:o,onWikiLinkClick:s,onMentionClick:l,placeholder:c="Start writing...",editable:d=!0,className:h},f){const[g,y]=b.useState(!1),v=d&&!g,w=x7({extensions:[aW.configure({heading:{levels:[1,2,3]},link:!1}),cW.configure({placeholder:c}),mU.configure({openOnClick:!1}),uW,dW.configure({nested:!0}),fW.configure({onWikiLinkClick:s,checkExists:i?async C=>{try{const{nodes:T}=await ax(i,C),N=T.find(R=>R.title.toLowerCase()===C.toLowerCase());return N?{exists:!0,id:N.id}:{exists:!1}}catch{return{exists:!1}}}:void 0}),hW,pW.configure({onMentionClick:l})],content:t,editable:d,immediatelyRender:!1,onUpdate:({editor:C})=>{const T=C.getHTML(),N=C.isEmpty||C.getText().trim().length===0;n(N?"":T)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[300px] px-6 py-4"},handleKeyDown:(C,T)=>(T.ctrlKey||T.metaKey)&&T.key==="s"?(T.preventDefault(),r==null||r(),!0):!1}});b.useEffect(()=>{w&&w.isEditable!==v&&w.setEditable(v)},[w,v]),b.useEffect(()=>{w&&(w.isFocused||t!==w.getHTML()&&w.commands.setContent(t,{emitUpdate:!1}))},[t,w]),b.useImperativeHandle(f,()=>({insertWikiLink:C=>{w&&w.chain().focus().insertContent(`[[${C}]] `).run()}}),[w]);const S=()=>{if(!w)return;const C=w.getAttributes("link").href??"",T=window.prompt("URL",C);if(T!==null){if(T===""){w.chain().focus().extendMarkRange("link").unsetLink().run();return}w.chain().focus().extendMarkRange("link").setLink({href:T}).run()}};return w?p.jsxs("div",{className:Pe("relative border rounded-lg bg-background shadow-sm",h),children:[d&&p.jsx("div",{className:"sticky top-0 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/75 border-b",children:p.jsx(mW,{editor:w,onLink:S,onRequestDocLink:o,previewing:g,onTogglePreview:()=>y(C=>!C)})}),p.jsx(BA,{editor:w,className:Pe("min-h-[60vh] max-h-[60vh] overflow-y-auto",g&&"bg-muted/20"),"data-testid":"markdown-editor-content"})]}):p.jsxs("div",{className:"border rounded-lg bg-background shadow-sm",children:[p.jsx("div",{className:"h-12 bg-muted/40 rounded-t-lg border-b"}),p.jsx("div",{className:"animate-pulse bg-muted/20 h-[300px] rounded-b-lg"})]})});function mW({editor:e,onLink:t,onRequestDocLink:n,previewing:r,onTogglePreview:i}){return r?p.jsxs("div",{className:"flex items-center gap-0.5 p-1 flex-wrap",children:[p.jsx(gn,{active:!0,onClick:i,title:"Back to editing",children:p.jsx(th,{className:"h-3.5 w-3.5"})}),p.jsx("span",{className:"text-xs text-muted-foreground px-2",children:"Preview — read-only"})]}):p.jsxs("div",{className:"flex items-center gap-0.5 p-1 flex-wrap",children:[p.jsx(gn,{active:e.isActive("bold"),onClick:()=>e.chain().focus().toggleBold().run(),title:"Bold (Ctrl+B)",children:p.jsx(cI,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{active:e.isActive("italic"),onClick:()=>e.chain().focus().toggleItalic().run(),title:"Italic (Ctrl+I)",children:p.jsx(GI,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{active:e.isActive("strike"),onClick:()=>e.chain().focus().toggleStrike().run(),title:"Strikethrough",children:p.jsx(PD,{className:"h-3.5 w-3.5"})}),p.jsx(Ha,{}),p.jsx(gn,{active:e.isActive("heading",{level:1}),onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",children:p.jsx($I,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{active:e.isActive("heading",{level:2}),onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:p.jsx(VI,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{active:e.isActive("heading",{level:3}),onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:p.jsx(UI,{className:"h-3.5 w-3.5"})}),p.jsx(Ha,{}),p.jsx(gn,{active:e.isActive("bulletList"),onClick:()=>e.chain().focus().toggleBulletList().run(),title:"Bullet list",children:p.jsx(oD,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{active:e.isActive("orderedList"),onClick:()=>e.chain().focus().toggleOrderedList().run(),title:"Numbered list",children:p.jsx(rD,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{onClick:()=>e.chain().focus().insertContent("[ ] ").run(),title:"Insert task ([ ])",children:p.jsx(jD,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{active:e.isActive("blockquote"),onClick:()=>e.chain().focus().toggleBlockquote().run(),title:"Quote",children:p.jsx(pD,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{active:e.isActive("codeBlock"),onClick:()=>e.chain().focus().toggleCodeBlock().run(),title:"Code block",children:p.jsx(CI,{className:"h-3.5 w-3.5"})}),p.jsx(Ha,{}),p.jsx(gn,{active:e.isActive("link"),onClick:t,title:"Insert URL link",children:p.jsx(tD,{className:"h-3.5 w-3.5"})}),n&&p.jsx(gn,{onClick:n,title:"Link to a document in this nest",children:p.jsx(zo,{className:"h-3.5 w-3.5"})}),p.jsx(Ha,{}),p.jsx(gn,{onClick:()=>e.chain().focus().undo().run(),disabled:!e.can().undo(),title:"Undo (Ctrl+Z)",children:p.jsx(zD,{className:"h-3.5 w-3.5"})}),p.jsx(gn,{onClick:()=>e.chain().focus().redo().run(),disabled:!e.can().redo(),title:"Redo (Ctrl+Shift+Z)",children:p.jsx(gD,{className:"h-3.5 w-3.5"})}),p.jsx(Ha,{}),p.jsx(gn,{onClick:i,title:"Preview — see how it will render",children:p.jsx($c,{className:"h-3.5 w-3.5"})}),p.jsxs("div",{className:"ml-auto text-xs text-muted-foreground hidden sm:flex items-center gap-2 px-1",children:[p.jsx("span",{children:"[[wiki]]"}),p.jsx("span",{children:"@mention"}),p.jsx("span",{children:"[ ] task"})]})]})}function gn({active:e,onClick:t,disabled:n,title:r,children:i}){return p.jsx(ve,{type:"button",variant:"ghost",size:"sm",onMouseDown:o=>o.preventDefault(),onClick:t,disabled:n,title:r,className:Pe("h-7 w-7 p-0",e&&"bg-muted text-foreground"),children:i})}function Ha(){return p.jsx("span",{className:"mx-1 inline-block h-5 w-px bg-border"})}function gW({nestId:e,nestName:t,isOwner:n,isAnonOwned:r,onBack:i,onOpenDocument:o}){var He,We;const{isAdmin:s,adminStatus:l,authMode:c}=Fs(),d=n||r&&c!=="open"&&s,h=((We=(He=l==null?void 0:l.me)==null?void 0:He.email)==null?void 0:We.toLowerCase())??"",[f,g]=b.useState([]),[y,v]=b.useState([]),[w,S]=b.useState([]),[C,T]=b.useState([]),[N,R]=b.useState(!1),[I,j]=b.useState(!1),[D,O]=b.useState(!1),[B,_]=b.useState("all"),[V,U]=b.useState(!0),[Z,K]=b.useState(""),[W,X]=b.useState("all"),[te,q]=b.useState(null),[Y,A]=b.useState(null),[z,Q]=b.useState(null),[P,fe]=b.useState({versions:[],approvedVersion:null,currentVersion:0}),[ue,re]=b.useState(!1),[ne,oe]=b.useState(!1),[me,Ce]=b.useState(!1),Ae=b.useCallback(async()=>{U(!0);const[ie,qe,nt,Zt,yr]=await Promise.all([lx(e).catch(()=>({nodes:[]})),u_(e).catch(()=>({stewards:[]})),m_(e).catch(()=>({requests:[],total:0})),gC(e).catch(()=>({stewardship_enabled:!1})),W1(e).catch(()=>({entries:[],total:0}))]);g(ie.nodes),v(qe.stewards),S(nt.requests),j(Zt.stewardship_enabled),T(yr.entries),U(!1)},[e]),Fe=b.useCallback(async()=>{R(!0);try{await y_(e).catch(()=>null);const{entries:ie}=await W1(e);T(ie)}finally{R(!1)}},[e]);b.useEffect(()=>{Ae()},[Ae]);const it={total:f.length,pending:f.filter(ie=>ie.status==="pending_review").length,approved:f.filter(ie=>ie.status==="approved").length,reviewQueue:w.length},lt=f.filter(ie=>!(W!=="all"&&ie.status!==W||Z&&!ie.title.toLowerCase().includes(Z.toLowerCase()))),_t=y.filter(ie=>ie.userEmail.toLowerCase()===h),Mt=!s&&_t.length>0,dt=!Mt||_t.some(ie=>ie.role==="editor"),ir=_t.some(ie=>ie.role==="reviewer"),pt=new Map;for(const ie of w)pt.set(ie.nodeId,ie.requestedBy.toLowerCase());const Dn=ie=>ie?_t.some(qe=>{if(qe.role!=="reviewer")return!1;if(qe.scope==="nest")return!0;if(qe.scope==="document")return qe.nodePattern===ie.id;if(qe.scope==="tag"){const nt=(qe.tagName||"").toLowerCase().replace(/^#+/,"");return(ie.tags||[]).map(Zt=>Zt.toLowerCase().replace(/^#+/,"")).includes(nt)}return!1}):!1,dn=w.filter(ie=>{if(ie.requestedBy.toLowerCase()===h)return!1;const qe=f.find(nt=>nt.id===ie.nodeId);return qe?Dn(qe):!1}),kt=async ie=>{Q(ie);try{const qe=await g_(e,ie.id);fe(qe)}catch{}},xe=async ie=>{te&&(await xC(e,te.id,ie),q(null),Ae())},at=async ie=>{te&&(await vC(e,te.id,ie),q(null),Ae())},tt=async(ie,qe)=>{Y&&(await yC(e,Y.id,ie,qe),A(null),Ae())},ee=async ie=>{if(window.confirm("Remove this steward? They will lose approval rights immediately. The user account and any documents stay intact."))try{await h_(e,ie),Ae()}catch(nt){window.alert((nt==null?void 0:nt.message)||"Failed to remove steward")}},ge=async ie=>{const{target:qe,...nt}=ie,Zt={...nt};ie.scope==="document"?Zt.nodePattern=qe:ie.scope==="tag"&&(Zt.tagName=qe),await f_(e,Zt),Ae()},De=async ie=>{if(window.confirm(`Delete "${ie.title}"? This cannot be undone.`))try{await c_(e,ie.id),Ae()}catch(nt){window.alert((nt==null?void 0:nt.message)||"Failed to delete document")}};return p.jsxs("div",{className:"md:py-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 sm:gap-4 mb-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(ve,{variant:"ghost",size:"icon",onClick:i,children:p.jsx(rx,{className:"h-4 w-4"})}),p.jsx("h3",{className:"text-xl font-semibold",children:t})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2 w-full sm:w-auto sm:justify-end",children:[p.jsxs(ve,{variant:"outline",onClick:()=>oe(!0),children:[p.jsx(ZI,{className:"h-4 w-4 mr-2"}),"Connect"]}),d&&p.jsxs(ve,{variant:"outline",onClick:()=>Ce(!0),className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:[p.jsx(_l,{className:"h-4 w-4 mr-2"}),"Delete"]}),s&&p.jsxs(ve,{variant:"outline",onClick:()=>O(!0),children:[p.jsx(H1,{className:"h-4 w-4 mr-2"}),"Settings"]}),I&&!Mt&&p.jsxs(p.Fragment,{children:[p.jsxs(ve,{variant:"outline",onClick:()=>d_(e).then(Ae),children:[p.jsx(xc,{className:"h-4 w-4 mr-2"}),"Sync stewards.yaml"]}),p.jsxs(ve,{variant:"outline",onClick:()=>re(!0),children:[p.jsx(tr,{className:"h-4 w-4 mr-2"}),"Assign Steward"]})]}),dt&&p.jsxs(ve,{onClick:()=>o("new"),children:[p.jsx(Gg,{className:"h-4 w-4 mr-2"}),"New Document"]})]})]}),p.jsxs("div",{className:`grid grid-cols-1 gap-4 mb-6 ${I?"md:grid-cols-4":"md:grid-cols-1 max-w-sm"}`,children:[p.jsxs(Bt,{children:[p.jsxs(on,{className:"pb-2",children:[p.jsx(Ar,{children:"Total Documents"}),p.jsx(sn,{className:"text-3xl",children:it.total})]}),p.jsx(Vt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(zo,{className:"h-4 w-4"}),p.jsx("span",{children:I?"In your context":"Auto-approved, AI-ready"})]})})]}),I&&p.jsxs(p.Fragment,{children:[p.jsxs(Bt,{children:[p.jsxs(on,{className:"pb-2",children:[p.jsx(Ar,{children:"Pending Review"}),p.jsx(sn,{className:"text-3xl text-amber-600",children:it.pending})]}),p.jsx(Vt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(qd,{className:"h-4 w-4"}),p.jsx("span",{children:"Awaiting approval"})]})})]}),p.jsxs(Bt,{children:[p.jsxs(on,{className:"pb-2",children:[p.jsx(Ar,{children:"AI Ready"}),p.jsx(sn,{className:"text-3xl text-green-600",children:it.approved})]}),p.jsx(Vt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(Hi,{className:"h-4 w-4"}),p.jsx("span",{children:"Approved for AI"})]})})]}),p.jsxs(Bt,{children:[p.jsxs(on,{className:"pb-2",children:[p.jsx(Ar,{children:"Review Queue"}),p.jsx(sn,{className:"text-3xl text-blue-600",children:it.reviewQueue})]}),p.jsx(Vt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(tr,{className:"h-4 w-4"}),p.jsx("span",{children:"Need your review"})]})})]})]})]}),p.jsxs(FE,{defaultValue:"documents",className:"w-full",children:[p.jsxs(vx,{className:"mb-4",children:[p.jsx(zi,{value:"documents",children:"Documents"}),I&&p.jsxs(zi,{value:"review",className:"gap-2",children:["Review Queue",dn.length>0&&p.jsx(Ir,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:dn.length})]}),p.jsxs(zi,{value:"external-edits",className:"gap-2",children:["External Edits",C.length>0&&p.jsx(Ir,{variant:"secondary",className:"text-[10px] px-1.5 py-0 bg-orange-100 text-orange-700",children:C.length})]}),I&&p.jsx(zi,{value:"stewards",children:"Stewards"})]}),p.jsx(Fi,{value:"documents",className:"space-y-4",children:p.jsxs(Bt,{children:[p.jsx(on,{children:p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx(sn,{className:"text-lg",children:"Documents"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"relative",children:[p.jsx(aC,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),p.jsx($n,{placeholder:"Search...",value:Z,onChange:ie=>K(ie.target.value),className:"pl-9 w-48 h-8"})]}),I&&p.jsxs(nc,{value:W,onValueChange:X,children:[p.jsx(Rl,{className:"w-[140px] h-8",children:p.jsx(rc,{})}),p.jsxs(Pl,{children:[p.jsx(zn,{value:"all",children:"All Status"}),p.jsx(zn,{value:"draft",children:"Draft"}),p.jsx(zn,{value:"pending_review",children:"Pending"}),p.jsx(zn,{value:"approved",children:"Approved"}),p.jsx(zn,{value:"rejected",children:"Rejected"})]})]})]})]})}),p.jsx(Vt,{children:V?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(Ct,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):lt.length===0?p.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:Z||W!=="all"?"No matching documents":"No documents yet"}):p.jsx("div",{className:"space-y-2",children:lt.map(ie=>{var qe;return p.jsxs("div",{onClick:()=>o(ie.id),className:"flex items-center gap-3 p-3 rounded-lg border hover:bg-muted/50 transition-colors group cursor-pointer","data-testid":`document-row-${ie.id}`,children:[p.jsx(zo,{className:"h-5 w-5 text-muted-foreground flex-shrink-0"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-medium truncate",children:ie.title}),I&&p.jsx(cB,{status:ie.status||"draft",size:"sm"})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-1",children:[p.jsxs("span",{children:["v",ie.version||1]}),((qe=ie.tags)==null?void 0:qe.length)>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{children:"·"}),p.jsx("span",{className:"truncate",children:ie.tags.slice(0,3).join(" ")})]})]})]}),p.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",onClick:nt=>nt.stopPropagation(),children:[I&&ie.status==="draft"&&dt&&p.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>A(ie),children:[p.jsx(ox,{className:"h-3.5 w-3.5 mr-1"}),"Submit"]}),I&&ie.status==="pending_review"&&pt.get(ie.id)!==h&&ir&&p.jsx(ve,{variant:"outline",size:"sm",onClick:()=>q(ie),className:"border-green-200 text-green-700 hover:bg-green-50",children:"Review"}),ie.status!=="pending_review"&&dt&&p.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>o(ie.id),title:"Edit",children:p.jsx(th,{className:"h-3.5 w-3.5"})}),p.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>kt(ie),title:"History",children:p.jsx(qg,{className:"h-3.5 w-3.5"})}),dt&&p.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>De(ie),title:"Delete",className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:p.jsx(_l,{className:"h-3.5 w-3.5"})})]})]},ie.id)})})})]})}),I&&p.jsx(Fi,{value:"review",className:"space-y-4",children:p.jsx(G$,{requests:dn,loading:V,onRefresh:Ae,onSelect:ie=>{const qe=f.find(nt=>nt.id===ie.nodeId);qe&&q(qe)}})}),p.jsx(Fi,{value:"external-edits",className:"space-y-4",children:p.jsxs(Bt,{children:[p.jsx(on,{className:"pb-3",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsxs(sn,{className:"text-lg flex items-center gap-2",children:[p.jsx(Kd,{className:"h-4 w-4 text-orange-600"}),"External Edits"]}),p.jsx(Ar,{children:"Files edited directly on disk, awaiting your approval."})]}),p.jsx(ve,{variant:"ghost",size:"icon",onClick:Fe,disabled:N,className:"h-8 w-8","data-testid":"external-edits-refresh",children:N?p.jsx(Ct,{className:"h-4 w-4 animate-spin"}):p.jsx(xc,{className:"h-4 w-4"})})]})}),p.jsx(Vt,{children:C.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[p.jsx(Hi,{className:"h-10 w-10 text-green-500 mb-3"}),p.jsx("p",{className:"text-sm font-medium",children:"No pending external edits"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"All files on disk match their last approved state."})]}):p.jsx("div",{className:"space-y-2",children:C.map(ie=>p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>o(ie.document_id),"data-testid":`external-edit-row-${ie.suggestion_id}`,children:[p.jsx(Kd,{className:"h-5 w-5 text-orange-600 flex-shrink-0"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-medium truncate",children:ie.document_id}),p.jsx(Ir,{variant:"secondary",className:"text-[10px] px-1.5 py-0 bg-orange-100 text-orange-700",children:ie.source})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-1",children:[p.jsx(qd,{className:"h-3 w-3"}),p.jsx("span",{children:new Date(ie.detected_at).toLocaleString()}),p.jsx("span",{children:"•"}),p.jsxs("span",{children:["by ",ie.actor]})]})]})]},ie.suggestion_id))})})]})}),I&&p.jsxs(Fi,{value:"stewards",className:"space-y-4",children:[p.jsxs(Bt,{className:"border-blue-200 bg-blue-50/40",children:[p.jsx(on,{className:"pb-2",children:p.jsxs(sn,{className:"text-sm flex items-center gap-2",children:[p.jsx(tr,{className:"h-4 w-4 text-blue-700"}),"How stewardship works"]})}),p.jsxs(Vt,{className:"text-xs text-muted-foreground space-y-2 leading-relaxed",children:[p.jsxs("p",{children:[p.jsx("strong",{className:"text-foreground",children:"New documents start as drafts."})," ","They're not available to AI queries until a steward approves them."]}),p.jsxs("p",{children:[p.jsx("strong",{className:"text-foreground",children:"Stewards"})," are people you name to govern content by scope. Resolution priority (first match wins):"]}),p.jsxs("ol",{className:"list-decimal list-inside ml-2 space-y-0.5",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Document"})," — this exact doc"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Tag"})," — everything with #tag"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Nest"})," — anything not matched above"]})]}),p.jsxs("p",{children:[p.jsx("strong",{className:"text-foreground",children:"Reviewers"})," can approve/reject; ",p.jsx("strong",{className:"text-foreground",children:"editors"})," can edit;"," ",p.jsx("strong",{className:"text-foreground",children:"viewers"})," have read access. Authors can't approve their own work."]})]})]}),p.jsxs(Bt,{children:[p.jsx(on,{className:"pb-3",children:p.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p.jsxs("div",{children:[p.jsx(sn,{className:"text-lg",children:"Stewards"}),p.jsx(Ar,{children:y.length===0?"Nobody's governing content yet":"Who governs what"})]}),y.length>0&&p.jsx("div",{className:"flex items-center gap-2",children:["all","document","tag","nest"].map(ie=>p.jsx("button",{onClick:()=>_(ie),className:`text-xs px-2 py-1 rounded border ${B===ie?"bg-primary text-primary-foreground border-primary":"bg-background text-muted-foreground border-border hover:bg-secondary"}`,children:ie==="all"?"All":ie.charAt(0).toUpperCase()+ie.slice(1)},ie))})]})}),p.jsx(Vt,{children:y.length===0?p.jsxs("div",{className:"text-sm space-y-3 py-2",children:[p.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Without stewards, every draft needs the nest owner to approve. Add an editor/reviewer to delegate approvals for a tag or specific doc."}),!Mt&&p.jsxs(ve,{variant:"outline",size:"sm",className:"w-full",onClick:()=>re(!0),children:[p.jsx(tr,{className:"h-3.5 w-3.5 mr-2"}),"Assign your first steward"]})]}):p.jsx(U$,{stewards:B==="all"?y:y.filter(ie=>ie.scope===B),showScope:!0,onAddSteward:Mt?void 0:()=>re(!0),onRemove:Mt?void 0:ee})})]})]})]}),!I&&p.jsxs(Bt,{className:"mt-4",children:[p.jsxs(on,{className:"pb-3",children:[p.jsxs(sn,{className:"text-base flex items-center gap-2",children:[p.jsx(tr,{className:"h-4 w-4"}),"Stewardship is off"]}),p.jsx(Ar,{children:"New documents are auto-approved and immediately AI-ready."})]}),p.jsxs(Vt,{children:[p.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Enable stewardship to require steward approval before documents become AI-ready. Versioning stays on either way."}),s?p.jsxs(ve,{variant:"outline",size:"sm",className:"w-full",onClick:()=>O(!0),children:[p.jsx(H1,{className:"h-3.5 w-3.5 mr-2"}),"Open Settings"]}):p.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Only the server admin can enable stewardship."})]})]}),ne&&p.jsx(wz,{isOpen:ne,onClose:()=>oe(!1),nestId:e,nestName:t}),D&&p.jsx(Az,{nestId:e,nestName:t,stewardshipEnabled:I,onClose:()=>O(!1),onChanged:()=>{O(!1),Ae()}}),me&&p.jsx(xE,{nestId:e,nestName:t,open:!0,onOpenChange:Ce,onDeleted:()=>{Ce(!1),i()}}),ue&&p.jsx(W$,{isOpen:ue,onClose:()=>re(!1),nestId:e,onSubmit:ge}),Y&&p.jsx(x2,{isOpen:!!Y,onClose:()=>A(null),documentTitle:Y.title,currentVersion:Y.version||1,onSubmit:tt}),te&&p.jsx(yW,{node:te,onApprove:xe,onReject:at,onClose:()=>q(null)}),z&&p.jsx(Rn,{open:!0,onOpenChange:()=>Q(null),children:p.jsxs(bn,{className:"sm:max-w-[600px] max-h-[85vh] overflow-hidden flex flex-col",children:[p.jsx(kn,{children:p.jsx(Sn,{children:z.title})}),p.jsx(aB,{className:"flex-1 min-h-0 overflow-hidden",versions:P.versions,currentVersion:P.currentVersion,approvedVersion:P.approvedVersion})]})})]})}function yW({node:e,onApprove:t,onReject:n,onClose:r}){return p.jsx(Rn,{open:!0,onOpenChange:r,children:p.jsxs(bn,{className:"sm:max-w-[600px] max-h-[80vh] flex flex-col",children:[p.jsx(kn,{children:p.jsx(Sn,{children:e.title})}),p.jsx("div",{className:"flex-1 overflow-y-auto rounded-md",children:e.content?p.jsx(wj,{content:e.content,onChange:()=>{},editable:!1}):p.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"(no content)"})}),p.jsx(zr,{children:p.jsx(y2,{documentTitle:e.title,version:e.version||1,onApprove:t,onReject:n})})]})})}function xW(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vW=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bW={};function uS(e,t){return(bW.jsx?wW:vW).test(e)}const kW=/[ \t\n\f\r]/g;function SW(e){return typeof e=="object"?e.type==="text"?dS(e.value):!1:dS(e)}function dS(e){return e.replace(kW,"")===""}class Zc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Zc.prototype.normal={};Zc.prototype.property={};Zc.prototype.space=void 0;function bj(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Zc(n,r,t)}function Hy(e){return e.toLowerCase()}class rr{constructor(t,n){this.attribute=n,this.property=t}}rr.prototype.attribute="";rr.prototype.booleanish=!1;rr.prototype.boolean=!1;rr.prototype.commaOrSpaceSeparated=!1;rr.prototype.commaSeparated=!1;rr.prototype.defined=!1;rr.prototype.mustUseProperty=!1;rr.prototype.number=!1;rr.prototype.overloadedBoolean=!1;rr.prototype.property="";rr.prototype.spaceSeparated=!1;rr.prototype.space=void 0;let CW=0;const Ge=qs(),$t=qs(),Uy=qs(),pe=qs(),gt=qs(),Dl=qs(),ur=qs();function qs(){return 2**++CW}const Wy=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:$t,commaOrSpaceSeparated:ur,commaSeparated:Dl,number:pe,overloadedBoolean:Uy,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Ng=Object.keys(Wy);class _v extends rr{constructor(t,n,r,i){let o=-1;if(super(t,n),fS(this,"space",i),typeof r=="number")for(;++o<Ng.length;){const s=Ng[o];fS(this,Ng[o],(r&Wy[s])===Wy[s])}}}_v.prototype.defined=!0;function fS(e,t,n){n&&(e[t]=n)}function Zl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new _v(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Hy(r)]=r,n[Hy(o.attribute)]=r}return new Zc(t,n,e.space)}const kj=Zl({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:gt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:pe,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:gt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:$t,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Sj(e,t){return t in e?e[t]:t}function Cj(e,t){return Sj(e,t.toLowerCase())}const EW=Zl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Dl,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:gt,autoFocus:Ge,autoPlay:Ge,blocking:gt,capture:null,charSet:null,checked:Ge,cite:null,className:gt,cols:pe,colSpan:null,content:null,contentEditable:$t,controls:Ge,controlsList:gt,coords:pe|Dl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:Uy,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:gt,height:pe,hidden:Uy,high:pe,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:gt,itemRef:gt,itemScope:Ge,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ge,optimum:pe,pattern:null,ping:gt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:gt,required:Ge,reversed:Ge,rows:pe,rowSpan:pe,sandbox:gt,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:$t,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ge,disableRemotePlayback:Ge,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:Cj}),NW=Zl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ur,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:gt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Dl,g2:Dl,glyphName:Dl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ur,rev:ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ur,requiredFeatures:ur,requiredFonts:ur,requiredFormats:ur,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ur,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sj}),Ej=Zl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Nj=Zl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cj}),Tj=Zl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),TW={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},MW=/[A-Z]/g,hS=/-[a-z]/g,AW=/^data[-\w.:]+$/i;function jW(e,t){const n=Hy(t);let r=t,i=rr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&AW.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(hS,PW);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!hS.test(o)){let s=o.replace(MW,RW);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=_v}return new i(r,t)}function RW(e){return"-"+e.toLowerCase()}function PW(e){return e.charAt(1).toUpperCase()}const OW=bj([kj,EW,Ej,Nj,Tj],"html"),Lv=bj([kj,NW,Ej,Nj,Tj],"svg");function IW(e){return e.join(" ").trim()}var bl={},Tg,pS;function DW(){if(pS)return Tg;pS=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
597
|
+
`,d="/",h="*",f="",g="comment",y="declaration";function v(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var T=1,N=1;function R(K){var W=K.match(t);W&&(T+=W.length);var X=K.lastIndexOf(c);N=~X?K.length-X:N+K.length}function I(){var K={line:T,column:N};return function(W){return W.position=new j(K),B(),W}}function j(K){this.start=K,this.end={line:T,column:N},this.source=C.source}j.prototype.content=S;function D(K){var W=new Error(C.source+":"+T+":"+N+": "+K);if(W.reason=K,W.filename=C.source,W.line=T,W.column=N,W.source=S,!C.silent)throw W}function O(K){var W=K.exec(S);if(W){var X=W[0];return R(X),S=S.slice(X.length),W}}function B(){O(n)}function _(K){var W;for(K=K||[];W=V();)W!==!1&&K.push(W);return K}function V(){var K=I();if(!(d!=S.charAt(0)||h!=S.charAt(1))){for(var W=2;f!=S.charAt(W)&&(h!=S.charAt(W)||d!=S.charAt(W+1));)++W;if(W+=2,f===S.charAt(W-1))return D("End of comment missing");var X=S.slice(2,W-2);return N+=2,R(X),S=S.slice(W),N+=2,K({type:g,comment:X})}}function U(){var K=I(),W=O(r);if(W){if(V(),!O(i))return D("property missing ':'");var X=O(o),te=K({type:y,property:w(W[0].replace(e,f)),value:X?w(X[0].replace(e,f)):f});return O(s),te}}function Z(){var K=[];_(K);for(var W;W=U();)W!==!1&&(K.push(W),_(K));return K}return B(),Z()}function w(S){return S?S.replace(l,f):f}return Tg=v,Tg}var mS;function _W(){if(mS)return bl;mS=1;var e=bl&&bl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bl,"__esModule",{value:!0}),bl.default=n;const t=e(DW());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const s=(0,t.default)(r),l=typeof i=="function";return s.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:h}=c;l?i(d,h,c):h&&(o=o||{},o[d]=h)}),o}return bl}var Ua={},gS;function LW(){if(gS)return Ua;gS=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},s=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},c=function(d,h){return h===void 0&&(h={}),o(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,s))};return Ua.camelCase=c,Ua}var Wa,yS;function zW(){if(yS)return Wa;yS=1;var e=Wa&&Wa.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(_W()),n=LW();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(s[(0,n.camelCase)(l,o)]=c)}),s}return r.default=r,Wa=r,Wa}var FW=zW();const $W=_c(FW),Mj=Aj("end"),zv=Aj("start");function Aj(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function BW(e){const t=zv(e),n=Mj(e);if(t&&n)return{start:t,end:n}}function mc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xS(e.position):"start"in e||"end"in e?xS(e):"line"in e||"column"in e?qy(e):""}function qy(e){return vS(e&&e.line)+":"+vS(e&&e.column)}function xS(e){return qy(e&&e.start)+"-"+qy(e&&e.end)}function vS(e){return e&&typeof e=="number"?e:1}class In extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=mc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}In.prototype.file="";In.prototype.name="";In.prototype.reason="";In.prototype.message="";In.prototype.stack="";In.prototype.column=void 0;In.prototype.line=void 0;In.prototype.ancestors=void 0;In.prototype.cause=void 0;In.prototype.fatal=void 0;In.prototype.place=void 0;In.prototype.ruleId=void 0;In.prototype.source=void 0;const Fv={}.hasOwnProperty,VW=new Map,HW=/[A-Z]/g,UW=new Set(["table","tbody","thead","tfoot","tr"]),WW=new Set(["td","th"]),jj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qW(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=eq(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ZW(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lv:OW,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Rj(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Rj(e,t,n){if(t.type==="element")return KW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return GW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JW(e,t,n);if(t.type==="mdxjsEsm")return YW(e,t);if(t.type==="root")return XW(e,t,n);if(t.type==="text")return QW(e,t)}function KW(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Lv,e.schema=i),e.ancestors.push(t);const o=Oj(e,t.tagName,!1),s=tq(e,t);let l=Bv(e,t);return UW.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!SW(c):!0})),Pj(e,s,o,t),$v(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function GW(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ic(e,t.position)}function YW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ic(e,t.position)}function JW(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Lv,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Oj(e,t.name,!0),s=nq(e,t),l=Bv(e,t);return Pj(e,s,o,t),$v(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function XW(e,t,n){const r={};return $v(r,Bv(e,t)),e.create(t,e.Fragment,r,n)}function QW(e,t){return t.value}function Pj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $v(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ZW(e,t,n){return r;function r(i,o,s,l){const d=Array.isArray(s.children)?n:t;return l?d(o,s,l):d(o,s)}}function eq(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),c=zv(r);return t(i,o,s,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function tq(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Fv.call(t.properties,i)){const o=rq(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&WW.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nq(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Ic(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Ic(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Bv(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:VW;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const d=i.get(c)||0;s=c+"-"+d,i.set(c,d+1)}}const l=Rj(e,o,s);l!==void 0&&n.push(l)}return n}function rq(e,t,n){const r=jW(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xW(n):IW(n)),r.property==="style"){let i=typeof n=="object"?n:iq(e,String(n));return e.stylePropertyNameCase==="css"&&(i=oq(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?TW[r.property]||r.property:r.attribute,n]}}function iq(e,t){try{return $W(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new In("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=jj+"#cannot-parse-style-attribute",i}}function Oj(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const l=uS(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=s}else r=uS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Fv.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ic(e)}function Ic(e,t){const n=new In("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=jj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oq(e){const t={};let n;for(n in e)Fv.call(e,n)&&(t[sq(n)]=e[n]);return t}function sq(e){let t=e.replace(HW,lq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lq(e){return"-"+e.toLowerCase()}const Mg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},aq={};function Vv(e,t){const n=aq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ij(e,r,i)}function Ij(e,t,n){if(cq(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return wS(e.children,t,n)}return Array.isArray(e)?wS(e,t,n):""}function wS(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ij(e[i],t,n);return r.join("")}function cq(e){return!!(e&&typeof e=="object")}const bS=document.createElement("i");function Hv(e){const t="&"+e+";";bS.innerHTML=t;const n=bS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mr(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Rr(e,t){return e.length>0?(mr(e,e.length,0,t),e):t}const kS={}.hasOwnProperty;function Dj(e){const t={};let n=-1;for(;++n<e.length;)uq(t,e[n]);return t}function uq(e,t){let n;for(n in t){const i=(kS.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){kS.call(i,s)||(i[s]=[]);const l=o[s];dq(i[s],Array.isArray(l)?l:l?[l]:[])}}}function dq(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mr(e,0,0,r)}function _j(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Fn=Qo(/[A-Za-z]/),jn=Qo(/[\dA-Za-z]/),fq=Qo(/[#-'*+\--9=?A-Z^-~]/);function Xf(e){return e!==null&&(e<32||e===127)}const Ky=Qo(/\d/),hq=Qo(/[\dA-Fa-f]/),pq=Qo(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const $h=Qo(new RegExp("\\p{P}|\\p{S}","u")),Ls=Qo(/\s/);function Qo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ea(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&jn(e.charCodeAt(n+1))&&jn(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function rt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(c){return Ze(c)?(e.enter(n),l(c)):t(c)}function l(c){return Ze(c)&&o++<i?(e.consume(c),l):(e.exit(n),t(c))}}const mq={tokenize:gq};function gq(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),rt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return ze(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),s)}}const yq={tokenize:xq},SS={tokenize:vq};function xq(e){const t=this,n=[];let r=0,i,o,s;return l;function l(N){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,c,d)(N)}return d(N)}function c(N){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&T();const R=t.events.length;let I=R,j;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){j=t.events[I][1].end;break}C(r);let D=R;for(;D<t.events.length;)t.events[D][1].end={...j},D++;return mr(t.events,I+1,0,t.events.slice(R)),t.events.length=D,d(N)}return l(N)}function d(N){if(r===n.length){if(!i)return g(N);if(i.currentConstruct&&i.currentConstruct.concrete)return v(N);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(SS,h,f)(N)}function h(N){return i&&T(),C(r),g(N)}function f(N){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(N)}function g(N){return t.containerState={},e.attempt(SS,y,v)(N)}function y(N){return r++,n.push([t.currentConstruct,t.containerState]),g(N)}function v(N){if(N===null){i&&T(),C(0),e.consume(N);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(N)}function w(N){if(N===null){S(e.exit("chunkFlow"),!0),C(0),e.consume(N);return}return ze(N)?(e.consume(N),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(N),w)}function S(N,R){const I=t.sliceStream(N);if(R&&I.push(null),N.previous=o,o&&(o.next=N),o=N,i.defineSkip(N.start),i.write(I),t.parser.lazy[N.start.line]){let j=i.events.length;for(;j--;)if(i.events[j][1].start.offset<s&&(!i.events[j][1].end||i.events[j][1].end.offset>s))return;const D=t.events.length;let O=D,B,_;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(B){_=t.events[O][1].end;break}B=!0}for(C(r),j=D;j<t.events.length;)t.events[j][1].end={..._},j++;mr(t.events,O+1,0,t.events.slice(D)),t.events.length=j}}function C(N){let R=n.length;for(;R-- >N;){const I=n[R];t.containerState=I[1],I[0].exit.call(t,e)}n.length=N}function T(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vq(e,t,n){return rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kl(e){if(e===null||ht(e)||Ls(e))return 1;if($h(e))return 2}function Bh(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Gy={name:"attention",resolveAll:wq,tokenize:bq};function wq(e,t){let n=-1,r,i,o,s,l,c,d,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},g={...e[n][1].start};CS(f,-c),CS(g,c),s={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Rr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Rr(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=Rr(d,Bh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Rr(d,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,d=Rr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,mr(e,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function bq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kl(r);let o;return s;function s(c){return o=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===o)return e.consume(c),l;const d=e.exit("attentionSequence"),h=Kl(c),f=!h||h===2&&i||n.includes(c),g=!i||i===2&&h||n.includes(r);return d._open=!!(o===42?f:f&&(i||!g)),d._close=!!(o===42?g:g&&(h||!f)),t(c)}}function CS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kq={name:"autolink",tokenize:Sq};function Sq(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return Fn(y)?(e.consume(y),s):y===64?n(y):d(y)}function s(y){return y===43||y===45||y===46||jn(y)?(r=1,l(y)):d(y)}function l(y){return y===58?(e.consume(y),r=0,c):(y===43||y===45||y===46||jn(y))&&r++<32?(e.consume(y),l):(r=0,d(y))}function c(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Xf(y)?n(y):(e.consume(y),c)}function d(y){return y===64?(e.consume(y),h):fq(y)?(e.consume(y),d):n(y)}function h(y){return jn(y)?f(y):n(y)}function f(y){return y===46?(e.consume(y),r=0,h):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):g(y)}function g(y){if((y===45||jn(y))&&r++<63){const v=y===45?g:f;return e.consume(y),v}return n(y)}}const eu={partial:!0,tokenize:Cq};function Cq(e,t,n){return r;function r(o){return Ze(o)?rt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ze(o)?t(o):n(o)}}const Lj={continuation:{tokenize:Nq},exit:Tq,name:"blockQuote",tokenize:Eq};function Eq(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Ze(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Nq(e,t,n){const r=this;return i;function i(s){return Ze(s)?rt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Lj,t,n)(s)}}function Tq(e){e.exit("blockQuote")}const zj={name:"characterEscape",tokenize:Mq};function Mq(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return pq(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Fj={name:"characterReference",tokenize:Aq};function Aq(e,t,n){const r=this;let i=0,o,s;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,s=jn,h(f))}function d(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=hq,h):(e.enter("characterReferenceValue"),o=7,s=Ky,h(f))}function h(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===jn&&!Hv(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),h):n(f)}}const ES={partial:!0,tokenize:Rq},NS={concrete:!0,name:"codeFenced",tokenize:jq};function jq(e,t,n){const r=this,i={partial:!0,tokenize:I};let o=0,s=0,l;return c;function c(j){return d(j)}function d(j){const D=r.events[r.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,l=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(j)}function h(j){return j===l?(s++,e.consume(j),h):s<3?n(j):(e.exit("codeFencedFenceSequence"),Ze(j)?rt(e,f,"whitespace")(j):f(j))}function f(j){return j===null||ze(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(ES,w,R)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||ze(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(j)):Ze(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rt(e,y,"whitespace")(j)):j===96&&j===l?n(j):(e.consume(j),g)}function y(j){return j===null||ze(j)?f(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===null||ze(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(j)):j===96&&j===l?n(j):(e.consume(j),v)}function w(j){return e.attempt(i,R,S)(j)}function S(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),C}function C(j){return o>0&&Ze(j)?rt(e,T,"linePrefix",o+1)(j):T(j)}function T(j){return j===null||ze(j)?e.check(ES,w,R)(j):(e.enter("codeFlowValue"),N(j))}function N(j){return j===null||ze(j)?(e.exit("codeFlowValue"),T(j)):(e.consume(j),N)}function R(j){return e.exit("codeFenced"),t(j)}function I(j,D,O){let B=0;return _;function _(W){return j.enter("lineEnding"),j.consume(W),j.exit("lineEnding"),V}function V(W){return j.enter("codeFencedFence"),Ze(W)?rt(j,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):U(W)}function U(W){return W===l?(j.enter("codeFencedFenceSequence"),Z(W)):O(W)}function Z(W){return W===l?(B++,j.consume(W),Z):B>=s?(j.exit("codeFencedFenceSequence"),Ze(W)?rt(j,K,"whitespace")(W):K(W)):O(W)}function K(W){return W===null||ze(W)?(j.exit("codeFencedFence"),D(W)):O(W)}}}function Rq(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Ag={name:"codeIndented",tokenize:Oq},Pq={partial:!0,tokenize:Iq};function Oq(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),rt(e,o,"linePrefix",5)(d)}function o(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?c(d):ze(d)?e.attempt(Pq,s,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||ze(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function Iq(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):rt(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):ze(s)?i(s):n(s)}}const Dq={name:"codeText",previous:Lq,resolve:_q,tokenize:zq};function _q(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Lq(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zq(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),r++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(o=e.enter("codeTextSequence"),i=0,h(f)):ze(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||ze(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),d)}function h(f){return f===96?(e.consume(f),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",d(f))}}class Fq{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qa(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qa(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qa(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);qa(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qa(this.left,n.reverse())}}}function qa(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $j(e){const t={};let n=-1,r,i,o,s,l,c,d;const h=new Fq(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,$q(h,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=h.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},l=h.slice(i,n),l.unshift(r),h.splice(i,n-i+1,l))}}return mr(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!d}function $q(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,c=[],d={};let h,f,g=-1,y=n,v=0,w=0;const S=[w];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(h=r.sliceStream(y),y.next||h.push(null),f&&s.defineSkip(y.start),y._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),y._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=y,y=y.next}for(y=n;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(w=g+1,S.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(s.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),g=S.length;g--;){const C=l.slice(S[g],S[g+1]),T=o.pop();c.push([T,T+C.length-1]),e.splice(T,2,C)}for(c.reverse(),g=-1;++g<c.length;)d[v+c[g][0]]=v+c[g][1],v+=c[g][1]-c[g][0]-1;return d}const Bq={resolve:Hq,tokenize:Uq},Vq={partial:!0,tokenize:Wq};function Hq(e){return $j(e),e}function Uq(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):ze(l)?e.check(Vq,s,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Wq(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),rt(e,o,"linePrefix")}function o(s){if(s===null||ze(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Bj(e,t,n,r,i,o,s,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return f;function f(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),g):C===null||C===32||C===41||Xf(C)?n(C):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(C))}function g(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===62?(e.exit("chunkString"),e.exit(l),g(C)):C===null||C===60||ze(C)?n(C):(e.consume(C),C===92?v:y)}function v(C){return C===60||C===62||C===92?(e.consume(C),y):y(C)}function w(C){return!h&&(C===null||C===41||ht(C))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(C)):h<d&&C===40?(e.consume(C),h++,w):C===41?(e.consume(C),h--,w):C===null||C===32||C===40||Xf(C)?n(C):(e.consume(C),C===92?S:w)}function S(C){return C===40||C===41||C===92?(e.consume(C),w):w(C)}}function Vj(e,t,n,r,i,o){const s=this;let l=0,c;return d;function d(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),h}function h(y){return l>999||y===null||y===91||y===93&&!c||y===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===null||y===91||y===93||ze(y)||l++>999?(e.exit("chunkString"),h(y)):(e.consume(y),c||(c=!Ze(y)),y===92?g:f)}function g(y){return y===91||y===92||y===93?(e.consume(y),l++,f):f(y)}}function Hj(e,t,n,r,i,o){let s;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,c):n(g)}function c(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),d(g))}function d(g){return g===s?(e.exit(o),c(s)):g===null?n(g):ze(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),rt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===s||g===null||ze(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?f:h)}function f(g){return g===s||g===92?(e.consume(g),h):h(g)}}function gc(e,t){let n;return r;function r(i){return ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ze(i)?rt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const qq={name:"definition",tokenize:Gq},Kq={partial:!0,tokenize:Yq};function Gq(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),s(y)}function s(y){return Vj.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),c):n(y)}function c(y){return ht(y)?gc(e,d)(y):d(y)}function d(y){return Bj(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function h(y){return e.attempt(Kq,f,f)(y)}function f(y){return Ze(y)?rt(e,g,"whitespace")(y):g(y)}function g(y){return y===null||ze(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function Yq(e,t,n){return r;function r(l){return ht(l)?gc(e,i)(l):n(l)}function i(l){return Hj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Ze(l)?rt(e,s,"whitespace")(l):s(l)}function s(l){return l===null||ze(l)?t(l):n(l)}}const Jq={name:"hardBreakEscape",tokenize:Xq};function Xq(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Qq={name:"headingAtx",resolve:Zq,tokenize:eK};function Zq(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function eK(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&r++<6?(e.consume(h),s):h===null||ht(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||ze(h)?(e.exit("atxHeading"),t(h)):Ze(h)?rt(e,l,"whitespace")(h):(e.enter("atxHeadingText"),d(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||ht(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),d)}}const tK=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],TS=["pre","script","style","textarea"],nK={concrete:!0,name:"htmlFlow",resolveTo:oK,tokenize:sK},rK={partial:!0,tokenize:aK},iK={partial:!0,tokenize:lK};function oK(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function sK(e,t,n){const r=this;let i,o,s,l,c;return d;function d(P){return h(P)}function h(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),g):P===47?(e.consume(P),o=!0,w):P===63?(e.consume(P),i=3,r.interrupt?t:A):Fn(P)?(e.consume(P),s=String.fromCharCode(P),S):n(P)}function g(P){return P===45?(e.consume(P),i=2,y):P===91?(e.consume(P),i=5,l=0,v):Fn(P)?(e.consume(P),i=4,r.interrupt?t:A):n(P)}function y(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function v(P){const fe="CDATA[";return P===fe.charCodeAt(l++)?(e.consume(P),l===fe.length?r.interrupt?t:U:v):n(P)}function w(P){return Fn(P)?(e.consume(P),s=String.fromCharCode(P),S):n(P)}function S(P){if(P===null||P===47||P===62||ht(P)){const fe=P===47,ue=s.toLowerCase();return!fe&&!o&&TS.includes(ue)?(i=1,r.interrupt?t(P):U(P)):tK.includes(s.toLowerCase())?(i=6,fe?(e.consume(P),C):r.interrupt?t(P):U(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):o?T(P):N(P))}return P===45||jn(P)?(e.consume(P),s+=String.fromCharCode(P),S):n(P)}function C(P){return P===62?(e.consume(P),r.interrupt?t:U):n(P)}function T(P){return Ze(P)?(e.consume(P),T):_(P)}function N(P){return P===47?(e.consume(P),_):P===58||P===95||Fn(P)?(e.consume(P),R):Ze(P)?(e.consume(P),N):_(P)}function R(P){return P===45||P===46||P===58||P===95||jn(P)?(e.consume(P),R):I(P)}function I(P){return P===61?(e.consume(P),j):Ze(P)?(e.consume(P),I):N(P)}function j(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,D):Ze(P)?(e.consume(P),j):O(P)}function D(P){return P===c?(e.consume(P),c=null,B):P===null||ze(P)?n(P):(e.consume(P),D)}function O(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||ht(P)?I(P):(e.consume(P),O)}function B(P){return P===47||P===62||Ze(P)?N(P):n(P)}function _(P){return P===62?(e.consume(P),V):n(P)}function V(P){return P===null||ze(P)?U(P):Ze(P)?(e.consume(P),V):n(P)}function U(P){return P===45&&i===2?(e.consume(P),X):P===60&&i===1?(e.consume(P),te):P===62&&i===4?(e.consume(P),z):P===63&&i===3?(e.consume(P),A):P===93&&i===5?(e.consume(P),Y):ze(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(rK,Q,Z)(P)):P===null||ze(P)?(e.exit("htmlFlowData"),Z(P)):(e.consume(P),U)}function Z(P){return e.check(iK,K,Q)(P)}function K(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),W}function W(P){return P===null||ze(P)?Z(P):(e.enter("htmlFlowData"),U(P))}function X(P){return P===45?(e.consume(P),A):U(P)}function te(P){return P===47?(e.consume(P),s="",q):U(P)}function q(P){if(P===62){const fe=s.toLowerCase();return TS.includes(fe)?(e.consume(P),z):U(P)}return Fn(P)&&s.length<8?(e.consume(P),s+=String.fromCharCode(P),q):U(P)}function Y(P){return P===93?(e.consume(P),A):U(P)}function A(P){return P===62?(e.consume(P),z):P===45&&i===2?(e.consume(P),A):U(P)}function z(P){return P===null||ze(P)?(e.exit("htmlFlowData"),Q(P)):(e.consume(P),z)}function Q(P){return e.exit("htmlFlow"),t(P)}}function lK(e,t,n){const r=this;return i;function i(s){return ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function aK(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(eu,t,n)}}const cK={name:"htmlText",tokenize:uK};function uK(e,t,n){const r=this;let i,o,s;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),I):A===63?(e.consume(A),N):Fn(A)?(e.consume(A),O):n(A)}function d(A){return A===45?(e.consume(A),h):A===91?(e.consume(A),o=0,v):Fn(A)?(e.consume(A),T):n(A)}function h(A){return A===45?(e.consume(A),y):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),g):ze(A)?(s=f,te(A)):(e.consume(A),f)}function g(A){return A===45?(e.consume(A),y):f(A)}function y(A){return A===62?X(A):A===45?g(A):f(A)}function v(A){const z="CDATA[";return A===z.charCodeAt(o++)?(e.consume(A),o===z.length?w:v):n(A)}function w(A){return A===null?n(A):A===93?(e.consume(A),S):ze(A)?(s=w,te(A)):(e.consume(A),w)}function S(A){return A===93?(e.consume(A),C):w(A)}function C(A){return A===62?X(A):A===93?(e.consume(A),C):w(A)}function T(A){return A===null||A===62?X(A):ze(A)?(s=T,te(A)):(e.consume(A),T)}function N(A){return A===null?n(A):A===63?(e.consume(A),R):ze(A)?(s=N,te(A)):(e.consume(A),N)}function R(A){return A===62?X(A):N(A)}function I(A){return Fn(A)?(e.consume(A),j):n(A)}function j(A){return A===45||jn(A)?(e.consume(A),j):D(A)}function D(A){return ze(A)?(s=D,te(A)):Ze(A)?(e.consume(A),D):X(A)}function O(A){return A===45||jn(A)?(e.consume(A),O):A===47||A===62||ht(A)?B(A):n(A)}function B(A){return A===47?(e.consume(A),X):A===58||A===95||Fn(A)?(e.consume(A),_):ze(A)?(s=B,te(A)):Ze(A)?(e.consume(A),B):X(A)}function _(A){return A===45||A===46||A===58||A===95||jn(A)?(e.consume(A),_):V(A)}function V(A){return A===61?(e.consume(A),U):ze(A)?(s=V,te(A)):Ze(A)?(e.consume(A),V):B(A)}function U(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,Z):ze(A)?(s=U,te(A)):Ze(A)?(e.consume(A),U):(e.consume(A),K)}function Z(A){return A===i?(e.consume(A),i=void 0,W):A===null?n(A):ze(A)?(s=Z,te(A)):(e.consume(A),Z)}function K(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||ht(A)?B(A):(e.consume(A),K)}function W(A){return A===47||A===62||ht(A)?B(A):n(A)}function X(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function te(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),q}function q(A){return Ze(A)?rt(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Y(A)}function Y(A){return e.enter("htmlTextData"),s(A)}}const Uv={name:"labelEnd",resolveAll:pK,resolveTo:mK,tokenize:gK},dK={tokenize:yK},fK={tokenize:xK},hK={tokenize:vK};function pK(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&mr(e,0,e.length,n),e}function mK(e,t){let n=e.length,r=0,i,o,s,l;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},h={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",c,t],["enter",d,t]],l=Rr(l,e.slice(o+1,o+r+3)),l=Rr(l,[["enter",h,t]]),l=Rr(l,Bh(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),l=Rr(l,[["exit",h,t],e[s-2],e[s-1],["exit",d,t]]),l=Rr(l,e.slice(s+1)),l=Rr(l,[["exit",c,t]]),mr(e,o,e.length,l),e}function gK(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(g){return o?o._inactive?f(g):(s=r.parser.defined.includes(Zr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),c):n(g)}function c(g){return g===40?e.attempt(dK,h,s?h:f)(g):g===91?e.attempt(fK,h,s?d:f)(g):s?h(g):f(g)}function d(g){return e.attempt(hK,h,f)(g)}function h(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function yK(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return ht(f)?gc(e,o)(f):o(f)}function o(f){return f===41?h(f):Bj(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ht(f)?gc(e,c)(f):h(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?Hj(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):h(f)}function d(f){return ht(f)?gc(e,h)(f):h(f)}function h(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function xK(e,t,n){const r=this;return i;function i(l){return Vj.call(r,e,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function vK(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const wK={name:"labelStartImage",resolveAll:Uv.resolveAll,tokenize:bK};function bK(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const kK={name:"labelStartLink",resolveAll:Uv.resolveAll,tokenize:SK};function SK(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const jg={name:"lineEnding",tokenize:CK};function CK(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),rt(e,t,"linePrefix")}}const Wd={name:"thematicBreak",tokenize:EK};function EK(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,l(d)}function l(d){return d===i?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||ze(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),Ze(d)?rt(e,l,"whitespace")(d):l(d))}}const Qn={continuation:{tokenize:AK},exit:RK,name:"list",tokenize:MK},NK={partial:!0,tokenize:PK},TK={partial:!0,tokenize:jK};function MK(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(y){const v=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Ky(y)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Wd,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(y)}return n(y)}function c(y){return Ky(y)&&++s<10?(e.consume(y),c):(!r.interrupt||s<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(eu,r.interrupt?n:h,e.attempt(NK,g,f))}function h(y){return r.containerState.initialBlankLine=!0,o++,g(y)}function f(y){return Ze(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),g):n(y)}function g(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function AK(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(eu,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,rt(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!Ze(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(TK,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,rt(e,e.attempt(Qn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function jK(e,t,n){const r=this;return rt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function RK(e){e.exit(this.containerState.type)}function PK(e,t,n){const r=this;return rt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Ze(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const MS={name:"setextUnderline",resolveTo:OK,tokenize:IK};function OK(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function IK(e,t,n){const r=this;let i;return o;function o(d){let h=r.events.length,f;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){f=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),Ze(d)?rt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||ze(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const DK={tokenize:_K};function _K(e){const t=this,n=e.attempt(eu,r,e.attempt(this.parser.constructs.flowInitial,i,rt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Bq,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const LK={resolveAll:Wj()},zK=Uj("string"),FK=Uj("text");function Uj(e){return{resolveAll:Wj(e==="text"?$K:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(h){return d(h)?o(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),o(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const f=i[h];let g=-1;if(f)for(;++g<f.length;){const y=f[g];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Wj(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function $K(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,l=0,c;for(;o--;){const d=i[o];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(d===-2)c=!0,l++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const BK={42:Qn,43:Qn,45:Qn,48:Qn,49:Qn,50:Qn,51:Qn,52:Qn,53:Qn,54:Qn,55:Qn,56:Qn,57:Qn,62:Lj},VK={91:qq},HK={[-2]:Ag,[-1]:Ag,32:Ag},UK={35:Qq,42:Wd,45:[MS,Wd],60:nK,61:MS,95:Wd,96:NS,126:NS},WK={38:Fj,92:zj},qK={[-5]:jg,[-4]:jg,[-3]:jg,33:wK,38:Fj,42:Gy,60:[kq,cK],91:kK,92:[Jq,zj],93:Uv,95:Gy,96:Dq},KK={null:[Gy,LK]},GK={null:[42,95]},YK={null:[]},JK=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:GK,contentInitial:VK,disable:YK,document:BK,flow:UK,flowInitial:HK,insideSpan:KK,string:WK,text:qK},Symbol.toStringTag,{value:"Module"}));function XK(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],l=[];const c={attempt:D(I),check:D(j),consume:T,enter:N,exit:R,interrupt:D(j,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:v,parser:e,previous:null,sliceSerialize:g,sliceStream:y,write:f};let h=t.tokenize.call(d,c);return t.resolveAll&&o.push(t),d;function f(V){return s=Rr(s,V),S(),s[s.length-1]!==null?[]:(O(t,0),d.events=Bh(o,d.events,d),d.events)}function g(V,U){return ZK(y(V),U)}function y(V){return QK(s,V)}function v(){const{_bufferIndex:V,_index:U,line:Z,column:K,offset:W}=r;return{_bufferIndex:V,_index:U,line:Z,column:K,offset:W}}function w(V){i[V.line]=V.column,_()}function S(){let V;for(;r._index<s.length;){const U=s[r._index];if(typeof U=="string")for(V=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===V&&r._bufferIndex<U.length;)C(U.charCodeAt(r._bufferIndex));else C(U)}}function C(V){h=h(V)}function T(V){ze(V)?(r.line++,r.column=1,r.offset+=V===-3?2:1,_()):V!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=V}function N(V,U){const Z=U||{};return Z.type=V,Z.start=v(),d.events.push(["enter",Z,d]),l.push(Z),Z}function R(V){const U=l.pop();return U.end=v(),d.events.push(["exit",U,d]),U}function I(V,U){O(V,U.from)}function j(V,U){U.restore()}function D(V,U){return Z;function Z(K,W,X){let te,q,Y,A;return Array.isArray(K)?Q(K):"tokenize"in K?Q([K]):z(K);function z(re){return ne;function ne(oe){const me=oe!==null&&re[oe],Ce=oe!==null&&re.null,Ae=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return Q(Ae)(oe)}}function Q(re){return te=re,q=0,re.length===0?X:P(re[q])}function P(re){return ne;function ne(oe){return A=B(),Y=re,re.partial||(d.currentConstruct=re),re.name&&d.parser.constructs.disable.null.includes(re.name)?ue():re.tokenize.call(U?Object.assign(Object.create(d),U):d,c,fe,ue)(oe)}}function fe(re){return V(Y,A),W}function ue(re){return A.restore(),++q<te.length?P(te[q]):X}}}function O(V,U){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&mr(d.events,U,d.events.length-U,V.resolve(d.events.slice(U),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function B(){const V=v(),U=d.previous,Z=d.currentConstruct,K=d.events.length,W=Array.from(l);return{from:K,restore:X};function X(){r=V,d.previous=U,d.currentConstruct=Z,d.events.length=K,l=W,_()}}function _(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function QK(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function ZK(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
598
|
+
`;break}case-3:{s=`\r
|
|
599
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function eG(e){const r={constructs:Dj([JK,...(e||{}).extensions||[]]),content:i(mq),defined:[],document:i(yq),flow:i(DK),lazy:{},string:i(zK),text:i(FK)};return r;function i(o){return s;function s(l){return XK(r,o,l)}}}function tG(e){for(;!$j(e););return e}const AS=/[\0\t\n\r]/g;function nG(){let e=1,t="",n=!0,r;return i;function i(o,s,l){const c=[];let d,h,f,g,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(AS.lastIndex=f,d=AS.exec(o),g=d&&d.index!==void 0?d.index:o.length,y=o.charCodeAt(g),!d){t=o.slice(f);break}if(y===10&&f===g&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<g&&(c.push(o.slice(f,g)),e+=g-f),y){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const rG=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iG(e){return e.replace(rG,oG)}function oG(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return _j(n.slice(o?2:1),o?16:10)}return Hv(n)||e}const qj={}.hasOwnProperty;function sG(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),lG(n)(tG(eG(n).document().write(nG()(e,t,!0))))}function lG(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(pt),autolinkProtocol:B,autolinkEmail:B,atxHeading:o(_t),blockQuote:o(Ce),characterEscape:B,characterReference:B,codeFenced:o(Ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ae,s),codeText:o(Fe,s),codeTextData:B,data:B,codeFlowValue:B,definition:o(it),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(lt),hardBreakEscape:o(Mt),hardBreakTrailing:o(Mt),htmlFlow:o(dt,s),htmlFlowData:B,htmlText:o(dt,s),htmlTextData:B,image:o(ir),label:s,link:o(pt),listItem:o(dn),listItemValue:g,listOrdered:o(Dn,f),listUnordered:o(Dn),paragraph:o(kt),reference:P,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(_t),strong:o(xe),thematicBreak:o(tt)},exit:{atxHeading:c(),atxHeadingSequence:I,autolink:c(),autolinkEmail:me,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:re,characterReference:ne,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:v,codeFlowValue:_,codeIndented:c(C),codeText:c(W),codeTextData:_,data:_,definition:c(),definitionDestinationString:R,definitionLabelString:T,definitionTitleString:N,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(Z),htmlFlowData:_,htmlText:c(K),htmlTextData:_,image:c(te),label:Y,labelText:q,lineEnding:V,link:c(X),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:fe,resourceDestinationString:A,resourceTitleString:z,resource:Q,setextHeading:c(O),setextHeadingLineSequence:D,setextHeadingText:j,strong:c(),thematicBreak:c()}};Kj(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ee){let ge={type:"root",children:[]};const De={stack:[ge],tokenStack:[],config:t,enter:l,exit:d,buffer:s,resume:h,data:n},He=[];let We=-1;for(;++We<ee.length;)if(ee[We][1].type==="listOrdered"||ee[We][1].type==="listUnordered")if(ee[We][0]==="enter")He.push(We);else{const ie=He.pop();We=i(ee,ie,We)}for(We=-1;++We<ee.length;){const ie=t[ee[We][0]];qj.call(ie,ee[We][1].type)&&ie[ee[We][1].type].call(Object.assign({sliceSerialize:ee[We][2].sliceSerialize},De),ee[We][1])}if(De.tokenStack.length>0){const ie=De.tokenStack[De.tokenStack.length-1];(ie[1]||jS).call(De,void 0,ie[0])}for(ge.position={start:So(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:So(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<t.transforms.length;)ge=t.transforms[We](ge)||ge;return ge}function i(ee,ge,De){let He=ge-1,We=-1,ie=!1,qe,nt,Zt,yr;for(;++He<=De;){const Lt=ee[He];switch(Lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Lt[0]==="enter"?We++:We--,yr=void 0;break}case"lineEndingBlank":{Lt[0]==="enter"&&(qe&&!yr&&!We&&!Zt&&(Zt=He),yr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yr=void 0}if(!We&&Lt[0]==="enter"&&Lt[1].type==="listItemPrefix"||We===-1&&Lt[0]==="exit"&&(Lt[1].type==="listUnordered"||Lt[1].type==="listOrdered")){if(qe){let xr=He;for(nt=void 0;xr--;){const fn=ee[xr];if(fn[1].type==="lineEnding"||fn[1].type==="lineEndingBlank"){if(fn[0]==="exit")continue;nt&&(ee[nt][1].type="lineEndingBlank",ie=!0),fn[1].type="lineEnding",nt=xr}else if(!(fn[1].type==="linePrefix"||fn[1].type==="blockQuotePrefix"||fn[1].type==="blockQuotePrefixWhitespace"||fn[1].type==="blockQuoteMarker"||fn[1].type==="listItemIndent"))break}Zt&&(!nt||Zt<nt)&&(qe._spread=!0),qe.end=Object.assign({},nt?ee[nt][1].start:Lt[1].end),ee.splice(nt||He,0,["exit",qe,Lt[2]]),He++,De++}if(Lt[1].type==="listItemPrefix"){const xr={type:"listItem",_spread:!1,start:Object.assign({},Lt[1].start),end:void 0};qe=xr,ee.splice(He,0,["enter",xr,Lt[2]]),He++,De++,Zt=void 0,yr=!0}}}return ee[ge][1]._spread=ie,De}function o(ee,ge){return De;function De(He){l.call(this,ee(He),He),ge&&ge.call(this,He)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(ee,ge,De){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([ge,De||void 0]),ee.position={start:So(ge.start),end:void 0}}function c(ee){return ge;function ge(De){ee&&ee.call(this,De),d.call(this,De)}}function d(ee,ge){const De=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==ee.type&&(ge?ge.call(this,ee,He[0]):(He[1]||jS).call(this,ee,He[0]));else throw new Error("Cannot close `"+ee.type+"` ("+mc({start:ee.start,end:ee.end})+"): it’s not open");De.position.end=So(ee.end)}function h(){return Vv(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(ee){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ee}function v(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ee}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ee.replace(/(\r?\n|\r)$/g,"")}function T(ee){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=Zr(this.sliceSerialize(ee)).toLowerCase()}function N(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ee}function R(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ee}function I(ee){const ge=this.stack[this.stack.length-1];if(!ge.depth){const De=this.sliceSerialize(ee).length;ge.depth=De}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function D(ee){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function B(ee){const De=this.stack[this.stack.length-1].children;let He=De[De.length-1];(!He||He.type!=="text")&&(He=at(),He.position={start:So(ee.start),end:void 0},De.push(He)),this.stack.push(He)}function _(ee){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ee),ge.position.end=So(ee.end)}function V(ee){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ge.children[ge.children.length-1];De.position.end=So(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(B.call(this,ee),_.call(this,ee))}function U(){this.data.atHardBreak=!0}function Z(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ee}function K(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ee}function W(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ee}function X(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ge,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function te(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ge,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function q(ee){const ge=this.sliceSerialize(ee),De=this.stack[this.stack.length-2];De.label=iG(ge),De.identifier=Zr(ge).toLowerCase()}function Y(){const ee=this.stack[this.stack.length-1],ge=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const He=ee.children;De.children=He}else De.alt=ge}function A(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ee}function z(){const ee=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ee}function Q(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function fe(ee){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=Zr(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function ue(ee){this.data.characterReferenceType=ee.type}function re(ee){const ge=this.sliceSerialize(ee),De=this.data.characterReferenceType;let He;De?(He=_j(ge,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=Hv(ge);const We=this.stack[this.stack.length-1];We.value+=He}function ne(ee){const ge=this.stack.pop();ge.position.end=So(ee.end)}function oe(ee){_.call(this,ee);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ee)}function me(ee){_.call(this,ee);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ee)}function Ce(){return{type:"blockquote",children:[]}}function Ae(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function it(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function lt(){return{type:"emphasis",children:[]}}function _t(){return{type:"heading",depth:0,children:[]}}function Mt(){return{type:"break"}}function dt(){return{type:"html",value:""}}function ir(){return{type:"image",title:null,url:"",alt:null}}function pt(){return{type:"link",title:null,url:"",children:[]}}function Dn(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function dn(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function kt(){return{type:"paragraph",children:[]}}function xe(){return{type:"strong",children:[]}}function at(){return{type:"text",value:""}}function tt(){return{type:"thematicBreak"}}}function So(e){return{line:e.line,column:e.column,offset:e.offset}}function Kj(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Kj(e,r):aG(e,r)}}function aG(e,t){let n;for(n in t)if(qj.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function jS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mc({start:t.start,end:t.end})+") is still open")}function cG(e){const t=this;t.parser=n;function n(r){return sG(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uG(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function dG(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
600
|
+
`}]}function fG(e,t){const n=t.value?t.value+`
|
|
601
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function hG(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pG(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mG(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ea(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function gG(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yG(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gj(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function xG(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gj(e,t);const i={src:ea(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function vG(e,t){const n={src:ea(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function wG(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function bG(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gj(e,t);const i={href:ea(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function kG(e,t){const n={href:ea(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SG(e,t,n){const r=e.all(t),i=n?CG(n):Yj(t),o={},s=[];if(typeof t.checked=="boolean"){const h=r[0];let f;h&&h.type==="element"&&h.tagName==="p"?f=h:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const h=r[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&s.push({type:"text",value:`
|
|
602
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?s.push(...h.children):s.push(h)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
|
|
603
|
+
`});const d={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,d),e.applyData(t,d)}function CG(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Yj(n[r])}return t}function Yj(e){const t=e.spread;return t??e.children.length>1}function EG(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function NG(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TG(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function MG(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AG(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=zv(t.children[1]),c=Mj(t.children[t.children.length-1]);l&&c&&(s.position={start:l,end:c}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function jG(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let c=-1;const d=[];for(;++c<l;){const f=t.children[c],g={},y=s?s[c]:void 0;y&&(g.align=y);let v={type:"element",tagName:o,properties:g,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),d.push(v)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,h),e.applyData(t,h)}function RG(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const RS=9,PS=32;function PG(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(OS(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(OS(t.slice(i),i>0,!1)),o.join("")}function OS(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===RS||o===PS;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===RS||o===PS;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function OG(e,t){const n={type:"text",value:PG(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function IG(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const DG={blockquote:uG,break:dG,code:fG,delete:hG,emphasis:pG,footnoteReference:mG,heading:gG,html:yG,imageReference:xG,image:vG,inlineCode:wG,linkReference:bG,link:kG,listItem:SG,list:EG,paragraph:NG,root:TG,strong:MG,table:AG,tableCell:RG,tableRow:jG,text:OG,thematicBreak:IG,toml:Od,yaml:Od,definition:Od,footnoteDefinition:Od};function Od(){}const Jj=-1,Vh=0,yc=1,Qf=2,Wv=3,qv=4,Kv=5,Gv=6,Xj=7,Qj=8,_G=typeof self=="object"?self:globalThis,IS=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new _G[e](t)},LG=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Vh:case Jj:return n(s,i);case yc:{const l=n([],i);for(const c of s)l.push(r(c));return l}case Qf:{const l=n({},i);for(const[c,d]of s)l[r(c)]=r(d);return l}case Wv:return n(new Date(s),i);case qv:{const{source:l,flags:c}=s;return n(new RegExp(l,c),i)}case Kv:{const l=n(new Map,i);for(const[c,d]of s)l.set(r(c),r(d));return l}case Gv:{const l=n(new Set,i);for(const c of s)l.add(r(c));return l}case Xj:{const{name:l,message:c}=s;return n(IS(l,c),i)}case Qj:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(IS(o,s),i)};return r},DS=e=>LG(new Map,e)(0),kl="",{toString:zG}={},{keys:FG}=Object,Ka=e=>{const t=typeof e;if(t!=="object"||!e)return[Vh,t];const n=zG.call(e).slice(8,-1);switch(n){case"Array":return[yc,kl];case"Object":return[Qf,kl];case"Date":return[Wv,kl];case"RegExp":return[qv,kl];case"Map":return[Kv,kl];case"Set":return[Gv,kl];case"DataView":return[yc,n]}return n.includes("Array")?[yc,n]:n.includes("Error")?[Xj,n]:[Qf,n]},Id=([e,t])=>e===Vh&&(t==="function"||t==="symbol"),$G=(e,t,n,r)=>{const i=(s,l)=>{const c=r.push(s)-1;return n.set(l,c),c},o=s=>{if(n.has(s))return n.get(s);let[l,c]=Ka(s);switch(l){case Vh:{let h=s;switch(c){case"bigint":l=Qj,h=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return i([Jj],s)}return i([l,h],s)}case yc:{if(c){let g=s;return c==="DataView"?g=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(s)),i([c,[...g]],s)}const h=[],f=i([l,h],s);for(const g of s)h.push(o(g));return f}case Qf:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const h=[],f=i([l,h],s);for(const g of FG(s))(e||!Id(Ka(s[g])))&&h.push([o(g),o(s[g])]);return f}case Wv:return i([l,s.toISOString()],s);case qv:{const{source:h,flags:f}=s;return i([l,{source:h,flags:f}],s)}case Kv:{const h=[],f=i([l,h],s);for(const[g,y]of s)(e||!(Id(Ka(g))||Id(Ka(y))))&&h.push([o(g),o(y)]);return f}case Gv:{const h=[],f=i([l,h],s);for(const g of s)(e||!Id(Ka(g)))&&h.push(o(g));return f}}const{message:d}=s;return i([l,{name:c,message:d}],s)};return o},_S=(e,{json:t,lossy:n}={})=>{const r=[];return $G(!(t||n),!!t,new Map,r)(e),r},Zf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?DS(_S(e,t)):structuredClone(e):(e,t)=>DS(_S(e,t));function BG(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function VG(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function HG(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||BG,r=e.options.footnoteBackLabel||VG,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const h=e.all(d),f=String(d.identifier).toUpperCase(),g=ea(f.toLowerCase());let y=0;const v=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++y<=w;){v.length>0&&v.push({type:"text",value:" "});let T=typeof n=="string"?n:n(c,y);typeof T=="string"&&(T={type:"text",value:T}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,y),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const T=S.children[S.children.length-1];T&&T.type==="text"?T.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...v)}else h.push(...v);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(h,!0)};e.patch(d,C),l.push(C)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Zf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
604
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
605
|
+
`}]}}const Hh=(function(e){if(e==null)return KG;if(typeof e=="function")return Uh(e);if(typeof e=="object")return Array.isArray(e)?UG(e):WG(e);if(typeof e=="string")return qG(e);throw new Error("Expected function, string, or object as test")});function UG(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Hh(e[n]);return Uh(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function WG(e){const t=e;return Uh(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function qG(e){return Uh(t);function t(n){return n&&n.type===e}}function Uh(e){return t;function t(n,r,i){return!!(GG(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function KG(){return!0}function GG(e){return e!==null&&typeof e=="object"&&"type"in e}const Zj=[],YG=!0,Yy=!1,JG="skip";function eR(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Hh(i),s=r?-1:1;l(e,void 0,[])();function l(c,d,h){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const y=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(y?"<"+y+">":""))+")"})}return g;function g(){let y=Zj,v,w,S;if((!t||o(c,d,h[h.length-1]||void 0))&&(y=XG(n(c,h)),y[0]===Yy))return y;if("children"in c&&c.children){const C=c;if(C.children&&y[0]!==JG)for(w=(r?C.children.length:-1)+s,S=h.concat(C);w>-1&&w<C.children.length;){const T=C.children[w];if(v=l(T,w,S)(),v[0]===Yy)return v;w=typeof v[1]=="number"?v[1]:w+s}}return y}}}function XG(e){return Array.isArray(e)?e:typeof e=="number"?[YG,e]:e==null?Zj:[e]}function Wh(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),eR(e,o,l,i);function l(c,d){const h=d[d.length-1],f=h?h.children.indexOf(c):void 0;return s(c,f,h)}}const Jy={}.hasOwnProperty,QG={};function ZG(e,t){const n=t||QG,r=new Map,i=new Map,o=new Map,s={...DG,...n.handlers},l={all:d,applyData:tY,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:c,options:n,patch:eY,wrap:rY};return Wh(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const f=h.type==="definition"?r:i,g=String(h.identifier).toUpperCase();f.has(g)||f.set(g,h)}}),l;function c(h,f){const g=h.type,y=l.handlers[g];if(Jy.call(l.handlers,g)&&y)return y(l,h,f);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in h){const{children:w,...S}=h,C=Zf(S);return C.children=l.all(h),C}return Zf(h)}return(l.options.unknownHandler||nY)(l,h,f)}function d(h){const f=[];if("children"in h){const g=h.children;let y=-1;for(;++y<g.length;){const v=l.one(g[y],h);if(v){if(y&&g[y-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=LS(v.value)),!Array.isArray(v)&&v.type==="element")){const w=v.children[0];w&&w.type==="text"&&(w.value=LS(w.value))}Array.isArray(v)?f.push(...v):f.push(v)}}}return f}}function eY(e,t){e.position&&(t.position=BW(e))}function tY(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Zf(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function nY(e,t){const n=t.data||{},r="value"in t&&!(Jy.call(n,"hProperties")||Jy.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rY(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
606
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
607
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
608
|
+
`}),n}function LS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function zS(e,t){const n=ZG(e,t),r=n.one(e,void 0),i=HG(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
609
|
+
`},i),o}function iY(e,t){return e&&"run"in e?async function(n,r){const i=zS(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zS(n,{file:r,...e||t})}}function FS(e){if(e)throw e}var Rg,$S;function oY(){if($S)return Rg;$S=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var h=e.call(d,"constructor"),f=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!f)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},s=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},l=function(d,h){if(h==="__proto__")if(e.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return Rg=function c(){var d,h,f,g,y,v,w=arguments[0],S=1,C=arguments.length,T=!1;for(typeof w=="boolean"&&(T=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<C;++S)if(d=arguments[S],d!=null)for(h in d)f=l(w,h),g=l(d,h),w!==g&&(T&&g&&(o(g)||(y=i(g)))?(y?(y=!1,v=f&&i(f)?f:[]):v=f&&o(f)?f:{},s(w,{name:h,newValue:c(T,v,g)})):typeof g<"u"&&s(w,{name:h,newValue:g}));return w},Rg}var sY=oY();const Pg=_c(sY);function Xy(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function lY(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(c,...d){const h=e[++o];let f=-1;if(c){s(c);return}for(;++f<i.length;)(d[f]===null||d[f]===void 0)&&(d[f]=i[f]);i=d,h?aY(h,l)(...d):s(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function aY(e,t){let n;return r;function r(...s){const l=e.length>s.length;let c;l&&s.push(i);try{c=e.apply(this,s)}catch(d){const h=d;if(l&&n)throw h;return i(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(o,i):c instanceof Error?i(c):o(c))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const hi={basename:cY,dirname:uY,extname:dY,join:fY,sep:"/"};function cY(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');tu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function uY(e){if(tu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function dY(e){tu(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function fY(...e){let t=-1,n;for(;++t<e.length;)tu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":hY(n)}function hY(e){tu(e);const t=e.codePointAt(0)===47;let n=pY(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pY(e,t){let n="",r=0,i=-1,o=0,s=-1,l,c;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return n}function tu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mY={cwd:gY};function gY(){return"/"}function Qy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function yY(e){if(typeof e=="string")e=new URL(e);else if(!Qy(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xY(e)}function xY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Og=["history","path","basename","stem","extname","dirname"];class tR{constructor(t){let n;t?Qy(t)?n={path:t}:typeof t=="string"||vY(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":mY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Og.length;){const o=Og[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Og.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?hi.basename(this.path):void 0}set basename(t){Dg(t,"basename"),Ig(t,"basename"),this.path=hi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?hi.dirname(this.path):void 0}set dirname(t){BS(this.basename,"dirname"),this.path=hi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?hi.extname(this.path):void 0}set extname(t){if(Ig(t,"extname"),BS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=hi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Qy(t)&&(t=yY(t)),Dg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?hi.basename(this.path,this.extname):void 0}set stem(t){Dg(t,"stem"),Ig(t,"stem"),this.path=hi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new In(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ig(e,t){if(e&&e.includes(hi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+hi.sep+"`")}function Dg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function BS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wY=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),bY={}.hasOwnProperty;class Yv extends wY{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=lY()}copy(){const t=new Yv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Pg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zg("data",this.frozen),this.namespace[t]=n,this):bY.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Dd(t),r=this.parser||this.Parser;return _g("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),_g("process",this.parser||this.Parser),Lg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const l=Dd(t),c=r.parse(l);r.run(c,l,function(h,f,g){if(h||!f||!g)return d(h);const y=f,v=r.stringify(y,g);CY(v)?g.value=v:g.result=v,d(h,g)});function d(h,f){h||!f?s(h):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),_g("processSync",this.parser||this.Parser),Lg("processSync",this.compiler||this.Compiler),this.process(t,i),HS("processSync","process",n),r;function i(o,s){n=!0,FS(o),r=s}}run(t,n,r){VS(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,l){const c=Dd(n);i.run(t,c,d);function d(h,f,g){const y=f||t;h?l(h):s?s(y):r(void 0,y,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),HS("runSync","run",r),i;function o(s,l){FS(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=Dd(n),i=this.compiler||this.Compiler;return Lg("stringify",i),VS(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(zg("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[h,...f]=d;c(h,f)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(i.settings=Pg(!0,i.settings,d.settings))}function l(d){let h=-1;if(d!=null)if(Array.isArray(d))for(;++h<d.length;){const f=d[h];o(f)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,h){let f=-1,g=-1;for(;++f<r.length;)if(r[f][0]===d){g=f;break}if(g===-1)r.push([d,...h]);else if(h.length>0){let[y,...v]=h;const w=r[g][1];Xy(w)&&Xy(y)&&(y=Pg(!0,w,y)),r[g]=[d,y,...v]}}}}const kY=new Yv().freeze();function _g(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function VS(e){if(!Xy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function HS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dd(e){return SY(e)?e:new tR(e)}function SY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function CY(e){return typeof e=="string"||EY(e)}function EY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",US=[],WS={allowDangerousHtml:!0},TY=/^(https?|ircs?|mailto|xmpp)$/i,MY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function AY(e){const t=jY(e),n=RY(e);return PY(t.runSync(t.parse(n),n),e)}function jY(e){const t=e.rehypePlugins||US,n=e.remarkPlugins||US,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...WS}:WS;return kY().use(cG).use(n).use(iY,r).use(t)}function RY(e){const t=e.children||"",n=new tR;return typeof t=="string"&&(n.value=t),n}function PY(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||OY;for(const h of MY)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+NY+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Wh(e,d),qW(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function d(h,f,g){if(h.type==="raw"&&g&&typeof f=="number")return s?g.children.splice(f,1):g.children[f]={type:"text",value:h.value},f;if(h.type==="element"){let y;for(y in Mg)if(Object.hasOwn(Mg,y)&&Object.hasOwn(h.properties,y)){const v=h.properties[y],w=Mg[y];(w===null||w.includes(h.tagName))&&(h.properties[y]=c(String(v||""),y,h))}}if(h.type==="element"){let y=n?!n.includes(h.tagName):o?o.includes(h.tagName):!1;if(!y&&r&&typeof f=="number"&&(y=!r(h,f,g)),y&&g&&typeof f=="number")return l&&h.children?g.children.splice(f,1,...h.children):g.children.splice(f,1),f}}}function OY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||TY.test(e.slice(0,t))?e:""}function qS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function IY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function DY(e,t,n){const i=Hh((n||{}).ignore||[]),o=_Y(t);let s=-1;for(;++s<o.length;)eR(e,"text",l);function l(d,h){let f=-1,g;for(;++f<h.length;){const y=h[f],v=g?g.children:void 0;if(i(y,v?v.indexOf(y):void 0,g))return;g=y}if(g)return c(d,h)}function c(d,h){const f=h[h.length-1],g=o[s][0],y=o[s][1];let v=0;const S=f.children.indexOf(d);let C=!1,T=[];g.lastIndex=0;let N=g.exec(d.value);for(;N;){const R=N.index,I={index:N.index,input:N.input,stack:[...h,d]};let j=y(...N,I);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?g.lastIndex=R+1:(v!==R&&T.push({type:"text",value:d.value.slice(v,R)}),Array.isArray(j)?T.push(...j):j&&T.push(j),v=R+N[0].length,C=!0),!g.global)break;N=g.exec(d.value)}return C?(v<d.value.length&&T.push({type:"text",value:d.value.slice(v)}),f.children.splice(S,1,...T)):T=[d],S+T.length}}function _Y(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([LY(i[0]),zY(i[1])])}return t}function LY(e){return typeof e=="string"?new RegExp(IY(e),"g"):e}function zY(e){return typeof e=="function"?e:function(){return e}}const Fg="phrasing",$g=["autolink","link","image","label"];function FY(){return{transforms:[qY],enter:{literalAutolink:BY,literalAutolinkEmail:Bg,literalAutolinkHttp:Bg,literalAutolinkWww:Bg},exit:{literalAutolink:WY,literalAutolinkEmail:UY,literalAutolinkHttp:VY,literalAutolinkWww:HY}}}function $Y(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fg,notInConstruct:$g},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fg,notInConstruct:$g},{character:":",before:"[ps]",after:"\\/",inConstruct:Fg,notInConstruct:$g}]}}function BY(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Bg(e){this.config.enter.autolinkProtocol.call(this,e)}function VY(e){this.config.exit.autolinkProtocol.call(this,e)}function HY(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function UY(e){this.config.exit.autolinkEmail.call(this,e)}function WY(e){this.exit(e)}function qY(e){DY(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,KY],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),GY]],{ignore:["link","linkReference"]})}function KY(e,t,n,r,i){let o="";if(!nR(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!YY(n)))return!1;const s=JY(n+r);if(!s[0])return!1;const l={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function GY(e,t,n,r){return!nR(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function YY(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function JY(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=qS(e,"(");let o=qS(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function nR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ls(n)||$h(n))&&(!t||n!==47)}rR.peek=oJ;function XY(){this.buffer()}function QY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ZY(){this.buffer()}function eJ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function tJ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nJ(e){this.exit(e)}function rJ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iJ(e){this.exit(e)}function oJ(){return"["}function rR(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),l=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),l(),s(),o+=i.move("]"),o}function sJ(){return{enter:{gfmFootnoteCallString:XY,gfmFootnoteCall:QY,gfmFootnoteDefinitionLabelString:ZY,gfmFootnoteDefinition:eJ},exit:{gfmFootnoteCallString:tJ,gfmFootnoteCall:nJ,gfmFootnoteDefinitionLabelString:rJ,gfmFootnoteDefinition:iJ}}}function lJ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:rR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const l=o.createTracker(s);let c=l.move("[^");const d=o.enter("footnoteDefinition"),h=o.enter("label");return c+=l.move(o.safe(o.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
|
|
610
|
+
`:" ")+o.indentLines(o.containerFlow(r,l.current()),t?iR:aJ))),d(),c}}function aJ(e,t,n){return t===0?e:iR(e,t,n)}function iR(e,t,n){return(n?"":" ")+e}const cJ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];oR.peek=pJ;function uJ(){return{canContainEols:["delete"],enter:{strikethrough:fJ},exit:{strikethrough:hJ}}}function dJ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:cJ}],handlers:{delete:oR}}}function fJ(e){this.enter({type:"delete",children:[]},e)}function hJ(e){this.exit(e)}function oR(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function pJ(){return"~"}function mJ(e){return e.length}function gJ(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||mJ,o=[],s=[],l=[],c=[];let d=0,h=-1;for(;++h<e.length;){const w=[],S=[];let C=-1;for(e[h].length>d&&(d=e[h].length);++C<e[h].length;){const T=yJ(e[h][C]);if(n.alignDelimiters!==!1){const N=i(T);S[C]=N,(c[C]===void 0||N>c[C])&&(c[C]=N)}w.push(T)}s[h]=w,l[h]=S}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<d;)o[f]=KS(r[f]);else{const w=KS(r);for(;++f<d;)o[f]=w}f=-1;const g=[],y=[];for(;++f<d;){const w=o[f];let S="",C="";w===99?(S=":",C=":"):w===108?S=":":w===114&&(C=":");let T=n.alignDelimiters===!1?1:Math.max(1,c[f]-S.length-C.length);const N=S+"-".repeat(T)+C;n.alignDelimiters!==!1&&(T=S.length+T+C.length,T>c[f]&&(c[f]=T),y[f]=T),g[f]=N}s.splice(1,0,g),l.splice(1,0,y),h=-1;const v=[];for(;++h<s.length;){const w=s[h],S=l[h];f=-1;const C=[];for(;++f<d;){const T=w[f]||"";let N="",R="";if(n.alignDelimiters!==!1){const I=c[f]-(S[f]||0),j=o[f];j===114?N=" ".repeat(I):j===99?I%2?(N=" ".repeat(I/2+.5),R=" ".repeat(I/2-.5)):(N=" ".repeat(I/2),R=N):R=" ".repeat(I)}n.delimiterStart!==!1&&!f&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||f)&&C.push(" "),n.alignDelimiters!==!1&&C.push(N),C.push(T),n.alignDelimiters!==!1&&C.push(R),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||f!==d-1)&&C.push("|")}v.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return v.join(`
|
|
611
|
+
`)}function yJ(e){return e==null?"":String(e)}function KS(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function xJ(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),vJ);return i(),s}function vJ(e,t,n){return">"+(n?"":" ")+e}function wJ(e,t){return GS(e,t.inConstruct,!0)&&!GS(e,t.notInConstruct,!1)}function GS(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function YS(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
612
|
+
`&&wJ(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
613
|
+
`}function bJ(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function kJ(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function SJ(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function CJ(e,t,n,r){const i=SJ(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(kJ(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(o,EJ);return f(),g}const l=n.createTracker(r),c=i.repeat(Math.max(bJ(o,i)+1,3)),d=n.enter("codeFenced");let h=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${s}`);h+=l.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);h+=l.move(" "),h+=l.move(n.safe(e.meta,{before:h,after:`
|
|
614
|
+
`,encode:["`"],...l.current()})),f()}return h+=l.move(`
|
|
615
|
+
`),o&&(h+=l.move(o+`
|
|
616
|
+
`)),h+=l.move(c),d(),h}function EJ(e,t,n){return(n?"":" ")+e}function Jv(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function NJ(e,t,n,r){const i=Jv(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
617
|
+
`,...c.current()}))),l(),e.title&&(l=n.enter(`title${o}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),s(),d}function TJ(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Dc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function eh(e,t,n){const r=Kl(e),i=Kl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}sR.peek=MJ;function sR(e,t,n,r){const i=TJ(n),o=n.enter("emphasis"),s=n.createTracker(r),l=s.move(i);let c=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const d=c.charCodeAt(0),h=eh(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(c=Dc(d)+c.slice(1));const f=c.charCodeAt(c.length-1),g=eh(r.after.charCodeAt(0),f,i);g.inside&&(c=c.slice(0,-1)+Dc(f));const y=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+y}function MJ(e,t,n){return n.options.emphasis||"*"}function AJ(e,t){let n=!1;return Wh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Yy}),!!((!e.depth||e.depth<3)&&Vv(e)&&(t.options.setext||n))}function jJ(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(AJ(e,n)){const h=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...o.current(),before:`
|
|
618
|
+
`,after:`
|
|
619
|
+
`});return f(),h(),g+`
|
|
620
|
+
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
|
|
621
|
+
`))+1))}const s="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
622
|
+
`,...o.current()});return/^[\t ]/.test(d)&&(d=Dc(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),c(),l(),d}lR.peek=RJ;function lR(e){return e.value||""}function RJ(){return"<"}aR.peek=PJ;function aR(e,t,n,r){const i=Jv(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${o}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),d+=c.move(")"),s(),d}function PJ(){return"!"}cR.peek=OJ;function cR(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return s(),n.stack=h,o(),i==="full"||!d||d!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function OJ(){return"!"}uR.peek=IJ;function uR(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],l=n.compilePattern(s);let c;if(s.atBreak)for(;c=l.exec(r);){let d=c.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(c.index+1)}}return i+r+i}function IJ(){return"`"}function dR(e,t){const n=Vv(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}fR.peek=DJ;function fR(e,t,n,r){const i=Jv(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let l,c;if(dR(e,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),l(),n.stack=h,f}l=n.enter("link"),c=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(c=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),c()),d+=s.move(")"),l(),d}function DJ(e,t,n){return dR(e,n)?"<":"["}hR.peek=_J;function hR(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return s(),n.stack=h,o(),i==="full"||!d||d!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function _J(){return"["}function Xv(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function LJ(e){const t=Xv(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function zJ(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function pR(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function FJ(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?zJ(n):Xv(n);const l=e.ordered?s==="."?")":".":LJ(n);let c=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),pR(n)===s&&h){let f=-1;for(;++f<e.children.length;){const g=e.children[f];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(s=l),n.bulletCurrent=s;const d=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),d}function $J(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function BJ(e,t,n,r){const i=$J(n);let o=n.bulletCurrent||Xv(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const l=n.createTracker(r);l.move(o+" ".repeat(s-o.length)),l.shift(s);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),h);return c(),d;function h(f,g,y){return g?(y?"":" ".repeat(s))+f:(y?o:o+" ".repeat(s-o.length))+f}}function VJ(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const HJ=Hh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function UJ(e,t,n,r){return(e.children.some(function(s){return HJ(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function WJ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}mR.peek=qJ;function mR(e,t,n,r){const i=WJ(n),o=n.enter("strong"),s=n.createTracker(r),l=s.move(i+i);let c=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const d=c.charCodeAt(0),h=eh(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(c=Dc(d)+c.slice(1));const f=c.charCodeAt(c.length-1),g=eh(r.after.charCodeAt(0),f,i);g.inside&&(c=c.slice(0,-1)+Dc(f));const y=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+y}function qJ(e,t,n){return n.options.strong||"*"}function KJ(e,t,n,r){return n.safe(e.value,r)}function GJ(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function YJ(e,t,n){const r=(pR(n)+(n.options.ruleSpaces?" ":"")).repeat(GJ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const gR={blockquote:xJ,break:YS,code:CJ,definition:NJ,emphasis:sR,hardBreak:YS,heading:jJ,html:lR,image:aR,imageReference:cR,inlineCode:uR,link:fR,linkReference:hR,list:FJ,listItem:BJ,paragraph:VJ,root:UJ,strong:mR,text:KJ,thematicBreak:YJ};function JJ(){return{enter:{table:XJ,tableData:JS,tableHeader:JS,tableRow:ZJ},exit:{codeText:eX,table:QJ,tableData:Vg,tableHeader:Vg,tableRow:Vg}}}function XJ(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function QJ(e){this.exit(e),this.data.inTable=void 0}function ZJ(e){this.enter({type:"tableRow",children:[]},e)}function Vg(e){this.exit(e)}function JS(e){this.enter({type:"tableCell",children:[]},e)}function eX(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,tX));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function tX(e,t){return t==="|"?t:e}function nX(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
623
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:s,tableCell:c,tableRow:l}};function s(y,v,w,S){return d(h(y,w,S),y.align)}function l(y,v,w,S){const C=f(y,w,S),T=d([C]);return T.slice(0,T.indexOf(`
|
|
624
|
+
`))}function c(y,v,w,S){const C=w.enter("tableCell"),T=w.enter("phrasing"),N=w.containerPhrasing(y,{...S,before:o,after:o});return T(),C(),N}function d(y,v){return gJ(y,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function h(y,v,w){const S=y.children;let C=-1;const T=[],N=v.enter("table");for(;++C<S.length;)T[C]=f(S[C],v,w);return N(),T}function f(y,v,w){const S=y.children;let C=-1;const T=[],N=v.enter("tableRow");for(;++C<S.length;)T[C]=c(S[C],y,v,w);return N(),T}function g(y,v,w){let S=gR.inlineCode(y,v,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function rX(){return{exit:{taskListCheckValueChecked:XS,taskListCheckValueUnchecked:XS,paragraph:oX}}}function iX(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:sX}}}function XS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function oX(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const l=i[o];if(l.type==="paragraph"){s=l;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function sX(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);o&&l.move(s);let c=gR.listItem(e,t,n,{...r,...l.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(h){return h+s}}function lX(){return[FY(),sJ(),uJ(),JJ(),rX()]}function aX(e){return{extensions:[$Y(),lJ(e),dJ(),nX(e),iX()]}}const cX={tokenize:mX,partial:!0},yR={tokenize:gX,partial:!0},xR={tokenize:yX,partial:!0},vR={tokenize:xX,partial:!0},uX={tokenize:vX,partial:!0},wR={name:"wwwAutolink",tokenize:hX,previous:kR},bR={name:"protocolAutolink",tokenize:pX,previous:SR},Yi={name:"emailAutolink",tokenize:fX,previous:CR},bi={};function dX(){return{text:bi}}let gs=48;for(;gs<123;)bi[gs]=Yi,gs++,gs===58?gs=65:gs===91&&(gs=97);bi[43]=Yi;bi[45]=Yi;bi[46]=Yi;bi[95]=Yi;bi[72]=[Yi,bR];bi[104]=[Yi,bR];bi[87]=[Yi,wR];bi[119]=[Yi,wR];function fX(e,t,n){const r=this;let i,o;return s;function s(f){return!Zy(f)||!CR.call(r,r.previous)||Qv(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return Zy(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(uX,h,d)(f):f===45||f===95||jn(f)?(o=!0,e.consume(f),c):h(f)}function d(f){return e.consume(f),i=!0,c}function h(f){return o&&i&&Fn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function hX(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!kR.call(r,r.previous)||Qv(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(cX,e.attempt(yR,e.attempt(xR,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function pX(e,t,n){const r=this;let i="",o=!1;return s;function s(f){return(f===72||f===104)&&SR.call(r,r.previous)&&!Qv(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(Fn(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),o?d:(o=!0,c)):n(f)}function d(f){return f===null||Xf(f)||ht(f)||Ls(f)||$h(f)?n(f):e.attempt(yR,e.attempt(xR,h),n)(f)}function h(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function mX(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function gX(e,t,n){let r,i,o;return s;function s(d){return d===46||d===95?e.check(vR,c,l)(d):d===null||ht(d)||Ls(d)||d!==45&&$h(d)?c(d):(o=!0,e.consume(d),s)}function l(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),s}function c(d){return i||r||!o?n(d):t(d)}}function yX(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(vR,t,o)(s):s===null||ht(s)||Ls(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function xX(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),o):l===93?(e.consume(l),i):l===60||l===null||ht(l)||Ls(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||ht(l)||Ls(l)?t(l):r(l)}function o(l){return Fn(l)?s(l):n(l)}function s(l){return l===59?(e.consume(l),r):Fn(l)?(e.consume(l),s):n(l)}}function vX(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return jn(o)?n(o):t(o)}}function kR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function SR(e){return!Fn(e)}function CR(e){return!(e===47||Zy(e))}function Zy(e){return e===43||e===45||e===46||e===95||jn(e)}function Qv(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const wX={tokenize:MX,partial:!0};function bX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:EX,continuation:{tokenize:NX},exit:TX}},text:{91:{name:"gfmFootnoteCall",tokenize:CX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kX,resolveTo:SX}}}}function kX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!s||!s._balanced)return n(c);const d=Zr(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function SX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function CX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(o>999||f===93&&!s||f===null||f===91||ht(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Zr(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ht(f)||(s=!0),o++,e.consume(f),f===92?h:d}function h(f){return f===91||f===92||f===93?(e.consume(f),o++,d):d(f)}}function EX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,l;return c;function c(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(v)}function h(v){if(s>999||v===93&&!l||v===null||v===91||ht(v))return n(v);if(v===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=Zr(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return ht(v)||(l=!0),s++,e.consume(v),v===92?f:h}function f(v){return v===91||v===92||v===93?(e.consume(v),s++,h):h(v)}function g(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(o)||i.push(o),rt(e,y,"gfmFootnoteDefinitionWhitespace")):n(v)}function y(v){return t(v)}}function NX(e,t,n){return e.check(eu,t,e.attempt(wX,t,n))}function TX(e){e.exit("gfmFootnoteDefinition")}function MX(e,t,n){const r=this;return rt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function AX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,l){let c=-1;for(;++c<s.length;)if(s[c][0]==="enter"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._close){let d=c;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[c][1].end.offset-s[c][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[c][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[c][1].end)},f={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[c][1].start)},g=[["enter",h,l],["enter",s[d][1],l],["exit",s[d][1],l],["enter",f,l]],y=l.parser.constructs.insideSpan.null;y&&mr(g,g.length,0,Bh(y,s.slice(d+1,c),l)),mr(g,g.length,0,[["exit",f,l],["enter",s[c][1],l],["exit",s[c][1],l],["exit",h,l]]),mr(s,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<s.length;)s[c][1].type==="strikethroughSequenceTemporary"&&(s[c][1].type="data");return s}function o(s,l,c){const d=this.previous,h=this.events;let f=0;return g;function g(v){return d===126&&h[h.length-1][1].type!=="characterEscape"?c(v):(s.enter("strikethroughSequenceTemporary"),y(v))}function y(v){const w=Kl(d);if(v===126)return f>1?c(v):(s.consume(v),f++,y);if(f<2&&!n)return c(v);const S=s.exit("strikethroughSequenceTemporary"),C=Kl(v);return S._open=!C||C===2&&!!w,S._close=!w||w===2&&!!C,l(v)}}}class jX{constructor(){this.map=[]}add(t,n,r){RX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function RX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function PX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function OX(){return{flow:{null:{name:"table",tokenize:IX,resolveAll:DX}}}}function IX(e,t,n){const r=this;let i=0,o=0,s;return l;function l(_){let V=r.events.length-1;for(;V>-1;){const K=r.events[V][1].type;if(K==="lineEnding"||K==="linePrefix")V--;else break}const U=V>-1?r.events[V][1].type:null,Z=U==="tableHead"||U==="tableRow"?j:c;return Z===j&&r.parser.lazy[r.now().line]?n(_):Z(_)}function c(_){return e.enter("tableHead"),e.enter("tableRow"),d(_)}function d(_){return _===124||(s=!0,o+=1),h(_)}function h(_){return _===null?n(_):ze(_)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),y):n(_):Ze(_)?rt(e,h,"whitespace")(_):(o+=1,s&&(s=!1,i+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),s=!0,h):(e.enter("data"),f(_)))}function f(_){return _===null||_===124||ht(_)?(e.exit("data"),h(_)):(e.consume(_),_===92?g:f)}function g(_){return _===92||_===124?(e.consume(_),f):f(_)}function y(_){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(_):(e.enter("tableDelimiterRow"),s=!1,Ze(_)?rt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):v(_))}function v(_){return _===45||_===58?S(_):_===124?(s=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),w):I(_)}function w(_){return Ze(_)?rt(e,S,"whitespace")(_):S(_)}function S(_){return _===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),C):_===45?(o+=1,C(_)):_===null||ze(_)?R(_):I(_)}function C(_){return _===45?(e.enter("tableDelimiterFiller"),T(_)):I(_)}function T(_){return _===45?(e.consume(_),T):_===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(_))}function N(_){return Ze(_)?rt(e,R,"whitespace")(_):R(_)}function R(_){return _===124?v(_):_===null||ze(_)?!s||i!==o?I(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):I(_)}function I(_){return n(_)}function j(_){return e.enter("tableRow"),D(_)}function D(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),D):_===null||ze(_)?(e.exit("tableRow"),t(_)):Ze(_)?rt(e,D,"whitespace")(_):(e.enter("data"),O(_))}function O(_){return _===null||_===124||ht(_)?(e.exit("data"),D(_)):(e.consume(_),_===92?B:O)}function B(_){return _===92||_===124?(e.consume(_),O):O(_)}}function DX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,c=0,d,h,f;const g=new jX;for(;++n<e.length;){const y=e[n],v=y[1];y[0]==="enter"?v.type==="tableHead"?(l=!1,c!==0&&(QS(g,t,c,d,h),h=void 0,c=0),d={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},g.add(n,0,[["enter",d,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,f=void 0,o=[0,0,0,0],s=[0,n+1,0,0],l&&(l=!1,h={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},g.add(n,0,[["enter",h,t]])),i=v.type==="tableDelimiterRow"?2:h?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=_d(g,t,o,i,void 0,f),o=[0,0,0,0]),s[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],f=_d(g,t,o,i,void 0,f)),o=s,s=[o[1],n,0,0])):v.type==="tableHead"?(l=!0,c=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(c=n,o[1]!==0?(s[0]=s[1],f=_d(g,t,o,i,n,f)):s[1]!==0&&(f=_d(g,t,s,i,n,f)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&QS(g,t,c,d,h),g.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=PX(t.events,n))}return e}function _d(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(o.end=Object.assign({},Nl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const c=Nl(t.events,n[1]);if(o={type:s,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=Nl(t.events,n[2]),h=Nl(t.events,n[3]),f={type:l,start:Object.assign({},d),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const g=t.events[n[2]],y=t.events[n[3]];if(g[1].end=Object.assign({},y[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,w=n[3]-n[2]-1;e.add(v,w,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},Nl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function QS(e,t,n,r,i){const o=[],s=Nl(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Nl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const _X={name:"tasklistCheck",tokenize:zX};function LX(){return{text:{91:_X}}}function zX(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return ht(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return ze(c)?t(c):Ze(c)?e.check({tokenize:FX},t,n)(c):n(c)}}function FX(e,t,n){return rt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function $X(e){return Dj([dX(),bX(),AX(e),OX(),LX()])}const BX={};function VX(e){const t=this,n=e||BX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push($X(n)),o.push(lX()),s.push(aX(n))}const ex="wiki://",Ga=/\[\[([^\]|\n]+)(?:\|([^\]\n]+))?\]\]/g,HX=()=>e=>{Wh(e,"text",(t,n,r)=>{if(!r||n===null||n===void 0)return;const i=t.value;if(Ga.lastIndex=0,!Ga.test(i))return;Ga.lastIndex=0;const o=[];let s=0,l;for(;(l=Ga.exec(i))!==null;){l.index>s&&o.push({type:"text",value:i.slice(s,l.index)});const c=l[1].trim(),d=(l[2]??l[1]).trim();o.push({type:"link",url:`${ex}${c}`,children:[{type:"text",value:d}]}),s=Ga.lastIndex}return s<i.length&&o.push({type:"text",value:i.slice(s)}),r.children.splice(n,1,...o),n+o.length})};function UX({content:e,onWikiLinkClick:t,className:n}){return p.jsx("div",{className:Pe("prose prose-sm dark:prose-invert max-w-none px-6 py-4",n),children:p.jsx(AY,{remarkPlugins:[VX,HX],components:{a:({href:r,children:i,...o})=>{if(r!=null&&r.startsWith(ex)){const s=decodeURIComponent(r.slice(ex.length));return p.jsx("button",{type:"button",className:"text-blue-600 hover:underline font-medium",onClick:l=>{l.preventDefault(),t==null||t(s)},children:i})}return p.jsx("a",{href:r,target:"_blank",rel:"noreferrer noopener",...o,children:i})}},children:e})})}function WX({isOpen:e,onClose:t,nestId:n,excludeNodeId:r,onSelect:i}){const[o,s]=b.useState([]),[l,c]=b.useState(""),[d,h]=b.useState(!1),[f,g]=b.useState(null);b.useEffect(()=>{if(!e){c(""),g(null);return}let v=!1;return(async()=>{h(!0);try{const{nodes:w}=await lx(n);v||s(w)}catch(w){v||g(w.message)}finally{v||h(!1)}})(),()=>{v=!0}},[e,n]),b.useEffect(()=>{if(!e||!l.trim())return;let v=!1;const w=setTimeout(async()=>{h(!0);try{const{nodes:S}=await ax(n,l.trim());v||s(S)}catch(S){v||g(S.message)}finally{v||h(!1)}},200);return()=>{v=!0,clearTimeout(w)}},[e,n,l]);const y=b.useMemo(()=>{const v=l.trim().toLowerCase();return o.filter(w=>w.id===r?!1:v?w.title.toLowerCase().includes(v):!0)},[o,l,r]);return p.jsx(Rn,{open:e,onOpenChange:t,children:p.jsxs(bn,{className:"sm:max-w-[520px] max-h-[80vh] flex flex-col",children:[p.jsxs(kn,{children:[p.jsx(Sn,{children:"Link to a document"}),p.jsx(Bn,{children:"Pick a document in this nest. The link will use this title and point at the document — clicking it inside the editor opens the target."})]}),p.jsxs("div",{className:"relative",children:[p.jsx(aC,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),p.jsx($n,{value:l,onChange:v=>c(v.target.value),placeholder:"Search by title...",className:"pl-8",autoFocus:!0,"data-testid":"document-picker-search"})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto -mx-1 px-1",children:[f&&p.jsx("div",{className:"text-sm text-destructive p-2",children:f}),d&&o.length===0?p.jsxs("div",{className:"flex items-center justify-center py-10 text-muted-foreground",children:[p.jsx(Ct,{className:"h-5 w-5 animate-spin mr-2"}),"Loading documents..."]}):y.length===0?p.jsx("div",{className:"text-center text-sm text-muted-foreground py-10",children:l.trim()?"No matches":"No other documents in this nest yet"}):p.jsx("div",{className:"space-y-1",children:y.map(v=>p.jsxs("button",{type:"button",onClick:()=>{i({id:v.id,title:v.title}),t()},className:"w-full flex items-center gap-2 p-2 rounded hover:bg-muted text-left","data-testid":`document-picker-row-${v.id}`,children:[p.jsx(zo,{className:"h-4 w-4 text-muted-foreground shrink-0"}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"font-medium truncate",children:v.title}),v.tags&&v.tags.length>0&&p.jsx("div",{className:"text-xs text-muted-foreground truncate",children:v.tags.slice(0,4).join(" · ")})]})]},v.id))})]})]})})}function qX(e){return e?/^\s*</.test(e):!1}function KX({nestId:e,nestName:t,nodeId:n,onBack:r,onSaved:i,onNavigateDocument:o}){var dn,kt;const s=n==="new",{adminStatus:l}=Fs(),c=((kt=(dn=l==null?void 0:l.me)==null?void 0:dn.email)==null?void 0:kt.toLowerCase())??"",[d,h]=b.useState(!1),[f,g]=b.useState(null),[y,v]=b.useState(""),[w,S]=b.useState(""),[C,T]=b.useState([]),[N,R]=b.useState(""),[I,j]=b.useState(void 0),[D,O]=b.useState(null),[B,_]=b.useState(null),[V,U]=b.useState(!1),[Z,K]=b.useState(!1),[W,X]=b.useState(!1),[te,q]=b.useState(s?"edit":"view"),Y=b.useRef(null),[A,z]=b.useState(!s),[Q,P]=b.useState(!1),[fe,ue]=b.useState(null);b.useEffect(()=>{let xe=!1;return(async()=>{try{const at=await gC(e).catch(()=>({stewardship_enabled:!1}));if(xe)return;U(!!at.stewardship_enabled)}catch{}})(),()=>{xe=!0}},[e]),b.useEffect(()=>{if(s||!n||!c){h(!1),g(null);return}let xe=!1;return(async()=>{try{const{stewards:at}=await p_(e,n);if(xe)return;const tt=at.find(ee=>(ee.email||"").toLowerCase()===c);g((tt==null?void 0:tt.role)??null),h(!!tt&&tt.role==="reviewer")}catch{xe||(h(!1),g(null))}})(),()=>{xe=!0}},[s,e,n,c]);const re=b.useCallback(async()=>{if(!s){z(!0);try{const{node:xe}=await s_(e,n);v((xe==null?void 0:xe.title)??""),S((xe==null?void 0:xe.content)??""),T(Array.isArray(xe==null?void 0:xe.tags)?xe.tags:[]),j(xe==null?void 0:xe.version),O((xe==null?void 0:xe.status)??null),_((xe==null?void 0:xe.pendingChange)??null)}catch(xe){ue(xe.message)}finally{z(!1)}}},[s,e,n]);b.useEffect(()=>{s||re()},[s,re]);const ne=D==="pending_review",oe=ne||te!=="edit",me=b.useMemo(()=>!ne&&y.trim().length>0&&w.trim().length>0&&!Q,[ne,y,w,Q]),Ce=b.useCallback(()=>{const xe=N.split(/[\s,]+/).map(tt=>tt.trim().replace(/^#+/,"")).filter(Boolean);if(xe.length===0)return;const at=[...C];for(const tt of xe)at.includes(tt)||at.push(tt);T(at),R("")},[N,C]),Ae=xe=>T(C.filter(at=>at!==xe)),Fe=async()=>{var xe,at;if(me){P(!0),ue(null);try{if(s){const tt=await l_(e,{title:y.trim(),content:w,tags:C}),ee=(xe=tt==null?void 0:tt.node)==null?void 0:xe.id;i==null||i(ee??"")}else{const tt=await a_(e,n,{title:y.trim(),content:w,tags:C},I),ee=(tt==null?void 0:tt.version)??((at=tt==null?void 0:tt.node)==null?void 0:at.version);typeof ee=="number"&&j(ee),i==null||i(n)}}catch(tt){ue(tt.message)}finally{P(!1)}}},it=async(xe,at)=>{s||(await yC(e,n,xe,at),K(!1),await re())},lt=async xe=>{s||(await xC(e,n,xe),await re())},_t=async xe=>{s||(await vC(e,n,xe),await re())},Mt=!s&&D==="pending_review"&&d,dt=f==="reviewer"||f==="viewer",ir=!s&&V&&D==="draft"&&!dt,pt=xe=>{var at;(at=Y.current)==null||at.insertWikiLink(xe.title)},Dn=async(xe,at)=>{if(at){o==null||o(e,at);return}try{const{nodes:tt}=await ax(e,xe),ee=tt.find(ge=>ge.title.toLowerCase()===xe.toLowerCase());ee&&(o==null||o(e,ee.id))}catch{}};return p.jsxs("div",{className:"md:py-6",children:[p.jsxs("div",{className:"flex items-center justify-between gap-3 mb-6 mt-14 md:mt-0",children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[p.jsx(ve,{variant:"ghost",size:"icon",onClick:r,"data-testid":"document-editor-back",children:p.jsx(rx,{className:"h-5 w-5"})}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"text-xs text-muted-foreground truncate",children:t}),p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("h3",{className:"text-xl font-semibold truncate mb-0",children:y||(s?"New document":"Untitled")}),!s&&D&&p.jsx(GX,{status:D}),!s&&!V&&D==="approved"&&p.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-green-50 text-green-700 border border-green-200",title:"Stewardship is off for this nest, so saving publishes immediately and the document is AI-readable.",children:"Auto-published"})]})]})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[ir&&p.jsxs(ve,{variant:"outline",onClick:()=>K(!0),"data-testid":"document-editor-submit",title:'With stewardship on, "publishing" in this nest means submitting for steward approval.',children:[p.jsx(ox,{className:"h-4 w-4 mr-2"}),"Publish (requires approval)"]}),Mt&&p.jsx(y2,{documentTitle:y,version:I??1,onApprove:lt,onReject:_t}),!ne&&!dt&&(te==="edit"?p.jsxs(ve,{onClick:Fe,disabled:!me,"data-testid":"document-editor-save",children:[Q?p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(wD,{className:"h-4 w-4 mr-2"}),s?"Create":"Save"]}):p.jsxs(ve,{onClick:()=>q("edit"),"data-testid":"document-editor-start-edit",children:[p.jsx(th,{className:"h-4 w-4 mr-2"}),"Start Editing"]}))]})]}),fe&&p.jsxs(Fr,{variant:"destructive",className:"mb-4",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:fe})]}),A?p.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[p.jsx(Ct,{className:"h-5 w-5 animate-spin mr-2"}),"Loading document..."]}):p.jsxs("div",{className:"space-y-4",children:[!s&&B&&p.jsx(fB,{nestId:e,nodeId:n,pending:B,onResolved:()=>{_(null),re()}}),ne&&p.jsxs(Fr,{children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:"This document is awaiting steward review. Editing is locked until the review is resolved."})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block mb-1 text-sm font-medium",children:["Title ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx($n,{value:y,onChange:xe=>v(xe.target.value),placeholder:"Document title",disabled:oe,"data-testid":"document-editor-title"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block mb-1 text-sm font-medium",children:"Tags"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx($n,{value:N,onChange:xe=>R(xe.target.value),onKeyDown:xe=>{(xe.key==="Enter"||xe.key===","||xe.key===" ")&&(xe.preventDefault(),Ce())},placeholder:'Press Enter or space. Try "#api #v2" or "api, v2"',disabled:oe,"data-testid":"document-editor-tag-input"}),p.jsx(ve,{type:"button",variant:"outline",onClick:Ce,disabled:oe||!N.trim(),children:"Add"})]}),C.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:C.map(xe=>p.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-secondary px-2 py-0.5 text-xs",children:[xe,!oe&&p.jsx("button",{type:"button",onClick:()=>Ae(xe),className:"hover:text-destructive","aria-label":`Remove ${xe}`,children:p.jsx(VD,{className:"h-3 w-3"})})]},xe))})]}),p.jsxs("div",{onDoubleClick:()=>{te==="view"&&!ne&&!dt&&q("edit")},children:[p.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Content ",p.jsx("span",{className:"text-destructive",children:"*"})]}),te==="view"&&!qX(w)?p.jsx("div",{className:"border rounded-lg bg-background shadow-sm min-h-[300px] cursor-text",children:p.jsx(UX,{content:w,onWikiLinkClick:xe=>Dn(xe,null)})}):p.jsx(wj,{ref:Y,content:w,onChange:S,onSave:Fe,nestId:e,editable:!ne&&te==="edit",onRequestDocLink:()=>X(!0),onWikiLinkClick:Dn,placeholder:"Start writing..."})]})]}),!s&&p.jsx(x2,{isOpen:Z,onClose:()=>K(!1),documentTitle:y,currentVersion:I??1,onSubmit:it}),p.jsx(WX,{isOpen:W,onClose:()=>X(!1),nestId:e,excludeNodeId:s?void 0:n,onSelect:pt})]})}function GX({status:e}){const n={draft:{label:"Draft",cls:"bg-muted text-muted-foreground"},pending_review:{label:"Pending review",cls:"bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-300"},approved:{label:"Approved",cls:"bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-300"},published:{label:"Published",cls:"bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-300"},rejected:{label:"Rejected",cls:"bg-red-100 text-red-800 dark:bg-red-950 dark:text-red-300"},external_edit_pending:{label:"External edit",cls:"bg-orange-100 text-orange-800 dark:bg-orange-950 dark:text-orange-300"}}[e];return n?p.jsx("span",{className:`shrink-0 inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${n.cls}`,"data-testid":`document-status-${e}`,children:n.label}):null}function YX({existingAdmin:e,onClose:t}){const{loginSuccess:n}=Fs(),[r,i]=b.useState("promptowl"),[o,s]=b.useState(""),[l,c]=b.useState(""),[d,h]=b.useState(!1),[f,g]=b.useState(null),[y,v]=b.useState(null),[w,S]=b.useState(null),[C,T]=b.useState(!1),[N,R]=b.useState(!1),[I,j]=b.useState(null),D=async()=>{w&&(await navigator.clipboard.writeText(w),T(!0),setTimeout(()=>T(!1),1500))},O=async()=>{g(null),h(!0);try{const _=await hC();v(_.verificationUrl),S(_.deviceCode),window.open(_.verificationUrl,"_blank","noopener,noreferrer");for(let V=0;V<180;V++){await new Promise(K=>setTimeout(K,2e3));const U=await pC(_.deviceCode,_.clientSecret);if(U.status==="approved"&&U.token){const K=await mC(U.token);if(n(K.user?{email:K.user.email,name:K.user.name,is_admin:!!K.user.is_admin}:void 0),K.claim_blocked&&!K.user.is_admin){j({info:K.claim_blocked,attemptedEmail:K.user.email}),v(null),S(null),h(!1);return}t();return}if(U.status==="pending")continue;const Z=U.status==="denied"||U.status==="rejected"?"Login denied. Approve the request in PromptOwl to continue, or try again.":U.status==="expired"?"Login expired. Try again.":U.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${U.status}). Try again.`;g(Z),v(null),S(null),h(!1);return}g("Login timed out waiting for approval. Try again."),v(null),S(null),h(!1)}catch(_){g(_.message),v(null),S(null),h(!1)}},B=async _=>{_.preventDefault(),g(null),h(!0);try{const V=await fC(o,l);n(V.user?{email:V.user.email,name:V.user.name,is_admin:!!V.user.is_admin}:void 0),t()}catch(V){g(V.message),h(!1)}};return p.jsx(Rn,{open:!0,onOpenChange:t,children:p.jsxs(bn,{className:"sm:max-w-[420px]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{className:"flex items-center gap-2",children:[p.jsx(tr,{className:"h-4 w-4"}),"Login"]}),p.jsx(Bn,{children:e?`This server is administered by ${e}. Login to manage settings and teammates.`:"Login with your account."})]}),p.jsxs("div",{className:"space-y-4 pt-2",children:[f&&p.jsxs(Fr,{variant:"destructive",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:f})]}),I&&p.jsxs(Fr,{variant:"destructive",children:[p.jsx(oC,{className:"h-4 w-4"}),p.jsx($r,{children:I.info.reason==="license_required"?p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"font-medium",children:"Admin claim blocked — no license installed."}),p.jsx("p",{className:"text-xs",children:"Generate a Community License key in PromptOwl, then paste it on the setup screen. Only the PromptOwl account that minted the key can claim admin on this server."}),p.jsxs("a",{href:"https://app.promptowl.ai/community-license",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs underline",children:["Open Community License page",p.jsx(Wg,{className:"h-3 w-3"})]})]}):p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"font-medium",children:"Admin claim blocked — email does not match license owner."}),p.jsxs("p",{className:"text-xs",children:["License owner:"," ",p.jsx("code",{className:"font-mono",children:I.info.license_owner_email||"(unknown)"})]}),p.jsxs("p",{className:"text-xs",children:["You logged in as:"," ",p.jsx("code",{className:"font-mono",children:I.attemptedEmail})]}),p.jsx("p",{className:"text-xs",children:"Log in with the PromptOwl account that generated the installed license key, or install a different key belonging to this account."})]})})]}),r==="promptowl"?p.jsxs(p.Fragment,{children:[p.jsx(ve,{onClick:O,disabled:d,className:"w-full",children:d&&y?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}),"Waiting for approval..."]}):"Login with PromptOwl"}),y&&p.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-2",children:[p.jsxs("p",{className:"text-xs text-muted-foreground",children:["A new tab opened at"," ",p.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary underline",children:["PromptOwl",p.jsx(Wg,{className:"h-3 w-3"})]}),". If it asks for a verification code, use this:"]}),w&&p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"flex-1 bg-background border rounded px-2 py-1.5 text-xs font-mono break-all",children:w}),p.jsx(ve,{size:"sm",variant:"outline",onClick:D,children:C?p.jsx(zs,{className:"h-3.5 w-3.5 text-green-600"}):p.jsx(Fc,{className:"h-3.5 w-3.5"})})]})]}),!y&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-0 flex items-center",children:p.jsx("div",{className:"w-full border-t border-border"})}),p.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:p.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),p.jsx(ve,{variant:"outline",className:"w-full",onClick:()=>i("password"),children:"Use email + password"})]})]}):p.jsxs("form",{onSubmit:B,className:"space-y-3",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx(an,{children:"Email"}),p.jsx($n,{type:"email",value:o,onChange:_=>s(_.target.value),required:!0,autoFocus:!0})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(an,{children:"Password"}),p.jsxs("div",{className:"relative",children:[p.jsx($n,{type:N?"text":"password",value:l,onChange:_=>c(_.target.value),required:!0,className:"pr-9"}),p.jsx("button",{type:"button",onClick:()=>R(_=>!_),"aria-label":N?"Hide password":"Show password",tabIndex:-1,className:"absolute inset-y-0 right-0 flex items-center px-2 text-muted-foreground hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-r-md",children:N?p.jsx(iC,{className:"h-4 w-4"}):p.jsx($c,{className:"h-4 w-4"})})]})]}),p.jsx(ve,{type:"submit",disabled:d,className:"w-full",children:d?p.jsx(Ct,{className:"h-4 w-4 animate-spin"}):"Login"}),p.jsx("button",{type:"button",onClick:()=>i("promptowl"),className:"w-full text-xs text-muted-foreground hover:text-foreground",children:"← Back to PromptOwl login"})]})]})]})})}function JX({onBack:e}){const[t,n]=b.useState([]),[r,i]=b.useState([]),[o,s]=b.useState(!0),[l,c]=b.useState(null),[d,h]=b.useState(!1),[f,g]=b.useState(""),[y,v]=b.useState(null),w=async()=>{s(!0);try{const C=await JD();n(C.teammates),i(C.pending_stewards||[]),c(null)}catch(C){c(C.message)}finally{s(!1)}};b.useEffect(()=>{w()},[]);const S=C=>{if(!C)return"Never";const T=new Date(C),N=Date.now()-T.getTime();return N<6e4?"Just now":N<36e5?`${Math.floor(N/6e4)}m ago`:N<864e5?`${Math.floor(N/36e5)}h ago`:N<6048e5?`${Math.floor(N/864e5)}d ago`:T.toLocaleDateString()};return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[p.jsx(ve,{variant:"ghost",size:"icon",onClick:e,children:p.jsx(rx,{className:"h-4 w-4"})}),p.jsxs("div",{className:"flex-1",children:[p.jsx("h2",{className:"text-2xl font-semibold",children:"Teammates"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Invite teammates and manage their access keys"})]}),p.jsxs(ve,{onClick:()=>h(!0),children:[p.jsx(Ml,{className:"h-4 w-4 mr-2"}),"Invite Teammate"]})]}),l&&p.jsxs(Fr,{variant:"destructive",className:"mb-4",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:l})]}),p.jsxs(Bt,{children:[p.jsxs(on,{children:[p.jsxs(sn,{className:"text-lg flex items-center gap-2",children:[p.jsx(sx,{className:"h-4 w-4"}),"All Users"]}),p.jsx(Ar,{children:"Everyone who has access to this community server"})]}),p.jsx(Vt,{children:o?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(Ct,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?p.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:'No teammates yet. Click "Invite Teammate" to add one.'}):p.jsx("div",{className:"space-y-2",children:t.map(C=>p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border",children:[p.jsx(Vo,{className:"h-9 w-9",children:p.jsx(Ho,{children:(C.email[0]||"?").toUpperCase()})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-medium truncate",children:C.name||C.email}),C.is_admin&&p.jsxs(Ir,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700",children:[p.jsx(tr,{className:"h-3 w-3"}),"Admin"]}),!!C.is_invited&&p.jsx(Ir,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700",title:"Invited but not yet registered. They must complete registration with this email to claim the account.",children:"Invited"})]}),p.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-3",children:[p.jsx("span",{children:C.email}),p.jsx("span",{children:"·"}),p.jsxs("span",{children:[C.key_count," key",C.key_count!==1?"s":""]}),C.last_active&&p.jsxs(p.Fragment,{children:[p.jsx("span",{children:"·"}),p.jsxs("span",{children:["last active ",S(C.last_active)]})]})]})]})]},C.id))})})]}),r.length>0&&p.jsxs(Bt,{className:"mt-4 border-amber-200 bg-amber-50/40",children:[p.jsxs(on,{children:[p.jsxs(sn,{className:"text-lg flex items-center gap-2",children:[p.jsx(tr,{className:"h-4 w-4 text-amber-700"}),"Stewards without server access"]}),p.jsx(Ar,{children:"These emails are assigned as stewards on one or more nests, but haven't been invited to this server yet — they can't log in or approve anything until they have an API key."})]}),p.jsx(Vt,{children:p.jsx("div",{className:"space-y-2",children:r.map(C=>p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-background",children:[p.jsx(Vo,{className:"h-9 w-9",children:p.jsx(Ho,{className:"bg-amber-100 text-amber-800",children:(C[0]||"?").toUpperCase()})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("span",{className:"font-medium text-sm truncate",children:C}),p.jsx("div",{className:"text-xs text-muted-foreground",children:"Assigned as steward · no API key yet"})]}),p.jsxs(ve,{size:"sm",onClick:()=>{g(C),h(!0)},children:[p.jsx(Ml,{className:"h-3.5 w-3.5 mr-1"}),"Invite"]})]},C))})})]}),d&&p.jsx(XX,{seedEmail:f,onClose:()=>{h(!1),g("")},onCreated:(C,T)=>{h(!1),g(""),v({email:C,key:T}),w()}}),y&&p.jsx(QX,{email:y.email,apiKey:y.key,onClose:()=>v(null)})]})}function XX({seedEmail:e,onClose:t,onCreated:n}){const[r,i]=b.useState(e||""),[o,s]=b.useState(""),[l,c]=b.useState(!1),[d,h]=b.useState(null),f=async g=>{if(g.preventDefault(),!!r.trim()){c(!0),h(null);try{const y=await XD(r,o||void 0);n(r,y.api_key)}catch(y){h(y.message),c(!1)}}};return p.jsx(Rn,{open:!0,onOpenChange:t,children:p.jsxs(bn,{className:"sm:max-w-[420px]",children:[p.jsxs(kn,{children:[p.jsx(Sn,{children:"Invite Teammate"}),p.jsx(Bn,{children:"Create an API key for a teammate. They'll use it to authenticate from Hootie, Claude Desktop, or the CLI."})]}),p.jsxs("form",{onSubmit:f,className:"space-y-3",children:[d&&p.jsxs(Fr,{variant:"destructive",children:[p.jsx(Or,{className:"h-4 w-4"}),p.jsx($r,{children:d})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(an,{children:"Email"}),p.jsx($n,{type:"email",placeholder:"jane@acme.com",value:r,onChange:g=>i(g.target.value),required:!0,autoFocus:!0})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(an,{children:"Key label (optional)"}),p.jsx($n,{placeholder:"Jane's laptop",value:o,onChange:g=>s(g.target.value)})]}),p.jsxs(zr,{children:[p.jsx(ve,{variant:"outline",type:"button",onClick:t,children:"Cancel"}),p.jsx(ve,{type:"submit",disabled:l||!r.trim(),children:l?p.jsx(Ct,{className:"h-4 w-4 animate-spin"}):"Generate Key"})]})]})]})})}function QX({email:e,apiKey:t,onClose:n}){const[r,i]=b.useState(!1),o=async()=>{await navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),1500)};return p.jsx(Rn,{open:!0,onOpenChange:n,children:p.jsxs(bn,{className:"sm:max-w-[520px]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{children:["Key created for ",e]}),p.jsxs(Bn,{children:["Copy this key and send it to them via Slack, email, or another secure channel. ",p.jsx("strong",{children:"It won't be shown again."})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(an,{className:"text-xs text-muted-foreground",children:"API Key"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"flex-1 bg-muted px-3 py-2 rounded text-xs font-mono break-all",children:t}),p.jsx(ve,{size:"sm",variant:"outline",onClick:o,children:r?p.jsx(zs,{className:"h-3.5 w-3.5 text-green-600"}):p.jsx(Fc,{className:"h-3.5 w-3.5"})})]}),p.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"They'll paste this into:"}),p.jsxs("ul",{className:"text-xs text-muted-foreground list-disc list-inside space-y-0.5",children:[p.jsx("li",{children:"Hootie → Settings → Vault → Remote Server → API Key"}),p.jsxs("li",{children:["Claude Desktop → add as"," ",p.jsx("code",{className:"text-[10px]",children:"Authorization: Bearer ..."})," ","in MCP config"]}),p.jsxs("li",{children:["CLI → ",p.jsx("code",{className:"text-[10px]",children:"--key ..."})," flag"]})]})]}),p.jsx(zr,{children:p.jsx(ve,{onClick:n,children:"Done"})})]})})}function ZX({onActivated:e}){const[t,n]=b.useState(""),[r,i]=b.useState(!1),[o,s]=b.useState(null),l=async()=>{const c=t.trim();if(!c.startsWith("pk_")){s("License key must start with pk_");return}s(null),i(!0);try{const d=await YD(c);if(!d.valid){s(d.error||"PromptOwl rejected this key.");return}e()}catch(d){s(d instanceof Error?d.message:"Failed to install key")}finally{i(!1)}};return p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:p.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[p.jsxs("div",{className:"text-center space-y-2",children:[p.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-primary/10",children:p.jsx(TD,{className:"h-6 w-6 text-primary"})}),p.jsx("h1",{className:"text-2xl font-bold",children:"Activate ContextNest Community"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This server is in setup mode. Paste a PromptOwl license key to unlock write access."})]}),p.jsxs("div",{className:"border rounded-lg p-6 space-y-4 bg-card",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(an,{htmlFor:"license-key",children:"License key"}),p.jsx($n,{id:"license-key","data-testid":"license-setup-key-input",placeholder:"pk_...",value:t,autoFocus:!0,onChange:c=>{n(c.target.value),o&&s(null)},onKeyDown:c=>{c.key==="Enter"&&!r&&l()},className:"font-mono"}),o&&p.jsx("p",{className:"text-sm text-destructive","data-testid":"license-setup-error",children:o})]}),p.jsx(ve,{className:"w-full",onClick:l,disabled:r||!t.trim(),"data-testid":"license-setup-submit",children:r?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{className:"h-4 w-4 mr-2 animate-spin"}),"Validating..."]}):p.jsxs(p.Fragment,{children:[p.jsx(oC,{className:"h-4 w-4 mr-2"}),"Activate Server"]})})]}),p.jsxs("div",{className:"text-sm text-muted-foreground space-y-2 border rounded-lg p-4 bg-muted/30",children:[p.jsx("p",{className:"font-medium text-foreground",children:"Need a key?"}),p.jsxs("ol",{className:"list-decimal list-inside space-y-1",children:[p.jsxs("li",{children:["Sign up free at"," ",p.jsxs("a",{href:"https://app.promptowl.ai",target:"_blank",rel:"noreferrer",className:"text-primary underline inline-flex items-center gap-1",children:["app.promptowl.ai",p.jsx(Wg,{className:"h-3 w-3"})]})]}),p.jsx("li",{children:"Open Overview > Community License"}),p.jsx("li",{children:"Generate a key and paste it above"})]}),p.jsx("p",{className:"text-xs pt-2",children:"Reads stay available without a license. Writes (nest/node create, update, delete) require activation."})]})]})})}const eQ="/assets/hootie-C2ocYkn4.svg";function tQ(){var B,_;const{authMode:e,adminStatus:t,authenticated:n,isAdmin:r,loading:i,error:o,logout:s}=Fs(),[l,c]=b.useState({page:"dashboard"}),[d,h]=b.useState(!1),[f,g]=b.useState(null),[y,v]=b.useState(!0),[w,S]=b.useState(!1),[C,T]=b.useState(!1),N=b.useCallback(()=>S(!0),[]),R=b.useCallback(async()=>{T(!0);try{await s(),S(!1),UO.success("Logged out successfully")}finally{T(!1)}},[s]),I=b.useCallback(async()=>{try{const V=await GD();g(V)}catch{g(null)}finally{v(!1)}},[]);b.useEffect(()=>{I();const V=setInterval(I,900*1e3),U=()=>{I()};return window.addEventListener("auth:unauthorized",U),()=>{clearInterval(V),window.removeEventListener("auth:unauthorized",U)}},[I]);const j=((B=t==null?void 0:t.me)==null?void 0:B.email)??null,D=b.useRef(j);if(b.useEffect(()=>{D.current!==j&&(D.current=j,c({page:"dashboard"}))},[j]),o)return p.jsx("div",{className:"min-h-screen flex items-center justify-center",children:p.jsxs("div",{className:"text-center",children:[p.jsx("p",{className:"text-lg font-medium text-destructive",children:o}),p.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Check that the community server is running."})]})});if(i||e===null||y)return p.jsx("div",{className:"min-h-screen flex items-center justify-center",children:p.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Connecting..."})});if(f&&!f.valid)return p.jsx(ZX,{onActivated:I});const O=p.jsx(p.Fragment,{children:p.jsx(Rn,{open:w,onOpenChange:V=>{!V&&!C&&S(!1)},children:p.jsxs(bn,{className:"sm:max-w-[400px]",children:[p.jsxs(kn,{children:[p.jsxs(Sn,{className:"flex items-center gap-2",children:[p.jsx(sC,{className:"h-4 w-4 text-muted-foreground"}),"Log out?"]}),p.jsx(Bn,{children:"You'll be signed out of this browser. Any unsaved edits in other tabs may be lost — save your work first."})]}),p.jsxs(zr,{className:"gap-2",children:[p.jsx(ve,{variant:"outline",onClick:()=>S(!1),disabled:C,children:"Cancel"}),p.jsx(ve,{variant:"destructive",onClick:R,disabled:C,children:C?"Logging out...":"Log out"})]})]})})});return!n&&e==="key"?p.jsxs(p.Fragment,{children:[p.jsx(k_,{}),O]}):p.jsxs("div",{className:"min-h-screen bg-background",children:[p.jsx("header",{className:"border-b border-border bg-card",children:p.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-3 flex items-center justify-between",children:[p.jsxs("button",{onClick:()=>c({page:"dashboard"}),className:"flex items-center gap-2 hover:opacity-80",children:[p.jsx("img",{src:eQ,alt:"ContextNest",className:"h-7 w-7"}),p.jsx("span",{className:"font-semibold",children:"ContextNest"}),p.jsx(Ir,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:"Community"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[e==="open"&&!(t!=null&&t.me)&&p.jsxs("span",{className:"hidden md:inline-flex items-center gap-1.5 text-xs text-amber-700 bg-amber-50 border border-amber-200 px-2 py-1 rounded",children:[p.jsx(Kg,{className:"h-3 w-3"}),"Open mode"]}),t!=null&&t.me?p.jsx(nQ,{me:t.me,isAdmin:r,onTeammates:()=>c({page:"teammates"}),onLogout:N}):p.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[p.jsx(tr,{className:"h-3.5 w-3.5 mr-1"}),"Login"]})]})]})}),p.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-6",children:[l.page==="dashboard"&&p.jsx(p4,{onSelectNest:(V,U,Z,K)=>c({page:"nest",nestId:V,nestName:U,isOwner:Z,isAnonOwned:K})}),l.page==="nest"&&p.jsx(gW,{nestId:l.nestId,nestName:l.nestName,isOwner:l.isOwner,isAnonOwned:l.isAnonOwned,onBack:()=>c({page:"dashboard"}),onOpenDocument:V=>c({page:"document",nestId:l.nestId,nestName:l.nestName,nodeId:V,isOwner:l.isOwner,isAnonOwned:l.isAnonOwned})}),l.page==="document"&&p.jsx(KX,{nestId:l.nestId,nestName:l.nestName,nodeId:l.nodeId,onBack:()=>c({page:"nest",nestId:l.nestId,nestName:l.nestName,isOwner:l.isOwner,isAnonOwned:l.isAnonOwned}),onSaved:()=>c({page:"nest",nestId:l.nestId,nestName:l.nestName,isOwner:l.isOwner,isAnonOwned:l.isAnonOwned}),onNavigateDocument:(V,U)=>c({page:"document",nestId:V,nestName:V===l.nestId?l.nestName:"Document",nodeId:U,isOwner:V===l.nestId?l.isOwner:!1,isAnonOwned:V===l.nestId?l.isAnonOwned:!1})}),l.page==="teammates"&&p.jsx(JX,{onBack:()=>c({page:"dashboard"})})]}),d&&p.jsx(YX,{existingAdmin:((_=t==null?void 0:t.admin)==null?void 0:_.email)||null,onClose:()=>h(!1)}),O]})}function nQ({me:e,isAdmin:t,onTeammates:n,onLogout:r}){var s;const i=((s=e.name)==null?void 0:s.trim())||e.email,o=i.charAt(0);return p.jsxs(m2,{children:[p.jsx(g2,{asChild:!0,children:p.jsxs(ve,{variant:"ghost",size:"sm",className:"group h-9 gap-2 px-2","data-testid":"user-menu-trigger",children:[p.jsx(Vo,{className:"h-[1.8rem] w-[1.8rem] rounded-sm shrink-0",children:p.jsx(Ho,{className:"rounded-sm",children:o})}),p.jsx("span",{className:"hidden sm:inline max-w-[140px] truncate text-sm font-medium",children:i}),p.jsx(ix,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),p.jsxs(Wx,{align:"end",className:"min-w-56",children:[p.jsxs("div",{className:"flex items-center gap-2 p-2",children:[p.jsx(Vo,{className:"h-8 w-8 rounded-sm shrink-0",children:p.jsx(Ho,{className:"rounded-sm",children:o})}),p.jsxs("div",{className:"grid gap-0.5 leading-none min-w-0 flex-1",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-semibold truncate",children:i}),t&&p.jsxs(Ir,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700 text-[10px] px-1.5 py-0",children:[p.jsx(tr,{className:"h-2.5 w-2.5"}),"Admin"]})]}),p.jsx("div",{className:"text-sm text-muted-foreground truncate",children:e.email})]})]}),t&&p.jsxs(p.Fragment,{children:[p.jsx(dy,{}),p.jsxs(of,{onSelect:n,className:"cursor-pointer",children:[p.jsx(sx,{className:"h-3.5 w-3.5 mr-2"}),"Teammates"]})]}),p.jsx(dy,{}),p.jsxs(of,{onSelect:r,className:"cursor-pointer text-red-600 focus:text-red-700","data-testid":"user-menu-logout",children:[p.jsx(sC,{className:"h-3.5 w-3.5 mr-2"}),"Logout"]})]})]})}TO.createRoot(document.getElementById("root")).render(p.jsx(ce.StrictMode,{children:p.jsxs(b_,{children:[p.jsx(tQ,{}),p.jsx(tI,{richColors:!0,position:"bottom-right"})]})}));
|