@promptowl/contextnest-community 1.0.0 → 1.1.0
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 +6 -4
- package/README.md +80 -7
- package/dist/{chunk-BLOPZDPL.js → chunk-7UTMBL6Z.js} +22 -7
- package/dist/{chunk-XDCW4HTW.js → chunk-S2EWN2VA.js} +83 -5
- package/dist/{chunk-2TW25QEA.js → chunk-TDAX3JOT.js} +168 -22
- package/dist/chunk-WCOUCBDJ.js +1406 -0
- package/dist/{chunk-7K2LLJXK.js → chunk-XRK6SQSC.js} +1 -1
- package/dist/index.js +1418 -1038
- package/dist/{keys-YV33AJK3.js → keys-73STFJJB.js} +1 -1
- package/dist/{review-service-2JHZHZWJ.js → review-service-3OJIPYNV.js} +4 -3
- package/dist/{stewardship-service-ZJATH6OM.js → stewardship-service-3XGX7QIN.js} +20 -4
- package/dist/{version-service-2MZJGE3H.js → version-service-UODXLAOJ.js} +8 -4
- package/dist/web3/assets/index-BLxRS7jD.js +673 -0
- package/dist/web3/assets/index-DszK6Vkc.css +1 -0
- package/dist/web3/index.html +2 -2
- package/package.json +136 -125
- package/dist/chunk-2FXVMVZJ.js +0 -540
- package/dist/web3/assets/index-BlGzOlFt.css +0 -1
- package/dist/web3/assets/index-C3W5d7fT.js +0 -591
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
var Qj=Object.defineProperty;var Zj=(e,t,n)=>t in e?Qj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qw=(e,t,n)=>Zj(e,typeof t!="symbol"?t+"":t,n);function eD(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 Ma(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M0={exports:{}},vu={},j0={exports:{}},tt={};/**
|
|
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 Zw;function tD(){if(Zw)return tt;Zw=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"),u=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 x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,v={};function w(z,ee,O){this.props=z,this.context=ee,this.refs=v,this.updater=O||x}w.prototype.isReactComponent={},w.prototype.setState=function(z,ee){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,ee,"setState")},w.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=w.prototype;function N(z,ee,O){this.props=z,this.context=ee,this.refs=v,this.updater=O||x}var T=N.prototype=new C;T.constructor=N,y(T,w.prototype),T.isPureReactComponent=!0;var D=Array.isArray,A=Object.prototype.hasOwnProperty,_={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function P(z,ee,O){var ce,pe={},le=null,ie=null;if(ee!=null)for(ce in ee.ref!==void 0&&(ie=ee.ref),ee.key!==void 0&&(le=""+ee.key),ee)A.call(ee,ce)&&!I.hasOwnProperty(ce)&&(pe[ce]=ee[ce]);var ue=arguments.length-2;if(ue===1)pe.children=O;else if(1<ue){for(var xe=Array(ue),Te=0;Te<ue;Te++)xe[Te]=arguments[Te+2];pe.children=xe}if(z&&z.defaultProps)for(ce in ue=z.defaultProps,ue)pe[ce]===void 0&&(pe[ce]=ue[ce]);return{$$typeof:e,type:z,key:le,ref:ie,props:pe,_owner:_.current}}function L(z,ee){return{$$typeof:e,type:z.type,key:ee,ref:z.ref,props:z.props,_owner:z._owner}}function R(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function V(z){var ee={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(O){return ee[O]})}var K=/\/+/g;function G(z,ee){return typeof z=="object"&&z!==null&&z.key!=null?V(""+z.key):ee.toString(36)}function B(z,ee,O,ce,pe){var le=typeof z;(le==="undefined"||le==="boolean")&&(z=null);var ie=!1;if(z===null)ie=!0;else switch(le){case"string":case"number":ie=!0;break;case"object":switch(z.$$typeof){case e:case t:ie=!0}}if(ie)return ie=z,pe=pe(ie),z=ce===""?"."+G(ie,0):ce,D(pe)?(O="",z!=null&&(O=z.replace(K,"$&/")+"/"),B(pe,ee,O,"",function(Te){return Te})):pe!=null&&(R(pe)&&(pe=L(pe,O+(!pe.key||ie&&ie.key===pe.key?"":(""+pe.key).replace(K,"$&/")+"/")+z)),ee.push(pe)),1;if(ie=0,ce=ce===""?".":ce+":",D(z))for(var ue=0;ue<z.length;ue++){le=z[ue];var xe=ce+G(le,ue);ie+=B(le,ee,O,xe,pe)}else if(xe=g(z),typeof xe=="function")for(z=xe.call(z),ue=0;!(le=z.next()).done;)le=le.value,xe=ce+G(le,ue++),ie+=B(le,ee,O,xe,pe);else if(le==="object")throw ee=String(z),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return ie}function W(z,ee,O){if(z==null)return z;var ce=[],pe=0;return B(z,ce,"","",function(le){return ee.call(O,le,pe++)}),ce}function U(z){if(z._status===-1){var ee=z._result;ee=ee(),ee.then(function(O){(z._status===0||z._status===-1)&&(z._status=1,z._result=O)},function(O){(z._status===0||z._status===-1)&&(z._status=2,z._result=O)}),z._status===-1&&(z._status=0,z._result=ee)}if(z._status===1)return z._result.default;throw z._result}var Z={current:null},q={transition:null},Y={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:q,ReactCurrentOwner:_};function j(){throw Error("act(...) is not supported in production builds of React.")}return tt.Children={map:W,forEach:function(z,ee,O){W(z,function(){ee.apply(this,arguments)},O)},count:function(z){var ee=0;return W(z,function(){ee++}),ee},toArray:function(z){return W(z,function(ee){return ee})||[]},only:function(z){if(!R(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},tt.Component=w,tt.Fragment=n,tt.Profiler=i,tt.PureComponent=N,tt.StrictMode=r,tt.Suspense=u,tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,tt.act=j,tt.cloneElement=function(z,ee,O){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var ce=y({},z.props),pe=z.key,le=z.ref,ie=z._owner;if(ee!=null){if(ee.ref!==void 0&&(le=ee.ref,ie=_.current),ee.key!==void 0&&(pe=""+ee.key),z.type&&z.type.defaultProps)var ue=z.type.defaultProps;for(xe in ee)A.call(ee,xe)&&!I.hasOwnProperty(xe)&&(ce[xe]=ee[xe]===void 0&&ue!==void 0?ue[xe]:ee[xe])}var xe=arguments.length-2;if(xe===1)ce.children=O;else if(1<xe){ue=Array(xe);for(var Te=0;Te<xe;Te++)ue[Te]=arguments[Te+2];ce.children=ue}return{$$typeof:e,type:z.type,key:pe,ref:le,props:ce,_owner:ie}},tt.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},tt.createElement=P,tt.createFactory=function(z){var ee=P.bind(null,z);return ee.type=z,ee},tt.createRef=function(){return{current:null}},tt.forwardRef=function(z){return{$$typeof:l,render:z}},tt.isValidElement=R,tt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:U}},tt.memo=function(z,ee){return{$$typeof:d,type:z,compare:ee===void 0?null:ee}},tt.startTransition=function(z){var ee=q.transition;q.transition={};try{z()}finally{q.transition=ee}},tt.unstable_act=j,tt.useCallback=function(z,ee){return Z.current.useCallback(z,ee)},tt.useContext=function(z){return Z.current.useContext(z)},tt.useDebugValue=function(){},tt.useDeferredValue=function(z){return Z.current.useDeferredValue(z)},tt.useEffect=function(z,ee){return Z.current.useEffect(z,ee)},tt.useId=function(){return Z.current.useId()},tt.useImperativeHandle=function(z,ee,O){return Z.current.useImperativeHandle(z,ee,O)},tt.useInsertionEffect=function(z,ee){return Z.current.useInsertionEffect(z,ee)},tt.useLayoutEffect=function(z,ee){return Z.current.useLayoutEffect(z,ee)},tt.useMemo=function(z,ee){return Z.current.useMemo(z,ee)},tt.useReducer=function(z,ee,O){return Z.current.useReducer(z,ee,O)},tt.useRef=function(z){return Z.current.useRef(z)},tt.useState=function(z){return Z.current.useState(z)},tt.useSyncExternalStore=function(z,ee,O){return Z.current.useSyncExternalStore(z,ee,O)},tt.useTransition=function(){return Z.current.useTransition()},tt.version="18.3.1",tt}var ek;function Cc(){return ek||(ek=1,j0.exports=tD()),j0.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 tk;function nD(){if(tk)return vu;tk=1;var e=Cc(),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,u,d){var h,f={},g=null,x=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(x=u.ref);for(h in u)r.call(u,h)&&!o.hasOwnProperty(h)&&(f[h]=u[h]);if(l&&l.defaultProps)for(h in u=l.defaultProps,u)f[h]===void 0&&(f[h]=u[h]);return{$$typeof:t,type:l,key:g,ref:x,props:f,_owner:i.current}}return vu.Fragment=n,vu.jsx=s,vu.jsxs=s,vu}var nk;function rD(){return nk||(nk=1,M0.exports=nD()),M0.exports}var p=rD(),k=Cc();const de=Ma(k),yx=eD({__proto__:null,default:de},[k]);var Zd={},D0={exports:{}},Cr={},R0={exports:{}},P0={};/**
|
|
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 rk;function iD(){return rk||(rk=1,(function(e){function t(q,Y){var j=q.length;q.push(Y);e:for(;0<j;){var z=j-1>>>1,ee=q[z];if(0<i(ee,Y))q[z]=Y,q[j]=ee,j=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],j=q.pop();if(j!==Y){q[0]=j;e:for(var z=0,ee=q.length,O=ee>>>1;z<O;){var ce=2*(z+1)-1,pe=q[ce],le=ce+1,ie=q[le];if(0>i(pe,j))le<ee&&0>i(ie,pe)?(q[z]=ie,q[le]=j,z=le):(q[z]=pe,q[ce]=j,z=ce);else if(le<ee&&0>i(ie,j))q[z]=ie,q[le]=j,z=le;else break e}}return Y}function i(q,Y){var j=q.sortIndex-Y.sortIndex;return j!==0?j: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 u=[],d=[],h=1,f=null,g=3,x=!1,y=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(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(u,Y);else break;Y=n(d)}}function D(q){if(v=!1,T(q),!y)if(n(u)!==null)y=!0,U(A);else{var Y=n(d);Y!==null&&Z(D,Y.startTime-q)}}function A(q,Y){y=!1,v&&(v=!1,C(P),P=-1),x=!0;var j=g;try{for(T(Y),f=n(u);f!==null&&(!(f.expirationTime>Y)||q&&!V());){var z=f.callback;if(typeof z=="function"){f.callback=null,g=f.priorityLevel;var ee=z(f.expirationTime<=Y);Y=e.unstable_now(),typeof ee=="function"?f.callback=ee:f===n(u)&&r(u),T(Y)}else r(u);f=n(u)}if(f!==null)var O=!0;else{var ce=n(d);ce!==null&&Z(D,ce.startTime-Y),O=!1}return O}finally{f=null,g=j,x=!1}}var _=!1,I=null,P=-1,L=5,R=-1;function V(){return!(e.unstable_now()-R<L)}function K(){if(I!==null){var q=e.unstable_now();R=q;var Y=!0;try{Y=I(!0,q)}finally{Y?G():(_=!1,I=null)}}else _=!1}var G;if(typeof N=="function")G=function(){N(K)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,W=B.port2;B.port1.onmessage=K,G=function(){W.postMessage(null)}}else G=function(){w(K,0)};function U(q){I=q,_||(_=!0,G())}function Z(q,Y){P=w(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(){y||x||(y=!0,U(A))},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"):L=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(q){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var j=g;g=Y;try{return q()}finally{g=j}},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 j=g;g=q;try{return Y()}finally{g=j}},e.unstable_scheduleCallback=function(q,Y,j){var z=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?z+j:z):j=z,q){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=j+ee,q={id:h++,callback:Y,priorityLevel:q,startTime:j,expirationTime:ee,sortIndex:-1},j>z?(q.sortIndex=j,t(d,q),n(u)===null&&q===n(d)&&(v?(C(P),P=-1):v=!0,Z(D,j-z))):(q.sortIndex=ee,t(u,q),y||x||(y=!0,U(A))),q},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(q){var Y=g;return function(){var j=g;g=Y;try{return q.apply(this,arguments)}finally{g=j}}}})(P0)),P0}var ik;function oD(){return ik||(ik=1,R0.exports=iD()),R0.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 ok;function sD(){if(ok)return Cr;ok=1;var e=Cc(),t=oD();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,m=1;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+a+"; visit "+c+" 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,c){s(a,c),s(a+"Capture",c)}function s(a,c){for(i[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=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 u.call(f,a)?!0:u.call(h,a)?!1:d.test(a)?f[a]=!0:(h[a]=!0,!1)}function x(a,c,m,b){if(m!==null&&m.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return b?!1:m!==null?!m.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function y(a,c,m,b){if(c===null||typeof c>"u"||x(a,c,m,b))return!0;if(b)return!1;if(m!==null)switch(m.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function v(a,c,m,b,S,E,M){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=b,this.attributeNamespace=S,this.mustUseProperty=m,this.propertyName=a,this.type=c,this.sanitizeURL=E,this.removeEmptyString=M}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new v(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];w[c]=new v(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new v(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){w[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new v(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new v(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new v(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function N(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 c=a.replace(C,N);w[c]=new v(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(C,N);w[c]=new v(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(C,N);w[c]=new v(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});function T(a,c,m,b){var S=w.hasOwnProperty(c)?w[c]:null;(S!==null?S.type!==0:b||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(y(c,m,S,b)&&(m=null),b||S===null?g(c)&&(m===null?a.removeAttribute(c):a.setAttribute(c,""+m)):S.mustUseProperty?a[S.propertyName]=m===null?S.type===3?!1:"":m:(c=S.attributeName,b=S.attributeNamespace,m===null?a.removeAttribute(c):(S=S.type,m=S===3||S===4&&m===!0?"":""+m,b?a.setAttributeNS(b,c,m):a.setAttribute(c,m))))}var D=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),_=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),V=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Z=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 j=Object.assign,z;function ee(a){if(z===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);z=c&&c[1]||""}return`
|
|
34
|
+
`+z+a}var O=!1;function ce(a,c){if(!a||O)return"";O=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Q){var b=Q}Reflect.construct(a,[],c)}else{try{c.call()}catch(Q){b=Q}a.call(c.prototype)}else{try{throw Error()}catch(Q){b=Q}a()}}catch(Q){if(Q&&b&&typeof Q.stack=="string"){for(var S=Q.stack.split(`
|
|
35
|
+
`),E=b.stack.split(`
|
|
36
|
+
`),M=S.length-1,F=E.length-1;1<=M&&0<=F&&S[M]!==E[F];)F--;for(;1<=M&&0<=F;M--,F--)if(S[M]!==E[F]){if(M!==1||F!==1)do if(M--,F--,0>F||S[M]!==E[F]){var $=`
|
|
37
|
+
`+S[M].replace(" at new "," at ");return a.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",a.displayName)),$}while(1<=M&&0<=F);break}}}finally{O=!1,Error.prepareStackTrace=m}return(a=a?a.displayName||a.name:"")?ee(a):""}function pe(a){switch(a.tag){case 5:return ee(a.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return a=ce(a.type,!1),a;case 11:return a=ce(a.type.render,!1),a;case 1:return a=ce(a.type,!0),a;default:return""}}function le(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 I:return"Fragment";case _:return"Portal";case L:return"Profiler";case P:return"StrictMode";case G:return"Suspense";case B:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case V:return(a.displayName||"Context")+".Consumer";case R:return(a._context.displayName||"Context")+".Provider";case K:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case W:return c=a.displayName||null,c!==null?c:le(a.type)||"Memo";case U:c=a._payload,a=a._init;try{return le(a(c))}catch{}}return null}function ie(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(c);case 8:return c===P?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ue(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function xe(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Te(a){var c=xe(a)?"checked":"value",m=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),b=""+a[c];if(!a.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var S=m.get,E=m.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return S.call(this)},set:function(M){b=""+M,E.call(this,M)}}),Object.defineProperty(a,c,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(M){b=""+M},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Le(a){a._valueTracker||(a._valueTracker=Te(a))}function Be(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var m=c.getValue(),b="";return a&&(b=xe(a)?a.checked?"true":"false":a.value),a=b,a!==m?(c.setValue(a),!0):!1}function at(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 Xe(a,c){var m=c.checked;return j({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??a._wrapperState.initialChecked})}function Ot(a,c){var m=c.defaultValue==null?"":c.defaultValue,b=c.checked!=null?c.checked:c.defaultChecked;m=ue(c.value!=null?c.value:m),a._wrapperState={initialChecked:b,initialValue:m,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function ut(a,c){c=c.checked,c!=null&&T(a,"checked",c,!1)}function Tt(a,c){ut(a,c);var m=ue(c.value),b=c.type;if(m!=null)b==="number"?(m===0&&a.value===""||a.value!=m)&&(a.value=""+m):a.value!==""+m&&(a.value=""+m);else if(b==="submit"||b==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?xt(a,c.type,m):c.hasOwnProperty("defaultValue")&&xt(a,c.type,ue(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function nr(a,c,m){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var b=c.type;if(!(b!=="submit"&&b!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,m||c===a.value||(a.value=c),a.defaultValue=c}m=a.name,m!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,m!==""&&(a.name=m)}function xt(a,c,m){(c!=="number"||at(a.ownerDocument)!==a)&&(m==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+m&&(a.defaultValue=""+m))}var Vn=Array.isArray;function rr(a,c,m,b){if(a=a.options,c){c={};for(var S=0;S<m.length;S++)c["$"+m[S]]=!0;for(m=0;m<a.length;m++)S=c.hasOwnProperty("$"+a[m].value),a[m].selected!==S&&(a[m].selected=S),S&&b&&(a[m].defaultSelected=!0)}else{for(m=""+ue(m),c=null,S=0;S<a.length;S++){if(a[S].value===m){a[S].selected=!0,b&&(a[S].defaultSelected=!0);return}c!==null||a[S].disabled||(c=a[S])}c!==null&&(c.selected=!0)}}function ft(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return j({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function hn(a,c){var m=c.value;if(m==null){if(m=c.children,c=c.defaultValue,m!=null){if(c!=null)throw Error(n(92));if(Vn(m)){if(1<m.length)throw Error(n(93));m=m[0]}c=m}c==null&&(c=""),m=c}a._wrapperState={initialValue:ue(m)}}function mr(a,c){var m=ue(c.value),b=ue(c.defaultValue);m!=null&&(m=""+m,m!==a.value&&(a.value=m),c.defaultValue==null&&a.defaultValue!==m&&(a.defaultValue=m)),b!=null&&(a.defaultValue=""+b)}function ir(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function te(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 he(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?te(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var De,Fe=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,m,b,S){MSApp.execUnsafeLocalFunction(function(){return a(c,m,b,S)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(De=De||document.createElement("div"),De.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=De.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Re(a,c){if(c){var m=a.firstChild;if(m&&m===a.lastChild&&m.nodeType===3){m.nodeValue=c;return}}a.textContent=c}var At={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},Yt=["Webkit","ms","Moz","O"];Object.keys(At).forEach(function(a){Yt.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),At[c]=At[a]})});function pn(a,c,m){return c==null||typeof c=="boolean"||c===""?"":m||typeof c!="number"||c===0||At.hasOwnProperty(a)&&At[a]?(""+c).trim():c+"px"}function jn(a,c){a=a.style;for(var m in c)if(c.hasOwnProperty(m)){var b=m.indexOf("--")===0,S=pn(m,c[m],b);m==="float"&&(m="cssFloat"),b?a.setProperty(m,S):a[m]=S}}var gr=j({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 ht(a,c){if(c){if(gr[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function _t(a,c){if(a.indexOf("-")===-1)return typeof c.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 Lt=null;function Dn(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var xr=null,yr=null,Rn=null;function Pn(a){if(a=ou(a)){if(typeof xr!="function")throw Error(n(280));var c=a.stateNode;c&&(c=pd(c),xr(a.stateNode,a.type,c))}}function We(a){yr?Rn?Rn.push(a):Rn=[a]:yr=a}function Mt(){if(yr){var a=yr,c=Rn;if(Rn=yr=null,Pn(a),c)for(a=0;a<c.length;a++)Pn(c[a])}}function Ft(a,c){return a(c)}function en(){}var qr=!1;function zt(a,c,m){if(qr)return a(c,m);qr=!0;try{return Ft(a,c,m)}finally{qr=!1,(yr!==null||Rn!==null)&&(en(),Mt())}}function Ut(a,c){var m=a.stateNode;if(m===null)return null;var b=pd(m);if(b===null)return null;m=b[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(a=a.type,b=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!b;break e;default:a=!1}if(a)return null;if(m&&typeof m!="function")throw Error(n(231,c,typeof m));return m}var Kr=!1;if(l)try{var kt={};Object.defineProperty(kt,"passive",{get:function(){Kr=!0}}),window.addEventListener("test",kt,kt),window.removeEventListener("test",kt,kt)}catch{Kr=!1}function wn(a,c,m,b,S,E,M,F,$){var Q=Array.prototype.slice.call(arguments,3);try{c.apply(m,Q)}catch(ae){this.onError(ae)}}var ne=!1,we=null,qe=!1,Pt=null,re={onError:function(a){ne=!0,we=a}};function Ce(a,c,m,b,S,E,M,F,$){ne=!1,we=null,wn.apply(re,arguments)}function nt(a,c,m,b,S,E,M,F,$){if(Ce.apply(this,arguments),ne){if(ne){var Q=we;ne=!1,we=null}else throw Error(n(198));qe||(qe=!0,Pt=Q)}}function ot(a){var c=a,m=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(m=c.return),a=c.return;while(a)}return c.tag===3?m:null}function kn(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function js(a){if(ot(a)!==a)throw Error(n(188))}function Ba(a){var c=a.alternate;if(!c){if(c=ot(a),c===null)throw Error(n(188));return c!==a?null:a}for(var m=a,b=c;;){var S=m.return;if(S===null)break;var E=S.alternate;if(E===null){if(b=S.return,b!==null){m=b;continue}break}if(S.child===E.child){for(E=S.child;E;){if(E===m)return js(S),a;if(E===b)return js(S),c;E=E.sibling}throw Error(n(188))}if(m.return!==b.return)m=S,b=E;else{for(var M=!1,F=S.child;F;){if(F===m){M=!0,m=S,b=E;break}if(F===b){M=!0,b=S,m=E;break}F=F.sibling}if(!M){for(F=E.child;F;){if(F===m){M=!0,m=E,b=S;break}if(F===b){M=!0,b=E,m=S;break}F=F.sibling}if(!M)throw Error(n(189))}}if(m.alternate!==b)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?a:c}function El(a){return a=Ba(a),a!==null?Cb(a):null}function Cb(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Cb(a);if(c!==null)return c;a=a.sibling}return null}var Eb=t.unstable_scheduleCallback,Nb=t.unstable_cancelCallback,u5=t.unstable_shouldYield,c5=t.unstable_requestPaint,Jt=t.unstable_now,d5=t.unstable_getCurrentPriorityLevel,Jp=t.unstable_ImmediatePriority,Tb=t.unstable_UserBlockingPriority,Gc=t.unstable_NormalPriority,f5=t.unstable_LowPriority,Ab=t.unstable_IdlePriority,Yc=null,Ti=null;function h5(a){if(Ti&&typeof Ti.onCommitFiberRoot=="function")try{Ti.onCommitFiberRoot(Yc,a,void 0,(a.current.flags&128)===128)}catch{}}var ui=Math.clz32?Math.clz32:g5,p5=Math.log,m5=Math.LN2;function g5(a){return a>>>=0,a===0?32:31-(p5(a)/m5|0)|0}var Jc=64,Xc=4194304;function $a(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 Qc(a,c){var m=a.pendingLanes;if(m===0)return 0;var b=0,S=a.suspendedLanes,E=a.pingedLanes,M=m&268435455;if(M!==0){var F=M&~S;F!==0?b=$a(F):(E&=M,E!==0&&(b=$a(E)))}else M=m&~S,M!==0?b=$a(M):E!==0&&(b=$a(E));if(b===0)return 0;if(c!==0&&c!==b&&(c&S)===0&&(S=b&-b,E=c&-c,S>=E||S===16&&(E&4194240)!==0))return c;if((b&4)!==0&&(b|=m&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=b;0<c;)m=31-ui(c),S=1<<m,b|=a[m],c&=~S;return b}function x5(a,c){switch(a){case 1:case 2:case 4:return c+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 c+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 y5(a,c){for(var m=a.suspendedLanes,b=a.pingedLanes,S=a.expirationTimes,E=a.pendingLanes;0<E;){var M=31-ui(E),F=1<<M,$=S[M];$===-1?((F&m)===0||(F&b)!==0)&&(S[M]=x5(F,c)):$<=c&&(a.expiredLanes|=F),E&=~F}}function Xp(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function _b(){var a=Jc;return Jc<<=1,(Jc&4194240)===0&&(Jc=64),a}function Qp(a){for(var c=[],m=0;31>m;m++)c.push(a);return c}function Va(a,c,m){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-ui(c),a[c]=m}function b5(a,c){var m=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var b=a.eventTimes;for(a=a.expirationTimes;0<m;){var S=31-ui(m),E=1<<S;c[S]=0,b[S]=-1,a[S]=-1,m&=~E}}function Zp(a,c){var m=a.entangledLanes|=c;for(a=a.entanglements;m;){var b=31-ui(m),S=1<<b;S&c|a[b]&c&&(a[b]|=c),m&=~S}}var mt=0;function Mb(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var jb,em,Db,Rb,Pb,tm=!1,Zc=[],_o=null,Mo=null,jo=null,Ha=new Map,Ua=new Map,Do=[],v5="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 Ib(a,c){switch(a){case"focusin":case"focusout":_o=null;break;case"dragenter":case"dragleave":Mo=null;break;case"mouseover":case"mouseout":jo=null;break;case"pointerover":case"pointerout":Ha.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ua.delete(c.pointerId)}}function Wa(a,c,m,b,S,E){return a===null||a.nativeEvent!==E?(a={blockedOn:c,domEventName:m,eventSystemFlags:b,nativeEvent:E,targetContainers:[S]},c!==null&&(c=ou(c),c!==null&&em(c)),a):(a.eventSystemFlags|=b,c=a.targetContainers,S!==null&&c.indexOf(S)===-1&&c.push(S),a)}function w5(a,c,m,b,S){switch(c){case"focusin":return _o=Wa(_o,a,c,m,b,S),!0;case"dragenter":return Mo=Wa(Mo,a,c,m,b,S),!0;case"mouseover":return jo=Wa(jo,a,c,m,b,S),!0;case"pointerover":var E=S.pointerId;return Ha.set(E,Wa(Ha.get(E)||null,a,c,m,b,S)),!0;case"gotpointercapture":return E=S.pointerId,Ua.set(E,Wa(Ua.get(E)||null,a,c,m,b,S)),!0}return!1}function Ob(a){var c=Ds(a.target);if(c!==null){var m=ot(c);if(m!==null){if(c=m.tag,c===13){if(c=kn(m),c!==null){a.blockedOn=c,Pb(a.priority,function(){Db(m)});return}}else if(c===3&&m.stateNode.current.memoizedState.isDehydrated){a.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}a.blockedOn=null}function ed(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var m=rm(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(m===null){m=a.nativeEvent;var b=new m.constructor(m.type,m);Lt=b,m.target.dispatchEvent(b),Lt=null}else return c=ou(m),c!==null&&em(c),a.blockedOn=m,!1;c.shift()}return!0}function Lb(a,c,m){ed(a)&&m.delete(c)}function k5(){tm=!1,_o!==null&&ed(_o)&&(_o=null),Mo!==null&&ed(Mo)&&(Mo=null),jo!==null&&ed(jo)&&(jo=null),Ha.forEach(Lb),Ua.forEach(Lb)}function qa(a,c){a.blockedOn===c&&(a.blockedOn=null,tm||(tm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,k5)))}function Ka(a){function c(S){return qa(S,a)}if(0<Zc.length){qa(Zc[0],a);for(var m=1;m<Zc.length;m++){var b=Zc[m];b.blockedOn===a&&(b.blockedOn=null)}}for(_o!==null&&qa(_o,a),Mo!==null&&qa(Mo,a),jo!==null&&qa(jo,a),Ha.forEach(c),Ua.forEach(c),m=0;m<Do.length;m++)b=Do[m],b.blockedOn===a&&(b.blockedOn=null);for(;0<Do.length&&(m=Do[0],m.blockedOn===null);)Ob(m),m.blockedOn===null&&Do.shift()}var Nl=D.ReactCurrentBatchConfig,td=!0;function S5(a,c,m,b){var S=mt,E=Nl.transition;Nl.transition=null;try{mt=1,nm(a,c,m,b)}finally{mt=S,Nl.transition=E}}function C5(a,c,m,b){var S=mt,E=Nl.transition;Nl.transition=null;try{mt=4,nm(a,c,m,b)}finally{mt=S,Nl.transition=E}}function nm(a,c,m,b){if(td){var S=rm(a,c,m,b);if(S===null)vm(a,c,b,nd,m),Ib(a,b);else if(w5(S,a,c,m,b))b.stopPropagation();else if(Ib(a,b),c&4&&-1<v5.indexOf(a)){for(;S!==null;){var E=ou(S);if(E!==null&&jb(E),E=rm(a,c,m,b),E===null&&vm(a,c,b,nd,m),E===S)break;S=E}S!==null&&b.stopPropagation()}else vm(a,c,b,null,m)}}var nd=null;function rm(a,c,m,b){if(nd=null,a=Dn(b),a=Ds(a),a!==null)if(c=ot(a),c===null)a=null;else if(m=c.tag,m===13){if(a=kn(c),a!==null)return a;a=null}else if(m===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return nd=a,null}function Fb(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(d5()){case Jp:return 1;case Tb:return 4;case Gc:case f5:return 16;case Ab:return 536870912;default:return 16}default:return 16}}var Ro=null,im=null,rd=null;function zb(){if(rd)return rd;var a,c=im,m=c.length,b,S="value"in Ro?Ro.value:Ro.textContent,E=S.length;for(a=0;a<m&&c[a]===S[a];a++);var M=m-a;for(b=1;b<=M&&c[m-b]===S[E-b];b++);return rd=S.slice(a,1<b?1-b:void 0)}function id(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function od(){return!0}function Bb(){return!1}function Rr(a){function c(m,b,S,E,M){this._reactName=m,this._targetInst=S,this.type=b,this.nativeEvent=E,this.target=M,this.currentTarget=null;for(var F in a)a.hasOwnProperty(F)&&(m=a[F],this[F]=m?m(E):E[F]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?od:Bb,this.isPropagationStopped=Bb,this}return j(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=od)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=od)},persist:function(){},isPersistent:od}),c}var Tl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},om=Rr(Tl),Ga=j({},Tl,{view:0,detail:0}),E5=Rr(Ga),sm,lm,Ya,sd=j({},Ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:um,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!==Ya&&(Ya&&a.type==="mousemove"?(sm=a.screenX-Ya.screenX,lm=a.screenY-Ya.screenY):lm=sm=0,Ya=a),sm)},movementY:function(a){return"movementY"in a?a.movementY:lm}}),$b=Rr(sd),N5=j({},sd,{dataTransfer:0}),T5=Rr(N5),A5=j({},Ga,{relatedTarget:0}),am=Rr(A5),_5=j({},Tl,{animationName:0,elapsedTime:0,pseudoElement:0}),M5=Rr(_5),j5=j({},Tl,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),D5=Rr(j5),R5=j({},Tl,{data:0}),Vb=Rr(R5),P5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I5={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"},O5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L5(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=O5[a])?!!c[a]:!1}function um(){return L5}var F5=j({},Ga,{key:function(a){if(a.key){var c=P5[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=id(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?I5[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:um,charCode:function(a){return a.type==="keypress"?id(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?id(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),z5=Rr(F5),B5=j({},sd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hb=Rr(B5),$5=j({},Ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:um}),V5=Rr($5),H5=j({},Tl,{propertyName:0,elapsedTime:0,pseudoElement:0}),U5=Rr(H5),W5=j({},sd,{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}),q5=Rr(W5),K5=[9,13,27,32],cm=l&&"CompositionEvent"in window,Ja=null;l&&"documentMode"in document&&(Ja=document.documentMode);var G5=l&&"TextEvent"in window&&!Ja,Ub=l&&(!cm||Ja&&8<Ja&&11>=Ja),Wb=" ",qb=!1;function Kb(a,c){switch(a){case"keyup":return K5.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Al=!1;function Y5(a,c){switch(a){case"compositionend":return Gb(c);case"keypress":return c.which!==32?null:(qb=!0,Wb);case"textInput":return a=c.data,a===Wb&&qb?null:a;default:return null}}function J5(a,c){if(Al)return a==="compositionend"||!cm&&Kb(a,c)?(a=zb(),rd=im=Ro=null,Al=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Ub&&c.locale!=="ko"?null:c.data;default:return null}}var X5={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 Yb(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!X5[a.type]:c==="textarea"}function Jb(a,c,m,b){We(b),c=dd(c,"onChange"),0<c.length&&(m=new om("onChange","change",null,m,b),a.push({event:m,listeners:c}))}var Xa=null,Qa=null;function Q5(a){pv(a,0)}function ld(a){var c=Rl(a);if(Be(c))return a}function Z5(a,c){if(a==="change")return c}var Xb=!1;if(l){var dm;if(l){var fm="oninput"in document;if(!fm){var Qb=document.createElement("div");Qb.setAttribute("oninput","return;"),fm=typeof Qb.oninput=="function"}dm=fm}else dm=!1;Xb=dm&&(!document.documentMode||9<document.documentMode)}function Zb(){Xa&&(Xa.detachEvent("onpropertychange",ev),Qa=Xa=null)}function ev(a){if(a.propertyName==="value"&&ld(Qa)){var c=[];Jb(c,Qa,a,Dn(a)),zt(Q5,c)}}function ej(a,c,m){a==="focusin"?(Zb(),Xa=c,Qa=m,Xa.attachEvent("onpropertychange",ev)):a==="focusout"&&Zb()}function tj(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ld(Qa)}function nj(a,c){if(a==="click")return ld(c)}function rj(a,c){if(a==="input"||a==="change")return ld(c)}function ij(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ci=typeof Object.is=="function"?Object.is:ij;function Za(a,c){if(ci(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var m=Object.keys(a),b=Object.keys(c);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++){var S=m[b];if(!u.call(c,S)||!ci(a[S],c[S]))return!1}return!0}function tv(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function nv(a,c){var m=tv(a);a=0;for(var b;m;){if(m.nodeType===3){if(b=a+m.textContent.length,a<=c&&b>=c)return{node:m,offset:c-a};a=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=tv(m)}}function rv(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?rv(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function iv(){for(var a=window,c=at();c instanceof a.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)a=c.contentWindow;else break;c=at(a.document)}return c}function hm(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function oj(a){var c=iv(),m=a.focusedElem,b=a.selectionRange;if(c!==m&&m&&m.ownerDocument&&rv(m.ownerDocument.documentElement,m)){if(b!==null&&hm(m)){if(c=b.start,a=b.end,a===void 0&&(a=c),"selectionStart"in m)m.selectionStart=c,m.selectionEnd=Math.min(a,m.value.length);else if(a=(c=m.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var S=m.textContent.length,E=Math.min(b.start,S);b=b.end===void 0?E:Math.min(b.end,S),!a.extend&&E>b&&(S=b,b=E,E=S),S=nv(m,E);var M=nv(m,b);S&&M&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==M.node||a.focusOffset!==M.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),a.removeAllRanges(),E>b?(a.addRange(c),a.extend(M.node,M.offset)):(c.setEnd(M.node,M.offset),a.addRange(c)))}}for(c=[],a=m;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<c.length;m++)a=c[m],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var sj=l&&"documentMode"in document&&11>=document.documentMode,_l=null,pm=null,eu=null,mm=!1;function ov(a,c,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;mm||_l==null||_l!==at(b)||(b=_l,"selectionStart"in b&&hm(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),eu&&Za(eu,b)||(eu=b,b=dd(pm,"onSelect"),0<b.length&&(c=new om("onSelect","select",null,c,m),a.push({event:c,listeners:b}),c.target=_l)))}function ad(a,c){var m={};return m[a.toLowerCase()]=c.toLowerCase(),m["Webkit"+a]="webkit"+c,m["Moz"+a]="moz"+c,m}var Ml={animationend:ad("Animation","AnimationEnd"),animationiteration:ad("Animation","AnimationIteration"),animationstart:ad("Animation","AnimationStart"),transitionend:ad("Transition","TransitionEnd")},gm={},sv={};l&&(sv=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function ud(a){if(gm[a])return gm[a];if(!Ml[a])return a;var c=Ml[a],m;for(m in c)if(c.hasOwnProperty(m)&&m in sv)return gm[a]=c[m];return a}var lv=ud("animationend"),av=ud("animationiteration"),uv=ud("animationstart"),cv=ud("transitionend"),dv=new Map,fv="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 Po(a,c){dv.set(a,c),o(c,[a])}for(var xm=0;xm<fv.length;xm++){var ym=fv[xm],lj=ym.toLowerCase(),aj=ym[0].toUpperCase()+ym.slice(1);Po(lj,"on"+aj)}Po(lv,"onAnimationEnd"),Po(av,"onAnimationIteration"),Po(uv,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(cv,"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 tu="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(" "),uj=new Set("cancel close invalid load scroll toggle".split(" ").concat(tu));function hv(a,c,m){var b=a.type||"unknown-event";a.currentTarget=m,nt(b,c,void 0,a),a.currentTarget=null}function pv(a,c){c=(c&4)!==0;for(var m=0;m<a.length;m++){var b=a[m],S=b.event;b=b.listeners;e:{var E=void 0;if(c)for(var M=b.length-1;0<=M;M--){var F=b[M],$=F.instance,Q=F.currentTarget;if(F=F.listener,$!==E&&S.isPropagationStopped())break e;hv(S,F,Q),E=$}else for(M=0;M<b.length;M++){if(F=b[M],$=F.instance,Q=F.currentTarget,F=F.listener,$!==E&&S.isPropagationStopped())break e;hv(S,F,Q),E=$}}}if(qe)throw a=Pt,qe=!1,Pt=null,a}function jt(a,c){var m=c[Nm];m===void 0&&(m=c[Nm]=new Set);var b=a+"__bubble";m.has(b)||(mv(c,a,2,!1),m.add(b))}function bm(a,c,m){var b=0;c&&(b|=4),mv(m,a,b,c)}var cd="_reactListening"+Math.random().toString(36).slice(2);function nu(a){if(!a[cd]){a[cd]=!0,r.forEach(function(m){m!=="selectionchange"&&(uj.has(m)||bm(m,!1,a),bm(m,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[cd]||(c[cd]=!0,bm("selectionchange",!1,c))}}function mv(a,c,m,b){switch(Fb(c)){case 1:var S=S5;break;case 4:S=C5;break;default:S=nm}m=S.bind(null,c,m,a),S=void 0,!Kr||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(S=!0),b?S!==void 0?a.addEventListener(c,m,{capture:!0,passive:S}):a.addEventListener(c,m,!0):S!==void 0?a.addEventListener(c,m,{passive:S}):a.addEventListener(c,m,!1)}function vm(a,c,m,b,S){var E=b;if((c&1)===0&&(c&2)===0&&b!==null)e:for(;;){if(b===null)return;var M=b.tag;if(M===3||M===4){var F=b.stateNode.containerInfo;if(F===S||F.nodeType===8&&F.parentNode===S)break;if(M===4)for(M=b.return;M!==null;){var $=M.tag;if(($===3||$===4)&&($=M.stateNode.containerInfo,$===S||$.nodeType===8&&$.parentNode===S))return;M=M.return}for(;F!==null;){if(M=Ds(F),M===null)return;if($=M.tag,$===5||$===6){b=E=M;continue e}F=F.parentNode}}b=b.return}zt(function(){var Q=E,ae=Dn(m),fe=[];e:{var oe=dv.get(a);if(oe!==void 0){var ke=om,Ae=a;switch(a){case"keypress":if(id(m)===0)break e;case"keydown":case"keyup":ke=z5;break;case"focusin":Ae="focus",ke=am;break;case"focusout":Ae="blur",ke=am;break;case"beforeblur":case"afterblur":ke=am;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":ke=$b;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=T5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=V5;break;case lv:case av:case uv:ke=M5;break;case cv:ke=U5;break;case"scroll":ke=E5;break;case"wheel":ke=q5;break;case"copy":case"cut":case"paste":ke=D5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=Hb}var je=(c&4)!==0,Xt=!je&&a==="scroll",J=je?oe!==null?oe+"Capture":null:oe;je=[];for(var H=Q,X;H!==null;){X=H;var ye=X.stateNode;if(X.tag===5&&ye!==null&&(X=ye,J!==null&&(ye=Ut(H,J),ye!=null&&je.push(ru(H,ye,X)))),Xt)break;H=H.return}0<je.length&&(oe=new ke(oe,Ae,null,m,ae),fe.push({event:oe,listeners:je}))}}if((c&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",ke=a==="mouseout"||a==="pointerout",oe&&m!==Lt&&(Ae=m.relatedTarget||m.fromElement)&&(Ds(Ae)||Ae[to]))break e;if((ke||oe)&&(oe=ae.window===ae?ae:(oe=ae.ownerDocument)?oe.defaultView||oe.parentWindow:window,ke?(Ae=m.relatedTarget||m.toElement,ke=Q,Ae=Ae?Ds(Ae):null,Ae!==null&&(Xt=ot(Ae),Ae!==Xt||Ae.tag!==5&&Ae.tag!==6)&&(Ae=null)):(ke=null,Ae=Q),ke!==Ae)){if(je=$b,ye="onMouseLeave",J="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(je=Hb,ye="onPointerLeave",J="onPointerEnter",H="pointer"),Xt=ke==null?oe:Rl(ke),X=Ae==null?oe:Rl(Ae),oe=new je(ye,H+"leave",ke,m,ae),oe.target=Xt,oe.relatedTarget=X,ye=null,Ds(ae)===Q&&(je=new je(J,H+"enter",Ae,m,ae),je.target=X,je.relatedTarget=Xt,ye=je),Xt=ye,ke&&Ae)t:{for(je=ke,J=Ae,H=0,X=je;X;X=jl(X))H++;for(X=0,ye=J;ye;ye=jl(ye))X++;for(;0<H-X;)je=jl(je),H--;for(;0<X-H;)J=jl(J),X--;for(;H--;){if(je===J||J!==null&&je===J.alternate)break t;je=jl(je),J=jl(J)}je=null}else je=null;ke!==null&&gv(fe,oe,ke,je,!1),Ae!==null&&Xt!==null&&gv(fe,Xt,Ae,je,!0)}}e:{if(oe=Q?Rl(Q):window,ke=oe.nodeName&&oe.nodeName.toLowerCase(),ke==="select"||ke==="input"&&oe.type==="file")var Pe=Z5;else if(Yb(oe))if(Xb)Pe=rj;else{Pe=tj;var $e=ej}else(ke=oe.nodeName)&&ke.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Pe=nj);if(Pe&&(Pe=Pe(a,Q))){Jb(fe,Pe,m,ae);break e}$e&&$e(a,oe,Q),a==="focusout"&&($e=oe._wrapperState)&&$e.controlled&&oe.type==="number"&&xt(oe,"number",oe.value)}switch($e=Q?Rl(Q):window,a){case"focusin":(Yb($e)||$e.contentEditable==="true")&&(_l=$e,pm=Q,eu=null);break;case"focusout":eu=pm=_l=null;break;case"mousedown":mm=!0;break;case"contextmenu":case"mouseup":case"dragend":mm=!1,ov(fe,m,ae);break;case"selectionchange":if(sj)break;case"keydown":case"keyup":ov(fe,m,ae)}var Ve;if(cm)e:{switch(a){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Al?Kb(a,m)&&(Ke="onCompositionEnd"):a==="keydown"&&m.keyCode===229&&(Ke="onCompositionStart");Ke&&(Ub&&m.locale!=="ko"&&(Al||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Al&&(Ve=zb()):(Ro=ae,im="value"in Ro?Ro.value:Ro.textContent,Al=!0)),$e=dd(Q,Ke),0<$e.length&&(Ke=new Vb(Ke,a,null,m,ae),fe.push({event:Ke,listeners:$e}),Ve?Ke.data=Ve:(Ve=Gb(m),Ve!==null&&(Ke.data=Ve)))),(Ve=G5?Y5(a,m):J5(a,m))&&(Q=dd(Q,"onBeforeInput"),0<Q.length&&(ae=new Vb("onBeforeInput","beforeinput",null,m,ae),fe.push({event:ae,listeners:Q}),ae.data=Ve))}pv(fe,c)})}function ru(a,c,m){return{instance:a,listener:c,currentTarget:m}}function dd(a,c){for(var m=c+"Capture",b=[];a!==null;){var S=a,E=S.stateNode;S.tag===5&&E!==null&&(S=E,E=Ut(a,m),E!=null&&b.unshift(ru(a,E,S)),E=Ut(a,c),E!=null&&b.push(ru(a,E,S))),a=a.return}return b}function jl(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function gv(a,c,m,b,S){for(var E=c._reactName,M=[];m!==null&&m!==b;){var F=m,$=F.alternate,Q=F.stateNode;if($!==null&&$===b)break;F.tag===5&&Q!==null&&(F=Q,S?($=Ut(m,E),$!=null&&M.unshift(ru(m,$,F))):S||($=Ut(m,E),$!=null&&M.push(ru(m,$,F)))),m=m.return}M.length!==0&&a.push({event:c,listeners:M})}var cj=/\r\n?/g,dj=/\u0000|\uFFFD/g;function xv(a){return(typeof a=="string"?a:""+a).replace(cj,`
|
|
38
|
+
`).replace(dj,"")}function fd(a,c,m){if(c=xv(c),xv(a)!==c&&m)throw Error(n(425))}function hd(){}var wm=null,km=null;function Sm(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Cm=typeof setTimeout=="function"?setTimeout:void 0,fj=typeof clearTimeout=="function"?clearTimeout:void 0,yv=typeof Promise=="function"?Promise:void 0,hj=typeof queueMicrotask=="function"?queueMicrotask:typeof yv<"u"?function(a){return yv.resolve(null).then(a).catch(pj)}:Cm;function pj(a){setTimeout(function(){throw a})}function Em(a,c){var m=c,b=0;do{var S=m.nextSibling;if(a.removeChild(m),S&&S.nodeType===8)if(m=S.data,m==="/$"){if(b===0){a.removeChild(S),Ka(c);return}b--}else m!=="$"&&m!=="$?"&&m!=="$!"||b++;m=S}while(m);Ka(c)}function Io(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function bv(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var m=a.data;if(m==="$"||m==="$!"||m==="$?"){if(c===0)return a;c--}else m==="/$"&&c++}a=a.previousSibling}return null}var Dl=Math.random().toString(36).slice(2),Ai="__reactFiber$"+Dl,iu="__reactProps$"+Dl,to="__reactContainer$"+Dl,Nm="__reactEvents$"+Dl,mj="__reactListeners$"+Dl,gj="__reactHandles$"+Dl;function Ds(a){var c=a[Ai];if(c)return c;for(var m=a.parentNode;m;){if(c=m[to]||m[Ai]){if(m=c.alternate,c.child!==null||m!==null&&m.child!==null)for(a=bv(a);a!==null;){if(m=a[Ai])return m;a=bv(a)}return c}a=m,m=a.parentNode}return null}function ou(a){return a=a[Ai]||a[to],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Rl(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function pd(a){return a[iu]||null}var Tm=[],Pl=-1;function Oo(a){return{current:a}}function Dt(a){0>Pl||(a.current=Tm[Pl],Tm[Pl]=null,Pl--)}function St(a,c){Pl++,Tm[Pl]=a.current,a.current=c}var Lo={},Hn=Oo(Lo),br=Oo(!1),Rs=Lo;function Il(a,c){var m=a.type.contextTypes;if(!m)return Lo;var b=a.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===c)return b.__reactInternalMemoizedMaskedChildContext;var S={},E;for(E in m)S[E]=c[E];return b&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=S),S}function vr(a){return a=a.childContextTypes,a!=null}function md(){Dt(br),Dt(Hn)}function vv(a,c,m){if(Hn.current!==Lo)throw Error(n(168));St(Hn,c),St(br,m)}function wv(a,c,m){var b=a.stateNode;if(c=c.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var S in b)if(!(S in c))throw Error(n(108,ie(a)||"Unknown",S));return j({},m,b)}function gd(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Lo,Rs=Hn.current,St(Hn,a),St(br,br.current),!0}function kv(a,c,m){var b=a.stateNode;if(!b)throw Error(n(169));m?(a=wv(a,c,Rs),b.__reactInternalMemoizedMergedChildContext=a,Dt(br),Dt(Hn),St(Hn,a)):Dt(br),St(br,m)}var no=null,xd=!1,Am=!1;function Sv(a){no===null?no=[a]:no.push(a)}function xj(a){xd=!0,Sv(a)}function Fo(){if(!Am&&no!==null){Am=!0;var a=0,c=mt;try{var m=no;for(mt=1;a<m.length;a++){var b=m[a];do b=b(!0);while(b!==null)}no=null,xd=!1}catch(S){throw no!==null&&(no=no.slice(a+1)),Eb(Jp,Fo),S}finally{mt=c,Am=!1}}return null}var Ol=[],Ll=0,yd=null,bd=0,Gr=[],Yr=0,Ps=null,ro=1,io="";function Is(a,c){Ol[Ll++]=bd,Ol[Ll++]=yd,yd=a,bd=c}function Cv(a,c,m){Gr[Yr++]=ro,Gr[Yr++]=io,Gr[Yr++]=Ps,Ps=a;var b=ro;a=io;var S=32-ui(b)-1;b&=~(1<<S),m+=1;var E=32-ui(c)+S;if(30<E){var M=S-S%5;E=(b&(1<<M)-1).toString(32),b>>=M,S-=M,ro=1<<32-ui(c)+S|m<<S|b,io=E+a}else ro=1<<E|m<<S|b,io=a}function _m(a){a.return!==null&&(Is(a,1),Cv(a,1,0))}function Mm(a){for(;a===yd;)yd=Ol[--Ll],Ol[Ll]=null,bd=Ol[--Ll],Ol[Ll]=null;for(;a===Ps;)Ps=Gr[--Yr],Gr[Yr]=null,io=Gr[--Yr],Gr[Yr]=null,ro=Gr[--Yr],Gr[Yr]=null}var Pr=null,Ir=null,It=!1,di=null;function Ev(a,c){var m=Zr(5,null,null,0);m.elementType="DELETED",m.stateNode=c,m.return=a,c=a.deletions,c===null?(a.deletions=[m],a.flags|=16):c.push(m)}function Nv(a,c){switch(a.tag){case 5:var m=a.type;return c=c.nodeType!==1||m.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,Pr=a,Ir=Io(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,Pr=a,Ir=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(m=Ps!==null?{id:ro,overflow:io}:null,a.memoizedState={dehydrated:c,treeContext:m,retryLane:1073741824},m=Zr(18,null,null,0),m.stateNode=c,m.return=a,a.child=m,Pr=a,Ir=null,!0):!1;default:return!1}}function jm(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Dm(a){if(It){var c=Ir;if(c){var m=c;if(!Nv(a,c)){if(jm(a))throw Error(n(418));c=Io(m.nextSibling);var b=Pr;c&&Nv(a,c)?Ev(b,m):(a.flags=a.flags&-4097|2,It=!1,Pr=a)}}else{if(jm(a))throw Error(n(418));a.flags=a.flags&-4097|2,It=!1,Pr=a}}}function Tv(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Pr=a}function vd(a){if(a!==Pr)return!1;if(!It)return Tv(a),It=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Sm(a.type,a.memoizedProps)),c&&(c=Ir)){if(jm(a))throw Av(),Error(n(418));for(;c;)Ev(a,c),c=Io(c.nextSibling)}if(Tv(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var m=a.data;if(m==="/$"){if(c===0){Ir=Io(a.nextSibling);break e}c--}else m!=="$"&&m!=="$!"&&m!=="$?"||c++}a=a.nextSibling}Ir=null}}else Ir=Pr?Io(a.stateNode.nextSibling):null;return!0}function Av(){for(var a=Ir;a;)a=Io(a.nextSibling)}function Fl(){Ir=Pr=null,It=!1}function Rm(a){di===null?di=[a]:di.push(a)}var yj=D.ReactCurrentBatchConfig;function su(a,c,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 b=m.stateNode}if(!b)throw Error(n(147,a));var S=b,E=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===E?c.ref:(c=function(M){var F=S.refs;M===null?delete F[E]:F[E]=M},c._stringRef=E,c)}if(typeof a!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,a))}return a}function wd(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function _v(a){var c=a._init;return c(a._payload)}function Mv(a){function c(J,H){if(a){var X=J.deletions;X===null?(J.deletions=[H],J.flags|=16):X.push(H)}}function m(J,H){if(!a)return null;for(;H!==null;)c(J,H),H=H.sibling;return null}function b(J,H){for(J=new Map;H!==null;)H.key!==null?J.set(H.key,H):J.set(H.index,H),H=H.sibling;return J}function S(J,H){return J=qo(J,H),J.index=0,J.sibling=null,J}function E(J,H,X){return J.index=X,a?(X=J.alternate,X!==null?(X=X.index,X<H?(J.flags|=2,H):X):(J.flags|=2,H)):(J.flags|=1048576,H)}function M(J){return a&&J.alternate===null&&(J.flags|=2),J}function F(J,H,X,ye){return H===null||H.tag!==6?(H=C0(X,J.mode,ye),H.return=J,H):(H=S(H,X),H.return=J,H)}function $(J,H,X,ye){var Pe=X.type;return Pe===I?ae(J,H,X.props.children,ye,X.key):H!==null&&(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===U&&_v(Pe)===H.type)?(ye=S(H,X.props),ye.ref=su(J,H,X),ye.return=J,ye):(ye=Wd(X.type,X.key,X.props,null,J.mode,ye),ye.ref=su(J,H,X),ye.return=J,ye)}function Q(J,H,X,ye){return H===null||H.tag!==4||H.stateNode.containerInfo!==X.containerInfo||H.stateNode.implementation!==X.implementation?(H=E0(X,J.mode,ye),H.return=J,H):(H=S(H,X.children||[]),H.return=J,H)}function ae(J,H,X,ye,Pe){return H===null||H.tag!==7?(H=Hs(X,J.mode,ye,Pe),H.return=J,H):(H=S(H,X),H.return=J,H)}function fe(J,H,X){if(typeof H=="string"&&H!==""||typeof H=="number")return H=C0(""+H,J.mode,X),H.return=J,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case A:return X=Wd(H.type,H.key,H.props,null,J.mode,X),X.ref=su(J,null,H),X.return=J,X;case _:return H=E0(H,J.mode,X),H.return=J,H;case U:var ye=H._init;return fe(J,ye(H._payload),X)}if(Vn(H)||Y(H))return H=Hs(H,J.mode,X,null),H.return=J,H;wd(J,H)}return null}function oe(J,H,X,ye){var Pe=H!==null?H.key:null;if(typeof X=="string"&&X!==""||typeof X=="number")return Pe!==null?null:F(J,H,""+X,ye);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case A:return X.key===Pe?$(J,H,X,ye):null;case _:return X.key===Pe?Q(J,H,X,ye):null;case U:return Pe=X._init,oe(J,H,Pe(X._payload),ye)}if(Vn(X)||Y(X))return Pe!==null?null:ae(J,H,X,ye,null);wd(J,X)}return null}function ke(J,H,X,ye,Pe){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return J=J.get(X)||null,F(H,J,""+ye,Pe);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case A:return J=J.get(ye.key===null?X:ye.key)||null,$(H,J,ye,Pe);case _:return J=J.get(ye.key===null?X:ye.key)||null,Q(H,J,ye,Pe);case U:var $e=ye._init;return ke(J,H,X,$e(ye._payload),Pe)}if(Vn(ye)||Y(ye))return J=J.get(X)||null,ae(H,J,ye,Pe,null);wd(H,ye)}return null}function Ae(J,H,X,ye){for(var Pe=null,$e=null,Ve=H,Ke=H=0,En=null;Ve!==null&&Ke<X.length;Ke++){Ve.index>Ke?(En=Ve,Ve=null):En=Ve.sibling;var ct=oe(J,Ve,X[Ke],ye);if(ct===null){Ve===null&&(Ve=En);break}a&&Ve&&ct.alternate===null&&c(J,Ve),H=E(ct,H,Ke),$e===null?Pe=ct:$e.sibling=ct,$e=ct,Ve=En}if(Ke===X.length)return m(J,Ve),It&&Is(J,Ke),Pe;if(Ve===null){for(;Ke<X.length;Ke++)Ve=fe(J,X[Ke],ye),Ve!==null&&(H=E(Ve,H,Ke),$e===null?Pe=Ve:$e.sibling=Ve,$e=Ve);return It&&Is(J,Ke),Pe}for(Ve=b(J,Ve);Ke<X.length;Ke++)En=ke(Ve,J,Ke,X[Ke],ye),En!==null&&(a&&En.alternate!==null&&Ve.delete(En.key===null?Ke:En.key),H=E(En,H,Ke),$e===null?Pe=En:$e.sibling=En,$e=En);return a&&Ve.forEach(function(Ko){return c(J,Ko)}),It&&Is(J,Ke),Pe}function je(J,H,X,ye){var Pe=Y(X);if(typeof Pe!="function")throw Error(n(150));if(X=Pe.call(X),X==null)throw Error(n(151));for(var $e=Pe=null,Ve=H,Ke=H=0,En=null,ct=X.next();Ve!==null&&!ct.done;Ke++,ct=X.next()){Ve.index>Ke?(En=Ve,Ve=null):En=Ve.sibling;var Ko=oe(J,Ve,ct.value,ye);if(Ko===null){Ve===null&&(Ve=En);break}a&&Ve&&Ko.alternate===null&&c(J,Ve),H=E(Ko,H,Ke),$e===null?Pe=Ko:$e.sibling=Ko,$e=Ko,Ve=En}if(ct.done)return m(J,Ve),It&&Is(J,Ke),Pe;if(Ve===null){for(;!ct.done;Ke++,ct=X.next())ct=fe(J,ct.value,ye),ct!==null&&(H=E(ct,H,Ke),$e===null?Pe=ct:$e.sibling=ct,$e=ct);return It&&Is(J,Ke),Pe}for(Ve=b(J,Ve);!ct.done;Ke++,ct=X.next())ct=ke(Ve,J,Ke,ct.value,ye),ct!==null&&(a&&ct.alternate!==null&&Ve.delete(ct.key===null?Ke:ct.key),H=E(ct,H,Ke),$e===null?Pe=ct:$e.sibling=ct,$e=ct);return a&&Ve.forEach(function(Xj){return c(J,Xj)}),It&&Is(J,Ke),Pe}function Xt(J,H,X,ye){if(typeof X=="object"&&X!==null&&X.type===I&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case A:e:{for(var Pe=X.key,$e=H;$e!==null;){if($e.key===Pe){if(Pe=X.type,Pe===I){if($e.tag===7){m(J,$e.sibling),H=S($e,X.props.children),H.return=J,J=H;break e}}else if($e.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===U&&_v(Pe)===$e.type){m(J,$e.sibling),H=S($e,X.props),H.ref=su(J,$e,X),H.return=J,J=H;break e}m(J,$e);break}else c(J,$e);$e=$e.sibling}X.type===I?(H=Hs(X.props.children,J.mode,ye,X.key),H.return=J,J=H):(ye=Wd(X.type,X.key,X.props,null,J.mode,ye),ye.ref=su(J,H,X),ye.return=J,J=ye)}return M(J);case _:e:{for($e=X.key;H!==null;){if(H.key===$e)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){m(J,H.sibling),H=S(H,X.children||[]),H.return=J,J=H;break e}else{m(J,H);break}else c(J,H);H=H.sibling}H=E0(X,J.mode,ye),H.return=J,J=H}return M(J);case U:return $e=X._init,Xt(J,H,$e(X._payload),ye)}if(Vn(X))return Ae(J,H,X,ye);if(Y(X))return je(J,H,X,ye);wd(J,X)}return typeof X=="string"&&X!==""||typeof X=="number"?(X=""+X,H!==null&&H.tag===6?(m(J,H.sibling),H=S(H,X),H.return=J,J=H):(m(J,H),H=C0(X,J.mode,ye),H.return=J,J=H),M(J)):m(J,H)}return Xt}var zl=Mv(!0),jv=Mv(!1),kd=Oo(null),Sd=null,Bl=null,Pm=null;function Im(){Pm=Bl=Sd=null}function Om(a){var c=kd.current;Dt(kd),a._currentValue=c}function Lm(a,c,m){for(;a!==null;){var b=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,b!==null&&(b.childLanes|=c)):b!==null&&(b.childLanes&c)!==c&&(b.childLanes|=c),a===m)break;a=a.return}}function $l(a,c){Sd=a,Pm=Bl=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(wr=!0),a.firstContext=null)}function Jr(a){var c=a._currentValue;if(Pm!==a)if(a={context:a,memoizedValue:c,next:null},Bl===null){if(Sd===null)throw Error(n(308));Bl=a,Sd.dependencies={lanes:0,firstContext:a}}else Bl=Bl.next=a;return c}var Os=null;function Fm(a){Os===null?Os=[a]:Os.push(a)}function Dv(a,c,m,b){var S=c.interleaved;return S===null?(m.next=m,Fm(c)):(m.next=S.next,S.next=m),c.interleaved=m,oo(a,b)}function oo(a,c){a.lanes|=c;var m=a.alternate;for(m!==null&&(m.lanes|=c),m=a,a=a.return;a!==null;)a.childLanes|=c,m=a.alternate,m!==null&&(m.childLanes|=c),m=a,a=a.return;return m.tag===3?m.stateNode:null}var zo=!1;function zm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rv(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function so(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Bo(a,c,m){var b=a.updateQueue;if(b===null)return null;if(b=b.shared,(lt&2)!==0){var S=b.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),b.pending=c,oo(a,m)}return S=b.interleaved,S===null?(c.next=c,Fm(b)):(c.next=S.next,S.next=c),b.interleaved=c,oo(a,m)}function Cd(a,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194240)!==0)){var b=c.lanes;b&=a.pendingLanes,m|=b,c.lanes=m,Zp(a,m)}}function Pv(a,c){var m=a.updateQueue,b=a.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var S=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?S=E=M:E=E.next=M,m=m.next}while(m!==null);E===null?S=E=c:E=E.next=c}else S=E=c;m={baseState:b.baseState,firstBaseUpdate:S,lastBaseUpdate:E,shared:b.shared,effects:b.effects},a.updateQueue=m;return}a=m.lastBaseUpdate,a===null?m.firstBaseUpdate=c:a.next=c,m.lastBaseUpdate=c}function Ed(a,c,m,b){var S=a.updateQueue;zo=!1;var E=S.firstBaseUpdate,M=S.lastBaseUpdate,F=S.shared.pending;if(F!==null){S.shared.pending=null;var $=F,Q=$.next;$.next=null,M===null?E=Q:M.next=Q,M=$;var ae=a.alternate;ae!==null&&(ae=ae.updateQueue,F=ae.lastBaseUpdate,F!==M&&(F===null?ae.firstBaseUpdate=Q:F.next=Q,ae.lastBaseUpdate=$))}if(E!==null){var fe=S.baseState;M=0,ae=Q=$=null,F=E;do{var oe=F.lane,ke=F.eventTime;if((b&oe)===oe){ae!==null&&(ae=ae.next={eventTime:ke,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Ae=a,je=F;switch(oe=c,ke=m,je.tag){case 1:if(Ae=je.payload,typeof Ae=="function"){fe=Ae.call(ke,fe,oe);break e}fe=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=je.payload,oe=typeof Ae=="function"?Ae.call(ke,fe,oe):Ae,oe==null)break e;fe=j({},fe,oe);break e;case 2:zo=!0}}F.callback!==null&&F.lane!==0&&(a.flags|=64,oe=S.effects,oe===null?S.effects=[F]:oe.push(F))}else ke={eventTime:ke,lane:oe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},ae===null?(Q=ae=ke,$=fe):ae=ae.next=ke,M|=oe;if(F=F.next,F===null){if(F=S.shared.pending,F===null)break;oe=F,F=oe.next,oe.next=null,S.lastBaseUpdate=oe,S.shared.pending=null}}while(!0);if(ae===null&&($=fe),S.baseState=$,S.firstBaseUpdate=Q,S.lastBaseUpdate=ae,c=S.shared.interleaved,c!==null){S=c;do M|=S.lane,S=S.next;while(S!==c)}else E===null&&(S.shared.lanes=0);zs|=M,a.lanes=M,a.memoizedState=fe}}function Iv(a,c,m){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var b=a[c],S=b.callback;if(S!==null){if(b.callback=null,b=m,typeof S!="function")throw Error(n(191,S));S.call(b)}}}var lu={},_i=Oo(lu),au=Oo(lu),uu=Oo(lu);function Ls(a){if(a===lu)throw Error(n(174));return a}function Bm(a,c){switch(St(uu,c),St(au,a),St(_i,lu),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:he(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=he(c,a)}Dt(_i),St(_i,c)}function Vl(){Dt(_i),Dt(au),Dt(uu)}function Ov(a){Ls(uu.current);var c=Ls(_i.current),m=he(c,a.type);c!==m&&(St(au,a),St(_i,m))}function $m(a){au.current===a&&(Dt(_i),Dt(au))}var Bt=Oo(0);function Nd(a){for(var c=a;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Vm=[];function Hm(){for(var a=0;a<Vm.length;a++)Vm[a]._workInProgressVersionPrimary=null;Vm.length=0}var Td=D.ReactCurrentDispatcher,Um=D.ReactCurrentBatchConfig,Fs=0,$t=null,mn=null,Sn=null,Ad=!1,cu=!1,du=0,bj=0;function Un(){throw Error(n(321))}function Wm(a,c){if(c===null)return!1;for(var m=0;m<c.length&&m<a.length;m++)if(!ci(a[m],c[m]))return!1;return!0}function qm(a,c,m,b,S,E){if(Fs=E,$t=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Td.current=a===null||a.memoizedState===null?Sj:Cj,a=m(b,S),cu){E=0;do{if(cu=!1,du=0,25<=E)throw Error(n(301));E+=1,Sn=mn=null,c.updateQueue=null,Td.current=Ej,a=m(b,S)}while(cu)}if(Td.current=jd,c=mn!==null&&mn.next!==null,Fs=0,Sn=mn=$t=null,Ad=!1,c)throw Error(n(300));return a}function Km(){var a=du!==0;return du=0,a}function Mi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?$t.memoizedState=Sn=a:Sn=Sn.next=a,Sn}function Xr(){if(mn===null){var a=$t.alternate;a=a!==null?a.memoizedState:null}else a=mn.next;var c=Sn===null?$t.memoizedState:Sn.next;if(c!==null)Sn=c,mn=a;else{if(a===null)throw Error(n(310));mn=a,a={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},Sn===null?$t.memoizedState=Sn=a:Sn=Sn.next=a}return Sn}function fu(a,c){return typeof c=="function"?c(a):c}function Gm(a){var c=Xr(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=a;var b=mn,S=b.baseQueue,E=m.pending;if(E!==null){if(S!==null){var M=S.next;S.next=E.next,E.next=M}b.baseQueue=S=E,m.pending=null}if(S!==null){E=S.next,b=b.baseState;var F=M=null,$=null,Q=E;do{var ae=Q.lane;if((Fs&ae)===ae)$!==null&&($=$.next={lane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),b=Q.hasEagerState?Q.eagerState:a(b,Q.action);else{var fe={lane:ae,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null};$===null?(F=$=fe,M=b):$=$.next=fe,$t.lanes|=ae,zs|=ae}Q=Q.next}while(Q!==null&&Q!==E);$===null?M=b:$.next=F,ci(b,c.memoizedState)||(wr=!0),c.memoizedState=b,c.baseState=M,c.baseQueue=$,m.lastRenderedState=b}if(a=m.interleaved,a!==null){S=a;do E=S.lane,$t.lanes|=E,zs|=E,S=S.next;while(S!==a)}else S===null&&(m.lanes=0);return[c.memoizedState,m.dispatch]}function Ym(a){var c=Xr(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=a;var b=m.dispatch,S=m.pending,E=c.memoizedState;if(S!==null){m.pending=null;var M=S=S.next;do E=a(E,M.action),M=M.next;while(M!==S);ci(E,c.memoizedState)||(wr=!0),c.memoizedState=E,c.baseQueue===null&&(c.baseState=E),m.lastRenderedState=E}return[E,b]}function Lv(){}function Fv(a,c){var m=$t,b=Xr(),S=c(),E=!ci(b.memoizedState,S);if(E&&(b.memoizedState=S,wr=!0),b=b.queue,Jm($v.bind(null,m,b,a),[a]),b.getSnapshot!==c||E||Sn!==null&&Sn.memoizedState.tag&1){if(m.flags|=2048,hu(9,Bv.bind(null,m,b,S,c),void 0,null),Cn===null)throw Error(n(349));(Fs&30)!==0||zv(m,c,S)}return S}function zv(a,c,m){a.flags|=16384,a={getSnapshot:c,value:m},c=$t.updateQueue,c===null?(c={lastEffect:null,stores:null},$t.updateQueue=c,c.stores=[a]):(m=c.stores,m===null?c.stores=[a]:m.push(a))}function Bv(a,c,m,b){c.value=m,c.getSnapshot=b,Vv(c)&&Hv(a)}function $v(a,c,m){return m(function(){Vv(c)&&Hv(a)})}function Vv(a){var c=a.getSnapshot;a=a.value;try{var m=c();return!ci(a,m)}catch{return!0}}function Hv(a){var c=oo(a,1);c!==null&&mi(c,a,1,-1)}function Uv(a){var c=Mi();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fu,lastRenderedState:a},c.queue=a,a=a.dispatch=kj.bind(null,$t,a),[c.memoizedState,a]}function hu(a,c,m,b){return a={tag:a,create:c,destroy:m,deps:b,next:null},c=$t.updateQueue,c===null?(c={lastEffect:null,stores:null},$t.updateQueue=c,c.lastEffect=a.next=a):(m=c.lastEffect,m===null?c.lastEffect=a.next=a:(b=m.next,m.next=a,a.next=b,c.lastEffect=a)),a}function Wv(){return Xr().memoizedState}function _d(a,c,m,b){var S=Mi();$t.flags|=a,S.memoizedState=hu(1|c,m,void 0,b===void 0?null:b)}function Md(a,c,m,b){var S=Xr();b=b===void 0?null:b;var E=void 0;if(mn!==null){var M=mn.memoizedState;if(E=M.destroy,b!==null&&Wm(b,M.deps)){S.memoizedState=hu(c,m,E,b);return}}$t.flags|=a,S.memoizedState=hu(1|c,m,E,b)}function qv(a,c){return _d(8390656,8,a,c)}function Jm(a,c){return Md(2048,8,a,c)}function Kv(a,c){return Md(4,2,a,c)}function Gv(a,c){return Md(4,4,a,c)}function Yv(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function Jv(a,c,m){return m=m!=null?m.concat([a]):null,Md(4,4,Yv.bind(null,c,a),m)}function Xm(){}function Xv(a,c){var m=Xr();c=c===void 0?null:c;var b=m.memoizedState;return b!==null&&c!==null&&Wm(c,b[1])?b[0]:(m.memoizedState=[a,c],a)}function Qv(a,c){var m=Xr();c=c===void 0?null:c;var b=m.memoizedState;return b!==null&&c!==null&&Wm(c,b[1])?b[0]:(a=a(),m.memoizedState=[a,c],a)}function Zv(a,c,m){return(Fs&21)===0?(a.baseState&&(a.baseState=!1,wr=!0),a.memoizedState=m):(ci(m,c)||(m=_b(),$t.lanes|=m,zs|=m,a.baseState=!0),c)}function vj(a,c){var m=mt;mt=m!==0&&4>m?m:4,a(!0);var b=Um.transition;Um.transition={};try{a(!1),c()}finally{mt=m,Um.transition=b}}function ew(){return Xr().memoizedState}function wj(a,c,m){var b=Uo(a);if(m={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null},tw(a))nw(c,m);else if(m=Dv(a,c,m,b),m!==null){var S=sr();mi(m,a,b,S),rw(m,c,b)}}function kj(a,c,m){var b=Uo(a),S={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null};if(tw(a))nw(c,S);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var M=c.lastRenderedState,F=E(M,m);if(S.hasEagerState=!0,S.eagerState=F,ci(F,M)){var $=c.interleaved;$===null?(S.next=S,Fm(c)):(S.next=$.next,$.next=S),c.interleaved=S;return}}catch{}finally{}m=Dv(a,c,S,b),m!==null&&(S=sr(),mi(m,a,b,S),rw(m,c,b))}}function tw(a){var c=a.alternate;return a===$t||c!==null&&c===$t}function nw(a,c){cu=Ad=!0;var m=a.pending;m===null?c.next=c:(c.next=m.next,m.next=c),a.pending=c}function rw(a,c,m){if((m&4194240)!==0){var b=c.lanes;b&=a.pendingLanes,m|=b,c.lanes=m,Zp(a,m)}}var jd={readContext:Jr,useCallback:Un,useContext:Un,useEffect:Un,useImperativeHandle:Un,useInsertionEffect:Un,useLayoutEffect:Un,useMemo:Un,useReducer:Un,useRef:Un,useState:Un,useDebugValue:Un,useDeferredValue:Un,useTransition:Un,useMutableSource:Un,useSyncExternalStore:Un,useId:Un,unstable_isNewReconciler:!1},Sj={readContext:Jr,useCallback:function(a,c){return Mi().memoizedState=[a,c===void 0?null:c],a},useContext:Jr,useEffect:qv,useImperativeHandle:function(a,c,m){return m=m!=null?m.concat([a]):null,_d(4194308,4,Yv.bind(null,c,a),m)},useLayoutEffect:function(a,c){return _d(4194308,4,a,c)},useInsertionEffect:function(a,c){return _d(4,2,a,c)},useMemo:function(a,c){var m=Mi();return c=c===void 0?null:c,a=a(),m.memoizedState=[a,c],a},useReducer:function(a,c,m){var b=Mi();return c=m!==void 0?m(c):c,b.memoizedState=b.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},b.queue=a,a=a.dispatch=wj.bind(null,$t,a),[b.memoizedState,a]},useRef:function(a){var c=Mi();return a={current:a},c.memoizedState=a},useState:Uv,useDebugValue:Xm,useDeferredValue:function(a){return Mi().memoizedState=a},useTransition:function(){var a=Uv(!1),c=a[0];return a=vj.bind(null,a[1]),Mi().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,m){var b=$t,S=Mi();if(It){if(m===void 0)throw Error(n(407));m=m()}else{if(m=c(),Cn===null)throw Error(n(349));(Fs&30)!==0||zv(b,c,m)}S.memoizedState=m;var E={value:m,getSnapshot:c};return S.queue=E,qv($v.bind(null,b,E,a),[a]),b.flags|=2048,hu(9,Bv.bind(null,b,E,m,c),void 0,null),m},useId:function(){var a=Mi(),c=Cn.identifierPrefix;if(It){var m=io,b=ro;m=(b&~(1<<32-ui(b)-1)).toString(32)+m,c=":"+c+"R"+m,m=du++,0<m&&(c+="H"+m.toString(32)),c+=":"}else m=bj++,c=":"+c+"r"+m.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},Cj={readContext:Jr,useCallback:Xv,useContext:Jr,useEffect:Jm,useImperativeHandle:Jv,useInsertionEffect:Kv,useLayoutEffect:Gv,useMemo:Qv,useReducer:Gm,useRef:Wv,useState:function(){return Gm(fu)},useDebugValue:Xm,useDeferredValue:function(a){var c=Xr();return Zv(c,mn.memoizedState,a)},useTransition:function(){var a=Gm(fu)[0],c=Xr().memoizedState;return[a,c]},useMutableSource:Lv,useSyncExternalStore:Fv,useId:ew,unstable_isNewReconciler:!1},Ej={readContext:Jr,useCallback:Xv,useContext:Jr,useEffect:Jm,useImperativeHandle:Jv,useInsertionEffect:Kv,useLayoutEffect:Gv,useMemo:Qv,useReducer:Ym,useRef:Wv,useState:function(){return Ym(fu)},useDebugValue:Xm,useDeferredValue:function(a){var c=Xr();return mn===null?c.memoizedState=a:Zv(c,mn.memoizedState,a)},useTransition:function(){var a=Ym(fu)[0],c=Xr().memoizedState;return[a,c]},useMutableSource:Lv,useSyncExternalStore:Fv,useId:ew,unstable_isNewReconciler:!1};function fi(a,c){if(a&&a.defaultProps){c=j({},c),a=a.defaultProps;for(var m in a)c[m]===void 0&&(c[m]=a[m]);return c}return c}function Qm(a,c,m,b){c=a.memoizedState,m=m(b,c),m=m==null?c:j({},c,m),a.memoizedState=m,a.lanes===0&&(a.updateQueue.baseState=m)}var Dd={isMounted:function(a){return(a=a._reactInternals)?ot(a)===a:!1},enqueueSetState:function(a,c,m){a=a._reactInternals;var b=sr(),S=Uo(a),E=so(b,S);E.payload=c,m!=null&&(E.callback=m),c=Bo(a,E,S),c!==null&&(mi(c,a,S,b),Cd(c,a,S))},enqueueReplaceState:function(a,c,m){a=a._reactInternals;var b=sr(),S=Uo(a),E=so(b,S);E.tag=1,E.payload=c,m!=null&&(E.callback=m),c=Bo(a,E,S),c!==null&&(mi(c,a,S,b),Cd(c,a,S))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var m=sr(),b=Uo(a),S=so(m,b);S.tag=2,c!=null&&(S.callback=c),c=Bo(a,S,b),c!==null&&(mi(c,a,b,m),Cd(c,a,b))}};function iw(a,c,m,b,S,E,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(b,E,M):c.prototype&&c.prototype.isPureReactComponent?!Za(m,b)||!Za(S,E):!0}function ow(a,c,m){var b=!1,S=Lo,E=c.contextType;return typeof E=="object"&&E!==null?E=Jr(E):(S=vr(c)?Rs:Hn.current,b=c.contextTypes,E=(b=b!=null)?Il(a,S):Lo),c=new c(m,E),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Dd,a.stateNode=c,c._reactInternals=a,b&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=S,a.__reactInternalMemoizedMaskedChildContext=E),c}function sw(a,c,m,b){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,b),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,b),c.state!==a&&Dd.enqueueReplaceState(c,c.state,null)}function Zm(a,c,m,b){var S=a.stateNode;S.props=m,S.state=a.memoizedState,S.refs={},zm(a);var E=c.contextType;typeof E=="object"&&E!==null?S.context=Jr(E):(E=vr(c)?Rs:Hn.current,S.context=Il(a,E)),S.state=a.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Qm(a,c,E,m),S.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(c=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),c!==S.state&&Dd.enqueueReplaceState(S,S.state,null),Ed(a,m,S,b),S.state=a.memoizedState),typeof S.componentDidMount=="function"&&(a.flags|=4194308)}function Hl(a,c){try{var m="",b=c;do m+=pe(b),b=b.return;while(b);var S=m}catch(E){S=`
|
|
39
|
+
Error generating stack: `+E.message+`
|
|
40
|
+
`+E.stack}return{value:a,source:c,stack:S,digest:null}}function e0(a,c,m){return{value:a,source:null,stack:m??null,digest:c??null}}function t0(a,c){try{console.error(c.value)}catch(m){setTimeout(function(){throw m})}}var Nj=typeof WeakMap=="function"?WeakMap:Map;function lw(a,c,m){m=so(-1,m),m.tag=3,m.payload={element:null};var b=c.value;return m.callback=function(){zd||(zd=!0,g0=b),t0(a,c)},m}function aw(a,c,m){m=so(-1,m),m.tag=3;var b=a.type.getDerivedStateFromError;if(typeof b=="function"){var S=c.value;m.payload=function(){return b(S)},m.callback=function(){t0(a,c)}}var E=a.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(m.callback=function(){t0(a,c),typeof b!="function"&&(Vo===null?Vo=new Set([this]):Vo.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})}),m}function uw(a,c,m){var b=a.pingCache;if(b===null){b=a.pingCache=new Nj;var S=new Set;b.set(c,S)}else S=b.get(c),S===void 0&&(S=new Set,b.set(c,S));S.has(m)||(S.add(m),a=Bj.bind(null,a,c,m),c.then(a,a))}function cw(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function dw(a,c,m,b,S){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(c=so(-1,1),c.tag=2,Bo(m,c,1))),m.lanes|=1),a):(a.flags|=65536,a.lanes=S,a)}var Tj=D.ReactCurrentOwner,wr=!1;function or(a,c,m,b){c.child=a===null?jv(c,null,m,b):zl(c,a.child,m,b)}function fw(a,c,m,b,S){m=m.render;var E=c.ref;return $l(c,S),b=qm(a,c,m,b,E,S),m=Km(),a!==null&&!wr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,lo(a,c,S)):(It&&m&&_m(c),c.flags|=1,or(a,c,b,S),c.child)}function hw(a,c,m,b,S){if(a===null){var E=m.type;return typeof E=="function"&&!S0(E)&&E.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=E,pw(a,c,E,b,S)):(a=Wd(m.type,null,b,c,c.mode,S),a.ref=c.ref,a.return=c,c.child=a)}if(E=a.child,(a.lanes&S)===0){var M=E.memoizedProps;if(m=m.compare,m=m!==null?m:Za,m(M,b)&&a.ref===c.ref)return lo(a,c,S)}return c.flags|=1,a=qo(E,b),a.ref=c.ref,a.return=c,c.child=a}function pw(a,c,m,b,S){if(a!==null){var E=a.memoizedProps;if(Za(E,b)&&a.ref===c.ref)if(wr=!1,c.pendingProps=b=E,(a.lanes&S)!==0)(a.flags&131072)!==0&&(wr=!0);else return c.lanes=a.lanes,lo(a,c,S)}return n0(a,c,m,b,S)}function mw(a,c,m){var b=c.pendingProps,S=b.children,E=a!==null?a.memoizedState:null;if(b.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},St(Wl,Or),Or|=m;else{if((m&1073741824)===0)return a=E!==null?E.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,St(Wl,Or),Or|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=E!==null?E.baseLanes:m,St(Wl,Or),Or|=b}else E!==null?(b=E.baseLanes|m,c.memoizedState=null):b=m,St(Wl,Or),Or|=b;return or(a,c,S,m),c.child}function gw(a,c){var m=c.ref;(a===null&&m!==null||a!==null&&a.ref!==m)&&(c.flags|=512,c.flags|=2097152)}function n0(a,c,m,b,S){var E=vr(m)?Rs:Hn.current;return E=Il(c,E),$l(c,S),m=qm(a,c,m,b,E,S),b=Km(),a!==null&&!wr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,lo(a,c,S)):(It&&b&&_m(c),c.flags|=1,or(a,c,m,S),c.child)}function xw(a,c,m,b,S){if(vr(m)){var E=!0;gd(c)}else E=!1;if($l(c,S),c.stateNode===null)Pd(a,c),ow(c,m,b),Zm(c,m,b,S),b=!0;else if(a===null){var M=c.stateNode,F=c.memoizedProps;M.props=F;var $=M.context,Q=m.contextType;typeof Q=="object"&&Q!==null?Q=Jr(Q):(Q=vr(m)?Rs:Hn.current,Q=Il(c,Q));var ae=m.getDerivedStateFromProps,fe=typeof ae=="function"||typeof M.getSnapshotBeforeUpdate=="function";fe||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(F!==b||$!==Q)&&sw(c,M,b,Q),zo=!1;var oe=c.memoizedState;M.state=oe,Ed(c,b,M,S),$=c.memoizedState,F!==b||oe!==$||br.current||zo?(typeof ae=="function"&&(Qm(c,m,ae,b),$=c.memoizedState),(F=zo||iw(c,m,F,b,oe,$,Q))?(fe||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"&&(c.flags|=4194308)):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=b,c.memoizedState=$),M.props=b,M.state=$,M.context=Q,b=F):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),b=!1)}else{M=c.stateNode,Rv(a,c),F=c.memoizedProps,Q=c.type===c.elementType?F:fi(c.type,F),M.props=Q,fe=c.pendingProps,oe=M.context,$=m.contextType,typeof $=="object"&&$!==null?$=Jr($):($=vr(m)?Rs:Hn.current,$=Il(c,$));var ke=m.getDerivedStateFromProps;(ae=typeof ke=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(F!==fe||oe!==$)&&sw(c,M,b,$),zo=!1,oe=c.memoizedState,M.state=oe,Ed(c,b,M,S);var Ae=c.memoizedState;F!==fe||oe!==Ae||br.current||zo?(typeof ke=="function"&&(Qm(c,m,ke,b),Ae=c.memoizedState),(Q=zo||iw(c,m,Q,b,oe,Ae,$)||!1)?(ae||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(b,Ae,$),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(b,Ae,$)),typeof M.componentDidUpdate=="function"&&(c.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof M.componentDidUpdate!="function"||F===a.memoizedProps&&oe===a.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||F===a.memoizedProps&&oe===a.memoizedState||(c.flags|=1024),c.memoizedProps=b,c.memoizedState=Ae),M.props=b,M.state=Ae,M.context=$,b=Q):(typeof M.componentDidUpdate!="function"||F===a.memoizedProps&&oe===a.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||F===a.memoizedProps&&oe===a.memoizedState||(c.flags|=1024),b=!1)}return r0(a,c,m,b,E,S)}function r0(a,c,m,b,S,E){gw(a,c);var M=(c.flags&128)!==0;if(!b&&!M)return S&&kv(c,m,!1),lo(a,c,E);b=c.stateNode,Tj.current=c;var F=M&&typeof m.getDerivedStateFromError!="function"?null:b.render();return c.flags|=1,a!==null&&M?(c.child=zl(c,a.child,null,E),c.child=zl(c,null,F,E)):or(a,c,F,E),c.memoizedState=b.state,S&&kv(c,m,!0),c.child}function yw(a){var c=a.stateNode;c.pendingContext?vv(a,c.pendingContext,c.pendingContext!==c.context):c.context&&vv(a,c.context,!1),Bm(a,c.containerInfo)}function bw(a,c,m,b,S){return Fl(),Rm(S),c.flags|=256,or(a,c,m,b),c.child}var i0={dehydrated:null,treeContext:null,retryLane:0};function o0(a){return{baseLanes:a,cachePool:null,transitions:null}}function vw(a,c,m){var b=c.pendingProps,S=Bt.current,E=!1,M=(c.flags&128)!==0,F;if((F=M)||(F=a!==null&&a.memoizedState===null?!1:(S&2)!==0),F?(E=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(S|=1),St(Bt,S&1),a===null)return Dm(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(M=b.children,a=b.fallback,E?(b=c.mode,E=c.child,M={mode:"hidden",children:M},(b&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=M):E=qd(M,b,0,null),a=Hs(a,b,m,null),E.return=c,a.return=c,E.sibling=a,c.child=E,c.child.memoizedState=o0(m),c.memoizedState=i0,a):s0(c,M));if(S=a.memoizedState,S!==null&&(F=S.dehydrated,F!==null))return Aj(a,c,M,b,F,S,m);if(E){E=b.fallback,M=c.mode,S=a.child,F=S.sibling;var $={mode:"hidden",children:b.children};return(M&1)===0&&c.child!==S?(b=c.child,b.childLanes=0,b.pendingProps=$,c.deletions=null):(b=qo(S,$),b.subtreeFlags=S.subtreeFlags&14680064),F!==null?E=qo(F,E):(E=Hs(E,M,m,null),E.flags|=2),E.return=c,b.return=c,b.sibling=E,c.child=b,b=E,E=c.child,M=a.child.memoizedState,M=M===null?o0(m):{baseLanes:M.baseLanes|m,cachePool:null,transitions:M.transitions},E.memoizedState=M,E.childLanes=a.childLanes&~m,c.memoizedState=i0,b}return E=a.child,a=E.sibling,b=qo(E,{mode:"visible",children:b.children}),(c.mode&1)===0&&(b.lanes=m),b.return=c,b.sibling=null,a!==null&&(m=c.deletions,m===null?(c.deletions=[a],c.flags|=16):m.push(a)),c.child=b,c.memoizedState=null,b}function s0(a,c){return c=qd({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Rd(a,c,m,b){return b!==null&&Rm(b),zl(c,a.child,null,m),a=s0(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function Aj(a,c,m,b,S,E,M){if(m)return c.flags&256?(c.flags&=-257,b=e0(Error(n(422))),Rd(a,c,M,b)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(E=b.fallback,S=c.mode,b=qd({mode:"visible",children:b.children},S,0,null),E=Hs(E,S,M,null),E.flags|=2,b.return=c,E.return=c,b.sibling=E,c.child=b,(c.mode&1)!==0&&zl(c,a.child,null,M),c.child.memoizedState=o0(M),c.memoizedState=i0,E);if((c.mode&1)===0)return Rd(a,c,M,null);if(S.data==="$!"){if(b=S.nextSibling&&S.nextSibling.dataset,b)var F=b.dgst;return b=F,E=Error(n(419)),b=e0(E,b,void 0),Rd(a,c,M,b)}if(F=(M&a.childLanes)!==0,wr||F){if(b=Cn,b!==null){switch(M&-M){case 4:S=2;break;case 16:S=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:S=32;break;case 536870912:S=268435456;break;default:S=0}S=(S&(b.suspendedLanes|M))!==0?0:S,S!==0&&S!==E.retryLane&&(E.retryLane=S,oo(a,S),mi(b,a,S,-1))}return k0(),b=e0(Error(n(421))),Rd(a,c,M,b)}return S.data==="$?"?(c.flags|=128,c.child=a.child,c=$j.bind(null,a),S._reactRetry=c,null):(a=E.treeContext,Ir=Io(S.nextSibling),Pr=c,It=!0,di=null,a!==null&&(Gr[Yr++]=ro,Gr[Yr++]=io,Gr[Yr++]=Ps,ro=a.id,io=a.overflow,Ps=c),c=s0(c,b.children),c.flags|=4096,c)}function ww(a,c,m){a.lanes|=c;var b=a.alternate;b!==null&&(b.lanes|=c),Lm(a.return,c,m)}function l0(a,c,m,b,S){var E=a.memoizedState;E===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:S}:(E.isBackwards=c,E.rendering=null,E.renderingStartTime=0,E.last=b,E.tail=m,E.tailMode=S)}function kw(a,c,m){var b=c.pendingProps,S=b.revealOrder,E=b.tail;if(or(a,c,b.children,m),b=Bt.current,(b&2)!==0)b=b&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&ww(a,m,c);else if(a.tag===19)ww(a,m,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}b&=1}if(St(Bt,b),(c.mode&1)===0)c.memoizedState=null;else switch(S){case"forwards":for(m=c.child,S=null;m!==null;)a=m.alternate,a!==null&&Nd(a)===null&&(S=m),m=m.sibling;m=S,m===null?(S=c.child,c.child=null):(S=m.sibling,m.sibling=null),l0(c,!1,S,m,E);break;case"backwards":for(m=null,S=c.child,c.child=null;S!==null;){if(a=S.alternate,a!==null&&Nd(a)===null){c.child=S;break}a=S.sibling,S.sibling=m,m=S,S=a}l0(c,!0,m,null,E);break;case"together":l0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Pd(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function lo(a,c,m){if(a!==null&&(c.dependencies=a.dependencies),zs|=c.lanes,(m&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,m=qo(a,a.pendingProps),c.child=m,m.return=c;a.sibling!==null;)a=a.sibling,m=m.sibling=qo(a,a.pendingProps),m.return=c;m.sibling=null}return c.child}function _j(a,c,m){switch(c.tag){case 3:yw(c),Fl();break;case 5:Ov(c);break;case 1:vr(c.type)&&gd(c);break;case 4:Bm(c,c.stateNode.containerInfo);break;case 10:var b=c.type._context,S=c.memoizedProps.value;St(kd,b._currentValue),b._currentValue=S;break;case 13:if(b=c.memoizedState,b!==null)return b.dehydrated!==null?(St(Bt,Bt.current&1),c.flags|=128,null):(m&c.child.childLanes)!==0?vw(a,c,m):(St(Bt,Bt.current&1),a=lo(a,c,m),a!==null?a.sibling:null);St(Bt,Bt.current&1);break;case 19:if(b=(m&c.childLanes)!==0,(a.flags&128)!==0){if(b)return kw(a,c,m);c.flags|=128}if(S=c.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),St(Bt,Bt.current),b)break;return null;case 22:case 23:return c.lanes=0,mw(a,c,m)}return lo(a,c,m)}var Sw,a0,Cw,Ew;Sw=function(a,c){for(var m=c.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===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},a0=function(){},Cw=function(a,c,m,b){var S=a.memoizedProps;if(S!==b){a=c.stateNode,Ls(_i.current);var E=null;switch(m){case"input":S=Xe(a,S),b=Xe(a,b),E=[];break;case"select":S=j({},S,{value:void 0}),b=j({},b,{value:void 0}),E=[];break;case"textarea":S=ft(a,S),b=ft(a,b),E=[];break;default:typeof S.onClick!="function"&&typeof b.onClick=="function"&&(a.onclick=hd)}ht(m,b);var M;m=null;for(Q in S)if(!b.hasOwnProperty(Q)&&S.hasOwnProperty(Q)&&S[Q]!=null)if(Q==="style"){var F=S[Q];for(M in F)F.hasOwnProperty(M)&&(m||(m={}),m[M]="")}else Q!=="dangerouslySetInnerHTML"&&Q!=="children"&&Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?E||(E=[]):(E=E||[]).push(Q,null));for(Q in b){var $=b[Q];if(F=S!=null?S[Q]:void 0,b.hasOwnProperty(Q)&&$!==F&&($!=null||F!=null))if(Q==="style")if(F){for(M in F)!F.hasOwnProperty(M)||$&&$.hasOwnProperty(M)||(m||(m={}),m[M]="");for(M in $)$.hasOwnProperty(M)&&F[M]!==$[M]&&(m||(m={}),m[M]=$[M])}else m||(E||(E=[]),E.push(Q,m)),m=$;else Q==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,F=F?F.__html:void 0,$!=null&&F!==$&&(E=E||[]).push(Q,$)):Q==="children"?typeof $!="string"&&typeof $!="number"||(E=E||[]).push(Q,""+$):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&(i.hasOwnProperty(Q)?($!=null&&Q==="onScroll"&&jt("scroll",a),E||F===$||(E=[])):(E=E||[]).push(Q,$))}m&&(E=E||[]).push("style",m);var Q=E;(c.updateQueue=Q)&&(c.flags|=4)}},Ew=function(a,c,m,b){m!==b&&(c.flags|=4)};function pu(a,c){if(!It)switch(a.tailMode){case"hidden":c=a.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?a.tail=null:m.sibling=null;break;case"collapsed":m=a.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:b.sibling=null}}function Wn(a){var c=a.alternate!==null&&a.alternate.child===a.child,m=0,b=0;if(c)for(var S=a.child;S!==null;)m|=S.lanes|S.childLanes,b|=S.subtreeFlags&14680064,b|=S.flags&14680064,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)m|=S.lanes|S.childLanes,b|=S.subtreeFlags,b|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=b,a.childLanes=m,c}function Mj(a,c,m){var b=c.pendingProps;switch(Mm(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(c),null;case 1:return vr(c.type)&&md(),Wn(c),null;case 3:return b=c.stateNode,Vl(),Dt(br),Dt(Hn),Hm(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(a===null||a.child===null)&&(vd(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,di!==null&&(b0(di),di=null))),a0(a,c),Wn(c),null;case 5:$m(c);var S=Ls(uu.current);if(m=c.type,a!==null&&c.stateNode!=null)Cw(a,c,m,b,S),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!b){if(c.stateNode===null)throw Error(n(166));return Wn(c),null}if(a=Ls(_i.current),vd(c)){b=c.stateNode,m=c.type;var E=c.memoizedProps;switch(b[Ai]=c,b[iu]=E,a=(c.mode&1)!==0,m){case"dialog":jt("cancel",b),jt("close",b);break;case"iframe":case"object":case"embed":jt("load",b);break;case"video":case"audio":for(S=0;S<tu.length;S++)jt(tu[S],b);break;case"source":jt("error",b);break;case"img":case"image":case"link":jt("error",b),jt("load",b);break;case"details":jt("toggle",b);break;case"input":Ot(b,E),jt("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!E.multiple},jt("invalid",b);break;case"textarea":hn(b,E),jt("invalid",b)}ht(m,E),S=null;for(var M in E)if(E.hasOwnProperty(M)){var F=E[M];M==="children"?typeof F=="string"?b.textContent!==F&&(E.suppressHydrationWarning!==!0&&fd(b.textContent,F,a),S=["children",F]):typeof F=="number"&&b.textContent!==""+F&&(E.suppressHydrationWarning!==!0&&fd(b.textContent,F,a),S=["children",""+F]):i.hasOwnProperty(M)&&F!=null&&M==="onScroll"&&jt("scroll",b)}switch(m){case"input":Le(b),nr(b,E,!0);break;case"textarea":Le(b),ir(b);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(b.onclick=hd)}b=S,c.updateQueue=b,b!==null&&(c.flags|=4)}else{M=S.nodeType===9?S:S.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=te(m)),a==="http://www.w3.org/1999/xhtml"?m==="script"?(a=M.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof b.is=="string"?a=M.createElement(m,{is:b.is}):(a=M.createElement(m),m==="select"&&(M=a,b.multiple?M.multiple=!0:b.size&&(M.size=b.size))):a=M.createElementNS(a,m),a[Ai]=c,a[iu]=b,Sw(a,c,!1,!1),c.stateNode=a;e:{switch(M=_t(m,b),m){case"dialog":jt("cancel",a),jt("close",a),S=b;break;case"iframe":case"object":case"embed":jt("load",a),S=b;break;case"video":case"audio":for(S=0;S<tu.length;S++)jt(tu[S],a);S=b;break;case"source":jt("error",a),S=b;break;case"img":case"image":case"link":jt("error",a),jt("load",a),S=b;break;case"details":jt("toggle",a),S=b;break;case"input":Ot(a,b),S=Xe(a,b),jt("invalid",a);break;case"option":S=b;break;case"select":a._wrapperState={wasMultiple:!!b.multiple},S=j({},b,{value:void 0}),jt("invalid",a);break;case"textarea":hn(a,b),S=ft(a,b),jt("invalid",a);break;default:S=b}ht(m,S),F=S;for(E in F)if(F.hasOwnProperty(E)){var $=F[E];E==="style"?jn(a,$):E==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&Fe(a,$)):E==="children"?typeof $=="string"?(m!=="textarea"||$!=="")&&Re(a,$):typeof $=="number"&&Re(a,""+$):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(i.hasOwnProperty(E)?$!=null&&E==="onScroll"&&jt("scroll",a):$!=null&&T(a,E,$,M))}switch(m){case"input":Le(a),nr(a,b,!1);break;case"textarea":Le(a),ir(a);break;case"option":b.value!=null&&a.setAttribute("value",""+ue(b.value));break;case"select":a.multiple=!!b.multiple,E=b.value,E!=null?rr(a,!!b.multiple,E,!1):b.defaultValue!=null&&rr(a,!!b.multiple,b.defaultValue,!0);break;default:typeof S.onClick=="function"&&(a.onclick=hd)}switch(m){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Wn(c),null;case 6:if(a&&c.stateNode!=null)Ew(a,c,a.memoizedProps,b);else{if(typeof b!="string"&&c.stateNode===null)throw Error(n(166));if(m=Ls(uu.current),Ls(_i.current),vd(c)){if(b=c.stateNode,m=c.memoizedProps,b[Ai]=c,(E=b.nodeValue!==m)&&(a=Pr,a!==null))switch(a.tag){case 3:fd(b.nodeValue,m,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&fd(b.nodeValue,m,(a.mode&1)!==0)}E&&(c.flags|=4)}else b=(m.nodeType===9?m:m.ownerDocument).createTextNode(b),b[Ai]=c,c.stateNode=b}return Wn(c),null;case 13:if(Dt(Bt),b=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(It&&Ir!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Av(),Fl(),c.flags|=98560,E=!1;else if(E=vd(c),b!==null&&b.dehydrated!==null){if(a===null){if(!E)throw Error(n(318));if(E=c.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Ai]=c}else Fl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Wn(c),E=!1}else di!==null&&(b0(di),di=null),E=!0;if(!E)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=m,c):(b=b!==null,b!==(a!==null&&a.memoizedState!==null)&&b&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(Bt.current&1)!==0?gn===0&&(gn=3):k0())),c.updateQueue!==null&&(c.flags|=4),Wn(c),null);case 4:return Vl(),a0(a,c),a===null&&nu(c.stateNode.containerInfo),Wn(c),null;case 10:return Om(c.type._context),Wn(c),null;case 17:return vr(c.type)&&md(),Wn(c),null;case 19:if(Dt(Bt),E=c.memoizedState,E===null)return Wn(c),null;if(b=(c.flags&128)!==0,M=E.rendering,M===null)if(b)pu(E,!1);else{if(gn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(M=Nd(a),M!==null){for(c.flags|=128,pu(E,!1),b=M.updateQueue,b!==null&&(c.updateQueue=b,c.flags|=4),c.subtreeFlags=0,b=m,m=c.child;m!==null;)E=m,a=b,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 St(Bt,Bt.current&1|2),c.child}a=a.sibling}E.tail!==null&&Jt()>ql&&(c.flags|=128,b=!0,pu(E,!1),c.lanes=4194304)}else{if(!b)if(a=Nd(M),a!==null){if(c.flags|=128,b=!0,m=a.updateQueue,m!==null&&(c.updateQueue=m,c.flags|=4),pu(E,!0),E.tail===null&&E.tailMode==="hidden"&&!M.alternate&&!It)return Wn(c),null}else 2*Jt()-E.renderingStartTime>ql&&m!==1073741824&&(c.flags|=128,b=!0,pu(E,!1),c.lanes=4194304);E.isBackwards?(M.sibling=c.child,c.child=M):(m=E.last,m!==null?m.sibling=M:c.child=M,E.last=M)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=Jt(),c.sibling=null,m=Bt.current,St(Bt,b?m&1|2:m&1),c):(Wn(c),null);case 22:case 23:return w0(),b=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==b&&(c.flags|=8192),b&&(c.mode&1)!==0?(Or&1073741824)!==0&&(Wn(c),c.subtreeFlags&6&&(c.flags|=8192)):Wn(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function jj(a,c){switch(Mm(c),c.tag){case 1:return vr(c.type)&&md(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Vl(),Dt(br),Dt(Hn),Hm(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return $m(c),null;case 13:if(Dt(Bt),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Fl()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Dt(Bt),null;case 4:return Vl(),null;case 10:return Om(c.type._context),null;case 22:case 23:return w0(),null;case 24:return null;default:return null}}var Id=!1,qn=!1,Dj=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function Ul(a,c){var m=a.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(b){Wt(a,c,b)}else m.current=null}function u0(a,c,m){try{m()}catch(b){Wt(a,c,b)}}var Nw=!1;function Rj(a,c){if(wm=td,a=iv(),hm(a)){if("selectionStart"in a)var m={start:a.selectionStart,end:a.selectionEnd};else e:{m=(m=a.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var S=b.anchorOffset,E=b.focusNode;b=b.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var M=0,F=-1,$=-1,Q=0,ae=0,fe=a,oe=null;t:for(;;){for(var ke;fe!==m||S!==0&&fe.nodeType!==3||(F=M+S),fe!==E||b!==0&&fe.nodeType!==3||($=M+b),fe.nodeType===3&&(M+=fe.nodeValue.length),(ke=fe.firstChild)!==null;)oe=fe,fe=ke;for(;;){if(fe===a)break t;if(oe===m&&++Q===S&&(F=M),oe===E&&++ae===b&&($=M),(ke=fe.nextSibling)!==null)break;fe=oe,oe=fe.parentNode}fe=ke}m=F===-1||$===-1?null:{start:F,end:$}}else m=null}m=m||{start:0,end:0}}else m=null;for(km={focusedElem:a,selectionRange:m},td=!1,Ee=c;Ee!==null;)if(c=Ee,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Ee=a;else for(;Ee!==null;){c=Ee;try{var Ae=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ae!==null){var je=Ae.memoizedProps,Xt=Ae.memoizedState,J=c.stateNode,H=J.getSnapshotBeforeUpdate(c.elementType===c.type?je:fi(c.type,je),Xt);J.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var X=c.stateNode.containerInfo;X.nodeType===1?X.textContent="":X.nodeType===9&&X.documentElement&&X.removeChild(X.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ye){Wt(c,c.return,ye)}if(a=c.sibling,a!==null){a.return=c.return,Ee=a;break}Ee=c.return}return Ae=Nw,Nw=!1,Ae}function mu(a,c,m){var b=c.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var S=b=b.next;do{if((S.tag&a)===a){var E=S.destroy;S.destroy=void 0,E!==void 0&&u0(c,m,E)}S=S.next}while(S!==b)}}function Od(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var m=c=c.next;do{if((m.tag&a)===a){var b=m.create;m.destroy=b()}m=m.next}while(m!==c)}}function c0(a){var c=a.ref;if(c!==null){var m=a.stateNode;switch(a.tag){case 5:a=m;break;default:a=m}typeof c=="function"?c(a):c.current=a}}function Tw(a){var c=a.alternate;c!==null&&(a.alternate=null,Tw(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Ai],delete c[iu],delete c[Nm],delete c[mj],delete c[gj])),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 Aw(a){return a.tag===5||a.tag===3||a.tag===4}function _w(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Aw(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 d0(a,c,m){var b=a.tag;if(b===5||b===6)a=a.stateNode,c?m.nodeType===8?m.parentNode.insertBefore(a,c):m.insertBefore(a,c):(m.nodeType===8?(c=m.parentNode,c.insertBefore(a,m)):(c=m,c.appendChild(a)),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=hd));else if(b!==4&&(a=a.child,a!==null))for(d0(a,c,m),a=a.sibling;a!==null;)d0(a,c,m),a=a.sibling}function f0(a,c,m){var b=a.tag;if(b===5||b===6)a=a.stateNode,c?m.insertBefore(a,c):m.appendChild(a);else if(b!==4&&(a=a.child,a!==null))for(f0(a,c,m),a=a.sibling;a!==null;)f0(a,c,m),a=a.sibling}var In=null,hi=!1;function $o(a,c,m){for(m=m.child;m!==null;)Mw(a,c,m),m=m.sibling}function Mw(a,c,m){if(Ti&&typeof Ti.onCommitFiberUnmount=="function")try{Ti.onCommitFiberUnmount(Yc,m)}catch{}switch(m.tag){case 5:qn||Ul(m,c);case 6:var b=In,S=hi;In=null,$o(a,c,m),In=b,hi=S,In!==null&&(hi?(a=In,m=m.stateNode,a.nodeType===8?a.parentNode.removeChild(m):a.removeChild(m)):In.removeChild(m.stateNode));break;case 18:In!==null&&(hi?(a=In,m=m.stateNode,a.nodeType===8?Em(a.parentNode,m):a.nodeType===1&&Em(a,m),Ka(a)):Em(In,m.stateNode));break;case 4:b=In,S=hi,In=m.stateNode.containerInfo,hi=!0,$o(a,c,m),In=b,hi=S;break;case 0:case 11:case 14:case 15:if(!qn&&(b=m.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){S=b=b.next;do{var E=S,M=E.destroy;E=E.tag,M!==void 0&&((E&2)!==0||(E&4)!==0)&&u0(m,c,M),S=S.next}while(S!==b)}$o(a,c,m);break;case 1:if(!qn&&(Ul(m,c),b=m.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=m.memoizedProps,b.state=m.memoizedState,b.componentWillUnmount()}catch(F){Wt(m,c,F)}$o(a,c,m);break;case 21:$o(a,c,m);break;case 22:m.mode&1?(qn=(b=qn)||m.memoizedState!==null,$o(a,c,m),qn=b):$o(a,c,m);break;default:$o(a,c,m)}}function jw(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var m=a.stateNode;m===null&&(m=a.stateNode=new Dj),c.forEach(function(b){var S=Vj.bind(null,a,b);m.has(b)||(m.add(b),b.then(S,S))})}}function pi(a,c){var m=c.deletions;if(m!==null)for(var b=0;b<m.length;b++){var S=m[b];try{var E=a,M=c,F=M;e:for(;F!==null;){switch(F.tag){case 5:In=F.stateNode,hi=!1;break e;case 3:In=F.stateNode.containerInfo,hi=!0;break e;case 4:In=F.stateNode.containerInfo,hi=!0;break e}F=F.return}if(In===null)throw Error(n(160));Mw(E,M,S),In=null,hi=!1;var $=S.alternate;$!==null&&($.return=null),S.return=null}catch(Q){Wt(S,c,Q)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Dw(c,a),c=c.sibling}function Dw(a,c){var m=a.alternate,b=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(pi(c,a),ji(a),b&4){try{mu(3,a,a.return),Od(3,a)}catch(je){Wt(a,a.return,je)}try{mu(5,a,a.return)}catch(je){Wt(a,a.return,je)}}break;case 1:pi(c,a),ji(a),b&512&&m!==null&&Ul(m,m.return);break;case 5:if(pi(c,a),ji(a),b&512&&m!==null&&Ul(m,m.return),a.flags&32){var S=a.stateNode;try{Re(S,"")}catch(je){Wt(a,a.return,je)}}if(b&4&&(S=a.stateNode,S!=null)){var E=a.memoizedProps,M=m!==null?m.memoizedProps:E,F=a.type,$=a.updateQueue;if(a.updateQueue=null,$!==null)try{F==="input"&&E.type==="radio"&&E.name!=null&&ut(S,E),_t(F,M);var Q=_t(F,E);for(M=0;M<$.length;M+=2){var ae=$[M],fe=$[M+1];ae==="style"?jn(S,fe):ae==="dangerouslySetInnerHTML"?Fe(S,fe):ae==="children"?Re(S,fe):T(S,ae,fe,Q)}switch(F){case"input":Tt(S,E);break;case"textarea":mr(S,E);break;case"select":var oe=S._wrapperState.wasMultiple;S._wrapperState.wasMultiple=!!E.multiple;var ke=E.value;ke!=null?rr(S,!!E.multiple,ke,!1):oe!==!!E.multiple&&(E.defaultValue!=null?rr(S,!!E.multiple,E.defaultValue,!0):rr(S,!!E.multiple,E.multiple?[]:"",!1))}S[iu]=E}catch(je){Wt(a,a.return,je)}}break;case 6:if(pi(c,a),ji(a),b&4){if(a.stateNode===null)throw Error(n(162));S=a.stateNode,E=a.memoizedProps;try{S.nodeValue=E}catch(je){Wt(a,a.return,je)}}break;case 3:if(pi(c,a),ji(a),b&4&&m!==null&&m.memoizedState.isDehydrated)try{Ka(c.containerInfo)}catch(je){Wt(a,a.return,je)}break;case 4:pi(c,a),ji(a);break;case 13:pi(c,a),ji(a),S=a.child,S.flags&8192&&(E=S.memoizedState!==null,S.stateNode.isHidden=E,!E||S.alternate!==null&&S.alternate.memoizedState!==null||(m0=Jt())),b&4&&jw(a);break;case 22:if(ae=m!==null&&m.memoizedState!==null,a.mode&1?(qn=(Q=qn)||ae,pi(c,a),qn=Q):pi(c,a),ji(a),b&8192){if(Q=a.memoizedState!==null,(a.stateNode.isHidden=Q)&&!ae&&(a.mode&1)!==0)for(Ee=a,ae=a.child;ae!==null;){for(fe=Ee=ae;Ee!==null;){switch(oe=Ee,ke=oe.child,oe.tag){case 0:case 11:case 14:case 15:mu(4,oe,oe.return);break;case 1:Ul(oe,oe.return);var Ae=oe.stateNode;if(typeof Ae.componentWillUnmount=="function"){b=oe,m=oe.return;try{c=b,Ae.props=c.memoizedProps,Ae.state=c.memoizedState,Ae.componentWillUnmount()}catch(je){Wt(b,m,je)}}break;case 5:Ul(oe,oe.return);break;case 22:if(oe.memoizedState!==null){Iw(fe);continue}}ke!==null?(ke.return=oe,Ee=ke):Iw(fe)}ae=ae.sibling}e:for(ae=null,fe=a;;){if(fe.tag===5){if(ae===null){ae=fe;try{S=fe.stateNode,Q?(E=S.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(F=fe.stateNode,$=fe.memoizedProps.style,M=$!=null&&$.hasOwnProperty("display")?$.display:null,F.style.display=pn("display",M))}catch(je){Wt(a,a.return,je)}}}else if(fe.tag===6){if(ae===null)try{fe.stateNode.nodeValue=Q?"":fe.memoizedProps}catch(je){Wt(a,a.return,je)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===a)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===a)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===a)break e;ae===fe&&(ae=null),fe=fe.return}ae===fe&&(ae=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:pi(c,a),ji(a),b&4&&jw(a);break;case 21:break;default:pi(c,a),ji(a)}}function ji(a){var c=a.flags;if(c&2){try{e:{for(var m=a.return;m!==null;){if(Aw(m)){var b=m;break e}m=m.return}throw Error(n(160))}switch(b.tag){case 5:var S=b.stateNode;b.flags&32&&(Re(S,""),b.flags&=-33);var E=_w(a);f0(a,E,S);break;case 3:case 4:var M=b.stateNode.containerInfo,F=_w(a);d0(a,F,M);break;default:throw Error(n(161))}}catch($){Wt(a,a.return,$)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function Pj(a,c,m){Ee=a,Rw(a)}function Rw(a,c,m){for(var b=(a.mode&1)!==0;Ee!==null;){var S=Ee,E=S.child;if(S.tag===22&&b){var M=S.memoizedState!==null||Id;if(!M){var F=S.alternate,$=F!==null&&F.memoizedState!==null||qn;F=Id;var Q=qn;if(Id=M,(qn=$)&&!Q)for(Ee=S;Ee!==null;)M=Ee,$=M.child,M.tag===22&&M.memoizedState!==null?Ow(S):$!==null?($.return=M,Ee=$):Ow(S);for(;E!==null;)Ee=E,Rw(E),E=E.sibling;Ee=S,Id=F,qn=Q}Pw(a)}else(S.subtreeFlags&8772)!==0&&E!==null?(E.return=S,Ee=E):Pw(a)}}function Pw(a){for(;Ee!==null;){var c=Ee;if((c.flags&8772)!==0){var m=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:qn||Od(5,c);break;case 1:var b=c.stateNode;if(c.flags&4&&!qn)if(m===null)b.componentDidMount();else{var S=c.elementType===c.type?m.memoizedProps:fi(c.type,m.memoizedProps);b.componentDidUpdate(S,m.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var E=c.updateQueue;E!==null&&Iv(c,E,b);break;case 3:var M=c.updateQueue;if(M!==null){if(m=null,c.child!==null)switch(c.child.tag){case 5:m=c.child.stateNode;break;case 1:m=c.child.stateNode}Iv(c,M,m)}break;case 5:var F=c.stateNode;if(m===null&&c.flags&4){m=F;var $=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":$.autoFocus&&m.focus();break;case"img":$.src&&(m.src=$.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var Q=c.alternate;if(Q!==null){var ae=Q.memoizedState;if(ae!==null){var fe=ae.dehydrated;fe!==null&&Ka(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}qn||c.flags&512&&c0(c)}catch(oe){Wt(c,c.return,oe)}}if(c===a){Ee=null;break}if(m=c.sibling,m!==null){m.return=c.return,Ee=m;break}Ee=c.return}}function Iw(a){for(;Ee!==null;){var c=Ee;if(c===a){Ee=null;break}var m=c.sibling;if(m!==null){m.return=c.return,Ee=m;break}Ee=c.return}}function Ow(a){for(;Ee!==null;){var c=Ee;try{switch(c.tag){case 0:case 11:case 15:var m=c.return;try{Od(4,c)}catch($){Wt(c,m,$)}break;case 1:var b=c.stateNode;if(typeof b.componentDidMount=="function"){var S=c.return;try{b.componentDidMount()}catch($){Wt(c,S,$)}}var E=c.return;try{c0(c)}catch($){Wt(c,E,$)}break;case 5:var M=c.return;try{c0(c)}catch($){Wt(c,M,$)}}}catch($){Wt(c,c.return,$)}if(c===a){Ee=null;break}var F=c.sibling;if(F!==null){F.return=c.return,Ee=F;break}Ee=c.return}}var Ij=Math.ceil,Ld=D.ReactCurrentDispatcher,h0=D.ReactCurrentOwner,Qr=D.ReactCurrentBatchConfig,lt=0,Cn=null,tn=null,On=0,Or=0,Wl=Oo(0),gn=0,gu=null,zs=0,Fd=0,p0=0,xu=null,kr=null,m0=0,ql=1/0,ao=null,zd=!1,g0=null,Vo=null,Bd=!1,Ho=null,$d=0,yu=0,x0=null,Vd=-1,Hd=0;function sr(){return(lt&6)!==0?Jt():Vd!==-1?Vd:Vd=Jt()}function Uo(a){return(a.mode&1)===0?1:(lt&2)!==0&&On!==0?On&-On:yj.transition!==null?(Hd===0&&(Hd=_b()),Hd):(a=mt,a!==0||(a=window.event,a=a===void 0?16:Fb(a.type)),a)}function mi(a,c,m,b){if(50<yu)throw yu=0,x0=null,Error(n(185));Va(a,m,b),((lt&2)===0||a!==Cn)&&(a===Cn&&((lt&2)===0&&(Fd|=m),gn===4&&Wo(a,On)),Sr(a,b),m===1&<===0&&(c.mode&1)===0&&(ql=Jt()+500,xd&&Fo()))}function Sr(a,c){var m=a.callbackNode;y5(a,c);var b=Qc(a,a===Cn?On:0);if(b===0)m!==null&&Nb(m),a.callbackNode=null,a.callbackPriority=0;else if(c=b&-b,a.callbackPriority!==c){if(m!=null&&Nb(m),c===1)a.tag===0?xj(Fw.bind(null,a)):Sv(Fw.bind(null,a)),hj(function(){(lt&6)===0&&Fo()}),m=null;else{switch(Mb(b)){case 1:m=Jp;break;case 4:m=Tb;break;case 16:m=Gc;break;case 536870912:m=Ab;break;default:m=Gc}m=qw(m,Lw.bind(null,a))}a.callbackPriority=c,a.callbackNode=m}}function Lw(a,c){if(Vd=-1,Hd=0,(lt&6)!==0)throw Error(n(327));var m=a.callbackNode;if(Kl()&&a.callbackNode!==m)return null;var b=Qc(a,a===Cn?On:0);if(b===0)return null;if((b&30)!==0||(b&a.expiredLanes)!==0||c)c=Ud(a,b);else{c=b;var S=lt;lt|=2;var E=Bw();(Cn!==a||On!==c)&&(ao=null,ql=Jt()+500,$s(a,c));do try{Fj();break}catch(F){zw(a,F)}while(!0);Im(),Ld.current=E,lt=S,tn!==null?c=0:(Cn=null,On=0,c=gn)}if(c!==0){if(c===2&&(S=Xp(a),S!==0&&(b=S,c=y0(a,S))),c===1)throw m=gu,$s(a,0),Wo(a,b),Sr(a,Jt()),m;if(c===6)Wo(a,b);else{if(S=a.current.alternate,(b&30)===0&&!Oj(S)&&(c=Ud(a,b),c===2&&(E=Xp(a),E!==0&&(b=E,c=y0(a,E))),c===1))throw m=gu,$s(a,0),Wo(a,b),Sr(a,Jt()),m;switch(a.finishedWork=S,a.finishedLanes=b,c){case 0:case 1:throw Error(n(345));case 2:Vs(a,kr,ao);break;case 3:if(Wo(a,b),(b&130023424)===b&&(c=m0+500-Jt(),10<c)){if(Qc(a,0)!==0)break;if(S=a.suspendedLanes,(S&b)!==b){sr(),a.pingedLanes|=a.suspendedLanes&S;break}a.timeoutHandle=Cm(Vs.bind(null,a,kr,ao),c);break}Vs(a,kr,ao);break;case 4:if(Wo(a,b),(b&4194240)===b)break;for(c=a.eventTimes,S=-1;0<b;){var M=31-ui(b);E=1<<M,M=c[M],M>S&&(S=M),b&=~E}if(b=S,b=Jt()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*Ij(b/1960))-b,10<b){a.timeoutHandle=Cm(Vs.bind(null,a,kr,ao),b);break}Vs(a,kr,ao);break;case 5:Vs(a,kr,ao);break;default:throw Error(n(329))}}}return Sr(a,Jt()),a.callbackNode===m?Lw.bind(null,a):null}function y0(a,c){var m=xu;return a.current.memoizedState.isDehydrated&&($s(a,c).flags|=256),a=Ud(a,c),a!==2&&(c=kr,kr=m,c!==null&&b0(c)),a}function b0(a){kr===null?kr=a:kr.push.apply(kr,a)}function Oj(a){for(var c=a;;){if(c.flags&16384){var m=c.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var b=0;b<m.length;b++){var S=m[b],E=S.getSnapshot;S=S.value;try{if(!ci(E(),S))return!1}catch{return!1}}}if(m=c.child,c.subtreeFlags&16384&&m!==null)m.return=c,c=m;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Wo(a,c){for(c&=~p0,c&=~Fd,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var m=31-ui(c),b=1<<m;a[m]=-1,c&=~b}}function Fw(a){if((lt&6)!==0)throw Error(n(327));Kl();var c=Qc(a,0);if((c&1)===0)return Sr(a,Jt()),null;var m=Ud(a,c);if(a.tag!==0&&m===2){var b=Xp(a);b!==0&&(c=b,m=y0(a,b))}if(m===1)throw m=gu,$s(a,0),Wo(a,c),Sr(a,Jt()),m;if(m===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Vs(a,kr,ao),Sr(a,Jt()),null}function v0(a,c){var m=lt;lt|=1;try{return a(c)}finally{lt=m,lt===0&&(ql=Jt()+500,xd&&Fo())}}function Bs(a){Ho!==null&&Ho.tag===0&&(lt&6)===0&&Kl();var c=lt;lt|=1;var m=Qr.transition,b=mt;try{if(Qr.transition=null,mt=1,a)return a()}finally{mt=b,Qr.transition=m,lt=c,(lt&6)===0&&Fo()}}function w0(){Or=Wl.current,Dt(Wl)}function $s(a,c){a.finishedWork=null,a.finishedLanes=0;var m=a.timeoutHandle;if(m!==-1&&(a.timeoutHandle=-1,fj(m)),tn!==null)for(m=tn.return;m!==null;){var b=m;switch(Mm(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&md();break;case 3:Vl(),Dt(br),Dt(Hn),Hm();break;case 5:$m(b);break;case 4:Vl();break;case 13:Dt(Bt);break;case 19:Dt(Bt);break;case 10:Om(b.type._context);break;case 22:case 23:w0()}m=m.return}if(Cn=a,tn=a=qo(a.current,null),On=Or=c,gn=0,gu=null,p0=Fd=zs=0,kr=xu=null,Os!==null){for(c=0;c<Os.length;c++)if(m=Os[c],b=m.interleaved,b!==null){m.interleaved=null;var S=b.next,E=m.pending;if(E!==null){var M=E.next;E.next=S,b.next=M}m.pending=b}Os=null}return a}function zw(a,c){do{var m=tn;try{if(Im(),Td.current=jd,Ad){for(var b=$t.memoizedState;b!==null;){var S=b.queue;S!==null&&(S.pending=null),b=b.next}Ad=!1}if(Fs=0,Sn=mn=$t=null,cu=!1,du=0,h0.current=null,m===null||m.return===null){gn=1,gu=c,tn=null;break}e:{var E=a,M=m.return,F=m,$=c;if(c=On,F.flags|=32768,$!==null&&typeof $=="object"&&typeof $.then=="function"){var Q=$,ae=F,fe=ae.tag;if((ae.mode&1)===0&&(fe===0||fe===11||fe===15)){var oe=ae.alternate;oe?(ae.updateQueue=oe.updateQueue,ae.memoizedState=oe.memoizedState,ae.lanes=oe.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var ke=cw(M);if(ke!==null){ke.flags&=-257,dw(ke,M,F,E,c),ke.mode&1&&uw(E,Q,c),c=ke,$=Q;var Ae=c.updateQueue;if(Ae===null){var je=new Set;je.add($),c.updateQueue=je}else Ae.add($);break e}else{if((c&1)===0){uw(E,Q,c),k0();break e}$=Error(n(426))}}else if(It&&F.mode&1){var Xt=cw(M);if(Xt!==null){(Xt.flags&65536)===0&&(Xt.flags|=256),dw(Xt,M,F,E,c),Rm(Hl($,F));break e}}E=$=Hl($,F),gn!==4&&(gn=2),xu===null?xu=[E]:xu.push(E),E=M;do{switch(E.tag){case 3:E.flags|=65536,c&=-c,E.lanes|=c;var J=lw(E,$,c);Pv(E,J);break e;case 1:F=$;var H=E.type,X=E.stateNode;if((E.flags&128)===0&&(typeof H.getDerivedStateFromError=="function"||X!==null&&typeof X.componentDidCatch=="function"&&(Vo===null||!Vo.has(X)))){E.flags|=65536,c&=-c,E.lanes|=c;var ye=aw(E,F,c);Pv(E,ye);break e}}E=E.return}while(E!==null)}Vw(m)}catch(Pe){c=Pe,tn===m&&m!==null&&(tn=m=m.return);continue}break}while(!0)}function Bw(){var a=Ld.current;return Ld.current=jd,a===null?jd:a}function k0(){(gn===0||gn===3||gn===2)&&(gn=4),Cn===null||(zs&268435455)===0&&(Fd&268435455)===0||Wo(Cn,On)}function Ud(a,c){var m=lt;lt|=2;var b=Bw();(Cn!==a||On!==c)&&(ao=null,$s(a,c));do try{Lj();break}catch(S){zw(a,S)}while(!0);if(Im(),lt=m,Ld.current=b,tn!==null)throw Error(n(261));return Cn=null,On=0,gn}function Lj(){for(;tn!==null;)$w(tn)}function Fj(){for(;tn!==null&&!u5();)$w(tn)}function $w(a){var c=Ww(a.alternate,a,Or);a.memoizedProps=a.pendingProps,c===null?Vw(a):tn=c,h0.current=null}function Vw(a){var c=a;do{var m=c.alternate;if(a=c.return,(c.flags&32768)===0){if(m=Mj(m,c,Or),m!==null){tn=m;return}}else{if(m=jj(m,c),m!==null){m.flags&=32767,tn=m;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{gn=6,tn=null;return}}if(c=c.sibling,c!==null){tn=c;return}tn=c=a}while(c!==null);gn===0&&(gn=5)}function Vs(a,c,m){var b=mt,S=Qr.transition;try{Qr.transition=null,mt=1,zj(a,c,m,b)}finally{Qr.transition=S,mt=b}return null}function zj(a,c,m,b){do Kl();while(Ho!==null);if((lt&6)!==0)throw Error(n(327));m=a.finishedWork;var S=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(b5(a,E),a===Cn&&(tn=Cn=null,On=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Bd||(Bd=!0,qw(Gc,function(){return Kl(),null})),E=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||E){E=Qr.transition,Qr.transition=null;var M=mt;mt=1;var F=lt;lt|=4,h0.current=null,Rj(a,m),Dw(m,a),oj(km),td=!!wm,km=wm=null,a.current=m,Pj(m),c5(),lt=F,mt=M,Qr.transition=E}else a.current=m;if(Bd&&(Bd=!1,Ho=a,$d=S),E=a.pendingLanes,E===0&&(Vo=null),h5(m.stateNode),Sr(a,Jt()),c!==null)for(b=a.onRecoverableError,m=0;m<c.length;m++)S=c[m],b(S.value,{componentStack:S.stack,digest:S.digest});if(zd)throw zd=!1,a=g0,g0=null,a;return($d&1)!==0&&a.tag!==0&&Kl(),E=a.pendingLanes,(E&1)!==0?a===x0?yu++:(yu=0,x0=a):yu=0,Fo(),null}function Kl(){if(Ho!==null){var a=Mb($d),c=Qr.transition,m=mt;try{if(Qr.transition=null,mt=16>a?16:a,Ho===null)var b=!1;else{if(a=Ho,Ho=null,$d=0,(lt&6)!==0)throw Error(n(331));var S=lt;for(lt|=4,Ee=a.current;Ee!==null;){var E=Ee,M=E.child;if((Ee.flags&16)!==0){var F=E.deletions;if(F!==null){for(var $=0;$<F.length;$++){var Q=F[$];for(Ee=Q;Ee!==null;){var ae=Ee;switch(ae.tag){case 0:case 11:case 15:mu(8,ae,E)}var fe=ae.child;if(fe!==null)fe.return=ae,Ee=fe;else for(;Ee!==null;){ae=Ee;var oe=ae.sibling,ke=ae.return;if(Tw(ae),ae===Q){Ee=null;break}if(oe!==null){oe.return=ke,Ee=oe;break}Ee=ke}}}var Ae=E.alternate;if(Ae!==null){var je=Ae.child;if(je!==null){Ae.child=null;do{var Xt=je.sibling;je.sibling=null,je=Xt}while(je!==null)}}Ee=E}}if((E.subtreeFlags&2064)!==0&&M!==null)M.return=E,Ee=M;else e:for(;Ee!==null;){if(E=Ee,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:mu(9,E,E.return)}var J=E.sibling;if(J!==null){J.return=E.return,Ee=J;break e}Ee=E.return}}var H=a.current;for(Ee=H;Ee!==null;){M=Ee;var X=M.child;if((M.subtreeFlags&2064)!==0&&X!==null)X.return=M,Ee=X;else e:for(M=H;Ee!==null;){if(F=Ee,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Od(9,F)}}catch(Pe){Wt(F,F.return,Pe)}if(F===M){Ee=null;break e}var ye=F.sibling;if(ye!==null){ye.return=F.return,Ee=ye;break e}Ee=F.return}}if(lt=S,Fo(),Ti&&typeof Ti.onPostCommitFiberRoot=="function")try{Ti.onPostCommitFiberRoot(Yc,a)}catch{}b=!0}return b}finally{mt=m,Qr.transition=c}}return!1}function Hw(a,c,m){c=Hl(m,c),c=lw(a,c,1),a=Bo(a,c,1),c=sr(),a!==null&&(Va(a,1,c),Sr(a,c))}function Wt(a,c,m){if(a.tag===3)Hw(a,a,m);else for(;c!==null;){if(c.tag===3){Hw(c,a,m);break}else if(c.tag===1){var b=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Vo===null||!Vo.has(b))){a=Hl(m,a),a=aw(c,a,1),c=Bo(c,a,1),a=sr(),c!==null&&(Va(c,1,a),Sr(c,a));break}}c=c.return}}function Bj(a,c,m){var b=a.pingCache;b!==null&&b.delete(c),c=sr(),a.pingedLanes|=a.suspendedLanes&m,Cn===a&&(On&m)===m&&(gn===4||gn===3&&(On&130023424)===On&&500>Jt()-m0?$s(a,0):p0|=m),Sr(a,c)}function Uw(a,c){c===0&&((a.mode&1)===0?c=1:(c=Xc,Xc<<=1,(Xc&130023424)===0&&(Xc=4194304)));var m=sr();a=oo(a,c),a!==null&&(Va(a,c,m),Sr(a,m))}function $j(a){var c=a.memoizedState,m=0;c!==null&&(m=c.retryLane),Uw(a,m)}function Vj(a,c){var m=0;switch(a.tag){case 13:var b=a.stateNode,S=a.memoizedState;S!==null&&(m=S.retryLane);break;case 19:b=a.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(c),Uw(a,m)}var Ww;Ww=function(a,c,m){if(a!==null)if(a.memoizedProps!==c.pendingProps||br.current)wr=!0;else{if((a.lanes&m)===0&&(c.flags&128)===0)return wr=!1,_j(a,c,m);wr=(a.flags&131072)!==0}else wr=!1,It&&(c.flags&1048576)!==0&&Cv(c,bd,c.index);switch(c.lanes=0,c.tag){case 2:var b=c.type;Pd(a,c),a=c.pendingProps;var S=Il(c,Hn.current);$l(c,m),S=qm(null,c,b,a,S,m);var E=Km();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,vr(b)?(E=!0,gd(c)):E=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,zm(c),S.updater=Dd,c.stateNode=S,S._reactInternals=c,Zm(c,b,a,m),c=r0(null,c,b,!0,E,m)):(c.tag=0,It&&E&&_m(c),or(null,c,S,m),c=c.child),c;case 16:b=c.elementType;e:{switch(Pd(a,c),a=c.pendingProps,S=b._init,b=S(b._payload),c.type=b,S=c.tag=Uj(b),a=fi(b,a),S){case 0:c=n0(null,c,b,a,m);break e;case 1:c=xw(null,c,b,a,m);break e;case 11:c=fw(null,c,b,a,m);break e;case 14:c=hw(null,c,b,fi(b.type,a),m);break e}throw Error(n(306,b,""))}return c;case 0:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:fi(b,S),n0(a,c,b,S,m);case 1:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:fi(b,S),xw(a,c,b,S,m);case 3:e:{if(yw(c),a===null)throw Error(n(387));b=c.pendingProps,E=c.memoizedState,S=E.element,Rv(a,c),Ed(c,b,null,m);var M=c.memoizedState;if(b=M.element,E.isDehydrated)if(E={element:b,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},c.updateQueue.baseState=E,c.memoizedState=E,c.flags&256){S=Hl(Error(n(423)),c),c=bw(a,c,b,m,S);break e}else if(b!==S){S=Hl(Error(n(424)),c),c=bw(a,c,b,m,S);break e}else for(Ir=Io(c.stateNode.containerInfo.firstChild),Pr=c,It=!0,di=null,m=jv(c,null,b,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Fl(),b===S){c=lo(a,c,m);break e}or(a,c,b,m)}c=c.child}return c;case 5:return Ov(c),a===null&&Dm(c),b=c.type,S=c.pendingProps,E=a!==null?a.memoizedProps:null,M=S.children,Sm(b,S)?M=null:E!==null&&Sm(b,E)&&(c.flags|=32),gw(a,c),or(a,c,M,m),c.child;case 6:return a===null&&Dm(c),null;case 13:return vw(a,c,m);case 4:return Bm(c,c.stateNode.containerInfo),b=c.pendingProps,a===null?c.child=zl(c,null,b,m):or(a,c,b,m),c.child;case 11:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:fi(b,S),fw(a,c,b,S,m);case 7:return or(a,c,c.pendingProps,m),c.child;case 8:return or(a,c,c.pendingProps.children,m),c.child;case 12:return or(a,c,c.pendingProps.children,m),c.child;case 10:e:{if(b=c.type._context,S=c.pendingProps,E=c.memoizedProps,M=S.value,St(kd,b._currentValue),b._currentValue=M,E!==null)if(ci(E.value,M)){if(E.children===S.children&&!br.current){c=lo(a,c,m);break e}}else for(E=c.child,E!==null&&(E.return=c);E!==null;){var F=E.dependencies;if(F!==null){M=E.child;for(var $=F.firstContext;$!==null;){if($.context===b){if(E.tag===1){$=so(-1,m&-m),$.tag=2;var Q=E.updateQueue;if(Q!==null){Q=Q.shared;var ae=Q.pending;ae===null?$.next=$:($.next=ae.next,ae.next=$),Q.pending=$}}E.lanes|=m,$=E.alternate,$!==null&&($.lanes|=m),Lm(E.return,m,c),F.lanes|=m;break}$=$.next}}else if(E.tag===10)M=E.type===c.type?null:E.child;else if(E.tag===18){if(M=E.return,M===null)throw Error(n(341));M.lanes|=m,F=M.alternate,F!==null&&(F.lanes|=m),Lm(M,m,c),M=E.sibling}else M=E.child;if(M!==null)M.return=E;else for(M=E;M!==null;){if(M===c){M=null;break}if(E=M.sibling,E!==null){E.return=M.return,M=E;break}M=M.return}E=M}or(a,c,S.children,m),c=c.child}return c;case 9:return S=c.type,b=c.pendingProps.children,$l(c,m),S=Jr(S),b=b(S),c.flags|=1,or(a,c,b,m),c.child;case 14:return b=c.type,S=fi(b,c.pendingProps),S=fi(b.type,S),hw(a,c,b,S,m);case 15:return pw(a,c,c.type,c.pendingProps,m);case 17:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:fi(b,S),Pd(a,c),c.tag=1,vr(b)?(a=!0,gd(c)):a=!1,$l(c,m),ow(c,b,S),Zm(c,b,S,m),r0(null,c,b,!0,a,m);case 19:return kw(a,c,m);case 22:return mw(a,c,m)}throw Error(n(156,c.tag))};function qw(a,c){return Eb(a,c)}function Hj(a,c,m,b){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=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(a,c,m,b){return new Hj(a,c,m,b)}function S0(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Uj(a){if(typeof a=="function")return S0(a)?1:0;if(a!=null){if(a=a.$$typeof,a===K)return 11;if(a===W)return 14}return 2}function qo(a,c){var m=a.alternate;return m===null?(m=Zr(a.tag,c,a.key,a.mode),m.elementType=a.elementType,m.type=a.type,m.stateNode=a.stateNode,m.alternate=a,a.alternate=m):(m.pendingProps=c,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,c=a.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=a.sibling,m.index=a.index,m.ref=a.ref,m}function Wd(a,c,m,b,S,E){var M=2;if(b=a,typeof a=="function")S0(a)&&(M=1);else if(typeof a=="string")M=5;else e:switch(a){case I:return Hs(m.children,S,E,c);case P:M=8,S|=8;break;case L:return a=Zr(12,m,c,S|2),a.elementType=L,a.lanes=E,a;case G:return a=Zr(13,m,c,S),a.elementType=G,a.lanes=E,a;case B:return a=Zr(19,m,c,S),a.elementType=B,a.lanes=E,a;case Z:return qd(m,S,E,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:M=10;break e;case V:M=9;break e;case K:M=11;break e;case W:M=14;break e;case U:M=16,b=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Zr(M,m,c,S),c.elementType=a,c.type=b,c.lanes=E,c}function Hs(a,c,m,b){return a=Zr(7,a,b,c),a.lanes=m,a}function qd(a,c,m,b){return a=Zr(22,a,b,c),a.elementType=Z,a.lanes=m,a.stateNode={isHidden:!1},a}function C0(a,c,m){return a=Zr(6,a,null,c),a.lanes=m,a}function E0(a,c,m){return c=Zr(4,a.children!==null?a.children:[],a.key,c),c.lanes=m,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function Wj(a,c,m,b,S){this.tag=c,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=Qp(0),this.expirationTimes=Qp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qp(0),this.identifierPrefix=b,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function N0(a,c,m,b,S,E,M,F,$){return a=new Wj(a,c,m,F,$),c===1?(c=1,E===!0&&(c|=8)):c=0,E=Zr(3,null,null,c),a.current=E,E.stateNode=a,E.memoizedState={element:b,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},zm(E),a}function qj(a,c,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:b==null?null:""+b,children:a,containerInfo:c,implementation:m}}function Kw(a){if(!a)return Lo;a=a._reactInternals;e:{if(ot(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(vr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var m=a.type;if(vr(m))return wv(a,m,c)}return c}function Gw(a,c,m,b,S,E,M,F,$){return a=N0(m,b,!0,a,S,E,M,F,$),a.context=Kw(null),m=a.current,b=sr(),S=Uo(m),E=so(b,S),E.callback=c??null,Bo(m,E,S),a.current.lanes=S,Va(a,S,b),Sr(a,b),a}function Kd(a,c,m,b){var S=c.current,E=sr(),M=Uo(S);return m=Kw(m),c.context===null?c.context=m:c.pendingContext=m,c=so(E,M),c.payload={element:a},b=b===void 0?null:b,b!==null&&(c.callback=b),a=Bo(S,c,M),a!==null&&(mi(a,S,M,E),Cd(a,S,M)),M}function Gd(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 Yw(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var m=a.retryLane;a.retryLane=m!==0&&m<c?m:c}}function T0(a,c){Yw(a,c),(a=a.alternate)&&Yw(a,c)}function Kj(){return null}var Jw=typeof reportError=="function"?reportError:function(a){console.error(a)};function A0(a){this._internalRoot=a}Yd.prototype.render=A0.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));Kd(a,c,null,null)},Yd.prototype.unmount=A0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Bs(function(){Kd(null,a,null,null)}),c[to]=null}};function Yd(a){this._internalRoot=a}Yd.prototype.unstable_scheduleHydration=function(a){if(a){var c=Rb();a={blockedOn:null,target:a,priority:c};for(var m=0;m<Do.length&&c!==0&&c<Do[m].priority;m++);Do.splice(m,0,a),m===0&&Ob(a)}};function _0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Jd(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Xw(){}function Gj(a,c,m,b,S){if(S){if(typeof b=="function"){var E=b;b=function(){var Q=Gd(M);E.call(Q)}}var M=Gw(c,b,a,0,null,!1,!1,"",Xw);return a._reactRootContainer=M,a[to]=M.current,nu(a.nodeType===8?a.parentNode:a),Bs(),M}for(;S=a.lastChild;)a.removeChild(S);if(typeof b=="function"){var F=b;b=function(){var Q=Gd($);F.call(Q)}}var $=N0(a,0,!1,null,null,!1,!1,"",Xw);return a._reactRootContainer=$,a[to]=$.current,nu(a.nodeType===8?a.parentNode:a),Bs(function(){Kd(c,$,m,b)}),$}function Xd(a,c,m,b,S){var E=m._reactRootContainer;if(E){var M=E;if(typeof S=="function"){var F=S;S=function(){var $=Gd(M);F.call($)}}Kd(c,M,a,S)}else M=Gj(m,c,a,S,b);return Gd(M)}jb=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var m=$a(c.pendingLanes);m!==0&&(Zp(c,m|1),Sr(c,Jt()),(lt&6)===0&&(ql=Jt()+500,Fo()))}break;case 13:Bs(function(){var b=oo(a,1);if(b!==null){var S=sr();mi(b,a,1,S)}}),T0(a,1)}},em=function(a){if(a.tag===13){var c=oo(a,134217728);if(c!==null){var m=sr();mi(c,a,134217728,m)}T0(a,134217728)}},Db=function(a){if(a.tag===13){var c=Uo(a),m=oo(a,c);if(m!==null){var b=sr();mi(m,a,c,b)}T0(a,c)}},Rb=function(){return mt},Pb=function(a,c){var m=mt;try{return mt=a,c()}finally{mt=m}},xr=function(a,c,m){switch(c){case"input":if(Tt(a,m),c=m.name,m.type==="radio"&&c!=null){for(m=a;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<m.length;c++){var b=m[c];if(b!==a&&b.form===a.form){var S=pd(b);if(!S)throw Error(n(90));Be(b),Tt(b,S)}}}break;case"textarea":mr(a,m);break;case"select":c=m.value,c!=null&&rr(a,!!m.multiple,c,!1)}},Ft=v0,en=Bs;var Yj={usingClientEntryPoint:!1,Events:[ou,Rl,pd,We,Mt,v0]},bu={findFiberByHostInstance:Ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jj={bundleType:bu.bundleType,version:bu.version,rendererPackageName:bu.rendererPackageName,rendererConfig:bu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:D.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=El(a),a===null?null:a.stateNode},findFiberByHostInstance:bu.findFiberByHostInstance||Kj,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 Qd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qd.isDisabled&&Qd.supportsFiber)try{Yc=Qd.inject(Jj),Ti=Qd}catch{}}return Cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yj,Cr.createPortal=function(a,c){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_0(c))throw Error(n(200));return qj(a,c,null,m)},Cr.createRoot=function(a,c){if(!_0(a))throw Error(n(299));var m=!1,b="",S=Jw;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onRecoverableError!==void 0&&(S=c.onRecoverableError)),c=N0(a,1,!1,null,null,m,!1,b,S),a[to]=c.current,nu(a.nodeType===8?a.parentNode:a),new A0(c)},Cr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=El(c),a=a===null?null:a.stateNode,a},Cr.flushSync=function(a){return Bs(a)},Cr.hydrate=function(a,c,m){if(!Jd(c))throw Error(n(200));return Xd(null,a,c,!0,m)},Cr.hydrateRoot=function(a,c,m){if(!_0(a))throw Error(n(405));var b=m!=null&&m.hydratedSources||null,S=!1,E="",M=Jw;if(m!=null&&(m.unstable_strictMode===!0&&(S=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onRecoverableError!==void 0&&(M=m.onRecoverableError)),c=Gw(c,null,a,1,m??null,S,!1,E,M),a[to]=c.current,nu(a),b)for(a=0;a<b.length;a++)m=b[a],S=m._getVersion,S=S(m._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[m,S]:c.mutableSourceEagerHydrationData.push(m,S);return new Yd(c)},Cr.render=function(a,c,m){if(!Jd(c))throw Error(n(200));return Xd(null,a,c,!1,m)},Cr.unmountComponentAtNode=function(a){if(!Jd(a))throw Error(n(40));return a._reactRootContainer?(Bs(function(){Xd(null,null,a,!1,function(){a._reactRootContainer=null,a[to]=null})}),!0):!1},Cr.unstable_batchedUpdates=v0,Cr.unstable_renderSubtreeIntoContainer=function(a,c,m,b){if(!Jd(m))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Xd(a,c,m,!1,b)},Cr.version="18.3.1-next-f1338f8080-20240426",Cr}var sk;function e3(){if(sk)return D0.exports;sk=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(),D0.exports=sD(),D0.exports}var lk;function lD(){if(lk)return Zd;lk=1;var e=e3();return Zd.createRoot=e.createRoot,Zd.hydrateRoot=e.hydrateRoot,Zd}var aD=lD();const uD=Ma(aD);var Ec=e3();const bx=Ma(Ec);function cD(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 dD=e=>{switch(e){case"success":return pD;case"info":return gD;case"warning":return mD;case"error":return xD;default:return null}},fD=Array(12).fill(0),hD=({visible:e,className:t})=>de.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},de.createElement("div",{className:"sonner-spinner"},fD.map((n,r)=>de.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),pD=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.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"})),mD=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},de.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"})),gD=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.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"})),xD=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.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"})),yD=de.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"},de.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),de.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),bD=()=>{const[e,t]=de.useState(document.hidden);return de.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let i1=1;class vD{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:i1++,s=this.toasts.find(u=>u.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(u=>u.id===o?(this.publish({...u,...t,id:o,title:r}),{...u,...t,id:o,dismissible:l,title:r}):u):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],de.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(kD(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,y=typeof f=="object"&&!de.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...y})}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,y=typeof f=="object"&&!de.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...y})}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,y=typeof f=="object"&&!de.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:g,...y})}}).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,x=typeof h=="object"&&!de.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:f,...x})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>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:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||i1++;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 Nr=new vD,wD=(e,t)=>{const n=(t==null?void 0:t.id)||i1++;return Nr.addToast({title:e,...t,id:n}),n},kD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",SD=wD,CD=()=>Nr.toasts,ED=()=>Nr.getActiveToasts(),gi=Object.assign(SD,{success:Nr.success,info:Nr.info,warning:Nr.warning,error:Nr.error,custom:Nr.custom,message:Nr.message,promise:Nr.promise,dismiss:Nr.dismiss,loading:Nr.loading},{getHistory:CD,getToasts:ED});cD("[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 ef(e){return e.label!==void 0}const ND=3,TD="24px",AD="16px",ak=4e3,_D=356,MD=14,jD=45,DD=200;function Di(...e){return e.filter(Boolean).join(" ")}function RD(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const PD=e=>{var t,n,r,i,o,s,l,u,d;const{invert:h,toast:f,unstyled:g,interacting:x,setHeights:y,visibleToasts:v,heights:w,index:C,toasts:N,expanded:T,removeToast:D,defaultRichColors:A,closeButton:_,style:I,cancelButtonStyle:P,actionButtonStyle:L,className:R="",descriptionClassName:V="",duration:K,position:G,gap:B,expandByDefault:W,classNames:U,icons:Z,closeButtonAriaLabel:q="Close toast"}=e,[Y,j]=de.useState(null),[z,ee]=de.useState(null),[O,ce]=de.useState(!1),[pe,le]=de.useState(!1),[ie,ue]=de.useState(!1),[xe,Te]=de.useState(!1),[Le,Be]=de.useState(!1),[at,Xe]=de.useState(0),[Ot,ut]=de.useState(0),Tt=de.useRef(f.duration||K||ak),nr=de.useRef(null),xt=de.useRef(null),Vn=C===0,rr=C+1<=v,ft=f.type,hn=f.dismissible!==!1,mr=f.className||"",ir=f.descriptionClassName||"",te=de.useMemo(()=>w.findIndex(We=>We.toastId===f.id)||0,[w,f.id]),he=de.useMemo(()=>{var We;return(We=f.closeButton)!=null?We:_},[f.closeButton,_]),De=de.useMemo(()=>f.duration||K||ak,[f.duration,K]),Fe=de.useRef(0),Re=de.useRef(0),At=de.useRef(0),Yt=de.useRef(null),[pn,jn]=G.split("-"),gr=de.useMemo(()=>w.reduce((We,Mt,Ft)=>Ft>=te?We:We+Mt.height,0),[w,te]),ht=bD(),_t=f.invert||h,Lt=ft==="loading";Re.current=de.useMemo(()=>te*B+gr,[te,gr]),de.useEffect(()=>{Tt.current=De},[De]),de.useEffect(()=>{ce(!0)},[]),de.useEffect(()=>{const We=xt.current;if(We){const Mt=We.getBoundingClientRect().height;return ut(Mt),y(Ft=>[{toastId:f.id,height:Mt,position:f.position},...Ft]),()=>y(Ft=>Ft.filter(en=>en.toastId!==f.id))}},[y,f.id]),de.useLayoutEffect(()=>{if(!O)return;const We=xt.current,Mt=We.style.height;We.style.height="auto";const Ft=We.getBoundingClientRect().height;We.style.height=Mt,ut(Ft),y(en=>en.find(zt=>zt.toastId===f.id)?en.map(zt=>zt.toastId===f.id?{...zt,height:Ft}:zt):[{toastId:f.id,height:Ft,position:f.position},...en])},[O,f.title,f.description,y,f.id,f.jsx,f.action,f.cancel]);const Dn=de.useCallback(()=>{le(!0),Xe(Re.current),y(We=>We.filter(Mt=>Mt.toastId!==f.id)),setTimeout(()=>{D(f)},DD)},[f,D,y,Re]);de.useEffect(()=>{if(f.promise&&ft==="loading"||f.duration===1/0||f.type==="loading")return;let We;return T||x||ht?(()=>{if(At.current<Fe.current){const en=new Date().getTime()-Fe.current;Tt.current=Tt.current-en}At.current=new Date().getTime()})():(()=>{Tt.current!==1/0&&(Fe.current=new Date().getTime(),We=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Dn()},Tt.current))})(),()=>clearTimeout(We)},[T,x,f,ft,ht,Dn]),de.useEffect(()=>{f.delete&&(Dn(),f.onDismiss==null||f.onDismiss.call(f,f))},[Dn,f.delete]);function xr(){var We;if(Z!=null&&Z.loading){var Mt;return de.createElement("div",{className:Di(U==null?void 0:U.loader,f==null||(Mt=f.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":ft==="loading"},Z.loading)}return de.createElement(hD,{className:Di(U==null?void 0:U.loader,f==null||(We=f.classNames)==null?void 0:We.loader),visible:ft==="loading"})}const yr=f.icon||(Z==null?void 0:Z[ft])||dD(ft);var Rn,Pn;return de.createElement("li",{tabIndex:0,ref:xt,className:Di(R,mr,U==null?void 0:U.toast,f==null||(t=f.classNames)==null?void 0:t.toast,U==null?void 0:U.default,U==null?void 0:U[ft],f==null||(n=f.classNames)==null?void 0:n[ft]),"data-sonner-toast":"","data-rich-colors":(Rn=f.richColors)!=null?Rn:A,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":O,"data-promise":!!f.promise,"data-swiped":Le,"data-removed":pe,"data-visible":rr,"data-y-position":pn,"data-x-position":jn,"data-index":C,"data-front":Vn,"data-swiping":ie,"data-dismissible":hn,"data-type":ft,"data-invert":_t,"data-swipe-out":xe,"data-swipe-direction":z,"data-expanded":!!(T||W&&O),"data-testid":f.testId,style:{"--index":C,"--toasts-before":C,"--z-index":N.length-C,"--offset":`${pe?at:Re.current}px`,"--initial-height":W?"auto":`${Ot}px`,...I,...f.style},onDragEnd:()=>{ue(!1),j(null),Yt.current=null},onPointerDown:We=>{We.button!==2&&(Lt||!hn||(nr.current=new Date,Xe(Re.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(ue(!0),Yt.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,Mt,Ft;if(xe||!hn)return;Yt.current=null;const en=Number(((We=xt.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),qr=Number(((Mt=xt.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),zt=new Date().getTime()-((Ft=nr.current)==null?void 0:Ft.getTime()),Ut=Y==="x"?en:qr,Kr=Math.abs(Ut)/zt;if(Math.abs(Ut)>=jD||Kr>.11){Xe(Re.current),f.onDismiss==null||f.onDismiss.call(f,f),ee(Y==="x"?en>0?"right":"left":qr>0?"down":"up"),Dn(),Te(!0);return}else{var kt,wn;(kt=xt.current)==null||kt.style.setProperty("--swipe-amount-x","0px"),(wn=xt.current)==null||wn.style.setProperty("--swipe-amount-y","0px")}Be(!1),ue(!1),j(null)},onPointerMove:We=>{var Mt,Ft,en;if(!Yt.current||!hn||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const zt=We.clientY-Yt.current.y,Ut=We.clientX-Yt.current.x;var Kr;const kt=(Kr=e.swipeDirections)!=null?Kr:RD(G);!Y&&(Math.abs(Ut)>1||Math.abs(zt)>1)&&j(Math.abs(Ut)>Math.abs(zt)?"x":"y");let wn={x:0,y:0};const ne=we=>1/(1.5+Math.abs(we)/20);if(Y==="y"){if(kt.includes("top")||kt.includes("bottom"))if(kt.includes("top")&&zt<0||kt.includes("bottom")&&zt>0)wn.y=zt;else{const we=zt*ne(zt);wn.y=Math.abs(we)<Math.abs(zt)?we:zt}}else if(Y==="x"&&(kt.includes("left")||kt.includes("right")))if(kt.includes("left")&&Ut<0||kt.includes("right")&&Ut>0)wn.x=Ut;else{const we=Ut*ne(Ut);wn.x=Math.abs(we)<Math.abs(Ut)?we:Ut}(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&Be(!0),(Ft=xt.current)==null||Ft.style.setProperty("--swipe-amount-x",`${wn.x}px`),(en=xt.current)==null||en.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},he&&!f.jsx&&ft!=="loading"?de.createElement("button",{"aria-label":q,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!hn?()=>{}:()=>{Dn(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Di(U==null?void 0:U.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Pn=Z==null?void 0:Z.close)!=null?Pn:yD):null,(ft||f.icon||f.promise)&&f.icon!==null&&((Z==null?void 0:Z[ft])!==null||f.icon)?de.createElement("div",{"data-icon":"",className:Di(U==null?void 0:U.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||xr():null,f.type!=="loading"?yr:null):null,de.createElement("div",{"data-content":"",className:Di(U==null?void 0:U.content,f==null||(o=f.classNames)==null?void 0:o.content)},de.createElement("div",{"data-title":"",className:Di(U==null?void 0:U.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?de.createElement("div",{"data-description":"",className:Di(V,ir,U==null?void 0:U.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),de.isValidElement(f.cancel)?f.cancel:f.cancel&&ef(f.cancel)?de.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||P,onClick:We=>{ef(f.cancel)&&hn&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,We),Dn())},className:Di(U==null?void 0:U.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,de.isValidElement(f.action)?f.action:f.action&&ef(f.action)?de.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||L,onClick:We=>{ef(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,We),!We.defaultPrevented&&Dn())},className:Di(U==null?void 0:U.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function uk(){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 ID(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,s=o?"--mobile-offset":"--offset",l=o?AD:TD;function u(d){["top","right","bottom","left"].forEach(h=>{n[`${s}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(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]}):u(l)}),n}const OD=de.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:s=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:h,mobileOffset:f,theme:g="light",richColors:x,duration:y,style:v,visibleToasts:w=ND,toastOptions:C,dir:N=uk(),gap:T=MD,icons:D,containerAriaLabel:A="Notifications"}=t,[_,I]=de.useState([]),P=de.useMemo(()=>r?_.filter(O=>O.toasterId===r):_.filter(O=>!O.toasterId),[_,r]),L=de.useMemo(()=>Array.from(new Set([o].concat(P.filter(O=>O.position).map(O=>O.position)))),[P,o]),[R,V]=de.useState([]),[K,G]=de.useState(!1),[B,W]=de.useState(!1),[U,Z]=de.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=de.useRef(null),Y=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=de.useRef(null),z=de.useRef(!1),ee=de.useCallback(O=>{I(ce=>{var pe;return(pe=ce.find(le=>le.id===O.id))!=null&&pe.delete||Nr.dismiss(O.id),ce.filter(({id:le})=>le!==O.id)})},[]);return de.useEffect(()=>Nr.subscribe(O=>{if(O.dismiss){requestAnimationFrame(()=>{I(ce=>ce.map(pe=>pe.id===O.id?{...pe,delete:!0}:pe))});return}setTimeout(()=>{bx.flushSync(()=>{I(ce=>{const pe=ce.findIndex(le=>le.id===O.id);return pe!==-1?[...ce.slice(0,pe),{...ce[pe],...O},...ce.slice(pe+1)]:[O,...ce]})})})}),[_]),de.useEffect(()=>{if(g!=="system"){Z(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:ce})=>{Z(ce?"dark":"light")})}catch{O.addListener(({matches:pe})=>{try{Z(pe?"dark":"light")}catch(le){console.error(le)}})}},[g]),de.useEffect(()=>{_.length<=1&&G(!1)},[_]),de.useEffect(()=>{const O=ce=>{var pe;if(s.every(ue=>ce[ue]||ce.code===ue)){var ie;G(!0),(ie=q.current)==null||ie.focus()}ce.code==="Escape"&&(document.activeElement===q.current||(pe=q.current)!=null&&pe.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[s]),de.useEffect(()=>{if(q.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,z.current=!1)}},[q.current]),de.createElement("section",{ref:n,"aria-label":`${A} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((O,ce)=>{var pe;const[le,ie]=O.split("-");return P.length?de.createElement("ol",{key:O,dir:N==="auto"?uk():N,tabIndex:-1,ref:q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":le,"data-x-position":ie,style:{"--front-toast-height":`${((pe=R[0])==null?void 0:pe.height)||0}px`,"--width":`${_D}px`,"--gap":`${T}px`,...v,...ID(h,f)},onBlur:ue=>{z.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(z.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||z.current||(z.current=!0,j.current=ue.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{B||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},P.filter(ue=>!ue.position&&ce===0||ue.position===O).map((ue,xe)=>{var Te,Le;return de.createElement(PD,{key:ue.id,icons:D,index:xe,toast:ue,defaultRichColors:x,duration:(Te=C==null?void 0:C.duration)!=null?Te:y,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:i,visibleToasts:w,closeButton:(Le=C==null?void 0:C.closeButton)!=null?Le:u,interacting:B,position:O,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:ee,toasts:P.filter(Be=>Be.position==ue.position),heights:R.filter(Be=>Be.position==ue.position),setHeights:V,expandByDefault:l,gap:T,expanded:K,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 t3=(...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 LD=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 FD=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 ck=e=>{const t=FD(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 zD={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 BD=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 $D=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},u)=>k.createElement("svg",{ref:u,...zD,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:t3("lucide",i),...!o&&!BD(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,h])=>k.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 Ne=(e,t)=>{const n=k.forwardRef(({className:r,...i},o)=>k.createElement($D,{ref:o,iconNode:t,className:t3(`lucide-${LD(ck(e))}`,`lucide-${e}`,r),...i}));return n.displayName=ck(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 VD=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],vx=Ne("arrow-left",VD);/**
|
|
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 HD=[["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"}]],UD=Ne("bold",HD);/**
|
|
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 WD=[["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"}]],n3=Ne("bot",WD);/**
|
|
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 qD=[["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"}]],r3=Ne("building-2",qD);/**
|
|
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 KD=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yl=Ne("check",KD);/**
|
|
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 GD=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wx=Ne("chevron-down",GD);/**
|
|
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 YD=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],i3=Ne("chevron-right",YD);/**
|
|
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 JD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],XD=Ne("chevron-up",JD);/**
|
|
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 QD=[["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"}]],ur=Ne("circle-alert",QD);/**
|
|
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 ZD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],qi=Ne("circle-check",ZD);/**
|
|
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 eR=[["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"}]],o1=Ne("circle-x",eR);/**
|
|
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 tR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nR=Ne("circle",tR);/**
|
|
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 rR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Bf=Ne("clock",rR);/**
|
|
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 iR=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],oR=Ne("code",iR);/**
|
|
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 sR=[["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"}]],Nc=Ne("copy",sR);/**
|
|
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 lR=[["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"}]],aR=Ne("database",lR);/**
|
|
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 uR=[["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"}]],cR=Ne("ellipsis-vertical",uR);/**
|
|
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 dR=[["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"}]],s1=Ne("external-link",dR);/**
|
|
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 fR=[["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"}]],o3=Ne("eye-off",fR);/**
|
|
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 hR=[["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"}]],Tc=Ne("eye",hR);/**
|
|
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 pR=[["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"}]],$f=Ne("file-exclamation-point",pR);/**
|
|
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 mR=[["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"}]],gR=Ne("file-pen",mR);/**
|
|
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 xR=[["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"}]],ps=Ne("file-text",xR);/**
|
|
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 yR=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],la=Ne("folder-input",yR);/**
|
|
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 bR=[["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"}]],kx=Ne("globe",bR);/**
|
|
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 vR=[["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"}]],wR=Ne("heading-1",vR);/**
|
|
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 kR=[["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"}]],SR=Ne("heading-2",kR);/**
|
|
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 CR=[["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"}]],ER=Ne("heading-3",CR);/**
|
|
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 NR=[["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"}]],l1=Ne("history",NR);/**
|
|
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 TR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Vf=Ne("info",TR);/**
|
|
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 AR=[["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"}]],_R=Ne("italic",AR);/**
|
|
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 MR=[["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"}]],s3=Ne("key-round",MR);/**
|
|
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 jR=[["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"}]],DR=Ne("key",jR);/**
|
|
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 RR=[["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"}]],PR=Ne("link-2",RR);/**
|
|
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 IR=[["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"}]],OR=Ne("link",IR);/**
|
|
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 LR=[["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"}]],FR=Ne("list-ordered",LR);/**
|
|
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 zR=[["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"}]],BR=Ne("list",zR);/**
|
|
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 $R=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],dt=Ne("loader-circle",$R);/**
|
|
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 VR=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],HR=Ne("lock",VR);/**
|
|
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 UR=[["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"}]],l3=Ne("log-out",UR);/**
|
|
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 WR=[["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"}]],qR=Ne("message-square",WR);/**
|
|
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 KR=[["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"}]],a3=Ne("monitor",KR);/**
|
|
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 GR=[["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"}]],Ac=Ne("pencil",GR);/**
|
|
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 YR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],a1=Ne("plus",YR);/**
|
|
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 JR=[["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"}]],XR=Ne("quote",JR);/**
|
|
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 QR=[["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"}]],ZR=Ne("redo",QR);/**
|
|
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 eP=[["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"}]],ec=Ne("refresh-cw",eP);/**
|
|
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 tP=[["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"}]],dk=Ne("rotate-ccw",tP);/**
|
|
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 nP=[["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"}]],fk=Ne("save",nP);/**
|
|
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 rP=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],u3=Ne("search",rP);/**
|
|
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 iP=[["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"}]],Sx=Ne("send",iP);/**
|
|
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 oP=[["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"}]],hk=Ne("settings",oP);/**
|
|
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 sP=[["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"}]],lP=Ne("shield-alert",sP);/**
|
|
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 aP=[["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"}]],uP=Ne("shield-check",aP);/**
|
|
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 cP=[["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"}]],Ar=Ne("shield",cP);/**
|
|
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 dP=[["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"}]],fP=Ne("square-check-big",dP);/**
|
|
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 hP=[["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"}]],pP=Ne("strikethrough",hP);/**
|
|
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 mP=[["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"}]],c3=Ne("tag",mP);/**
|
|
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 gP=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],d3=Ne("terminal",gP);/**
|
|
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 xP=[["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"}]],ll=Ne("trash-2",xP);/**
|
|
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 yP=[["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=Ne("triangle-alert",yP);/**
|
|
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 bP=[["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"}]],vP=Ne("undo",bP);/**
|
|
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 wP=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["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"}]],kP=Ne("user-check",wP);/**
|
|
396
|
+
* @license lucide-react v0.577.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const SP=[["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"}]],tl=Ne("user-plus",SP);/**
|
|
401
|
+
* @license lucide-react v0.577.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const CP=[["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"}]],ja=Ne("users",CP);/**
|
|
406
|
+
* @license lucide-react v0.577.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const EP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],NP=Ne("x",EP),TP="",AP="cnst_token";function f3(){try{localStorage.removeItem(AP)}catch{}}async function Ue(e,t={}){const n={"Content-Type":"application/json",...t.headers},r=await fetch(`${TP}${e}`,{...t,headers:n,credentials:"include"}),i=await r.text(),o=i?JSON.parse(i):{};if(!r.ok)throw r.status===401&&(f3(),typeof window<"u"&&window.dispatchEvent(new Event("auth:unauthorized"))),new Error(o.error||`Request failed: ${r.status}`);return o}async function h3(e,t){return Ue("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})})}async function _P(e,t,n){return Ue("/auth/register",{method:"POST",body:JSON.stringify({email:e,password:t,name:n})})}async function MP(){return Ue("/auth/logout",{method:"POST"})}async function p3(){return Ue("/auth/device",{method:"POST",body:JSON.stringify({})})}async function m3(e,t){return Ue(`/auth/device/poll?code=${encodeURIComponent(e)}&client_secret=${encodeURIComponent(t)}`)}async function g3(e){return Ue("/auth/promptowl",{method:"POST",body:JSON.stringify({token:e})})}async function jP(){return Ue("/health")}async function DP(){return Ue("/license/status")}async function RP(e){return Ue("/license/install",{method:"POST",body:JSON.stringify({key:e})})}async function I0(){return Ue("/auth/admin-status")}async function PP(){return Ue("/auth/teammates")}async function IP(e,t){return Ue("/auth/invite",{method:"POST",body:JSON.stringify({email:e,label:t})})}async function OP(){return Ue("/auth/keys")}async function LP(e){return Ue("/auth/keys",{method:"POST",body:JSON.stringify(e||{})})}async function FP(e){return Ue("/auth/keys/rotate",{method:"POST",body:JSON.stringify(e||{})})}async function x3(e){return Ue(`/nests/${e}/settings`)}async function zP(e,t){return Ue(`/nests/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}async function BP(){return Ue("/nests")}async function $P(e,t){return Ue("/nests",{method:"POST",body:JSON.stringify({name:e,description:t})})}async function VP(e){return Ue("/nests/"+e,{method:"DELETE"})}async function HP(e,t){return Ue("/nests/import",{method:"POST",body:JSON.stringify({name:e,files:t})})}async function UP(e,t){return Ue(`/nests/${e}/visibility`,{method:"PATCH",body:JSON.stringify({visibility:t})})}async function Zh(e){return Ue(`/nests/${e}`)}async function WP(){return Ue("/stats")}async function ga(e){return Ue(`/nests/${e}/nodes`)}async function qP(e,t){return Ue(`/nests/${e}/nodes/${t}`)}async function KP(e,t){return Ue(`/nests/${e}/nodes`,{method:"POST",body:JSON.stringify(t)})}async function GP(e,t,n,r){const i={};return r!==void 0&&(i["X-Base-Version"]=String(r)),Ue(`/nests/${e}/nodes/${t}`,{method:"PATCH",headers:i,body:JSON.stringify(n)})}async function YP(e,t){return Ue(`/nests/${e}/nodes/${t}`,{method:"DELETE"})}async function Cx(e,t){return Ue(`/nests/${e}/search?q=${encodeURIComponent(t)}`)}async function JP(e){const t=await Ue(`/nests/${e}/overview`),n=(t==null?void 0:t.tags)??{};return Object.keys(n).map(r=>r.replace(/^#+/,"")).filter(Boolean).sort((r,i)=>r.localeCompare(i))}async function XP(e){return Ue(`/nests/${e}/stewards`)}async function QP(e){return Ue(`/nests/${e}/stewards/sync`,{method:"POST",body:"{}"})}async function ZP(e,t){return Ue(`/nests/${e}/stewards`,{method:"POST",body:JSON.stringify(t)})}async function e8(e,t){return Ue(`/nests/${e}/stewards/${t}`,{method:"DELETE"})}async function t8(e,t,n){return Ue(`/nests/${e}/stewards/${t}`,{method:"PATCH",body:JSON.stringify(n)})}async function n8(e,t){return Ue(`/nests/${e}/nodes/${t}/stewards`)}async function r8(e,t="pending"){return Ue(`/nests/${e}/review-queue?status=${encodeURIComponent(t)}`)}async function y3(e,t,n,r){return Ue(`/nests/${e}/nodes/${t}/submit-review`,{method:"POST",body:JSON.stringify({note:n,priority:r})})}async function b3(e,t,n){return Ue(`/nests/${e}/nodes/${t}/approve`,{method:"POST",body:JSON.stringify({note:n})})}async function v3(e,t,n){return Ue(`/nests/${e}/nodes/${t}/reject`,{method:"POST",body:JSON.stringify({note:n})})}async function i8(e,t){return Ue(`/nests/${e}/nodes/${t}/versions`)}async function pk(e,t=!1){return Ue(`/nests/${e}/external-edits${t?"?refresh=true":""}`)}async function o8(e){return Ue(`/nests/${e}/external-edits/scan`,{method:"POST",body:"{}"})}async function s8(e,t,n){return Ue(`/nests/${e}/nodes/${t}/external-edits/${n}`)}async function l8(e,t,n,r){return Ue(`/nests/${e}/nodes/${t}/external-edits/${n}/approve`,{method:"POST",body:JSON.stringify({comment:r})})}async function a8(e,t,n,r){return Ue(`/nests/${e}/nodes/${t}/external-edits/${n}/reject`,{method:"POST",body:JSON.stringify({reason:r})})}async function u8(e){return Ue(`/nests/${e}/collaborators`)}async function c8(e,t){return Ue(`/nests/${e}/collaborators`,{method:"POST",body:JSON.stringify(t)})}async function d8(e,t,n){return Ue(`/nests/${e}/collaborators/${t}`,{method:"PATCH",body:JSON.stringify({permission:n})})}async function f8(e,t){return Ue(`/nests/${e}/collaborators/${t}`,{method:"DELETE"})}const w3=k.createContext(null);function h8({children:e}){var D;const[t,n]=k.useState(null),[r,i]=k.useState(null),[o,s]=k.useState(null),[l,u]=k.useState(!1),[d,h]=k.useState(!0),[f,g]=k.useState(null),x=k.useRef(0),y=k.useCallback((A,_)=>A==="open"?!0:!!_,[]),v=k.useCallback(async()=>{const A=++x.current;try{const _=await I0();if(x.current!==A)return;s(_),u(t==="open"?!0:!!_.me)}catch{}},[t]);k.useEffect(()=>{f3();let A=!1;return(async()=>{try{const _=await jP();if(A)return;const I=_.auth_mode;n(I),i(_.logo_url??null);const P=await I0();if(A)return;s(P),u(y(I,P.me))}catch{A||g("Cannot connect to server")}finally{A||h(!1)}})(),()=>{A=!0}},[y]),k.useEffect(()=>{if(!r)return;const A=document.querySelector('link[rel="icon"]');A&&(A.href=r)},[r]),k.useEffect(()=>{const A=()=>{++x.current,u(t==="open"),s(_=>_&&{..._,me:null})};return window.addEventListener("auth:unauthorized",A),()=>window.removeEventListener("auth:unauthorized",A)},[t]),k.useEffect(()=>{const A="cnst_auth_tick",_=P=>{P.key===A&&v()},I=()=>{document.visibilityState==="visible"&&v()};return window.addEventListener("storage",_),document.addEventListener("visibilitychange",I),()=>{window.removeEventListener("storage",_),document.removeEventListener("visibilitychange",I)}},[v]);const w=k.useCallback(()=>{try{localStorage.setItem("cnst_auth_tick",String(Date.now()))}catch{}},[]),C=k.useCallback(A=>{const _=++x.current;if(A){const I=A.name??null;s(P=>({claimed:(P==null?void 0:P.claimed)??!0,admin:(P==null?void 0:P.admin)??{email:A.email,name:I},me:{email:A.email,name:I,is_admin:A.is_admin}})),u(!0)}w(),(async()=>{try{const I=await I0();x.current===_&&(s(I),u(y(t,I.me)))}catch{}})()},[t,w,y]),N=k.useCallback(async()=>{++x.current;try{await MP()}catch{}u(t==="open"),s(A=>A&&{...A,me:null}),w()},[t,w]),T=!!((D=o==null?void 0:o.me)!=null&&D.is_admin);return p.jsx(w3.Provider,{value:{authMode:t,logoUrl:r,adminStatus:o,authenticated:l,isAdmin:T,loading:d,error:f,refresh:v,loginSuccess:C,logout:N},children:e})}function Ss(){const e=k.useContext(w3);if(!e)throw new Error("useAuth must be used inside <AuthProvider>");return e}function p8(){const{loginSuccess:e,logoUrl:t}=Ss(),[n,r]=k.useState("login"),[i,o]=k.useState(""),[s,l]=k.useState(""),[u,d]=k.useState(""),[h,f]=k.useState(null),[g,x]=k.useState(!1),[y,v]=k.useState(null),[w,C]=k.useState(null),[N,T]=k.useState(!1),[D,A]=k.useState(!1),_=async()=>{w&&(await navigator.clipboard.writeText(w),T(!0),setTimeout(()=>T(!1),1500))},I=async L=>{L.preventDefault(),f(null),x(!0);try{const R=n==="register"?await _P(i,s,u):await h3(i,s);e(R.user?{email:R.user.email,name:R.user.name,is_admin:!!R.user.is_admin}:void 0)}catch(R){f(R.message)}finally{x(!1)}},P=async()=>{f(null),x(!0);try{const L=await p3();v(L.verificationUrl),C(L.deviceCode),window.open(L.verificationUrl,"_blank","noopener,noreferrer");for(let R=0;R<180;R++){await new Promise(G=>setTimeout(G,2e3));const V=await m3(L.deviceCode,L.clientSecret);if(V.status==="approved"&&V.token){const G=await g3(V.token);e(G.user?{email:G.user.email,name:G.user.name,is_admin:!!G.user.is_admin}:void 0);return}if(V.status==="pending")continue;const K=V.status==="denied"||V.status==="rejected"?"Login request was denied. Please try again to create a new authentication request.":V.status==="expired"?"Login expired. Try again.":V.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${V.status}). Try again.`;f(K),v(null),C(null),x(!1);return}f("Login timed out waiting for approval. Try again."),v(null),C(null),x(!1)}catch(L){f(L.message),v(null),C(null),x(!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:[t?p.jsx("img",{src:t,alt:"",className:"h-12 w-12 mx-auto object-contain"}):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:P,disabled:g,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:g&&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:_,className:"px-2 py-1.5 rounded border text-xs hover:bg-secondary",children:N?"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:I,className:"space-y-3",children:[n==="register"&&p.jsx("input",{type:"text",placeholder:"Name",value:u,onChange:L=>d(L.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:i,onChange:L=>o(L.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:D?"text":"password",placeholder:"Password",value:s,onChange:L=>l(L.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:()=>A(L=>!L),"aria-label":D?"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:D?p.jsx(o3,{className:"h-4 w-4"}):p.jsx(Tc,{className:"h-4 w-4"})})]}),p.jsx("button",{type:"submit",disabled:g,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:g?"...":n==="register"?"Create Account":"Login"})]})]}),h&&p.jsx("p",{className:"text-sm text-destructive text-center",children:h}),!y&&p.jsx("p",{className:"text-xs text-center text-muted-foreground",children:n==="login"?p.jsxs(p.Fragment,{children:["No account?"," ",p.jsx("button",{onClick:()=>r("register"),className:"text-primary underline",children:"Register"})]}):p.jsxs(p.Fragment,{children:["Have an account?"," ",p.jsx("button",{onClick:()=>r("login"),className:"text-primary underline",children:"Login"})]})})]})})}const m8="00000000-0000-0000-0000-000000000000";function k3(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=k3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function S3(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=k3(e))&&(r&&(r+=" "),r+=t);return r}const g8=(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},x8=(e,t)=>({classGroupId:e,validator:t}),C3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Hf="-",mk=[],y8="arbitrary..",b8=e=>{const t=w8(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return v8(s);const l=s.split(Hf),u=l[0]===""&&l.length>1?1:0;return E3(l,u,t)},getConflictingClassGroupIds:(s,l)=>{if(l){const u=r[s],d=n[s];return u?d?g8(d,u):u:d||mk}return n[s]||mk}}},E3=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const d=E3(e,t+1,o);if(d)return d}const s=n.validators;if(s===null)return;const l=t===0?e.join(Hf):e.slice(t).join(Hf),u=s.length;for(let d=0;d<u;d++){const h=s[d];if(h.validator(l))return h.classGroupId}},v8=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?y8+r:void 0})(),w8=e=>{const{theme:t,classGroups:n}=e;return k8(n,t)},k8=(e,t)=>{const n=C3();for(const r in e){const i=e[r];Ex(i,n,r,t)}return n},Ex=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const s=e[o];S8(s,t,n,r)}},S8=(e,t,n,r)=>{if(typeof e=="string"){C8(e,t,n);return}if(typeof e=="function"){E8(e,t,n,r);return}N8(e,t,n,r)},C8=(e,t,n)=>{const r=e===""?t:N3(t,e);r.classGroupId=n},E8=(e,t,n,r)=>{if(T8(e)){Ex(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(x8(n,e))},N8=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let s=0;s<o;s++){const[l,u]=i[s];Ex(u,N3(t,l),n,r)}},N3=(e,t)=>{let n=e;const r=t.split(Hf),i=r.length;for(let o=0;o<i;o++){const s=r[o];let l=n.nextPart.get(s);l||(l=C3(),n.nextPart.set(s,l)),n=l}return n},T8=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,A8=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)}}},c1="!",gk=":",_8=[],xk=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),M8=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,l=0,u=0,d;const h=i.length;for(let v=0;v<h;v++){const w=i[v];if(s===0&&l===0){if(w===gk){o.push(i.slice(u,v)),u=v+1;continue}if(w==="/"){d=v;continue}}w==="["?s++:w==="]"?s--:w==="("?l++:w===")"&&l--}const f=o.length===0?i:i.slice(u);let g=f,x=!1;f.endsWith(c1)?(g=f.slice(0,-1),x=!0):f.startsWith(c1)&&(g=f.slice(1),x=!0);const y=d&&d>u?d-u:void 0;return xk(o,x,g,y)};if(t){const i=t+gk,o=r;r=s=>s.startsWith(i)?o(s.slice(i.length)):xk(_8,!1,s,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},j8=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]==="[",u=t.has(s);l||u?(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}},D8=e=>({cache:A8(e.cacheSize),parseClassName:M8(e),sortModifiers:j8(e),...b8(e)}),R8=/\s+/,P8=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],l=e.trim().split(R8);let u="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:f,modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:v}=n(h);if(f){u=h+(u.length>0?" "+u:u);continue}let w=!!v,C=r(w?y.substring(0,v):y);if(!C){if(!w){u=h+(u.length>0?" "+u:u);continue}if(C=r(y),!C){u=h+(u.length>0?" "+u:u);continue}w=!1}const N=g.length===0?"":g.length===1?g[0]:o(g).join(":"),T=x?N+c1:N,D=T+C;if(s.indexOf(D)>-1)continue;s.push(D);const A=i(C,w);for(let _=0;_<A.length;++_){const I=A[_];s.push(T+I)}u=h+(u.length>0?" "+u:u)}return u},I8=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=T3(n))&&(i&&(i+=" "),i+=r);return i},T3=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=T3(e[r]))&&(n&&(n+=" "),n+=t);return n},O8=(e,...t)=>{let n,r,i,o;const s=u=>{const d=t.reduce((h,f)=>f(h),e());return n=D8(d),r=n.cache.get,i=n.cache.set,o=l,l(u)},l=u=>{const d=r(u);if(d)return d;const h=P8(u,n);return i(u,h),h};return o=s,(...u)=>o(I8(...u))},L8=[],xn=e=>{const t=n=>n[e]||L8;return t.isThemeGetter=!0,t},A3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,F8=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,z8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B8=/\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$/,$8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,V8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Go=e=>F8.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),Yo=e=>!!e&&Number.isInteger(Number(e)),O0=e=>e.endsWith("%")&&et(e.slice(0,-1)),uo=e=>z8.test(e),M3=()=>!0,U8=e=>B8.test(e)&&!$8.test(e),Nx=()=>!1,W8=e=>V8.test(e),q8=e=>H8.test(e),K8=e=>!_e(e)&&!Me(e),G8=e=>Cs(e,R3,Nx),_e=e=>A3.test(e),Us=e=>Cs(e,P3,U8),yk=e=>Cs(e,nI,et),Y8=e=>Cs(e,O3,M3),J8=e=>Cs(e,I3,Nx),bk=e=>Cs(e,j3,Nx),X8=e=>Cs(e,D3,q8),tf=e=>Cs(e,L3,W8),Me=e=>_3.test(e),wu=e=>bl(e,P3),Q8=e=>bl(e,I3),vk=e=>bl(e,j3),Z8=e=>bl(e,R3),eI=e=>bl(e,D3),nf=e=>bl(e,L3,!0),tI=e=>bl(e,O3,!0),Cs=(e,t,n)=>{const r=A3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},bl=(e,t,n=!1)=>{const r=_3.exec(e);return r?r[1]?t(r[1]):n:!1},j3=e=>e==="position"||e==="percentage",D3=e=>e==="image"||e==="url",R3=e=>e==="length"||e==="size"||e==="bg-size",P3=e=>e==="length",nI=e=>e==="number",I3=e=>e==="family-name",O3=e=>e==="number"||e==="weight",L3=e=>e==="shadow",rI=()=>{const e=xn("color"),t=xn("font"),n=xn("text"),r=xn("font-weight"),i=xn("tracking"),o=xn("leading"),s=xn("breakpoint"),l=xn("container"),u=xn("spacing"),d=xn("radius"),h=xn("shadow"),f=xn("inset-shadow"),g=xn("text-shadow"),x=xn("drop-shadow"),y=xn("blur"),v=xn("perspective"),w=xn("aspect"),C=xn("ease"),N=xn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...D(),Me,_e],_=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],P=()=>[Me,_e,u],L=()=>[Go,"full","auto",...P()],R=()=>[Yo,"none","subgrid",Me,_e],V=()=>["auto",{span:["full",Yo,Me,_e]},Yo,Me,_e],K=()=>[Yo,"auto",Me,_e],G=()=>["auto","min","max","fr",Me,_e],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...P()],Z=()=>[Go,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],q=()=>[Go,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Y=()=>[Go,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],j=()=>[e,Me,_e],z=()=>[...D(),vk,bk,{position:[Me,_e]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",Z8,G8,{size:[Me,_e]}],ce=()=>[O0,wu,Us],pe=()=>["","none","full",d,Me,_e],le=()=>["",et,wu,Us],ie=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[et,O0,vk,bk],Te=()=>["","none",y,Me,_e],Le=()=>["none",et,Me,_e],Be=()=>["none",et,Me,_e],at=()=>[et,Me,_e],Xe=()=>[Go,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[uo],breakpoint:[uo],color:[M3],container:[uo],"drop-shadow":[uo],ease:["in","out","in-out"],font:[K8],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[uo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[uo],shadow:[uo],spacing:["px",et],text:[uo],"text-shadow":[uo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Go,_e,Me,w]}],container:["container"],columns:[{columns:[et,_e,Me,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:A()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Yo,"auto",Me,_e]}],basis:[{basis:[Go,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,Go,"auto","initial","none",_e]}],grow:[{grow:["",et,Me,_e]}],shrink:[{shrink:["",et,Me,_e]}],order:[{order:[Yo,"first","last","none",Me,_e]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"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",...Z()]}],"min-w":[{"min-w":[l,"screen","none",...Z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,wu,Us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tI,Y8]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",O0,_e]}],"font-family":[{font:[Q8,J8,t]}],"font-features":[{"font-features":[_e]}],"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,Me,_e]}],"line-clamp":[{"line-clamp":[et,"none",Me,yk]}],leading:[{leading:[o,...P()]}],"list-image":[{"list-image":["none",Me,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Me,Us]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[et,"auto",Me,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,_e]}],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",Me,_e]}],"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:ee()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yo,Me,_e],radial:["",Me,_e],conic:[Yo,Me,_e]},eI,X8]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Me,_e]}],"outline-w":[{outline:["",et,wu,Us]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",h,nf,tf]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",f,nf,tf]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[et,Us]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",g,nf,tf]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[et,Me,_e]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[et]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Me,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,_e]}],filter:[{filter:["","none",Me,_e]}],blur:[{blur:Te()}],brightness:[{brightness:[et,Me,_e]}],contrast:[{contrast:[et,Me,_e]}],"drop-shadow":[{"drop-shadow":["","none",x,nf,tf]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",et,Me,_e]}],"hue-rotate":[{"hue-rotate":[et,Me,_e]}],invert:[{invert:["",et,Me,_e]}],saturate:[{saturate:[et,Me,_e]}],sepia:[{sepia:["",et,Me,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,_e]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[et,Me,_e]}],"backdrop-contrast":[{"backdrop-contrast":[et,Me,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Me,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Me,_e]}],"backdrop-invert":[{"backdrop-invert":["",et,Me,_e]}],"backdrop-opacity":[{"backdrop-opacity":[et,Me,_e]}],"backdrop-saturate":[{"backdrop-saturate":[et,Me,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Me,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Me,_e]}],ease:[{ease:["linear","initial",C,Me,_e]}],delay:[{delay:[et,Me,_e]}],animate:[{animate:["none",N,Me,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,Me,_e]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:at()}],"skew-x":[{"skew-x":at()}],"skew-y":[{"skew-y":at()}],transform:[{transform:[Me,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"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",Me,_e]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Me,_e]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[et,wu,Us,yk]}],stroke:[{stroke:["none",...j()]}],"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"]}},iI=O8(rI);function Ie(...e){return iI(S3(e))}const Qt=k.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Qt.displayName="Card";const yn=k.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Ie("flex flex-col space-y-1.5 p-6",e),...t}));yn.displayName="CardHeader";const bn=k.forwardRef(({className:e,...t},n)=>p.jsx("h3",{ref:n,className:Ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));bn.displayName="CardTitle";const Fr=k.forwardRef(({className:e,...t},n)=>p.jsx("p",{ref:n,className:Ie("text-sm text-muted-foreground",e),...t}));Fr.displayName="CardDescription";const Zt=k.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Ie("p-6 pt-0",e),...t}));Zt.displayName="CardContent";const oI=k.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Ie("flex items-center p-6 pt-0",e),...t}));oI.displayName="CardFooter";function wk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Eo(...e){return t=>{let n=!1;const r=e.map(i=>{const o=wk(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():wk(e[i],null)}}}}function it(...e){return k.useCallback(Eo(...e),e)}var sI=Symbol.for("react.lazy"),Uf=yx[" use ".trim().toString()];function lI(e){return typeof e=="object"&&e!==null&&"then"in e}function F3(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===sI&&"_payload"in e&&lI(e._payload)}function Tx(e){const t=uI(e),n=k.forwardRef((r,i)=>{let{children:o,...s}=r;F3(o)&&typeof Uf=="function"&&(o=Uf(o._payload));const l=k.Children.toArray(o),u=l.find(dI);if(u){const d=u.props.children,h=l.map(f=>f===u?k.Children.count(d)>1?k.Children.only(null):k.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:k.isValidElement(d)?k.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var aI=Tx("Slot");function uI(e){const t=k.forwardRef((n,r)=>{let{children:i,...o}=n;if(F3(i)&&typeof Uf=="function"&&(i=Uf(i._payload)),k.isValidElement(i)){const s=hI(i),l=fI(o,i.props);return i.type!==k.Fragment&&(l.ref=r?Eo(r,s):s),k.cloneElement(i,l)}return k.Children.count(i)>1?k.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cI=Symbol("radix.slottable");function dI(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cI}function fI(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 u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function hI(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 kk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Sk=S3,ep=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Sk(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=kk(h)||kk(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},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:f,className:g,...x}=h;return Object.entries(x).every(y=>{let[v,w]=y;return Array.isArray(w)?w.includes({...o,...l}[v]):{...o,...l}[v]===w})?[...d,f,g]:d},[]);return Sk(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},pI=ep("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"}}),be=k.forwardRef(({className:e,variant:t="default",size:n="default",asChild:r=!1,...i},o)=>{const s=r?aI:"button";return p.jsx(s,{className:Ie(pI({variant:t,size:n,className:e})),ref:o,...i})});be.displayName="Button";const Xn=k.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:Ie("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}));Xn.displayName="Input";var mI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gI=mI.reduce((e,t)=>{const n=Tx(`Primitive.${t}`),r=k.forwardRef((i,o)=>{const{asChild:s,...l}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),xI="Label",z3=k.forwardRef((e,t)=>p.jsx(gI.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())}}));z3.displayName=xI;var B3=z3;const yI=ep("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Vt=k.forwardRef(({className:e,...t},n)=>p.jsx(B3,{ref:n,className:Ie(yI(),e),...t}));Vt.displayName=B3.displayName;function ve(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 bI(e,t){const n=k.createContext(t),r=o=>{const{children:s,...l}=o,u=k.useMemo(()=>l,Object.values(l));return p.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function i(o){const s=k.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 Ci(e,t=[]){let n=[];function r(o,s){const l=k.createContext(s),u=n.length;n=[...n,s];const d=f=>{var C;const{scope:g,children:x,...y}=f,v=((C=g==null?void 0:g[e])==null?void 0:C[u])||l,w=k.useMemo(()=>y,Object.values(y));return p.jsx(v.Provider,{value:w,children:x})};d.displayName=o+"Provider";function h(f,g){var v;const x=((v=g==null?void 0:g[e])==null?void 0:v[u])||l,y=k.useContext(x);if(y)return y;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=>k.createContext(s));return function(l){const u=(l==null?void 0:l[e])||o;return k.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,vI(i,...t)]}function vI(...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:u,scopeName:d})=>{const f=u(o)[`__scope${d}`];return{...l,...f}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ln=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},wI=yx[" useId ".trim().toString()]||(()=>{}),kI=0;function vi(e){const[t,n]=k.useState(wI());return ln(()=>{n(r=>r??String(kI++))},[e]),t?`radix-${t}`:""}var SI=yx[" useInsertionEffect ".trim().toString()]||ln;function ms({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=CI({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const h=k.useRef(e!==void 0);k.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=k.useCallback(h=>{var f;if(l){const g=EI(h)?h(e):h;g!==e&&((f=s.current)==null||f.call(s,g))}else o(h)},[l,e,o,s]);return[u,d]}function CI({defaultProp:e,onChange:t}){const[n,r]=k.useState(e),i=k.useRef(n),o=k.useRef(t);return SI(()=>{o.current=t},[t]),k.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function EI(e){return typeof e=="function"}function NI(e){const t=TI(e),n=k.forwardRef((r,i)=>{const{children:o,...s}=r,l=k.Children.toArray(o),u=l.find(_I);if(u){const d=u.props.children,h=l.map(f=>f===u?k.Children.count(d)>1?k.Children.only(null):k.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:k.isValidElement(d)?k.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function TI(e){const t=k.forwardRef((n,r)=>{const{children:i,...o}=n;if(k.isValidElement(i)){const s=jI(i),l=MI(o,i.props);return i.type!==k.Fragment&&(l.ref=r?Eo(r,s):s),k.cloneElement(i,l)}return k.Children.count(i)>1?k.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AI=Symbol("radix.slottable");function _I(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AI}function MI(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 u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function jI(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 DI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=DI.reduce((e,t)=>{const n=NI(`Primitive.${t}`),r=k.forwardRef((i,o)=>{const{asChild:s,...l}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $3(e,t){e&&Ec.flushSync(()=>e.dispatchEvent(t))}function Tn(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function RI(e,t=globalThis==null?void 0:globalThis.document){const n=Tn(e);k.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 PI="DismissableLayer",d1="dismissableLayer.update",II="dismissableLayer.pointerDownOutside",OI="dismissableLayer.focusOutside",Ck,V3=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_c=k.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,d=k.useContext(V3),[h,f]=k.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=k.useState({}),y=it(t,I=>f(I)),v=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=v.indexOf(w),N=h?v.indexOf(h):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,D=N>=C,A=zI(I=>{const P=I.target,L=[...d.branches].some(R=>R.contains(P));!D||L||(i==null||i(I),s==null||s(I),I.defaultPrevented||l==null||l())},g),_=BI(I=>{const P=I.target;[...d.branches].some(R=>R.contains(P))||(o==null||o(I),s==null||s(I),I.defaultPrevented||l==null||l())},g);return RI(I=>{N===d.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},g),k.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ck=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Ek(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Ck)}},[h,g,n,d]),k.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Ek())},[h,d]),k.useEffect(()=>{const I=()=>x({});return document.addEventListener(d1,I),()=>document.removeEventListener(d1,I)},[]),p.jsx(Ye.div,{...u,ref:y,style:{pointerEvents:T?D?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,_.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,A.onPointerDownCapture)})});_c.displayName=PI;var LI="DismissableLayerBranch",FI=k.forwardRef((e,t)=>{const n=k.useContext(V3),r=k.useRef(null),i=it(t,r);return k.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),p.jsx(Ye.div,{...e,ref:i})});FI.displayName=LI;function zI(e,t=globalThis==null?void 0:globalThis.document){const n=Tn(e),r=k.useRef(!1),i=k.useRef(()=>{});return k.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){H3(II,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}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 BI(e,t=globalThis==null?void 0:globalThis.document){const n=Tn(e),r=k.useRef(!1);return k.useEffect(()=>{const i=o=>{o.target&&!r.current&&H3(OI,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 Ek(){const e=new CustomEvent(d1);document.dispatchEvent(e)}function H3(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?$3(i,o):i.dispatchEvent(o)}var L0="focusScope.autoFocusOnMount",F0="focusScope.autoFocusOnUnmount",Nk={bubbles:!1,cancelable:!0},$I="FocusScope",tp=k.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[l,u]=k.useState(null),d=Tn(i),h=Tn(o),f=k.useRef(null),g=it(t,v=>u(v)),x=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let v=function(T){if(x.paused||!l)return;const D=T.target;l.contains(D)?f.current=D:Qo(f.current,{select:!0})},w=function(T){if(x.paused||!l)return;const D=T.relatedTarget;D!==null&&(l.contains(D)||Qo(f.current,{select:!0}))},C=function(T){if(document.activeElement===document.body)for(const A of T)A.removedNodes.length>0&&Qo(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const N=new MutationObserver(C);return l&&N.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),N.disconnect()}}},[r,l,x.paused]),k.useEffect(()=>{if(l){Ak.add(x);const v=document.activeElement;if(!l.contains(v)){const C=new CustomEvent(L0,Nk);l.addEventListener(L0,d),l.dispatchEvent(C),C.defaultPrevented||(VI(KI(U3(l)),{select:!0}),document.activeElement===v&&Qo(l))}return()=>{l.removeEventListener(L0,d),setTimeout(()=>{const C=new CustomEvent(F0,Nk);l.addEventListener(F0,h),l.dispatchEvent(C),C.defaultPrevented||Qo(v??document.body,{select:!0}),l.removeEventListener(F0,h),Ak.remove(x)},0)}}},[l,d,h,x]);const y=k.useCallback(v=>{if(!n&&!r||x.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,C=document.activeElement;if(w&&C){const N=v.currentTarget,[T,D]=HI(N);T&&D?!v.shiftKey&&C===D?(v.preventDefault(),n&&Qo(T,{select:!0})):v.shiftKey&&C===T&&(v.preventDefault(),n&&Qo(D,{select:!0})):C===N&&v.preventDefault()}},[n,r,x.paused]);return p.jsx(Ye.div,{tabIndex:-1,...s,ref:g,onKeyDown:y})});tp.displayName=$I;function VI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Qo(r,{select:t}),document.activeElement!==n)return}function HI(e){const t=U3(e),n=Tk(t,e),r=Tk(t.reverse(),e);return[n,r]}function U3(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 Tk(e,t){for(const n of e)if(!UI(n,{upTo:t}))return n}function UI(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 WI(e){return e instanceof HTMLInputElement&&"select"in e}function Qo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WI(e)&&t&&e.select()}}var Ak=qI();function qI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_k(e,t),e.unshift(t)},remove(t){var n;e=_k(e,t),(n=e[0])==null||n.resume()}}}function _k(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function KI(e){return e.filter(t=>t.tagName!=="A")}var GI="Portal",Mc=k.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,o]=k.useState(!1);ln(()=>o(!0),[]);const s=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?bx.createPortal(p.jsx(Ye.div,{...r,ref:t}),s):null});Mc.displayName=GI;function YI(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var hr=e=>{const{present:t,children:n}=e,r=JI(t),i=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),o=it(r.ref,XI(i));return typeof n=="function"||r.isPresent?k.cloneElement(i,{ref:o}):null};hr.displayName="Presence";function JI(e){const[t,n]=k.useState(),r=k.useRef(null),i=k.useRef(e),o=k.useRef("none"),s=e?"mounted":"unmounted",[l,u]=YI(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const d=rf(r.current);o.current=l==="mounted"?d:"none"},[l]),ln(()=>{const d=r.current,h=i.current;if(h!==e){const g=o.current,x=rf(d);e?u("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(h&&g!==x?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),ln(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,f=x=>{const v=rf(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&v&&(u("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=x=>{x.target===t&&(o.current=rf(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 u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:k.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function rf(e){return(e==null?void 0:e.animationName)||"none"}function XI(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 z0=0;function Ax(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Mk()),document.body.insertAdjacentElement("beforeend",e[1]??Mk()),z0++,()=>{z0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z0--}},[])}function Mk(){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 Li=function(){return Li=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},Li.apply(this,arguments)};function W3(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 QI(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 jf="right-scroll-bar-position",Df="width-before-scroll-bar",ZI="with-scroll-bars-hidden",eO="--removed-body-scroll-bar-size";function B0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tO(e,t){var n=k.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 nO=typeof window<"u"?k.useLayoutEffect:k.useEffect,jk=new WeakMap;function rO(e,t){var n=tO(null,function(r){return e.forEach(function(i){return B0(i,r)})});return nO(function(){var r=jk.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(l){o.has(l)||B0(l,null)}),o.forEach(function(l){i.has(l)||B0(l,s)})}jk.set(n,e)},[e]),n}function iO(e){return e}function oO(e,t){t===void 0&&(t=iO);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 u=function(){var h=s;s=[],h.forEach(o)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){s.push(h),d()},filter:function(h){return s=s.filter(h),n}}}};return i}function sO(e){e===void 0&&(e={});var t=oO(null);return t.options=Li({async:!0,ssr:!1},e),t}var q3=function(e){var t=e.sideCar,n=W3(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 k.createElement(r,Li({},n))};q3.isSideCarExport=!0;function lO(e,t){return e.useMedium(t),q3}var K3=sO(),$0=function(){},np=k.forwardRef(function(e,t){var n=k.useRef(null),r=k.useState({onScrollCapture:$0,onWheelCapture:$0,onTouchMoveCapture:$0}),i=r[0],o=r[1],s=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,h=e.enabled,f=e.shards,g=e.sideCar,x=e.noRelative,y=e.noIsolation,v=e.inert,w=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,T=e.gapMode,D=W3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,_=rO([n,t]),I=Li(Li({},D),i);return k.createElement(k.Fragment,null,h&&k.createElement(A,{sideCar:K3,removeScrollBar:d,shards:f,noRelative:x,noIsolation:y,inert:v,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:T}),s?k.cloneElement(k.Children.only(l),Li(Li({},I),{ref:_})):k.createElement(N,Li({},I,{className:u,ref:_}),l))});np.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};np.classNames={fullWidth:Df,zeroRight:jf};var aO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=aO();return t&&e.setAttribute("nonce",t),e}function cO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uO())&&(cO(t,n),dO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hO=function(){var e=fO();return function(t,n){k.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},G3=function(){var e=hO(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},pO={left:0,top:0,right:0,gap:0},V0=function(e){return parseInt(e||"",10)||0},mO=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[V0(n),V0(r),V0(i)]},gO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pO;var t=mO(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])}},xO=G3(),aa="data-scroll-locked",yO=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
411
|
+
.`.concat(ZI,` {
|
|
412
|
+
overflow: hidden `).concat(r,`;
|
|
413
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
414
|
+
}
|
|
415
|
+
body[`).concat(aa,`] {
|
|
416
|
+
overflow: hidden `).concat(r,`;
|
|
417
|
+
overscroll-behavior: contain;
|
|
418
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
419
|
+
padding-left: `.concat(i,`px;
|
|
420
|
+
padding-top: `).concat(o,`px;
|
|
421
|
+
padding-right: `).concat(s,`px;
|
|
422
|
+
margin-left:0;
|
|
423
|
+
margin-top:0;
|
|
424
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
425
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.`).concat(jf,` {
|
|
429
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.`).concat(Df,` {
|
|
433
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.`).concat(jf," .").concat(jf,` {
|
|
437
|
+
right: 0 `).concat(r,`;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.`).concat(Df," .").concat(Df,` {
|
|
441
|
+
margin-right: 0 `).concat(r,`;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
body[`).concat(aa,`] {
|
|
445
|
+
`).concat(eO,": ").concat(l,`px;
|
|
446
|
+
}
|
|
447
|
+
`)},Dk=function(){var e=parseInt(document.body.getAttribute(aa)||"0",10);return isFinite(e)?e:0},bO=function(){k.useEffect(function(){return document.body.setAttribute(aa,(Dk()+1).toString()),function(){var e=Dk()-1;e<=0?document.body.removeAttribute(aa):document.body.setAttribute(aa,e.toString())}},[])},vO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;bO();var o=k.useMemo(function(){return gO(i)},[i]);return k.createElement(xO,{styles:yO(o,!t,i,n?"":"!important")})},f1=!1;if(typeof window<"u")try{var of=Object.defineProperty({},"passive",{get:function(){return f1=!0,!0}});window.addEventListener("test",of,of),window.removeEventListener("test",of,of)}catch{f1=!1}var Gl=f1?{passive:!1}:!1,wO=function(e){return e.tagName==="TEXTAREA"},Y3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!wO(e)&&n[t]==="visible")},kO=function(e){return Y3(e,"overflowY")},SO=function(e){return Y3(e,"overflowX")},Rk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=J3(e,r);if(i){var o=X3(e,r),s=o[1],l=o[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},EO=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},J3=function(e,t){return e==="v"?kO(t):SO(t)},X3=function(e,t){return e==="v"?CO(t):EO(t)},NO=function(e,t){return e==="h"&&t==="rtl"?-1:1},TO=function(e,t,n,r,i){var o=NO(e,window.getComputedStyle(t).direction),s=o*r,l=n.target,u=t.contains(l),d=!1,h=s>0,f=0,g=0;do{if(!l)break;var x=X3(e,l),y=x[0],v=x[1],w=x[2],C=v-w-o*y;(y||C)&&J3(e,l)&&(f+=C,g+=y);var N=l.parentNode;l=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&Math.abs(f)<1||!h&&Math.abs(g)<1)&&(d=!0),d},sf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pk=function(e){return[e.deltaX,e.deltaY]},Ik=function(e){return e&&"current"in e?e.current:e},AO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_O=function(e){return`
|
|
448
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
449
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
450
|
+
`)},MO=0,Yl=[];function jO(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),i=k.useState(MO++)[0],o=k.useState(G3)[0],s=k.useRef(e);k.useEffect(function(){s.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=QI([e.lockRef.current],(e.shards||[]).map(Ik),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=k.useCallback(function(v,w){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var C=sf(v),N=n.current,T="deltaX"in v?v.deltaX:N[0]-C[0],D="deltaY"in v?v.deltaY:N[1]-C[1],A,_=v.target,I=Math.abs(T)>Math.abs(D)?"h":"v";if("touches"in v&&I==="h"&&_.type==="range")return!1;var P=window.getSelection(),L=P&&P.anchorNode,R=L?L===_||L.contains(_):!1;if(R)return!1;var V=Rk(I,_);if(!V)return!0;if(V?A=I:(A=I==="v"?"h":"v",V=Rk(I,_)),!V)return!1;if(!r.current&&"changedTouches"in v&&(T||D)&&(r.current=A),!A)return!0;var K=r.current||A;return TO(K,w,v,K==="h"?T:D)},[]),u=k.useCallback(function(v){var w=v;if(!(!Yl.length||Yl[Yl.length-1]!==o)){var C="deltaY"in w?Pk(w):sf(w),N=t.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&AO(A.delta,C)})[0];if(N&&N.should){w.cancelable&&w.preventDefault();return}if(!N){var T=(s.current.shards||[]).map(Ik).filter(Boolean).filter(function(A){return A.contains(w.target)}),D=T.length>0?l(w,T[0]):!s.current.noIsolation;D&&w.cancelable&&w.preventDefault()}}},[]),d=k.useCallback(function(v,w,C,N){var T={name:v,delta:w,target:C,should:N,shadowParent:DO(C)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(D){return D!==T})},1)},[]),h=k.useCallback(function(v){n.current=sf(v),r.current=void 0},[]),f=k.useCallback(function(v){d(v.type,Pk(v),v.target,l(v,e.lockRef.current))},[]),g=k.useCallback(function(v){d(v.type,sf(v),v.target,l(v,e.lockRef.current))},[]);k.useEffect(function(){return Yl.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Gl),document.addEventListener("touchmove",u,Gl),document.addEventListener("touchstart",h,Gl),function(){Yl=Yl.filter(function(v){return v!==o}),document.removeEventListener("wheel",u,Gl),document.removeEventListener("touchmove",u,Gl),document.removeEventListener("touchstart",h,Gl)}},[]);var x=e.removeScrollBar,y=e.inert;return k.createElement(k.Fragment,null,y?k.createElement(o,{styles:_O(i)}):null,x?k.createElement(vO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const RO=lO(K3,jO);var rp=k.forwardRef(function(e,t){return k.createElement(np,Li({},e,{ref:t,sideCar:RO}))});rp.classNames=np.classNames;var PO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jl=new WeakMap,lf=new WeakMap,af={},H0=0,Q3=function(e){return e&&(e.host||Q3(e.parentNode))},IO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Q3(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})},OO=function(e,t,n,r){var i=IO(t,Array.isArray(e)?e:[e]);af[n]||(af[n]=new WeakMap);var o=af[n],s=[],l=new Set,u=new Set(i),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};i.forEach(d);var h=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(g){if(l.has(g))h(g);else try{var x=g.getAttribute(r),y=x!==null&&x!=="false",v=(Jl.get(g)||0)+1,w=(o.get(g)||0)+1;Jl.set(g,v),o.set(g,w),s.push(g),v===1&&y&&lf.set(g,!0),w===1&&g.setAttribute(n,"true"),y||g.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",g,C)}})};return h(t),l.clear(),H0++,function(){s.forEach(function(f){var g=Jl.get(f)-1,x=o.get(f)-1;Jl.set(f,g),o.set(f,x),g||(lf.has(f)||f.removeAttribute(r),lf.delete(f)),x||f.removeAttribute(n)}),H0--,H0||(Jl=new WeakMap,Jl=new WeakMap,lf=new WeakMap,af={})}},_x=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=PO(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),OO(r,i,n,"aria-hidden")):function(){return null}};function LO(e){const t=FO(e),n=k.forwardRef((r,i)=>{const{children:o,...s}=r,l=k.Children.toArray(o),u=l.find(BO);if(u){const d=u.props.children,h=l.map(f=>f===u?k.Children.count(d)>1?k.Children.only(null):k.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:k.isValidElement(d)?k.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function FO(e){const t=k.forwardRef((n,r)=>{const{children:i,...o}=n;if(k.isValidElement(i)){const s=VO(i),l=$O(o,i.props);return i.type!==k.Fragment&&(l.ref=r?Eo(r,s):s),k.cloneElement(i,l)}return k.Children.count(i)>1?k.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zO=Symbol("radix.slottable");function BO(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zO}function $O(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 u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function VO(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 ip="Dialog",[Z3]=Ci(ip),[HO,Ei]=Z3(ip),eE=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,l=k.useRef(null),u=k.useRef(null),[d,h]=ms({prop:r,defaultProp:i??!1,onChange:o,caller:ip});return p.jsx(HO,{scope:t,triggerRef:l,contentRef:u,contentId:vi(),titleId:vi(),descriptionId:vi(),open:d,onOpenChange:h,onOpenToggle:k.useCallback(()=>h(f=>!f),[h]),modal:s,children:n})};eE.displayName=ip;var tE="DialogTrigger",UO=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ei(tE,n),o=it(t,i.triggerRef);return p.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Dx(i.open),...r,ref:o,onClick:ve(e.onClick,i.onOpenToggle)})});UO.displayName=tE;var Mx="DialogPortal",[WO,nE]=Z3(Mx,{forceMount:void 0}),rE=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Ei(Mx,t);return p.jsx(WO,{scope:t,forceMount:n,children:k.Children.map(r,s=>p.jsx(hr,{present:n||o.open,children:p.jsx(Mc,{asChild:!0,container:i,children:s})}))})};rE.displayName=Mx;var Wf="DialogOverlay",iE=k.forwardRef((e,t)=>{const n=nE(Wf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Ei(Wf,e.__scopeDialog);return o.modal?p.jsx(hr,{present:r||o.open,children:p.jsx(KO,{...i,ref:t})}):null});iE.displayName=Wf;var qO=LO("DialogOverlay.RemoveScroll"),KO=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ei(Wf,n);return p.jsx(rp,{as:qO,allowPinchZoom:!0,shards:[i.contentRef],children:p.jsx(Ye.div,{"data-state":Dx(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),al="DialogContent",oE=k.forwardRef((e,t)=>{const n=nE(al,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Ei(al,e.__scopeDialog);return p.jsx(hr,{present:r||o.open,children:o.modal?p.jsx(GO,{...i,ref:t}):p.jsx(YO,{...i,ref:t})})});oE.displayName=al;var GO=k.forwardRef((e,t)=>{const n=Ei(al,e.__scopeDialog),r=k.useRef(null),i=it(t,n.contentRef,r);return k.useEffect(()=>{const o=r.current;if(o)return _x(o)},[]),p.jsx(sE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&o.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,o=>o.preventDefault())})}),YO=k.forwardRef((e,t)=>{const n=Ei(al,e.__scopeDialog),r=k.useRef(!1),i=k.useRef(!1);return p.jsx(sE,{...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 u,d;(u=e.onInteractOutside)==null||u.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()}})}),sE=k.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,l=Ei(al,n),u=k.useRef(null),d=it(t,u);return Ax(),p.jsxs(p.Fragment,{children:[p.jsx(tp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:p.jsx(_c,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Dx(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(JO,{titleId:l.titleId}),p.jsx(QO,{contentRef:u,descriptionId:l.descriptionId})]})]})}),jx="DialogTitle",lE=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ei(jx,n);return p.jsx(Ye.h2,{id:i.titleId,...r,ref:t})});lE.displayName=jx;var aE="DialogDescription",uE=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ei(aE,n);return p.jsx(Ye.p,{id:i.descriptionId,...r,ref:t})});uE.displayName=aE;var cE="DialogClose",dE=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ei(cE,n);return p.jsx(Ye.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,()=>i.onOpenChange(!1))})});dE.displayName=cE;function Dx(e){return e?"open":"closed"}var fE="DialogTitleWarning",[Yie,hE]=bI(fE,{contentName:al,titleName:jx,docsSlug:"dialog"}),JO=({titleId:e})=>{const t=hE(fE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
451
|
+
|
|
452
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
453
|
+
|
|
454
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},XO="DialogDescriptionWarning",QO=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hE(XO).contentName}}.`;return k.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},ZO=eE,eL=rE,pE=iE,mE=oE,gE=lE,xE=uE,tL=dE;function nL(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 rL=["color"],iL=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=nL(e,rL);return k.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}),k.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 vn=ZO,oL=eL,yE=k.forwardRef(({className:e,...t},n)=>p.jsx(pE,{ref:n,className:Ie("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=pE.displayName;const an=k.forwardRef(({className:e,children:t,hideCloseButton:n,...r},i)=>p.jsxs(oL,{children:[p.jsx(yE,{}),p.jsxs(mE,{ref:i,className:Ie("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 [overflow-wrap:anywhere]",e),...r,children:[t,!n&&p.jsxs(tL,{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(iL,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));an.displayName=mE.displayName;const un=({className:e,...t})=>p.jsx("div",{className:Ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});un.displayName="DialogHeader";const cr=({className:e,...t})=>p.jsx("div",{className:Ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});cr.displayName="DialogFooter";const cn=k.forwardRef(({className:e,...t},n)=>p.jsx(gE,{ref:n,className:Ie("text-lg font-semibold leading-none tracking-tight",e),...t}));cn.displayName=gE.displayName;const Qn=k.forwardRef(({className:e,...t},n)=>p.jsx(xE,{ref:n,className:Ie("text-sm text-muted-foreground",e),...t}));Qn.displayName=xE.displayName;function bE({nestId:e,nestName:t,open:n,onOpenChange:r,onDeleted:i,isImported:o=!1}){const[s,l]=k.useState(""),[u,d]=k.useState(!1),[h,f]=k.useState(null);k.useEffect(()=>{n&&(l(""),f(null),d(!1))},[n]);const g=async()=>{d(!0),f(null);try{await VP(e),i()}catch(x){console.error("[DeleteNestDialog] deleteNest failed",e,x),f((x==null?void 0:x.message)??"Failed to delete this nest. You may not have permission, or the server may be unreachable."),d(!1)}};return p.jsx(vn,{open:n,onOpenChange:x=>{!x&&u||r(x)},children:p.jsxs(an,{className:"sm:max-w-[440px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{className:"flex items-center gap-2 text-red-700",children:[p.jsx(ll,{className:"h-4 w-4"}),"Delete nest"]}),p.jsxs(Qn,{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:"Stewardship assignments and review-queue entries"}),p.jsx("li",{children:"Collaborator access and linked API keys"}),p.jsx("li",{children:"Version history and governance metadata"}),o?p.jsxs(p.Fragment,{children:[p.jsx("li",{children:"All documents and content (the workspace copy)"}),p.jsx("li",{className:"text-foreground",children:"Your original imported folder is not affected — only the copy in this workspace is removed"})]}):p.jsxs(p.Fragment,{children:[p.jsx("li",{children:"All documents and content"}),p.jsx("li",{children:"The nest folder on disk"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(Vt,{htmlFor:"delete-nest-confirm",className:"text-xs",children:["Type ",p.jsx("strong",{className:"font-mono",children:t})," to confirm:"]}),p.jsx(Xn,{id:"delete-nest-confirm",value:s,onChange:x=>l(x.target.value),placeholder:t,disabled:u,autoComplete:"off"})]}),h&&p.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-2 text-xs text-red-900",children:h}),p.jsxs(cr,{className:"gap-2",children:[p.jsx(be,{variant:"outline",onClick:()=>r(!1),disabled:u,children:"Cancel"}),p.jsx(be,{variant:"destructive",onClick:g,disabled:u||s!==t,children:u?p.jsxs(p.Fragment,{children:[p.jsx(dt,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Deleting..."]}):p.jsxs(p.Fragment,{children:[p.jsx(ll,{className:"h-3.5 w-3.5 mr-2"}),"Delete nest"]})})]})]})})}const vE=/\.(md|markdown|ya?ml|txt|json)$/i;function wE(e){return e===".versions"?!1:e.startsWith(".")||e==="node_modules"}async function kE(e,t,n){for await(const r of e.values()){const i=t?`${t}/${r.name}`:r.name;if(r.kind==="directory"){if(wE(r.name))continue;await kE(r,i,n)}else if(vE.test(r.name)){const o=await r.getFile();n.push({path:i,content:await o.text()})}}}async function sL(e){const t=[];for(const n of Array.from(e)){const r=n.webkitRelativePath.split("/");r.shift();const i=r.join("/");!i||r.some(wE)||!vE.test(n.name)||t.push({path:i,content:await n.text()})}return t}function lL({isOpen:e,onClose:t,onImported:n}){const[r,i]=k.useState(""),[o,s]=k.useState(null),[l,u]=k.useState(""),[d,h]=k.useState(!1),[f,g]=k.useState(!1),[x,y]=k.useState(null),v=k.useRef(null),w=()=>{i(""),s(null),u(""),y(null),h(!1),g(!1)},C=()=>{f||(w(),t())},N=async()=>{var I;y(null);const A=window.showDirectoryPicker;if(typeof A!="function"){(I=v.current)==null||I.click();return}let _;try{_=await A()}catch(P){if((P==null?void 0:P.name)==="AbortError")return;console.error("[ImportFolderModal] showDirectoryPicker failed",P),y("Couldn't open that folder");return}h(!0);try{const P=[];await kE(_,"",P),i(_.name),s(P),u(L=>L||_.name)}catch(P){console.error("[ImportFolderModal] scan failed",P),y("Couldn't read that folder")}finally{h(!1)}},T=async A=>{const _=A.target.files;if(!(!_||!_.length)){h(!0),y(null);try{const I=_[0].webkitRelativePath.split("/")[0]||"Imported",P=await sL(_);i(I),s(P),u(L=>L||I)}catch(I){console.error("[ImportFolderModal] scan failed",I),y("Couldn't read that folder")}finally{h(!1),A.target.value=""}}},D=async()=>{if(o){g(!0),y(null);try{await HP(l.trim()||r,o),n(),C()}catch(A){console.error("[ImportFolderModal] import failed",A),y((A==null?void 0:A.message)||"Import failed"),g(!1)}}};return p.jsx(vn,{open:e,onOpenChange:A=>!A&&C(),children:p.jsxs(an,{className:"sm:max-w-[480px]",children:[p.jsx(un,{children:p.jsxs(cn,{className:"flex items-center gap-2",children:[p.jsx(la,{className:"h-5 w-5"}),"Import a folder"]})}),p.jsxs("div",{className:"space-y-3",children:[p.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a folder from your computer. Its markdown files are uploaded into a new nest — your original folder is left untouched, and the nest can be shared with collaborators."}),p.jsx("input",{ref:A=>{v.current=A,A&&(A.setAttribute("webkitdirectory",""),A.setAttribute("directory",""))},type:"file",multiple:!0,className:"hidden",onChange:T}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(be,{className:"shrink-0",variant:"outline",onClick:N,disabled:d||f,children:[d?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(la,{className:"h-4 w-4 mr-2"}),"Choose folder"]}),o&&p.jsxs("p",{className:"break-words text-sm text-muted-foreground",children:[p.jsx("span",{className:"font-medium text-foreground",children:r})," — ",o.length," file",o.length===1?"":"s"]})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vt,{children:"Nest name"}),p.jsx(Xn,{placeholder:r||"My Folder",value:l,onChange:A=>u(A.target.value)})]}),x&&p.jsx("p",{className:"text-sm text-destructive",children:x})]}),p.jsxs(cr,{children:[p.jsx(be,{variant:"outline",onClick:C,disabled:f,children:"Cancel"}),p.jsxs(be,{onClick:D,disabled:!o||d||f,children:[f?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(la,{className:"h-4 w-4 mr-2"}),"Import"]})]})]})})}function aL({onSelectNest:e}){var L;const{adminStatus:t,authMode:n,isAdmin:r}=Ss(),i=((L=t==null?void 0:t.me)==null?void 0:L.email)??null,[o,s]=k.useState([]),[l,u]=k.useState(null),[d,h]=k.useState(!0),[f,g]=k.useState(!1),[x,y]=k.useState(!1),[v,w]=k.useState(""),[C,N]=k.useState(""),[T,D]=k.useState(null),A=typeof window<"u"?window.location.origin:"http://localhost:3838",_=async()=>{h(!0);try{const[R,V]=await Promise.all([BP(),WP().catch(K=>(console.error("[Dashboard] getServerStats failed",K),null))]);s(R.nests),u(V)}catch(R){console.error("[Dashboard] fetchNests failed",R)}finally{h(!1)}};k.useEffect(()=>{_()},[i]);const I=async R=>{if(R.preventDefault(),!!v.trim())try{await $P(v,C),w(""),N(""),g(!1),_()}catch(V){console.error("[Dashboard] createNest failed",V)}},P=(R,V,K=!1)=>{D({id:R,name:V,isImported:K})};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs(Qt,{className:"bg-gradient-to-br from-blue-50 to-indigo-50 border-blue-200",children:[p.jsx(yn,{className:"pb-3",children:p.jsxs("div",{className:"flex items-start justify-between",children:[p.jsxs("div",{children:[p.jsx(bn,{className:"text-lg",children:"Your Community Server"}),p.jsxs(Fr,{children:["Running at"," ",p.jsx("code",{className:"text-xs bg-white/60 px-1.5 py-0.5 rounded font-mono",children:A}),p.jsx(uL,{value:A})]})]}),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(Zt,{className:"pt-0",children:p.jsxs("div",{className:"grid md:grid-cols-3 gap-3 text-xs",children:[p.jsx(U0,{icon:p.jsx(n3,{className:"h-4 w-4"}),title:"Hootie",desc:"Settings → Vault → Remote Server → paste URL"}),p.jsx(U0,{icon:p.jsx(a3,{className:"h-4 w-4"}),title:"Claude Desktop",desc:"Add MCP endpoint per nest via Connect button"}),p.jsx(U0,{icon:p.jsx(d3,{className:"h-4 w-4"}),title:"CLI",desc:`ctx --server ${A}`,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("div",{className:"flex items-center gap-2",children:[p.jsxs(be,{variant:"outline",onClick:()=>y(!0),children:[p.jsx(la,{className:"h-4 w-4 mr-2"}),"Import Folder"]}),p.jsxs(be,{onClick:()=>g(!0),children:[p.jsx(a1,{className:"h-4 w-4 mr-2"}),"New Nest"]})]})]}),f&&p.jsx(Qt,{children:p.jsx(Zt,{className:"pt-6",children:p.jsxs("form",{onSubmit:I,className:"space-y-3",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vt,{children:"Name"}),p.jsx(Xn,{placeholder:"Team Knowledge",value:v,onChange:R=>w(R.target.value),autoFocus:!0})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vt,{children:"Description (optional)"}),p.jsx(Xn,{placeholder:"Shared docs for the engineering team",value:C,onChange:R=>N(R.target.value)})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(be,{type:"submit",children:"Create Nest"}),p.jsx(be,{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(Qt,{children:p.jsxs(Zt,{className:"text-center py-12",children:[p.jsx(aR,{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(be,{onClick:()=>g(!0),children:[p.jsx(a1,{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(R=>{const V=R.user_id===m8,K=()=>e(R.id,R.name,R.is_owner??(R.permission??"owner")==="owner",V),G=R.permission??"owner",B=R.is_owner??G==="owner",W=!B,U=B||V&&n!=="open"&&r,Z=Array.isArray(R.roles)?R.roles:[],q=Z.includes("admin")?"admin":Z.includes("editor")?"editor":Z.includes("reviewer")?"reviewer":Z.includes("viewer")?"viewer":G==="admin"?"admin":G==="write"?"editor":G==="read"?"viewer":null,Y=q?{admin:{label:"Admin",Icon:Ar,cls:"bg-purple-50 text-purple-700 border-purple-200",title:"Admin — full access except deleting the nest"},editor:{label:"Editor",Icon:Ac,cls:"bg-indigo-50 text-indigo-700 border-indigo-200",title:"Editor — you can read and edit documents"},reviewer:{label:"Reviewer",Icon:qi,cls:"bg-amber-50 text-amber-700 border-amber-200",title:"Reviewer — you can approve or reject submissions"},viewer:{label:"Viewer",Icon:Tc,cls:"bg-slate-50 text-slate-700 border-slate-200",title:"View only — you can read but not edit"}}[q]:null,j=(Y==null?void 0:Y.Icon)??null;return p.jsxs("div",{role:"button",tabIndex:0,onClick:K,onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),K())},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 ${V?"border-dashed border-amber-300":"border-border"}`,children:[U&&p.jsx("button",{type:"button","aria-label":`Delete nest ${R.name}`,title:"Delete nest",onClick:z=>{z.stopPropagation(),P(R.id,R.name,!!R.is_imported)},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(ll,{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 ${V?"bg-amber-100":"bg-primary/10"}`,children:V?p.jsx(kx,{className:"h-5 w-5 text-amber-700"}):p.jsx(ps,{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:R.name}),R.description&&p.jsx("p",{className:"text-sm text-muted-foreground truncate mt-0.5",children:R.description}),W&&p.jsxs("p",{className:"flex items-center gap-1 mt-1 text-xs text-blue-700 truncate",title:R.owner_email?`Shared by ${R.owner_email}`:"Shared with you",children:[p.jsx(ja,{className:"h-3 w-3 shrink-0"}),p.jsxs("span",{className:"truncate",children:["Shared by"," ",p.jsx("span",{className:"font-medium",children:R.owner_email||"unknown user"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground flex-wrap",children:[V&&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"}),W&&Y&&j&&p.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded border ${Y.cls}`,title:Y.title,children:[p.jsx(j,{className:"h-3 w-3"}),Y.label]}),p.jsx("span",{className:`px-1.5 py-0.5 rounded ${R.visibility==="public"?"bg-green-100 text-green-700":"bg-secondary text-secondary-foreground"}`,children:R.visibility}),R.is_imported?p.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",title:"Imported from a folder — its files were copied into the workspace",children:[p.jsx(la,{className:"h-3 w-3"}),"Imported"]}):null,p.jsx("span",{children:new Date(R.created_at).toLocaleDateString()})]})]})]})]},R.id)})})}),T&&p.jsx(bE,{nestId:T.id,nestName:T.name,isImported:T.isImported,open:!0,onOpenChange:R=>{R||D(null)},onDeleted:async()=>{D(null),await _()}}),p.jsx(lL,{isOpen:x,onClose:()=>y(!1),onImported:_})]})}function U0({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 uL({value:e}){const[t,n]=k.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(yl,{className:"h-3 w-3 text-green-600"}):p.jsx(Nc,{className:"h-3 w-3"})})}function Ok(e){const t=cL(e),n=k.forwardRef((r,i)=>{const{children:o,...s}=r,l=k.Children.toArray(o),u=l.find(fL);if(u){const d=u.props.children,h=l.map(f=>f===u?k.Children.count(d)>1?k.Children.only(null):k.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:k.isValidElement(d)?k.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function cL(e){const t=k.forwardRef((n,r)=>{const{children:i,...o}=n;if(k.isValidElement(i)){const s=pL(i),l=hL(o,i.props);return i.type!==k.Fragment&&(l.ref=r?Eo(r,s):s),k.cloneElement(i,l)}return k.Children.count(i)>1?k.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dL=Symbol("radix.slottable");function fL(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dL}function hL(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 u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function pL(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 Rx(e){const t=e+"CollectionProvider",[n,r]=Ci(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:w,children:C}=v,N=de.useRef(null),T=de.useRef(new Map).current;return p.jsx(i,{scope:w,itemMap:T,collectionRef:N,children:C})};s.displayName=t;const l=e+"CollectionSlot",u=Ok(l),d=de.forwardRef((v,w)=>{const{scope:C,children:N}=v,T=o(l,C),D=it(w,T.collectionRef);return p.jsx(u,{ref:D,children:N})});d.displayName=l;const h=e+"CollectionItemSlot",f="data-radix-collection-item",g=Ok(h),x=de.forwardRef((v,w)=>{const{scope:C,children:N,...T}=v,D=de.useRef(null),A=it(w,D),_=o(h,C);return de.useEffect(()=>(_.itemMap.set(D,{ref:D,...T}),()=>void _.itemMap.delete(D))),p.jsx(g,{[f]:"",ref:A,children:N})});x.displayName=h;function y(v){const w=o(e+"CollectionConsumer",v);return de.useCallback(()=>{const N=w.collectionRef.current;if(!N)return[];const T=Array.from(N.querySelectorAll(`[${f}]`));return Array.from(w.itemMap.values()).sort((_,I)=>T.indexOf(_.ref.current)-T.indexOf(I.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:d,ItemSlot:x},y,r]}var mL=k.createContext(void 0);function jc(e){const t=k.useContext(mL);return e||t||"ltr"}var W0="rovingFocusGroup.onEntryFocus",gL={bubbles:!1,cancelable:!0},Dc="RovingFocusGroup",[h1,SE,xL]=Rx(Dc),[yL,op]=Ci(Dc,[xL]),[bL,vL]=yL(Dc),CE=k.forwardRef((e,t)=>p.jsx(h1.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(h1.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(wL,{...e,ref:t})})}));CE.displayName=Dc;var wL=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,g=k.useRef(null),x=it(t,g),y=jc(o),[v,w]=ms({prop:s,defaultProp:l??null,onChange:u,caller:Dc}),[C,N]=k.useState(!1),T=Tn(d),D=SE(n),A=k.useRef(!1),[_,I]=k.useState(0);return k.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(W0,T),()=>P.removeEventListener(W0,T)},[T]),p.jsx(bL,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:v,onItemFocus:k.useCallback(P=>w(P),[w]),onItemShiftTab:k.useCallback(()=>N(!0),[]),onFocusableItemAdd:k.useCallback(()=>I(P=>P+1),[]),onFocusableItemRemove:k.useCallback(()=>I(P=>P-1),[]),children:p.jsx(Ye.div,{tabIndex:C||_===0?-1:0,"data-orientation":r,...f,ref:x,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{A.current=!0}),onFocus:ve(e.onFocus,P=>{const L=!A.current;if(P.target===P.currentTarget&&L&&!C){const R=new CustomEvent(W0,gL);if(P.currentTarget.dispatchEvent(R),!R.defaultPrevented){const V=D().filter(U=>U.focusable),K=V.find(U=>U.active),G=V.find(U=>U.id===v),W=[K,G,...V].filter(Boolean).map(U=>U.ref.current);TE(W,h)}}A.current=!1}),onBlur:ve(e.onBlur,()=>N(!1))})})}),EE="RovingFocusGroupItem",NE=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...l}=e,u=vi(),d=o||u,h=vL(EE,n),f=h.currentTabStopId===d,g=SE(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:v}=h;return k.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),p.jsx(h1.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:p.jsx(Ye.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:ve(e.onMouseDown,w=>{r?h.onItemFocus(d):w.preventDefault()}),onFocus:ve(e.onFocus,()=>h.onItemFocus(d)),onKeyDown:ve(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const C=CL(w,h.orientation,h.dir);if(C!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let T=g().filter(D=>D.focusable).map(D=>D.ref.current);if(C==="last")T.reverse();else if(C==="prev"||C==="next"){C==="prev"&&T.reverse();const D=T.indexOf(w.currentTarget);T=h.loop?EL(T,D+1):T.slice(D+1)}setTimeout(()=>TE(T))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:v!=null}):s})})});NE.displayName=EE;var kL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SL(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CL(e,t,n){const r=SL(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return kL[r]}function TE(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function EL(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var AE=CE,_E=NE,sp="Tabs",[NL]=Ci(sp,[op]),ME=op(),[TL,Px]=NL(sp),jE=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:l,activationMode:u="automatic",...d}=e,h=jc(l),[f,g]=ms({prop:r,onChange:i,defaultProp:o??"",caller:sp});return p.jsx(TL,{scope:n,baseId:vi(),value:f,onValueChange:g,orientation:s,dir:h,activationMode:u,children:p.jsx(Ye.div,{dir:h,"data-orientation":s,...d,ref:t})})});jE.displayName=sp;var DE="TabsList",RE=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Px(DE,n),s=ME(n);return p.jsx(AE,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:p.jsx(Ye.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});RE.displayName=DE;var PE="TabsTrigger",IE=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Px(PE,n),l=ME(n),u=FE(s.baseId,r),d=zE(s.baseId,r),h=r===s.value;return p.jsx(_E,{asChild:!0,...l,focusable:!i,active:h,children:p.jsx(Ye.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:ve(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:ve(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:ve(e.onFocus,()=>{const f=s.activationMode!=="manual";!h&&!i&&f&&s.onValueChange(r)})})})});IE.displayName=PE;var OE="TabsContent",LE=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,l=Px(OE,n),u=FE(l.baseId,r),d=zE(l.baseId,r),h=r===l.value,f=k.useRef(h);return k.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),p.jsx(hr,{present:i||h,children:({present:g})=>p.jsx(Ye.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:g&&o})})});LE.displayName=OE;function FE(e,t){return`${e}-trigger-${t}`}function zE(e,t){return`${e}-content-${t}`}var AL=jE,BE=RE,$E=IE,VE=LE;const HE=AL,Ix=k.forwardRef(({className:e,...t},n)=>p.jsx(BE,{ref:n,className:Ie("inline-flex min-h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ix.displayName=BE.displayName;const Fi=k.forwardRef(({className:e,...t},n)=>p.jsx($E,{ref:n,className:Ie("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}));Fi.displayName=$E.displayName;const zi=k.forwardRef(({className:e,...t},n)=>p.jsx(VE,{ref:n,className:Ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));zi.displayName=VE.displayName;const _L=["top","right","bottom","left"],gs=Math.min,zr=Math.max,qf=Math.round,uf=Math.floor,Wi=e=>({x:e,y:e}),ML={left:"right",right:"left",bottom:"top",top:"bottom"};function p1(e,t,n){return zr(e,gs(t,n))}function So(e,t){return typeof e=="function"?e(t):e}function Co(e){return e.split("-")[0]}function Da(e){return e.split("-")[1]}function Ox(e){return e==="x"?"y":"x"}function Lx(e){return e==="y"?"height":"width"}function Bi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Fx(e){return Ox(Bi(e))}function jL(e,t,n){n===void 0&&(n=!1);const r=Da(e),i=Fx(e),o=Lx(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Kf(s)),[s,Kf(s)]}function DL(e){const t=Kf(e);return[m1(e),t,m1(t)]}function m1(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Lk=["left","right"],Fk=["right","left"],RL=["top","bottom"],PL=["bottom","top"];function IL(e,t,n){switch(e){case"top":case"bottom":return n?t?Fk:Lk:t?Lk:Fk;case"left":case"right":return t?RL:PL;default:return[]}}function OL(e,t,n,r){const i=Da(e);let o=IL(Co(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(m1)))),o}function Kf(e){const t=Co(e);return ML[t]+e.slice(t.length)}function LL(e){return{top:0,right:0,bottom:0,left:0,...e}}function UE(e){return typeof e!="number"?LL(e):{top:e,right:e,bottom:e,left:e}}function Gf(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 zk(e,t,n){let{reference:r,floating:i}=e;const o=Bi(t),s=Fx(t),l=Lx(s),u=Co(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 x;switch(u){case"top":x={x:h,y:r.y-i.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:f};break;case"left":x={x:r.x-i.width,y:f};break;default:x={x:r.x,y:r.y}}switch(Da(t)){case"start":x[s]-=g*(n&&d?-1:1);break;case"end":x[s]+=g*(n&&d?-1:1);break}return x}async function FL(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:x=0}=So(t,e),y=UE(x),w=l[g?f==="floating"?"reference":"floating":f],C=Gf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),N=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),D=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},A=Gf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:N,offsetParent:T,strategy:u}):N);return{top:(C.top-A.top+y.top)/D.y,bottom:(A.bottom-C.bottom+y.bottom)/D.y,left:(C.left-A.left+y.left)/D.x,right:(A.right-C.right+y.right)/D.x}}const zL=50,BL=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:FL},u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:f}=zk(d,r,u),g=r,x=0;const y={};for(let v=0;v<o.length;v++){const w=o[v];if(!w)continue;const{name:C,fn:N}=w,{x:T,y:D,data:A,reset:_}=await N({x:h,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:y,rects:d,platform:l,elements:{reference:e,floating:t}});h=T??h,f=D??f,y[C]={...y[C],...A},_&&x<zL&&(x++,typeof _=="object"&&(_.placement&&(g=_.placement),_.rects&&(d=_.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:h,y:f}=zk(d,g,u)),v=-1)}return{x:h,y:f,placement:g,strategy:i,middlewareData:y}},$L=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:u}=t,{element:d,padding:h=0}=So(e,t)||{};if(d==null)return{};const f=UE(h),g={x:n,y:r},x=Fx(i),y=Lx(x),v=await s.getDimensions(d),w=x==="y",C=w?"top":"left",N=w?"bottom":"right",T=w?"clientHeight":"clientWidth",D=o.reference[y]+o.reference[x]-g[x]-o.floating[y],A=g[x]-o.reference[x],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let I=_?_[T]:0;(!I||!await(s.isElement==null?void 0:s.isElement(_)))&&(I=l.floating[T]||o.floating[y]);const P=D/2-A/2,L=I/2-v[y]/2-1,R=gs(f[C],L),V=gs(f[N],L),K=R,G=I-v[y]-V,B=I/2-v[y]/2+P,W=p1(K,B,G),U=!u.arrow&&Da(i)!=null&&B!==W&&o.reference[y]/2-(B<K?R:V)-v[y]/2<0,Z=U?B<K?B-K:B-G:0;return{[x]:g[x]+Z,data:{[x]:W,centerOffset:B-W-Z,...U&&{alignmentOffset:Z}},reset:U}}}),VL=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:u,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...w}=So(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=Co(i),N=Bi(l),T=Co(l)===l,D=await(u.isRTL==null?void 0:u.isRTL(d.floating)),A=g||(T||!v?[Kf(l)]:DL(l)),_=y!=="none";!g&&_&&A.push(...OL(l,v,y,D));const I=[l,...A],P=await u.detectOverflow(t,w),L=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&L.push(P[C]),f){const B=jL(i,s,D);L.push(P[B[0]],P[B[1]])}if(R=[...R,{placement:i,overflows:L}],!L.every(B=>B<=0)){var V,K;const B=(((V=o.flip)==null?void 0:V.index)||0)+1,W=I[B];if(W&&(!(f==="alignment"?N!==Bi(W):!1)||R.every(q=>Bi(q.placement)===N?q.overflows[0]>0:!0)))return{data:{index:B,overflows:R},reset:{placement:W}};let U=(K=R.filter(Z=>Z.overflows[0]<=0).sort((Z,q)=>Z.overflows[1]-q.overflows[1])[0])==null?void 0:K.placement;if(!U)switch(x){case"bestFit":{var G;const Z=(G=R.filter(q=>{if(_){const Y=Bi(q.placement);return Y===N||Y==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(Y=>Y>0).reduce((Y,j)=>Y+j,0)]).sort((q,Y)=>q[1]-Y[1])[0])==null?void 0:G[0];Z&&(U=Z);break}case"initialPlacement":U=l;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function Bk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $k(e){return _L.some(t=>e[t]>=0)}const HL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=So(e,t);switch(i){case"referenceHidden":{const s=await r.detectOverflow(t,{...o,elementContext:"reference"}),l=Bk(s,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:$k(l)}}}case"escaped":{const s=await r.detectOverflow(t,{...o,altBoundary:!0}),l=Bk(s,n.floating);return{data:{escapedOffsets:l,escaped:$k(l)}}}default:return{}}}}},WE=new Set(["left","top"]);async function UL(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Co(n),l=Da(n),u=Bi(n)==="y",d=WE.has(s)?-1:1,h=o&&u?-1:1,f=So(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof y=="number"&&(x=l==="end"?y*-1:y),u?{x:x*h,y:g*d}:{x:g*d,y:x*h}}const WL=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,u=await UL(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},qL=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:u={fn:C=>{let{x:N,y:T}=C;return{x:N,y:T}}},...d}=So(e,t),h={x:n,y:r},f=await o.detectOverflow(t,d),g=Bi(Co(i)),x=Ox(g);let y=h[x],v=h[g];if(s){const C=x==="y"?"top":"left",N=x==="y"?"bottom":"right",T=y+f[C],D=y-f[N];y=p1(T,y,D)}if(l){const C=g==="y"?"top":"left",N=g==="y"?"bottom":"right",T=v+f[C],D=v-f[N];v=p1(T,v,D)}const w=u.fn({...t,[x]:y,[g]:v});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[x]:s,[g]:l}}}}}},KL=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:u=!0,crossAxis:d=!0}=So(e,t),h={x:n,y:r},f=Bi(i),g=Ox(f);let x=h[g],y=h[f];const v=So(l,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const T=g==="y"?"height":"width",D=o.reference[g]-o.floating[T]+w.mainAxis,A=o.reference[g]+o.reference[T]-w.mainAxis;x<D?x=D:x>A&&(x=A)}if(d){var C,N;const T=g==="y"?"width":"height",D=WE.has(Co(i)),A=o.reference[f]-o.floating[T]+(D&&((C=s.offset)==null?void 0:C[f])||0)+(D?0:w.crossAxis),_=o.reference[f]+o.reference[T]+(D?0:((N=s.offset)==null?void 0:N[f])||0)-(D?w.crossAxis:0);y<A?y=A:y>_&&(y=_)}return{[g]:x,[f]:y}}}},GL=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:u=()=>{},...d}=So(e,t),h=await s.detectOverflow(t,d),f=Co(i),g=Da(i),x=Bi(i)==="y",{width:y,height:v}=o.floating;let w,C;f==="top"||f==="bottom"?(w=f,C=g===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(C=f,w=g==="end"?"top":"bottom");const N=v-h.top-h.bottom,T=y-h.left-h.right,D=gs(v-h[w],N),A=gs(y-h[C],T),_=!t.middlewareData.shift;let I=D,P=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=N),_&&!g){const R=zr(h.left,0),V=zr(h.right,0),K=zr(h.top,0),G=zr(h.bottom,0);x?P=y-2*(R!==0||V!==0?R+V:zr(h.left,h.right)):I=v-2*(K!==0||G!==0?K+G:zr(h.top,h.bottom))}await u({...t,availableWidth:P,availableHeight:I});const L=await s.getDimensions(l.floating);return y!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function lp(){return typeof window<"u"}function Ra(e){return qE(e)?(e.nodeName||"").toLowerCase():"#document"}function $r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yi(e){var t;return(t=(qE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qE(e){return lp()?e instanceof Node||e instanceof $r(e).Node:!1}function ki(e){return lp()?e instanceof Element||e instanceof $r(e).Element:!1}function No(e){return lp()?e instanceof HTMLElement||e instanceof $r(e).HTMLElement:!1}function Vk(e){return!lp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $r(e).ShadowRoot}function Rc(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Si(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function YL(e){return/^(table|td|th)$/.test(Ra(e))}function ap(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const JL=/transform|translate|scale|rotate|perspective|filter/,XL=/paint|layout|strict|content/,Ws=e=>!!e&&e!=="none";let q0;function zx(e){const t=ki(e)?Si(e):e;return Ws(t.transform)||Ws(t.translate)||Ws(t.scale)||Ws(t.rotate)||Ws(t.perspective)||!Bx()&&(Ws(t.backdropFilter)||Ws(t.filter))||JL.test(t.willChange||"")||XL.test(t.contain||"")}function QL(e){let t=xs(e);for(;No(t)&&!xa(t);){if(zx(t))return t;if(ap(t))return null;t=xs(t)}return null}function Bx(){return q0==null&&(q0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),q0}function xa(e){return/^(html|body|#document)$/.test(Ra(e))}function Si(e){return $r(e).getComputedStyle(e)}function up(e){return ki(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xs(e){if(Ra(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vk(e)&&e.host||Yi(e);return Vk(t)?t.host:t}function KE(e){const t=xs(e);return xa(t)?e.ownerDocument?e.ownerDocument.body:e.body:No(t)&&Rc(t)?t:KE(t)}function tc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=KE(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=$r(i);if(o){const l=g1(s);return t.concat(s,s.visualViewport||[],Rc(i)?i:[],l&&n?tc(l):[])}else return t.concat(i,tc(i,[],n))}function g1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function GE(e){const t=Si(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=No(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,l=qf(n)!==o||qf(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function $x(e){return ki(e)?e:e.contextElement}function ua(e){const t=$x(e);if(!No(t))return Wi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=GE(t);let s=(o?qf(n.width):n.width)/r,l=(o?qf(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const ZL=Wi(0);function YE(e){const t=$r(e);return!Bx()||!t.visualViewport?ZL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function e9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$r(e)?!1:t}function ul(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=$x(e);let s=Wi(1);t&&(r?ki(r)&&(s=ua(r)):s=ua(e));const l=e9(o,n,r)?YE(o):Wi(0);let u=(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=$r(o),x=r&&ki(r)?$r(r):r;let y=g,v=g1(y);for(;v&&r&&x!==y;){const w=ua(v),C=v.getBoundingClientRect(),N=Si(v),T=C.left+(v.clientLeft+parseFloat(N.paddingLeft))*w.x,D=C.top+(v.clientTop+parseFloat(N.paddingTop))*w.y;u*=w.x,d*=w.y,h*=w.x,f*=w.y,u+=T,d+=D,y=$r(v),v=g1(y)}}return Gf({width:h,height:f,x:u,y:d})}function cp(e,t){const n=up(e).scrollLeft;return t?t.left+n:ul(Yi(e)).left+n}function JE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-cp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function t9(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Yi(r),l=t?ap(t.floating):!1;if(r===s||l&&o)return n;let u={scrollLeft:0,scrollTop:0},d=Wi(1);const h=Wi(0),f=No(r);if((f||!f&&!o)&&((Ra(r)!=="body"||Rc(s))&&(u=up(r)),f)){const x=ul(r);d=ua(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const g=s&&!f&&!o?JE(s,u):Wi(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function n9(e){return Array.from(e.getClientRects())}function r9(e){const t=Yi(e),n=up(e),r=e.ownerDocument.body,i=zr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=zr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+cp(e);const l=-n.scrollTop;return Si(r).direction==="rtl"&&(s+=zr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}const Hk=25;function i9(e,t){const n=$r(e),r=Yi(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;const h=Bx();(!h||h&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const d=cp(r);if(d<=0){const h=r.ownerDocument,f=h.body,g=getComputedStyle(f),x=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-x);y<=Hk&&(o-=y)}else d<=Hk&&(o+=d);return{width:o,height:s,x:l,y:u}}function o9(e,t){const n=ul(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=No(e)?ua(e):Wi(1),s=e.clientWidth*o.x,l=e.clientHeight*o.y,u=i*o.x,d=r*o.y;return{width:s,height:l,x:u,y:d}}function Uk(e,t,n){let r;if(t==="viewport")r=i9(e,n);else if(t==="document")r=r9(Yi(e));else if(ki(t))r=o9(t,n);else{const i=YE(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Gf(r)}function XE(e,t){const n=xs(e);return n===t||!ki(n)||xa(n)?!1:Si(n).position==="fixed"||XE(n,t)}function s9(e,t){const n=t.get(e);if(n)return n;let r=tc(e,[],!1).filter(l=>ki(l)&&Ra(l)!=="body"),i=null;const o=Si(e).position==="fixed";let s=o?xs(e):e;for(;ki(s)&&!xa(s);){const l=Si(s),u=zx(s);!u&&l.position==="fixed"&&(i=null),(o?!u&&!i:!u&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Rc(s)&&!u&&XE(e,s))?r=r.filter(h=>h!==s):i=l,s=xs(s)}return t.set(e,r),r}function l9(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?ap(t)?[]:s9(t,this._c):[].concat(n),r],l=Uk(t,s[0],i);let u=l.top,d=l.right,h=l.bottom,f=l.left;for(let g=1;g<s.length;g++){const x=Uk(t,s[g],i);u=zr(x.top,u),d=gs(x.right,d),h=gs(x.bottom,h),f=zr(x.left,f)}return{width:d-f,height:h-u,x:f,y:u}}function a9(e){const{width:t,height:n}=GE(e);return{width:t,height:n}}function u9(e,t,n){const r=No(t),i=Yi(t),o=n==="fixed",s=ul(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const u=Wi(0);function d(){u.x=cp(i)}if(r||!r&&!o)if((Ra(t)!=="body"||Rc(i))&&(l=up(t)),r){const x=ul(t,!0,o,t);u.x=x.x+t.clientLeft,u.y=x.y+t.clientTop}else i&&d();o&&!r&&i&&d();const h=i&&!r&&!o?JE(i,l):Wi(0),f=s.left+l.scrollLeft-u.x-h.x,g=s.top+l.scrollTop-u.y-h.y;return{x:f,y:g,width:s.width,height:s.height}}function K0(e){return Si(e).position==="static"}function Wk(e,t){if(!No(e)||Si(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yi(e)===n&&(n=n.ownerDocument.body),n}function QE(e,t){const n=$r(e);if(ap(e))return n;if(!No(e)){let i=xs(e);for(;i&&!xa(i);){if(ki(i)&&!K0(i))return i;i=xs(i)}return n}let r=Wk(e,t);for(;r&&YL(r)&&K0(r);)r=Wk(r,t);return r&&xa(r)&&K0(r)&&!zx(r)?n:r||QL(e)||n}const c9=async function(e){const t=this.getOffsetParent||QE,n=this.getDimensions,r=await n(e.floating);return{reference:u9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function d9(e){return Si(e).direction==="rtl"}const f9={convertOffsetParentRelativeRectToViewportRelativeRect:t9,getDocumentElement:Yi,getClippingRect:l9,getOffsetParent:QE,getElementRects:c9,getClientRects:n9,getDimensions:a9,getScale:ua,isElement:ki,isRTL:d9};function ZE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function h9(e,t){let n=null,r;const i=Yi(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:h,top:f,width:g,height:x}=d;if(l||t(),!g||!x)return;const y=uf(f),v=uf(i.clientWidth-(h+g)),w=uf(i.clientHeight-(f+x)),C=uf(h),T={rootMargin:-y+"px "+-v+"px "+-w+"px "+-C+"px",threshold:zr(0,gs(1,u))||1};let D=!0;function A(_){const I=_[0].intersectionRatio;if(I!==u){if(!D)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!ZE(d,e.getBoundingClientRect())&&s(),D=!1}try{n=new IntersectionObserver(A,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,T)}n.observe(e)}return s(!0),o}function p9(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:u=!1}=r,d=$x(e),h=i||o?[...d?tc(d):[],...t?tc(t):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const f=d&&l?h9(d,n):null;let g=-1,x=null;s&&(x=new ResizeObserver(C=>{let[N]=C;N&&N.target===d&&x&&t&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=x)==null||T.observe(t)})),n()}),d&&!u&&x.observe(d),t&&x.observe(t));let y,v=u?ul(e):null;u&&w();function w(){const C=ul(e);v&&!ZE(v,C)&&n(),v=C,y=requestAnimationFrame(w)}return n(),()=>{var C;h.forEach(N=>{i&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),f==null||f(),(C=x)==null||C.disconnect(),x=null,u&&cancelAnimationFrame(y)}}const m9=WL,g9=qL,x9=VL,y9=GL,b9=HL,qk=$L,v9=KL,w9=(e,t,n)=>{const r=new Map,i={platform:f9,...n},o={...i.platform,_c:r};return BL(e,t,{...i,platform:o})};var k9=typeof document<"u",S9=function(){},Rf=k9?k.useLayoutEffect:S9;function Yf(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(!Yf(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)&&!Yf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function eN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kk(e,t){const n=eN(e);return Math.round(t*n)/n}function G0(e){const t=k.useRef(e);return Rf(()=>{t.current=e}),t}function C9(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:u,open:d}=e,[h,f]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=k.useState(r);Yf(g,r)||x(r);const[y,v]=k.useState(null),[w,C]=k.useState(null),N=k.useCallback(q=>{q!==_.current&&(_.current=q,v(q))},[]),T=k.useCallback(q=>{q!==I.current&&(I.current=q,C(q))},[]),D=o||y,A=s||w,_=k.useRef(null),I=k.useRef(null),P=k.useRef(h),L=u!=null,R=G0(u),V=G0(i),K=G0(d),G=k.useCallback(()=>{if(!_.current||!I.current)return;const q={placement:t,strategy:n,middleware:g};V.current&&(q.platform=V.current),w9(_.current,I.current,q).then(Y=>{const j={...Y,isPositioned:K.current!==!1};B.current&&!Yf(P.current,j)&&(P.current=j,Ec.flushSync(()=>{f(j)}))})},[g,t,n,V,K]);Rf(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[d]);const B=k.useRef(!1);Rf(()=>(B.current=!0,()=>{B.current=!1}),[]),Rf(()=>{if(D&&(_.current=D),A&&(I.current=A),D&&A){if(R.current)return R.current(D,A,G);G()}},[D,A,G,R,L]);const W=k.useMemo(()=>({reference:_,floating:I,setReference:N,setFloating:T}),[N,T]),U=k.useMemo(()=>({reference:D,floating:A}),[D,A]),Z=k.useMemo(()=>{const q={position:n,left:0,top:0};if(!U.floating)return q;const Y=Kk(U.floating,h.x),j=Kk(U.floating,h.y);return l?{...q,transform:"translate("+Y+"px, "+j+"px)",...eN(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:j}},[n,l,U.floating,h.x,h.y]);return k.useMemo(()=>({...h,update:G,refs:W,elements:U,floatingStyles:Z}),[h,G,W,U,Z])}const E9=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?qk({element:r.current,padding:i}).fn(n):{}:r?qk({element:r,padding:i}).fn(n):{}}}},N9=(e,t)=>{const n=m9(e);return{name:n.name,fn:n.fn,options:[e,t]}},T9=(e,t)=>{const n=g9(e);return{name:n.name,fn:n.fn,options:[e,t]}},A9=(e,t)=>({fn:v9(e).fn,options:[e,t]}),_9=(e,t)=>{const n=x9(e);return{name:n.name,fn:n.fn,options:[e,t]}},M9=(e,t)=>{const n=y9(e);return{name:n.name,fn:n.fn,options:[e,t]}},j9=(e,t)=>{const n=b9(e);return{name:n.name,fn:n.fn,options:[e,t]}},D9=(e,t)=>{const n=E9(e);return{name:n.name,fn:n.fn,options:[e,t]}};var R9="Arrow",tN=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return p.jsx(Ye.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"})})});tN.displayName=R9;var P9=tN;function nN(e){const[t,n]=k.useState(void 0);return ln(()=>{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 u=o.borderBoxSize,d=Array.isArray(u)?u[0]:u;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 Vx="Popper",[rN,Pa]=Ci(Vx),[I9,iN]=rN(Vx),oN=e=>{const{__scopePopper:t,children:n}=e,[r,i]=k.useState(null);return p.jsx(I9,{scope:t,anchor:r,onAnchorChange:i,children:n})};oN.displayName=Vx;var sN="PopperAnchor",lN=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=iN(sN,n),s=k.useRef(null),l=it(t,s),u=k.useRef(null);return k.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||s.current,d!==u.current&&o.onAnchorChange(u.current)}),r?null:p.jsx(Ye.div,{...i,ref:l})});lN.displayName=sN;var Hx="PopperContent",[O9,L9]=rN(Hx),aN=k.forwardRef((e,t)=>{var ie,ue,xe,Te,Le,Be;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:y,...v}=e,w=iN(Hx,n),[C,N]=k.useState(null),T=it(t,at=>N(at)),[D,A]=k.useState(null),_=nN(D),I=(_==null?void 0:_.width)??0,P=(_==null?void 0:_.height)??0,L=r+(o!=="center"?"-"+o:""),R=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},V=Array.isArray(d)?d:[d],K=V.length>0,G={padding:R,boundary:V.filter(z9),altBoundary:K},{refs:B,floatingStyles:W,placement:U,isPositioned:Z,middlewareData:q}=C9({strategy:"fixed",placement:L,whileElementsMounted:(...at)=>p9(...at,{animationFrame:x==="always"}),elements:{reference:w.anchor},middleware:[N9({mainAxis:i+P,alignmentAxis:s}),u&&T9({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?A9():void 0,...G}),u&&_9({...G}),M9({...G,apply:({elements:at,rects:Xe,availableWidth:Ot,availableHeight:ut})=>{const{width:Tt,height:nr}=Xe.reference,xt=at.floating.style;xt.setProperty("--radix-popper-available-width",`${Ot}px`),xt.setProperty("--radix-popper-available-height",`${ut}px`),xt.setProperty("--radix-popper-anchor-width",`${Tt}px`),xt.setProperty("--radix-popper-anchor-height",`${nr}px`)}}),D&&D9({element:D,padding:l}),B9({arrowWidth:I,arrowHeight:P}),g&&j9({strategy:"referenceHidden",...G})]}),[Y,j]=dN(U),z=Tn(y);ln(()=>{Z&&(z==null||z())},[Z,z]);const ee=(ie=q.arrow)==null?void 0:ie.x,O=(ue=q.arrow)==null?void 0:ue.y,ce=((xe=q.arrow)==null?void 0:xe.centerOffset)!==0,[pe,le]=k.useState();return ln(()=>{C&&le(window.getComputedStyle(C).zIndex)},[C]),p.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:Z?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(Te=q.transformOrigin)==null?void 0:Te.x,(Le=q.transformOrigin)==null?void 0:Le.y].join(" "),...((Be=q.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(O9,{scope:n,placedSide:Y,onArrowChange:A,arrowX:ee,arrowY:O,shouldHideArrow:ce,children:p.jsx(Ye.div,{"data-side":Y,"data-align":j,...v,ref:T,style:{...v.style,animation:Z?void 0:"none"}})})})});aN.displayName=Hx;var uN="PopperArrow",F9={top:"bottom",right:"left",bottom:"top",left:"right"},cN=k.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=L9(uN,r),s=F9[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(P9,{...i,ref:n,style:{...i.style,display:"block"}})})});cN.displayName=uN;function z9(e){return e!==null}var B9=e=>({name:"transformOrigin",options:e,fn(t){var w,C,N;const{placement:n,rects:r,middlewareData:i}=t,s=((w=i.arrow)==null?void 0:w.centerOffset)!==0,l=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[d,h]=dN(n),f={start:"0%",center:"50%",end:"100%"}[h],g=(((C=i.arrow)==null?void 0:C.x)??0)+l/2,x=(((N=i.arrow)==null?void 0:N.y)??0)+u/2;let y="",v="";return d==="bottom"?(y=s?f:`${g}px`,v=`${-u}px`):d==="top"?(y=s?f:`${g}px`,v=`${r.floating.height+u}px`):d==="right"?(y=`${-u}px`,v=s?f:`${x}px`):d==="left"&&(y=`${r.floating.width+u}px`,v=s?f:`${x}px`),{data:{x:y,y:v}}}});function dN(e){const[t,n="center"]=e.split("-");return[t,n]}var Ux=oN,Wx=lN,qx=aN,Kx=cN,$9=Symbol("radix.slottable");function V9(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$9,t}var fN=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"}),H9="VisuallyHidden",hN=k.forwardRef((e,t)=>p.jsx(Ye.span,{...e,ref:t,style:{...fN,...e.style}}));hN.displayName=H9;var U9=hN,[dp]=Ci("Tooltip",[Pa]),fp=Pa(),pN="TooltipProvider",W9=700,x1="tooltip.open",[q9,Gx]=dp(pN),mN=e=>{const{__scopeTooltip:t,delayDuration:n=W9,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,s=k.useRef(!0),l=k.useRef(!1),u=k.useRef(0);return k.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),p.jsx(q9,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:k.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:k.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:o})};mN.displayName=pN;var nc="Tooltip",[K9,Pc]=dp(nc),gN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:l}=e,u=Gx(nc,e.__scopeTooltip),d=fp(t),[h,f]=k.useState(null),g=vi(),x=k.useRef(0),y=s??u.disableHoverableContent,v=l??u.delayDuration,w=k.useRef(!1),[C,N]=ms({prop:r,defaultProp:i??!1,onChange:I=>{I?(u.onOpen(),document.dispatchEvent(new CustomEvent(x1))):u.onClose(),o==null||o(I)},caller:nc}),T=k.useMemo(()=>C?w.current?"delayed-open":"instant-open":"closed",[C]),D=k.useCallback(()=>{window.clearTimeout(x.current),x.current=0,w.current=!1,N(!0)},[N]),A=k.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N(!1)},[N]),_=k.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{w.current=!0,N(!0),x.current=0},v)},[v,N]);return k.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),p.jsx(Ux,{...d,children:p.jsx(K9,{scope:t,contentId:g,open:C,stateAttribute:T,trigger:h,onTriggerChange:f,onTriggerEnter:k.useCallback(()=>{u.isOpenDelayedRef.current?_():D()},[u.isOpenDelayedRef,_,D]),onTriggerLeave:k.useCallback(()=>{y?A():(window.clearTimeout(x.current),x.current=0)},[A,y]),onOpen:D,onClose:A,disableHoverableContent:y,children:n})})};gN.displayName=nc;var y1="TooltipTrigger",xN=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Pc(y1,n),o=Gx(y1,n),s=fp(n),l=k.useRef(null),u=it(t,l,i.onTriggerChange),d=k.useRef(!1),h=k.useRef(!1),f=k.useCallback(()=>d.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx(Wx,{asChild:!0,...s,children:p.jsx(Ye.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:ve(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:ve(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:ve(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ve(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:ve(e.onBlur,i.onClose),onClick:ve(e.onClick,i.onClose)})})});xN.displayName=y1;var Yx="TooltipPortal",[G9,Y9]=dp(Yx,{forceMount:void 0}),yN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Pc(Yx,t);return p.jsx(G9,{scope:t,forceMount:n,children:p.jsx(hr,{present:n||o.open,children:p.jsx(Mc,{asChild:!0,container:i,children:r})})})};yN.displayName=Yx;var ya="TooltipContent",bN=k.forwardRef((e,t)=>{const n=Y9(ya,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=Pc(ya,e.__scopeTooltip);return p.jsx(hr,{present:r||s.open,children:s.disableHoverableContent?p.jsx(vN,{side:i,...o,ref:t}):p.jsx(J9,{side:i,...o,ref:t})})}),J9=k.forwardRef((e,t)=>{const n=Pc(ya,e.__scopeTooltip),r=Gx(ya,e.__scopeTooltip),i=k.useRef(null),o=it(t,i),[s,l]=k.useState(null),{trigger:u,onClose:d}=n,h=i.current,{onPointerInTransitChange:f}=r,g=k.useCallback(()=>{l(null),f(!1)},[f]),x=k.useCallback((y,v)=>{const w=y.currentTarget,C={x:y.clientX,y:y.clientY},N=tF(C,w.getBoundingClientRect()),T=nF(C,N),D=rF(v.getBoundingClientRect()),A=oF([...T,...D]);l(A),f(!0)},[f]);return k.useEffect(()=>()=>g(),[g]),k.useEffect(()=>{if(u&&h){const y=w=>x(w,h),v=w=>x(w,u);return u.addEventListener("pointerleave",y),h.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",v)}}},[u,h,x,g]),k.useEffect(()=>{if(s){const y=v=>{const w=v.target,C={x:v.clientX,y:v.clientY},N=(u==null?void 0:u.contains(w))||(h==null?void 0:h.contains(w)),T=!iF(C,s);N?g():T&&(g(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,h,s,d,g]),p.jsx(vN,{...e,ref:o})}),[X9,Q9]=dp(nc,{isInside:!1}),Z9=V9("TooltipContent"),vN=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...l}=e,u=Pc(ya,n),d=fp(n),{onClose:h}=u;return k.useEffect(()=>(document.addEventListener(x1,h),()=>document.removeEventListener(x1,h)),[h]),k.useEffect(()=>{if(u.trigger){const f=g=>{const x=g.target;x!=null&&x.contains(u.trigger)&&h()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,h]),p.jsx(_c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:h,children:p.jsxs(qx,{"data-state":u.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(Z9,{children:r}),p.jsx(X9,{scope:n,isInside:!0,children:p.jsx(U9,{id:u.contentId,role:"tooltip",children:i||r})})]})})});bN.displayName=ya;var wN="TooltipArrow",eF=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=fp(n);return Q9(wN,n).isInside?null:p.jsx(Kx,{...i,...r,ref:t})});eF.displayName=wN;function tF(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 nF(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 rF(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 iF(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],u=t[s],d=l.x,h=l.y,f=u.x,g=u.y;h>r!=g>r&&n<(f-d)*(r-h)/(g-h)+d&&(i=!i)}return i}function oF(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),sF(t)}function sF(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 lF=mN,aF=gN,uF=xN,cF=yN,kN=bN;const dF=({children:e,delayDuration:t=0})=>p.jsx(lF,{delayDuration:t,children:e}),fF=aF,hF=uF,SN=k.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(cF,{children:p.jsx(kN,{ref:r,sideOffset:t,className:Ie("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})}));SN.displayName=kN.displayName;const po="<paste-your-api-key-here>";function pF({isOpen:e,onClose:t,nestId:n,nestName:r}){const{authenticated:i,authMode:o}=Ss(),s=typeof window<"u"?window.location.origin:"http://localhost:3838",l=`${s}/nests/${n}/mcp`,[u,d]=k.useState(null),[h,f]=k.useState(null),[g,x]=k.useState(null),[y,v]=k.useState(null),[w,C]=k.useState(null),[N,T]=k.useState(null),[D,A]=k.useState(null);k.useEffect(()=>{if(!e){T(null),A(null);return}if(!i||o==="open"){d(!1);return}let G=!1;return(async()=>{C("loading");try{const{keys:B}=await OP();if(G)return;const W=B[0];d(!!W),f((W==null?void 0:W.key_prefix)??null)}catch(B){G||(T(B.message),d(!1))}finally{G||C(null)}})(),()=>{G=!0}},[e,i,o]);const _=async()=>{T(null),C("mint");try{const{api_key:G,key_prefix:B}=await LP({nest_id:n,label:`connect:${Y0(r)}`});f(B),d(!0),v("generated"),x(G),A("generated")}catch(G){T(G.message)}finally{C(null)}},I=async()=>{T(null),C("rotate");try{const{api_key:G,key_prefix:B}=await FP({nest_id:n,label:`connect:${Y0(r)}`});f(B),d(!0),v("rotated"),x(G),A("rotated")}catch(G){T(G.message)}finally{C(null)}};k.useEffect(()=>{if(!D)return;const G=setTimeout(()=>A(null),6e3);return()=>clearTimeout(G)},[D]);const P=()=>{x(null),v(null)},L=JSON.stringify({mcpServers:{[Y0(r)]:{type:"http",url:l,headers:{Authorization:`Bearer ${po}`}}}},null,2),R=`ctx --server ${s} --nest ${n} --key ${po} query "type:document"`,V=o==="open",K=!i&&o==="key";return p.jsxs(p.Fragment,{children:[p.jsx(vn,{open:e,onOpenChange:t,children:p.jsxs(an,{className:"sm:max-w-[640px] max-h-[85vh] flex flex-col",children:[p.jsxs(un,{children:[p.jsxs(cn,{children:["Connect to ",r]}),p.jsx(Qn,{children:"Point your tools at this nest to read, write, and query context."})]}),K&&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(ur,{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(ur,{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."]})]}),N&&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(ur,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),p.jsx("span",{children:N})]}),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(DR,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"font-medium",children:"External-client API key"})]}),u?p.jsx(dF,{delayDuration:200,children:p.jsxs(fF,{children:[p.jsx(hF,{asChild:!0,children:p.jsx(be,{variant:"outline",size:"sm",onClick:I,disabled:w!==null,"aria-label":"Rotate API key — invalidates the current key and mints a fresh one",children:w==="rotate"?p.jsx(dt,{className:"h-3.5 w-3.5 animate-spin"}):p.jsxs(p.Fragment,{children:[p.jsx(ec,{className:"h-3.5 w-3.5 mr-1"}),"Rotate"]})})}),p.jsx(SN,{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(be,{size:"sm",onClick:_,disabled:w!==null,children:w==="mint"?p.jsx(dt,{className:"h-3.5 w-3.5 animate-spin"}):"Generate Key"})]}),u&&D&&p.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-green-700",children:[p.jsx(qi,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),p.jsxs("span",{children:[D==="rotated"?"Key rotated":"Key generated"," · new prefix"," ",p.jsx("code",{className:"font-mono",children:h}),D==="rotated"&&" · previous key revoked","."]})]}),u&&!D&&p.jsxs("p",{className:"text-xs text-muted-foreground",children:["Active key prefix:"," ",p.jsx("code",{className:"font-mono",children:h}),"."]}),!u&&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(HE,{defaultValue:"hootie",className:"w-full",children:[p.jsxs(Ix,{className:"grid w-full grid-cols-4",children:[p.jsxs(Fi,{value:"hootie",children:[p.jsx(n3,{className:"h-3.5 w-3.5 mr-1"}),"Hootie"]}),p.jsxs(Fi,{value:"claude",children:[p.jsx(a3,{className:"h-3.5 w-3.5 mr-1"}),"Claude"]}),p.jsx(Fi,{value:"mcp",children:"MCP"}),p.jsxs(Fi,{value:"cli",children:[p.jsx(d3,{className:"h-3.5 w-3.5 mr-1"}),"CLI"]})]}),p.jsxs(zi,{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:po})]}),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(zi,{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:po})," ","with your generated key):"]})]}),p.jsx(Xl,{label:"Config",value:L,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(zi,{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 ${po}`})]}),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(zi,{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:R})]}),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 ${po}`," ",'query "#architecture"']}),p.jsxs("div",{children:["ctx --server ",s," --nest ",n,!V&&` --key ${po}`,' add "My Doc" content.md']}),p.jsxs("div",{children:["ctx --server ",s," --nest ",n,!V&&` --key ${po}`," ","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(CN,{value:n})]})})]})}),g&&y&&p.jsx(mF,{apiKey:g,kind:y,onClose:P})]})}function mF({apiKey:e,kind:t,onClose:n}){const[r,i]=k.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return p.jsx(vn,{open:!0,onOpenChange:n,children:p.jsxs(an,{className:"sm:max-w-[480px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{className:"flex items-center gap-2",children:[p.jsx(lP,{className:"h-4 w-4 text-amber-700"}),t==="generated"?"API key generated":"API key rotated"]}),p.jsxs(Qn,{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(be,{size:"sm",variant:"outline",onClick:o,children:r?p.jsx(yl,{className:"h-3.5 w-3.5 text-green-600"}):p.jsx(Nc,{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:po}),"."]})]}),p.jsx("div",{className:"flex justify-end pt-2",children:p.jsx(be,{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(CN,{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 CN({value:e}){const[t,n]=k.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return p.jsx(be,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:r,children:t?p.jsx(yl,{className:"h-3 w-3 text-green-600"}):p.jsx(Nc,{className:"h-3 w-3"})})}function Y0(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"nest"}function EN(e){const t=k.useRef({value:e,previous:e});return k.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var hp="Switch",[gF]=Ci(hp),[xF,yF]=gF(hp),NN=k.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:l,value:u="on",onCheckedChange:d,form:h,...f}=e,[g,x]=k.useState(null),y=it(t,T=>x(T)),v=k.useRef(!1),w=g?h||!!g.closest("form"):!0,[C,N]=ms({prop:i,defaultProp:o??!1,onChange:d,caller:hp});return p.jsxs(xF,{scope:n,checked:C,disabled:l,children:[p.jsx(Ye.button,{type:"button",role:"switch","aria-checked":C,"aria-required":s,"data-state":MN(C),"data-disabled":l?"":void 0,disabled:l,value:u,...f,ref:y,onClick:ve(e.onClick,T=>{N(D=>!D),w&&(v.current=T.isPropagationStopped(),v.current||T.stopPropagation())})}),w&&p.jsx(_N,{control:g,bubbles:!v.current,name:r,value:u,checked:C,required:s,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});NN.displayName=hp;var TN="SwitchThumb",AN=k.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=yF(TN,n);return p.jsx(Ye.span,{"data-state":MN(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});AN.displayName=TN;var bF="SwitchBubbleInput",_N=k.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const s=k.useRef(null),l=it(s,o),u=EN(n),d=nN(t);return k.useEffect(()=>{const h=s.current;if(!h)return;const f=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(f,"checked").set;if(u!==n&&x){const y=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(y)}},[u,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}})});_N.displayName=bF;function MN(e){return e?"checked":"unchecked"}var jN=NN,vF=AN;const Jf=k.forwardRef(({className:e,...t},n)=>p.jsx(jN,{className:Ie("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(vF,{className:Ie("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")})}));Jf.displayName=jN.displayName;const wF=ep("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"}}),Yn=k.forwardRef(({className:e,variant:t,...n},r)=>p.jsx("div",{ref:r,role:"alert",className:Ie(wF({variant:t}),e),...n}));Yn.displayName="Alert";const kF=k.forwardRef(({className:e,...t},n)=>p.jsx("h5",{ref:n,className:Ie("mb-1 font-medium leading-none tracking-tight",e),...t}));kF.displayName="AlertTitle";const Jn=k.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:Ie("text-sm [&_p]:leading-relaxed",e),...t}));Jn.displayName="AlertDescription";function SF({nestId:e,nestName:t,stewardshipEnabled:n,allowSelfApprove:r,canManageStewardship:i,onClose:o,onChanged:s}){const[l,u]=k.useState(n),[d,h]=k.useState(r),[f,g]=k.useState(!1),[x,y]=k.useState(null),[v,w]=k.useState(!1),C=n&&!l,N=async()=>{const T=l!==n,D=d!==r;if(!T&&!D){o();return}g(!0),y(null);try{const A=await zP(e,{...T?{stewardship_enabled:l}:{},...D?{allow_self_approve:d}:{}});if(A.stewardship_enabled!==l||A.allow_self_approve!==d){y("Server did not accept the change. You may not have permission to change these settings."),g(!1);return}s()}catch(A){y(A.message),g(!1)}};return p.jsx(vn,{open:!0,onOpenChange:o,children:p.jsxs(an,{className:"sm:max-w-[500px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{children:["Settings: ",t]}),p.jsx(Qn,{children:"Admin controls for this nest. Changes apply to all future documents."})]}),p.jsxs("div",{className:"space-y-4 py-2",children:[x&&p.jsxs(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:x})]}),i&&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(Vt,{className:"flex items-center gap-2 text-sm font-medium",children:[p.jsx(Ar,{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(Jf,{checked:l,onCheckedChange:u})]}),!l&&!C&&p.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground pt-2 border-t",children:[p.jsx(Vf,{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."]})]}),C&&p.jsxs(Yn,{variant:"destructive",className:"pt-2",children:[p.jsx(u1,{className:"h-4 w-4"}),p.jsxs(Jn,{className:"space-y-2",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Disabling stewardship removes governance."})," ","All steward assignments and pending review requests for this nest will be deleted, and new documents become auto-approved. Collaborator access is kept — manage it from Share. Approved/rejected review history is kept."]}),p.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:v,onChange:T=>w(T.target.checked),className:"h-3.5 w-3.5"}),"I understand this will remove all stewards."]})]})]}),l&&p.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground pt-2 border-t",children:[p.jsx(Vf,{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."]})]})]}),i&&p.jsx("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(Vt,{className:"flex items-center gap-2 text-sm font-medium",children:[p.jsx(kP,{className:"h-4 w-4"}),"Allow self-approve"]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Default off. When enabled, the same person can submit a draft and approve it — useful while seeding a single-person nest or running solo. Turning this back off does not retroactively revoke approvals; it only changes future behavior. Stewardship audit logs still record the actor; the trail is intact, the separation isn't."})]}),p.jsx(Jf,{checked:d,onCheckedChange:h})]})})]}),p.jsxs(cr,{children:[p.jsx(be,{variant:"outline",onClick:o,disabled:f,children:"Cancel"}),p.jsx(be,{onClick:N,disabled:f||C&&!v,children:f?p.jsx(dt,{className:"h-4 w-4 animate-spin"}):"Save Settings"})]})]})})}const CF=ep("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 lr({className:e,variant:t,...n}){return p.jsx("div",{className:Ie(CF({variant:t}),e),...n})}function b1(e,[t,n]){return Math.min(n,Math.max(t,e))}function EF(e){const t=NF(e),n=k.forwardRef((r,i)=>{const{children:o,...s}=r,l=k.Children.toArray(o),u=l.find(AF);if(u){const d=u.props.children,h=l.map(f=>f===u?k.Children.count(d)>1?k.Children.only(null):k.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:k.isValidElement(d)?k.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function NF(e){const t=k.forwardRef((n,r)=>{const{children:i,...o}=n;if(k.isValidElement(i)){const s=MF(i),l=_F(o,i.props);return i.type!==k.Fragment&&(l.ref=r?Eo(r,s):s),k.cloneElement(i,l)}return k.Children.count(i)>1?k.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TF=Symbol("radix.slottable");function AF(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TF}function _F(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 u=o(...l);return i(...l),u}: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 jF=[" ","Enter","ArrowUp","ArrowDown"],DF=[" ","Enter"],cl="Select",[pp,mp,RF]=Rx(cl),[Ia]=Ci(cl,[RF,Pa]),gp=Pa(),[PF,Es]=Ia(cl),[IF,OF]=Ia(cl),DN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:l,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:g,required:x,form:y}=e,v=gp(t),[w,C]=k.useState(null),[N,T]=k.useState(null),[D,A]=k.useState(!1),_=jc(d),[I,P]=ms({prop:r,defaultProp:i??!1,onChange:o,caller:cl}),[L,R]=ms({prop:s,defaultProp:l,onChange:u,caller:cl}),V=k.useRef(null),K=w?y||!!w.closest("form"):!0,[G,B]=k.useState(new Set),W=Array.from(G).map(U=>U.props.value).join(";");return p.jsx(Ux,{...v,children:p.jsxs(PF,{required:x,scope:t,trigger:w,onTriggerChange:C,valueNode:N,onValueNodeChange:T,valueNodeHasChildren:D,onValueNodeHasChildrenChange:A,contentId:vi(),value:L,onValueChange:R,open:I,onOpenChange:P,dir:_,triggerPointerDownPosRef:V,disabled:g,children:[p.jsx(pp.Provider,{scope:t,children:p.jsx(IF,{scope:e.__scopeSelect,onNativeOptionAdd:k.useCallback(U=>{B(Z=>new Set(Z).add(U))},[]),onNativeOptionRemove:k.useCallback(U=>{B(Z=>{const q=new Set(Z);return q.delete(U),q})},[]),children:n})}),K?p.jsxs(n4,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:f,value:L,onChange:U=>R(U.target.value),disabled:g,form:y,children:[L===void 0?p.jsx("option",{value:""}):null,Array.from(G)]},W):null]})})};DN.displayName=cl;var RN="SelectTrigger",PN=k.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=gp(n),s=Es(RN,n),l=s.disabled||r,u=it(t,s.onTriggerChange),d=mp(n),h=k.useRef("touch"),[f,g,x]=i4(v=>{const w=d().filter(T=>!T.disabled),C=w.find(T=>T.value===s.value),N=o4(w,v,C);N!==void 0&&s.onValueChange(N.value)}),y=v=>{l||(s.onOpenChange(!0),x()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return p.jsx(Wx,{asChild:!0,...o,children:p.jsx(Ye.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":r4(s.value)?"":void 0,...i,ref:u,onClick:ve(i.onClick,v=>{v.currentTarget.focus(),h.current!=="mouse"&&y(v)}),onPointerDown:ve(i.onPointerDown,v=>{h.current=v.pointerType;const w=v.target;w.hasPointerCapture(v.pointerId)&&w.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:ve(i.onKeyDown,v=>{const w=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&g(v.key),!(w&&v.key===" ")&&jF.includes(v.key)&&(y(),v.preventDefault())})})})});PN.displayName=RN;var IN="SelectValue",ON=k.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...l}=e,u=Es(IN,n),{onValueNodeHasChildrenChange:d}=u,h=o!==void 0,f=it(t,u.onValueNodeChange);return ln(()=>{d(h)},[d,h]),p.jsx(Ye.span,{...l,ref:f,style:{pointerEvents:"none"},children:r4(u.value)?p.jsx(p.Fragment,{children:s}):o})});ON.displayName=IN;var LF="SelectIcon",LN=k.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return p.jsx(Ye.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});LN.displayName=LF;var FF="SelectPortal",FN=e=>p.jsx(Mc,{asChild:!0,...e});FN.displayName=FF;var dl="SelectContent",zN=k.forwardRef((e,t)=>{const n=Es(dl,e.__scopeSelect),[r,i]=k.useState();if(ln(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Ec.createPortal(p.jsx(BN,{scope:e.__scopeSelect,children:p.jsx(pp.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),o):null}return p.jsx($N,{...e,ref:t})});zN.displayName=dl;var xi=10,[BN,Ns]=Ia(dl),zF="SelectContentImpl",BF=EF("SelectContent.RemoveScroll"),$N=k.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:g,collisionPadding:x,sticky:y,hideWhenDetached:v,avoidCollisions:w,...C}=e,N=Es(dl,n),[T,D]=k.useState(null),[A,_]=k.useState(null),I=it(t,ie=>D(ie)),[P,L]=k.useState(null),[R,V]=k.useState(null),K=mp(n),[G,B]=k.useState(!1),W=k.useRef(!1);k.useEffect(()=>{if(T)return _x(T)},[T]),Ax();const U=k.useCallback(ie=>{const[ue,...xe]=K().map(Be=>Be.ref.current),[Te]=xe.slice(-1),Le=document.activeElement;for(const Be of ie)if(Be===Le||(Be==null||Be.scrollIntoView({block:"nearest"}),Be===ue&&A&&(A.scrollTop=0),Be===Te&&A&&(A.scrollTop=A.scrollHeight),Be==null||Be.focus(),document.activeElement!==Le))return},[K,A]),Z=k.useCallback(()=>U([P,T]),[U,P,T]);k.useEffect(()=>{G&&Z()},[G,Z]);const{onOpenChange:q,triggerPointerDownPosRef:Y}=N;k.useEffect(()=>{if(T){let ie={x:0,y:0};const ue=Te=>{var Le,Be;ie={x:Math.abs(Math.round(Te.pageX)-(((Le=Y.current)==null?void 0:Le.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((Be=Y.current)==null?void 0:Be.y)??0))}},xe=Te=>{ie.x<=10&&ie.y<=10?Te.preventDefault():T.contains(Te.target)||q(!1),document.removeEventListener("pointermove",ue),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",xe,{capture:!0})}}},[T,q,Y]),k.useEffect(()=>{const ie=()=>q(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[q]);const[j,z]=i4(ie=>{const ue=K().filter(Le=>!Le.disabled),xe=ue.find(Le=>Le.ref.current===document.activeElement),Te=o4(ue,ie,xe);Te&&setTimeout(()=>Te.ref.current.focus())}),ee=k.useCallback((ie,ue,xe)=>{const Te=!W.current&&!xe;(N.value!==void 0&&N.value===ue||Te)&&(L(ie),Te&&(W.current=!0))},[N.value]),O=k.useCallback(()=>T==null?void 0:T.focus(),[T]),ce=k.useCallback((ie,ue,xe)=>{const Te=!W.current&&!xe;(N.value!==void 0&&N.value===ue||Te)&&V(ie)},[N.value]),pe=r==="popper"?v1:VN,le=pe===v1?{side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:g,collisionPadding:x,sticky:y,hideWhenDetached:v,avoidCollisions:w}:{};return p.jsx(BN,{scope:n,content:T,viewport:A,onViewportChange:_,itemRefCallback:ee,selectedItem:P,onItemLeave:O,itemTextRefCallback:ce,focusSelectedItem:Z,selectedItemText:R,position:r,isPositioned:G,searchRef:j,children:p.jsx(rp,{as:BF,allowPinchZoom:!0,children:p.jsx(tp,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:ve(i,ie=>{var ue;(ue=N.trigger)==null||ue.focus({preventScroll:!0}),ie.preventDefault()}),children:p.jsx(_c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:p.jsx(pe,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...C,...le,onPlaced:()=>B(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:ve(C.onKeyDown,ie=>{const ue=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ue&&ie.key.length===1&&z(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Te=K().filter(Le=>!Le.disabled).map(Le=>Le.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Le=ie.target,Be=Te.indexOf(Le);Te=Te.slice(Be+1)}setTimeout(()=>U(Te)),ie.preventDefault()}})})})})})})});$N.displayName=zF;var $F="SelectItemAlignedPosition",VN=k.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Es(dl,n),s=Ns(dl,n),[l,u]=k.useState(null),[d,h]=k.useState(null),f=it(t,I=>h(I)),g=mp(n),x=k.useRef(!1),y=k.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:C,focusSelectedItem:N}=s,T=k.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&v&&w&&C){const I=o.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),R=C.getBoundingClientRect();if(o.dir!=="rtl"){const Le=R.left-P.left,Be=L.left-Le,at=I.left-Be,Xe=I.width+at,Ot=Math.max(Xe,P.width),ut=window.innerWidth-xi,Tt=b1(Be,[xi,Math.max(xi,ut-Ot)]);l.style.minWidth=Xe+"px",l.style.left=Tt+"px"}else{const Le=P.right-R.right,Be=window.innerWidth-L.right-Le,at=window.innerWidth-I.right-Be,Xe=I.width+at,Ot=Math.max(Xe,P.width),ut=window.innerWidth-xi,Tt=b1(Be,[xi,Math.max(xi,ut-Ot)]);l.style.minWidth=Xe+"px",l.style.right=Tt+"px"}const V=g(),K=window.innerHeight-xi*2,G=v.scrollHeight,B=window.getComputedStyle(d),W=parseInt(B.borderTopWidth,10),U=parseInt(B.paddingTop,10),Z=parseInt(B.borderBottomWidth,10),q=parseInt(B.paddingBottom,10),Y=W+U+G+q+Z,j=Math.min(w.offsetHeight*5,Y),z=window.getComputedStyle(v),ee=parseInt(z.paddingTop,10),O=parseInt(z.paddingBottom,10),ce=I.top+I.height/2-xi,pe=K-ce,le=w.offsetHeight/2,ie=w.offsetTop+le,ue=W+U+ie,xe=Y-ue;if(ue<=ce){const Le=V.length>0&&w===V[V.length-1].ref.current;l.style.bottom="0px";const Be=d.clientHeight-v.offsetTop-v.offsetHeight,at=Math.max(pe,le+(Le?O:0)+Be+Z),Xe=ue+at;l.style.height=Xe+"px"}else{const Le=V.length>0&&w===V[0].ref.current;l.style.top="0px";const at=Math.max(ce,W+v.offsetTop+(Le?ee:0)+le)+xe;l.style.height=at+"px",v.scrollTop=ue-ce+v.offsetTop}l.style.margin=`${xi}px 0`,l.style.minHeight=j+"px",l.style.maxHeight=K+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,l,d,v,w,C,o.dir,r]);ln(()=>T(),[T]);const[D,A]=k.useState();ln(()=>{d&&A(window.getComputedStyle(d).zIndex)},[d]);const _=k.useCallback(I=>{I&&y.current===!0&&(T(),N==null||N(),y.current=!1)},[T,N]);return p.jsx(HF,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:x,onScrollButtonChange:_,children:p.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:p.jsx(Ye.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});VN.displayName=$F;var VF="SelectPopperPosition",v1=k.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=xi,...o}=e,s=gp(n);return p.jsx(qx,{...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)"}})});v1.displayName=VF;var[HF,Jx]=Ia(dl,{}),w1="SelectViewport",HN=k.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Ns(w1,n),s=Jx(w1,n),l=it(t,o.onViewportChange),u=k.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(pp.Slot,{scope:n,children:p.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ve(i.onScroll,d=>{const h=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=s;if(g!=null&&g.current&&f){const x=Math.abs(u.current-h.scrollTop);if(x>0){const y=window.innerHeight-xi*2,v=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),C=Math.max(v,w);if(C<y){const N=C+x,T=Math.min(y,N),D=N-T;f.style.height=T+"px",f.style.bottom==="0px"&&(h.scrollTop=D>0?D:0,f.style.justifyContent="flex-end")}}}u.current=h.scrollTop})})})]})});HN.displayName=w1;var UN="SelectGroup",[UF,WF]=Ia(UN),qF=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=vi();return p.jsx(UF,{scope:n,id:i,children:p.jsx(Ye.div,{role:"group","aria-labelledby":i,...r,ref:t})})});qF.displayName=UN;var WN="SelectLabel",qN=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=WF(WN,n);return p.jsx(Ye.div,{id:i.id,...r,ref:t})});qN.displayName=WN;var Xf="SelectItem",[KF,KN]=Ia(Xf),GN=k.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,l=Es(Xf,n),u=Ns(Xf,n),d=l.value===r,[h,f]=k.useState(o??""),[g,x]=k.useState(!1),y=it(t,N=>{var T;return(T=u.itemRefCallback)==null?void 0:T.call(u,N,r,i)}),v=vi(),w=k.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(KF,{scope:n,value:r,disabled:i,textId:v,isSelected:d,onItemTextChange:k.useCallback(N=>{f(T=>T||((N==null?void 0:N.textContent)??"").trim())},[]),children:p.jsx(pp.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:p.jsx(Ye.div,{role:"option","aria-labelledby":v,"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:y,onFocus:ve(s.onFocus,()=>x(!0)),onBlur:ve(s.onBlur,()=>x(!1)),onClick:ve(s.onClick,()=>{w.current!=="mouse"&&C()}),onPointerUp:ve(s.onPointerUp,()=>{w.current==="mouse"&&C()}),onPointerDown:ve(s.onPointerDown,N=>{w.current=N.pointerType}),onPointerMove:ve(s.onPointerMove,N=>{var T;w.current=N.pointerType,i?(T=u.onItemLeave)==null||T.call(u):w.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(s.onPointerLeave,N=>{var T;N.currentTarget===document.activeElement&&((T=u.onItemLeave)==null||T.call(u))}),onKeyDown:ve(s.onKeyDown,N=>{var D;((D=u.searchRef)==null?void 0:D.current)!==""&&N.key===" "||(DF.includes(N.key)&&C(),N.key===" "&&N.preventDefault())})})})})});GN.displayName=Xf;var Ru="SelectItemText",YN=k.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Es(Ru,n),l=Ns(Ru,n),u=KN(Ru,n),d=OF(Ru,n),[h,f]=k.useState(null),g=it(t,C=>f(C),u.onItemTextChange,C=>{var N;return(N=l.itemTextRefCallback)==null?void 0:N.call(l,C,u.value,u.disabled)}),x=h==null?void 0:h.textContent,y=k.useMemo(()=>p.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=d;return ln(()=>(v(y),()=>w(y)),[v,w,y]),p.jsxs(p.Fragment,{children:[p.jsx(Ye.span,{id:u.textId,...o,ref:g}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ec.createPortal(o.children,s.valueNode):null]})});YN.displayName=Ru;var JN="SelectItemIndicator",XN=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return KN(JN,n).isSelected?p.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});XN.displayName=JN;var k1="SelectScrollUpButton",QN=k.forwardRef((e,t)=>{const n=Ns(k1,e.__scopeSelect),r=Jx(k1,e.__scopeSelect),[i,o]=k.useState(!1),s=it(t,r.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;o(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?p.jsx(e4,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});QN.displayName=k1;var S1="SelectScrollDownButton",ZN=k.forwardRef((e,t)=>{const n=Ns(S1,e.__scopeSelect),r=Jx(S1,e.__scopeSelect),[i,o]=k.useState(!1),s=it(t,r.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,h=Math.ceil(u.scrollTop)<d;o(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?p.jsx(e4,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});ZN.displayName=S1;var e4=k.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Ns("SelectScrollButton",n),s=k.useRef(null),l=mp(n),u=k.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return k.useEffect(()=>()=>u(),[u]),ln(()=>{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(Ye.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ve(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:ve(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:ve(i.onPointerLeave,()=>{u()})})}),GF="SelectSeparator",t4=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});t4.displayName=GF;var C1="SelectArrow",YF=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=gp(n),o=Es(C1,n),s=Ns(C1,n);return o.open&&s.position==="popper"?p.jsx(Kx,{...i,...r,ref:t}):null});YF.displayName=C1;var JF="SelectBubbleInput",n4=k.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=k.useRef(null),o=it(r,i),s=EN(t);return k.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&h){const f=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(f)}},[s,t]),p.jsx(Ye.select,{...n,style:{...fN,...n.style},ref:o,defaultValue:t})});n4.displayName=JF;function r4(e){return e===""||e===void 0}function i4(e){const t=Tn(e),n=k.useRef(""),r=k.useRef(0),i=k.useCallback(s=>{const l=n.current+s;t(l),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(l)},[t]),o=k.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function o4(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=XF(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const u=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function XF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var QF=DN,s4=PN,ZF=ON,e7=LN,t7=FN,l4=zN,n7=HN,a4=qN,u4=GN,r7=YN,i7=XN,c4=QN,d4=ZN,f4=t4;const yo=QF,bo=ZF,$i=k.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(s4,{ref:r,className:Ie("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(e7,{asChild:!0,children:p.jsx(wx,{className:"h-4 w-4 opacity-50"})})]}));$i.displayName=s4.displayName;const h4=k.forwardRef(({className:e,...t},n)=>p.jsx(c4,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(XD,{className:"h-4 w-4"})}));h4.displayName=c4.displayName;const p4=k.forwardRef(({className:e,...t},n)=>p.jsx(d4,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(wx,{className:"h-4 w-4"})}));p4.displayName=d4.displayName;const Vi=k.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>p.jsx(t7,{children:p.jsxs(l4,{ref:i,className:Ie("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(h4,{}),p.jsx(n7,{className:Ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),p.jsx(p4,{})]})}));Vi.displayName=l4.displayName;const o7=k.forwardRef(({className:e,...t},n)=>p.jsx(a4,{ref:n,className:Ie("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));o7.displayName=a4.displayName;const Kt=k.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(u4,{ref:r,className:Ie("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(i7,{children:p.jsx(yl,{className:"h-4 w-4"})})}),p.jsx(r7,{children:t})]}));Kt.displayName=u4.displayName;const s7=k.forwardRef(({className:e,...t},n)=>p.jsx(f4,{ref:n,className:Ie("-mx-1 my-1 h-px bg-muted",e),...t}));s7.displayName=f4.displayName;const Gk=[{value:"read",label:"Viewer",hint:"Read only"},{value:"write",label:"Editor",hint:"Read and edit documents"},{value:"admin",label:"Admin",hint:"Full access except deleting the nest"}];function m4({nestId:e,nestName:t,onChanged:n,currentUserEmail:r}){const i=(r||"").toLowerCase(),[o,s]=k.useState([]),[l,u]=k.useState(!0),[d,h]=k.useState(""),[f,g]=k.useState("read"),[x,y]=k.useState(!1),[v,w]=k.useState(null),C=async()=>{u(!0);try{const{collaborators:A}=await u8(e);s(A)}catch(A){w((A==null?void 0:A.message)||"Failed to load collaborators")}finally{u(!1)}};k.useEffect(()=>{C()},[e]);const N=async A=>{A.preventDefault();const _=d.trim();if(_){y(!0),w(null);try{await c8(e,{email:_,permission:f}),h(""),g("read"),await C(),n()}catch(I){w((I==null?void 0:I.message)||"Failed to add collaborator")}finally{y(!1)}}},T=async(A,_)=>{const I=o.find(P=>P.id===A);if(I&&(I.email||"").toLowerCase()===i){gi.error("You can't change your own access level.");return}w(null),s(P=>P.map(L=>L.id===A?{...L,permission:_}:L));try{await d8(e,A,_),n()}catch(P){w((P==null?void 0:P.message)||"Failed to update permission"),await C()}},D=async A=>{if(window.confirm(`Remove ${A.email||"this collaborator"}'s access to "${t}"? They keep their account; only their access to this nest is revoked.`)){w(null);try{await f8(e,A.id),s(I=>I.filter(P=>P.id!==A.id)),n()}catch(I){w((I==null?void 0:I.message)||"Failed to remove collaborator")}}};return p.jsxs("div",{className:"space-y-4",children:[v&&p.jsxs(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:v})]}),p.jsxs("form",{onSubmit:N,className:"rounded-lg border p-4 space-y-3",children:[p.jsxs(Vt,{className:"flex items-center gap-2 text-sm font-medium",children:[p.jsx(tl,{className:"h-4 w-4"}),"Add a person"]}),p.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[p.jsx(Xn,{type:"email",placeholder:"teammate@example.com",value:d,onChange:A=>h(A.target.value),disabled:x,className:"flex-1"}),p.jsxs(yo,{value:f,onValueChange:A=>g(A),children:[p.jsx($i,{className:"w-full sm:w-[130px]",children:p.jsx(bo,{})}),p.jsx(Vi,{children:Gk.map(A=>p.jsx(Kt,{value:A.value,children:A.label},A.value))})]}),p.jsx(be,{type:"submit",disabled:x||!d.trim(),children:x?p.jsx(dt,{className:"h-4 w-4 animate-spin"}):"Add"})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"If they don't have an account yet, they'll get access when they register with this email."})]}),p.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[p.jsx(Vt,{className:"text-sm font-medium",children:"People with access"}),l?p.jsx("div",{className:"flex items-center justify-center py-4",children:p.jsx(dt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):o.length===0?p.jsx("p",{className:"text-xs text-muted-foreground py-2",children:"Nobody's been added yet. The owner always has full access."}):p.jsx("div",{className:"space-y-1",children:o.map(A=>p.jsxs("div",{className:"flex items-center gap-2 py-1.5","data-testid":`collaborator-row-${A.id}`,children:[p.jsx("span",{className:"flex-1 min-w-0 truncate text-sm",children:A.email||A.user_id}),(A.stewardRoles??[]).map(_=>p.jsx(lr,{variant:"outline",className:"text-[10px] px-1.5 py-0 capitalize",title:"Steward role — manage in the Stewards tab",children:_},_)),p.jsxs(yo,{value:A.permission,disabled:(A.email||"").toLowerCase()===i,onValueChange:_=>T(A.id,_),children:[p.jsx($i,{className:"w-[120px] h-8",title:(A.email||"").toLowerCase()===i?"You can't change your own access level":void 0,children:p.jsx(bo,{})}),p.jsx(Vi,{children:Gk.map(_=>p.jsx(Kt,{value:_.value,children:_.label},_.value))})]}),(A.email||"").toLowerCase()!==i&&p.jsx(be,{variant:"ghost",size:"sm",onClick:()=>D(A),title:"Remove access",className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:p.jsx(ll,{className:"h-3.5 w-3.5"})})]},A.id))})]})]})}function g4({nestId:e,nestName:t,onClose:n,onChanged:r}){var x,y;const{adminStatus:i}=Ss(),o=((y=(x=i==null?void 0:i.me)==null?void 0:x.email)==null?void 0:y.toLowerCase())??"",[s,l]=k.useState(!1),[u,d]=k.useState(!1),[h,f]=k.useState(null);k.useEffect(()=>{Zh(e).then(v=>{var w;return l(((w=v.nest)==null?void 0:w.visibility)==="public")}).catch(()=>{})},[e]);const g=async v=>{l(v),d(!0),f(null);try{if((await UP(e,v?"public":"private")).visibility==="public"!==v){l(!v),f("Server did not accept the change. You may not have admin access to this nest.");return}r()}catch(w){l(!v),f((w==null?void 0:w.message)||"Failed to change visibility")}finally{d(!1)}};return p.jsx(vn,{open:!0,onOpenChange:n,children:p.jsxs(an,{className:"sm:max-w-[560px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{className:"flex items-center gap-2",children:[p.jsx(ja,{className:"h-4 w-4"}),"Share: ",t]}),p.jsx(Qn,{children:"Control who can see this nest and what they can do. Sharing here grants plain access — it does not make anyone a steward."})]}),p.jsxs("div",{className:"space-y-4 py-1",children:[h&&p.jsxs(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:h})]}),p.jsx("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(Vt,{className:"flex items-center gap-2 text-sm font-medium",children:[s?p.jsx(kx,{className:"h-4 w-4 text-green-600"}):p.jsx(HR,{className:"h-4 w-4"}),s?"Public":"Private"]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:s?"Anyone on this server can read this nest. Editing still requires being added below.":"Only people added below (and the owner) can see this nest."})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[u&&p.jsx(dt,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),p.jsx(Jf,{checked:s,onCheckedChange:g,disabled:u,"aria-label":"Toggle public visibility"})]})]})}),p.jsx(m4,{nestId:e,nestName:t,onChanged:r,currentUserEmail:o})]}),p.jsx(cr,{children:p.jsx(be,{variant:"outline",onClick:n,children:"Done"})})]})})}function l7(e,t=[]){let n=[];function r(o,s){const l=k.createContext(s);l.displayName=o+"Context";const u=n.length;n=[...n,s];const d=f=>{var C;const{scope:g,children:x,...y}=f,v=((C=g==null?void 0:g[e])==null?void 0:C[u])||l,w=k.useMemo(()=>y,Object.values(y));return p.jsx(v.Provider,{value:w,children:x})};d.displayName=o+"Provider";function h(f,g){var v;const x=((v=g==null?void 0:g[e])==null?void 0:v[u])||l,y=k.useContext(x);if(y)return y;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=>k.createContext(s));return function(l){const u=(l==null?void 0:l[e])||o;return k.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,a7(i,...t)]}function a7(...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:u,scopeName:d})=>{const f=u(o)[`__scope${d}`];return{...l,...f}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var u7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xx=u7.reduce((e,t)=>{const n=Tx(`Primitive.${t}`),r=k.forwardRef((i,o)=>{const{asChild:s,...l}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),J0={exports:{}},X0={};/**
|
|
455
|
+
* @license React
|
|
456
|
+
* use-sync-external-store-shim.production.js
|
|
457
|
+
*
|
|
458
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
459
|
+
*
|
|
460
|
+
* This source code is licensed under the MIT license found in the
|
|
461
|
+
* LICENSE file in the root directory of this source tree.
|
|
462
|
+
*/var Yk;function c7(){if(Yk)return X0;Yk=1;var e=Cc();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 x=g(),y=r({inst:{value:x,getSnapshot:g}}),v=y[0].inst,w=y[1];return o(function(){v.value=x,v.getSnapshot=g,u(v)&&w({inst:v})},[f,x,g]),i(function(){return u(v)&&w({inst:v}),f(function(){u(v)&&w({inst:v})})},[f]),s(x),x}function u(f){var g=f.getSnapshot;f=f.value;try{var x=g();return!n(f,x)}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 X0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,X0}var Jk;function x4(){return Jk||(Jk=1,J0.exports=c7()),J0.exports}var Qx=x4();function d7(){return Qx.useSyncExternalStore(f7,()=>!0,()=>!1)}function f7(){return()=>{}}var Zx="Avatar",[h7]=l7(Zx),[p7,y4]=h7(Zx),b4=k.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=k.useState("idle");return p.jsx(p7,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:p.jsx(Xx.span,{...r,ref:t})})});b4.displayName=Zx;var v4="AvatarImage",w4=k.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=y4(v4,n),l=m7(r,o),u=Tn(d=>{i(d),s.onImageLoadingStatusChange(d)});return ln(()=>{l!=="idle"&&u(l)},[l,u]),l==="loaded"?p.jsx(Xx.img,{...o,ref:t,src:r}):null});w4.displayName=v4;var k4="AvatarFallback",S4=k.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=y4(k4,n),[s,l]=k.useState(r===void 0);return k.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(u)}},[r]),s&&o.imageLoadingStatus!=="loaded"?p.jsx(Xx.span,{...i,ref:t}):null});S4.displayName=k4;function Xk(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function m7(e,{referrerPolicy:t,crossOrigin:n}){const r=d7(),i=k.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,l]=k.useState(()=>Xk(o,e));return ln(()=>{l(Xk(o,e))},[o,e]),ln(()=>{const u=f=>()=>{l(f)};if(!o)return;const d=u("loaded"),h=u("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 C4=b4,E4=w4,N4=S4;const ys=k.forwardRef(({className:e,...t},n)=>p.jsx(C4,{ref:n,className:Ie("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ys.displayName=C4.displayName;const g7=k.forwardRef(({className:e,...t},n)=>p.jsx(E4,{ref:n,className:Ie("aspect-square h-full w-full",e),...t}));g7.displayName=E4.displayName;const bs=k.forwardRef(({className:e,...t},n)=>p.jsx(N4,{ref:n,className:Ie("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));bs.displayName=N4.displayName;function x7(e){const t=y7(e),n=k.forwardRef((r,i)=>{const{children:o,...s}=r,l=k.Children.toArray(o),u=l.find(v7);if(u){const d=u.props.children,h=l.map(f=>f===u?k.Children.count(d)>1?k.Children.only(null):k.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:i,children:k.isValidElement(d)?k.cloneElement(d,void 0,h):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function y7(e){const t=k.forwardRef((n,r)=>{const{children:i,...o}=n;if(k.isValidElement(i)){const s=k7(i),l=w7(o,i.props);return i.type!==k.Fragment&&(l.ref=r?Eo(r,s):s),k.cloneElement(i,l)}return k.Children.count(i)>1?k.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var b7=Symbol("radix.slottable");function v7(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===b7}function w7(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 u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function k7(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 E1=["Enter"," "],S7=["ArrowDown","PageUp","Home"],T4=["ArrowUp","PageDown","End"],C7=[...S7,...T4],E7={ltr:[...E1,"ArrowRight"],rtl:[...E1,"ArrowLeft"]},N7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ic="Menu",[rc,T7,A7]=Rx(Ic),[vl,A4]=Ci(Ic,[A7,Pa,op]),xp=Pa(),_4=op(),[_7,wl]=vl(Ic),[M7,Oc]=vl(Ic),M4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,l=xp(t),[u,d]=k.useState(null),h=k.useRef(!1),f=Tn(o),g=jc(i);return k.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),p.jsx(Ux,{...l,children:p.jsx(_7,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:d,children:p.jsx(M7,{scope:t,onClose:k.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:h,dir:g,modal:s,children:r})})})};M4.displayName=Ic;var j7="MenuAnchor",ey=k.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=xp(n);return p.jsx(Wx,{...i,...r,ref:t})});ey.displayName=j7;var ty="MenuPortal",[D7,j4]=vl(ty,{forceMount:void 0}),D4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=wl(ty,t);return p.jsx(D7,{scope:t,forceMount:n,children:p.jsx(hr,{present:n||o.open,children:p.jsx(Mc,{asChild:!0,container:i,children:r})})})};D4.displayName=ty;var oi="MenuContent",[R7,ny]=vl(oi),R4=k.forwardRef((e,t)=>{const n=j4(oi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=wl(oi,e.__scopeMenu),s=Oc(oi,e.__scopeMenu);return p.jsx(rc.Provider,{scope:e.__scopeMenu,children:p.jsx(hr,{present:r||o.open,children:p.jsx(rc.Slot,{scope:e.__scopeMenu,children:s.modal?p.jsx(P7,{...i,ref:t}):p.jsx(I7,{...i,ref:t})})})})}),P7=k.forwardRef((e,t)=>{const n=wl(oi,e.__scopeMenu),r=k.useRef(null),i=it(t,r);return k.useEffect(()=>{const o=r.current;if(o)return _x(o)},[]),p.jsx(ry,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),I7=k.forwardRef((e,t)=>{const n=wl(oi,e.__scopeMenu);return p.jsx(ry,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),O7=x7("MenuContent.ScrollLock"),ry=k.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:g,onDismiss:x,disableOutsideScroll:y,...v}=e,w=wl(oi,n),C=Oc(oi,n),N=xp(n),T=_4(n),D=T7(n),[A,_]=k.useState(null),I=k.useRef(null),P=it(t,I,w.onContentChange),L=k.useRef(0),R=k.useRef(""),V=k.useRef(0),K=k.useRef(null),G=k.useRef("right"),B=k.useRef(0),W=y?rp:k.Fragment,U=y?{as:O7,allowPinchZoom:!0}:void 0,Z=Y=>{var ie,ue;const j=R.current+Y,z=D().filter(xe=>!xe.disabled),ee=document.activeElement,O=(ie=z.find(xe=>xe.ref.current===ee))==null?void 0:ie.textValue,ce=z.map(xe=>xe.textValue),pe=G7(ce,j,O),le=(ue=z.find(xe=>xe.textValue===pe))==null?void 0:ue.ref.current;(function xe(Te){R.current=Te,window.clearTimeout(L.current),Te!==""&&(L.current=window.setTimeout(()=>xe(""),1e3))})(j),le&&setTimeout(()=>le.focus())};k.useEffect(()=>()=>window.clearTimeout(L.current),[]),Ax();const q=k.useCallback(Y=>{var z,ee;return G.current===((z=K.current)==null?void 0:z.side)&&J7(Y,(ee=K.current)==null?void 0:ee.area)},[]);return p.jsx(R7,{scope:n,searchRef:R,onItemEnter:k.useCallback(Y=>{q(Y)&&Y.preventDefault()},[q]),onItemLeave:k.useCallback(Y=>{var j;q(Y)||((j=I.current)==null||j.focus(),_(null))},[q]),onTriggerLeave:k.useCallback(Y=>{q(Y)&&Y.preventDefault()},[q]),pointerGraceTimerRef:V,onPointerGraceIntentChange:k.useCallback(Y=>{K.current=Y},[]),children:p.jsx(W,{...U,children:p.jsx(tp,{asChild:!0,trapped:i,onMountAutoFocus:ve(o,Y=>{var j;Y.preventDefault(),(j=I.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:p.jsx(_c,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:g,onDismiss:x,children:p.jsx(AE,{asChild:!0,...T,dir:C.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:_,onEntryFocus:ve(u,Y=>{C.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(qx,{role:"menu","aria-orientation":"vertical","data-state":Y4(w.open),"data-radix-menu-content":"",dir:C.dir,...N,...v,ref:P,style:{outline:"none",...v.style},onKeyDown:ve(v.onKeyDown,Y=>{const z=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,ee=Y.ctrlKey||Y.altKey||Y.metaKey,O=Y.key.length===1;z&&(Y.key==="Tab"&&Y.preventDefault(),!ee&&O&&Z(Y.key));const ce=I.current;if(Y.target!==ce||!C7.includes(Y.key))return;Y.preventDefault();const le=D().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);T4.includes(Y.key)&&le.reverse(),q7(le)}),onBlur:ve(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(L.current),R.current="")}),onPointerMove:ve(e.onPointerMove,ic(Y=>{const j=Y.target,z=B.current!==Y.clientX;if(Y.currentTarget.contains(j)&&z){const ee=Y.clientX>B.current?"right":"left";G.current=ee,B.current=Y.clientX}}))})})})})})})});R4.displayName=oi;var L7="MenuGroup",iy=k.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ye.div,{role:"group",...r,ref:t})});iy.displayName=L7;var F7="MenuLabel",P4=k.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ye.div,{...r,ref:t})});P4.displayName=F7;var Qf="MenuItem",Qk="menu.itemSelect",yp=k.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=k.useRef(null),s=Oc(Qf,e.__scopeMenu),l=ny(Qf,e.__scopeMenu),u=it(t,o),d=k.useRef(!1),h=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(Qk,{bubbles:!0,cancelable:!0});f.addEventListener(Qk,x=>r==null?void 0:r(x),{once:!0}),$3(f,g),g.defaultPrevented?d.current=!1:s.onClose()}};return p.jsx(I4,{...i,ref:u,disabled:n,onClick:ve(e.onClick,h),onPointerDown:f=>{var g;(g=e.onPointerDown)==null||g.call(e,f),d.current=!0},onPointerUp:ve(e.onPointerUp,f=>{var g;d.current||(g=f.currentTarget)==null||g.click()}),onKeyDown:ve(e.onKeyDown,f=>{const g=l.searchRef.current!=="";n||g&&f.key===" "||E1.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});yp.displayName=Qf;var I4=k.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=ny(Qf,n),l=_4(n),u=k.useRef(null),d=it(t,u),[h,f]=k.useState(!1),[g,x]=k.useState("");return k.useEffect(()=>{const y=u.current;y&&x((y.textContent??"").trim())},[o.children]),p.jsx(rc.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:p.jsx(_E,{asChild:!0,...l,focusable:!r,children:p.jsx(Ye.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:ve(e.onPointerMove,ic(y=>{r?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,ic(y=>s.onItemLeave(y))),onFocus:ve(e.onFocus,()=>f(!0)),onBlur:ve(e.onBlur,()=>f(!1))})})})}),z7="MenuCheckboxItem",O4=k.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return p.jsx($4,{scope:e.__scopeMenu,checked:n,children:p.jsx(yp,{role:"menuitemcheckbox","aria-checked":Zf(n)?"mixed":n,...i,ref:t,"data-state":sy(n),onSelect:ve(i.onSelect,()=>r==null?void 0:r(Zf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});O4.displayName=z7;var L4="MenuRadioGroup",[B7,$7]=vl(L4,{value:void 0,onValueChange:()=>{}}),F4=k.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Tn(r);return p.jsx(B7,{scope:e.__scopeMenu,value:n,onValueChange:o,children:p.jsx(iy,{...i,ref:t})})});F4.displayName=L4;var z4="MenuRadioItem",B4=k.forwardRef((e,t)=>{const{value:n,...r}=e,i=$7(z4,e.__scopeMenu),o=n===i.value;return p.jsx($4,{scope:e.__scopeMenu,checked:o,children:p.jsx(yp,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":sy(o),onSelect:ve(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});B4.displayName=z4;var oy="MenuItemIndicator",[$4,V7]=vl(oy,{checked:!1}),V4=k.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=V7(oy,n);return p.jsx(hr,{present:r||Zf(o.checked)||o.checked===!0,children:p.jsx(Ye.span,{...i,ref:t,"data-state":sy(o.checked)})})});V4.displayName=oy;var H7="MenuSeparator",H4=k.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});H4.displayName=H7;var U7="MenuArrow",U4=k.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=xp(n);return p.jsx(Kx,{...i,...r,ref:t})});U4.displayName=U7;var W7="MenuSub",[Jie,W4]=vl(W7),Pu="MenuSubTrigger",q4=k.forwardRef((e,t)=>{const n=wl(Pu,e.__scopeMenu),r=Oc(Pu,e.__scopeMenu),i=W4(Pu,e.__scopeMenu),o=ny(Pu,e.__scopeMenu),s=k.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},h=k.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return k.useEffect(()=>h,[h]),k.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),u(null)}},[l,u]),p.jsx(ey,{asChild:!0,...d,children:p.jsx(I4,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Y4(n.open),...e,ref:Eo(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:ve(e.onPointerMove,ic(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:ve(e.onPointerLeave,ic(f=>{var x,y;h();const g=(x=n.content)==null?void 0:x.getBoundingClientRect();if(g){const v=(y=n.content)==null?void 0:y.dataset.side,w=v==="right",C=w?-5:5,N=g[w?"left":"right"],T=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+C,y:f.clientY},{x:N,y:g.top},{x:T,y:g.top},{x:T,y:g.bottom},{x:N,y:g.bottom}],side:v}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,f=>{var x;const g=o.searchRef.current!=="";e.disabled||g&&f.key===" "||E7[r.dir].includes(f.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),f.preventDefault())})})})});q4.displayName=Pu;var K4="MenuSubContent",G4=k.forwardRef((e,t)=>{const n=j4(oi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=wl(oi,e.__scopeMenu),s=Oc(oi,e.__scopeMenu),l=W4(K4,e.__scopeMenu),u=k.useRef(null),d=it(t,u);return p.jsx(rc.Provider,{scope:e.__scopeMenu,children:p.jsx(hr,{present:r||o.open,children:p.jsx(rc.Slot,{scope:e.__scopeMenu,children:p.jsx(ry,{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=u.current)==null||f.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:ve(e.onFocusOutside,h=>{h.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,h=>{s.onClose(),h.preventDefault()}),onKeyDown:ve(e.onKeyDown,h=>{var x;const f=h.currentTarget.contains(h.target),g=N7[s.dir].includes(h.key);f&&g&&(o.onOpenChange(!1),(x=l.trigger)==null||x.focus(),h.preventDefault())})})})})})});G4.displayName=K4;function Y4(e){return e?"open":"closed"}function Zf(e){return e==="indeterminate"}function sy(e){return Zf(e)?"indeterminate":e?"checked":"unchecked"}function q7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function K7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function G7(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=K7(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const u=s.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function Y7(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],u=t[s],d=l.x,h=l.y,f=u.x,g=u.y;h>r!=g>r&&n<(f-d)*(r-h)/(g-h)+d&&(i=!i)}return i}function J7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Y7(n,t)}function ic(e){return t=>t.pointerType==="mouse"?e(t):void 0}var X7=M4,Q7=ey,Z7=D4,ez=R4,tz=iy,nz=P4,rz=yp,iz=O4,oz=F4,sz=B4,lz=V4,az=H4,uz=U4,cz=q4,dz=G4,bp="DropdownMenu",[fz]=Ci(bp,[A4]),pr=A4(),[hz,J4]=fz(bp),X4=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:l=!0}=e,u=pr(t),d=k.useRef(null),[h,f]=ms({prop:i,defaultProp:o??!1,onChange:s,caller:bp});return p.jsx(hz,{scope:t,triggerId:vi(),triggerRef:d,contentId:vi(),open:h,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(g=>!g),[f]),modal:l,children:p.jsx(X7,{...u,open:h,onOpenChange:f,dir:r,modal:l,children:n})})};X4.displayName=bp;var Q4="DropdownMenuTrigger",Z4=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=J4(Q4,n),s=pr(n);return p.jsx(Q7,{asChild:!0,...s,children:p.jsx(Ye.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:Eo(t,o.triggerRef),onPointerDown:ve(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:ve(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Z4.displayName=Q4;var pz="DropdownMenuPortal",eT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=pr(t);return p.jsx(Z7,{...r,...n})};eT.displayName=pz;var tT="DropdownMenuContent",nT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=J4(tT,n),o=pr(n),s=k.useRef(!1);return p.jsx(ez,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,l=>{var u;s.current||(u=i.triggerRef.current)==null||u.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.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)"}})});nT.displayName=tT;var mz="DropdownMenuGroup",gz=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(tz,{...i,...r,ref:t})});gz.displayName=mz;var xz="DropdownMenuLabel",rT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(nz,{...i,...r,ref:t})});rT.displayName=xz;var yz="DropdownMenuItem",iT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(rz,{...i,...r,ref:t})});iT.displayName=yz;var bz="DropdownMenuCheckboxItem",oT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(iz,{...i,...r,ref:t})});oT.displayName=bz;var vz="DropdownMenuRadioGroup",wz=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(oz,{...i,...r,ref:t})});wz.displayName=vz;var kz="DropdownMenuRadioItem",sT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(sz,{...i,...r,ref:t})});sT.displayName=kz;var Sz="DropdownMenuItemIndicator",lT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(lz,{...i,...r,ref:t})});lT.displayName=Sz;var Cz="DropdownMenuSeparator",aT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(az,{...i,...r,ref:t})});aT.displayName=Cz;var Ez="DropdownMenuArrow",Nz=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(uz,{...i,...r,ref:t})});Nz.displayName=Ez;var Tz="DropdownMenuSubTrigger",uT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(cz,{...i,...r,ref:t})});uT.displayName=Tz;var Az="DropdownMenuSubContent",cT=k.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return p.jsx(dz,{...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)"}})});cT.displayName=Az;var _z=X4,Mz=Z4,jz=eT,dT=nT,fT=rT,hT=iT,pT=oT,mT=sT,gT=lT,xT=aT,yT=uT,bT=cT;const vT=_z,wT=Mz,Dz=k.forwardRef(({className:e,inset:t,children:n,...r},i)=>p.jsxs(yT,{ref:i,className:Ie("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(i3,{className:"ml-auto h-4 w-4"})]}));Dz.displayName=yT.displayName;const Rz=k.forwardRef(({className:e,...t},n)=>p.jsx(bT,{ref:n,className:Ie("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}));Rz.displayName=bT.displayName;const ly=k.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(jz,{children:p.jsx(dT,{ref:r,sideOffset:t,className:Ie("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})}));ly.displayName=dT.displayName;const oc=k.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(hT,{ref:r,className:Ie("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}));oc.displayName=hT.displayName;const Pz=k.forwardRef(({className:e,children:t,checked:n,...r},i)=>p.jsxs(pT,{ref:i,className:Ie("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(gT,{children:p.jsx(yl,{className:"h-4 w-4"})})}),t]}));Pz.displayName=pT.displayName;const Iz=k.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(mT,{ref:r,className:Ie("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(gT,{children:p.jsx(nR,{className:"h-2 w-2 fill-current"})})}),t]}));Iz.displayName=mT.displayName;const Oz=k.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(fT,{ref:r,className:Ie("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Oz.displayName=fT.displayName;const N1=k.forwardRef(({className:e,...t},n)=>p.jsx(xT,{ref:n,className:Ie("-mx-1 my-1 h-px bg-muted",e),...t}));N1.displayName=xT.displayName;const Lz={document:{label:"Document",icon:ps},tag:{label:"Tag",icon:c3},nest:{label:"Nest",icon:r3}};function Fz({stewards:e,loading:t=!1,showScope:n=!1,className:r,onAddSteward:i,onRemove:o,onEditRole:s,compact:l=!1,currentUserEmail:u}){const[d,h]=k.useState(null),f=(u||"").toLowerCase(),g=async v=>{if(o){h(v);try{await o(v)}finally{h(null)}}},x=v=>{const w=Lz[v.scope];let C="";return v.scope==="tag"?C=v.tagName||"":v.scope==="document"&&(C=v.nodeTitle||v.nodePattern||""),p.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[p.jsx(w.icon,{className:"h-3 w-3"}),p.jsx("span",{children:w.label}),C&&p.jsxs("span",{className:"opacity-75",children:[": ",C]})]})},y=v=>(v.userEmail[0]||"?").toUpperCase();return t?p.jsx("div",{className:Ie("flex items-center justify-center py-4",r),children:p.jsx(dt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.length===0?p.jsxs("div",{className:Ie("text-center py-4",r),children:[p.jsx(Ar,{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(be,{variant:"outline",size:"sm",onClick:i,children:[p.jsx(tl,{className:"h-4 w-4 mr-2"}),"Assign Steward"]})]}):l?p.jsxs("div",{className:Ie("flex items-center gap-1",r),children:[p.jsx(Ar,{className:"h-4 w-4 text-muted-foreground"}),p.jsx("div",{className:"flex -space-x-2",children:e.slice(0,3).map(v=>p.jsx(ys,{className:"h-6 w-6 border-2 border-background",children:p.jsx(bs,{className:"text-[10px]",children:y(v)})},v.id))}),e.length>3&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",e.length-3]}),i&&p.jsx(be,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:i,children:p.jsx(tl,{className:"h-3 w-3"})})]}):p.jsxs("div",{className:Ie("space-y-2",r),children:[e.map(v=>p.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg border bg-card",children:[p.jsx(ys,{className:"h-8 w-8",children:p.jsx(bs,{children:y(v)})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("p",{className:"font-medium text-sm truncate",children:v.userEmail}),n&&x(v),p.jsx("div",{className:"flex items-center gap-1 mt-1",children:p.jsx(lr,{variant:"secondary",className:"text-[10px] px-1.5 py-0 capitalize",children:v.role})})]}),(s||o)&&v.userEmail.toLowerCase()!==f&&p.jsxs(vT,{children:[p.jsx(wT,{asChild:!0,children:p.jsx(be,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:d===v.id,children:d===v.id?p.jsx(dt,{className:"h-4 w-4 animate-spin"}):p.jsx(cR,{className:"h-4 w-4"})})}),p.jsxs(ly,{align:"end",children:[s&&p.jsxs(oc,{onClick:()=>s(v),children:[p.jsx(Ac,{className:"h-4 w-4 mr-2"}),"Edit Role"]}),o&&p.jsxs(oc,{className:"text-destructive",onClick:()=>g(v.id),children:[p.jsx(ll,{className:"h-4 w-4 mr-2"}),"Remove"]})]})]})]},v.id)),i&&p.jsxs(be,{variant:"outline",className:"w-full",onClick:i,children:[p.jsx(tl,{className:"h-4 w-4 mr-2"}),"Add Steward"]})]})}const Q0={nest:{label:"Entire Nest",icon:r3,placeholder:""},tag:{label:"Tag",icon:c3,placeholder:"e.g., #architecture"},document:{label:"Document",icon:ps,placeholder:"e.g., nodes/getting-started"}};function Zk(e){return e.scope==="tag"?e.tagName||"":e.scope==="document"&&e.nodePattern||""}function e2({isOpen:e,onClose:t,nestId:n,steward:r,onSubmit:i,onSync:o}){const s=!!r,[l,u]=k.useState(""),[d,h]=k.useState("tag"),[f,g]=k.useState(""),[x,y]=k.useState("reviewer"),[v,w]=k.useState(!1),[C,N]=k.useState(!1),[T,D]=k.useState(null),[A,_]=k.useState([]),[I,P]=k.useState([]),[L,R]=k.useState(!1);k.useEffect(()=>{e&&(u((r==null?void 0:r.userEmail)??""),h((r==null?void 0:r.scope)??"tag"),g(r?Zk(r):""),y((r==null?void 0:r.role)??"reviewer"),D(null))},[e,r]),k.useEffect(()=>{if(!e||d!=="document"&&d!=="tag")return;let U=!1;return R(!0),(d==="document"?ga(n).then(q=>{if(U)return;const Y=Array.isArray(q==null?void 0:q.nodes)?q.nodes:[];_(Y)}):JP(n).then(q=>{U||P(q)})).catch(q=>console.error(`[StewardModal] ${d} fetch failed`,q)).finally(()=>{U||R(!1)}),()=>{U=!0}},[e,d,n]);const V=!s||x!==r.role||d!==r.scope||f!==Zk(r),K=async()=>{if(o){N(!0),D(null);try{await o()}catch(U){D(U instanceof Error?U.message:"Failed to sync stewards.yaml")}finally{N(!1)}}},G=async()=>{if(s&&!V){t();return}if(!s&&!l.trim()){D("Please enter an email");return}if(d!=="nest"&&!f.trim()){D(`Please specify the ${d} target`);return}w(!0),D(null);try{await i({email:((r==null?void 0:r.userEmail)??l).trim(),scope:d,target:d==="nest"?void 0:f.trim(),role:x}),t()}catch(U){D(U instanceof Error?U.message:s?"Failed to update steward":"Failed to assign steward"),w(!1)}},B=v||C,W=Q0[d].icon;return p.jsx(vn,{open:e,onOpenChange:U=>!U&&!B&&t(),children:p.jsxs(an,{className:"sm:max-w-[500px]",children:[p.jsxs(un,{children:[p.jsx(cn,{children:s?"Edit steward":"Assign Context Steward"}),p.jsx(Qn,{children:s?p.jsxs(p.Fragment,{children:["Change the role and scope for"," ",p.jsx("strong",{className:"text-foreground",children:r.userEmail}),"."]}):"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:[T&&p.jsxs(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:T})]}),!s&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(Vt,{htmlFor:"email",children:"Steward Email"}),p.jsx(Xn,{id:"email",type:"email",placeholder:"reviewer@acme.com",value:l,onChange:U=>u(U.target.value),disabled:v})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(Vt,{children:"Scope"}),p.jsxs(yo,{value:d,onValueChange:U=>{h(U),g("")},disabled:v,children:[p.jsx($i,{children:p.jsx(bo,{})}),p.jsx(Vi,{children:Object.entries(Q0).map(([U,Z])=>{const q=Z.icon;return p.jsx(Kt,{value:U,children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(q,{className:"h-4 w-4"}),Z.label]})},U)})})]})]}),d!=="nest"&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs(Vt,{htmlFor:"target",children:[p.jsx(W,{className:"h-4 w-4 inline mr-2"}),d==="tag"?"Tag":Q0[d].label]}),d==="tag"?p.jsxs(yo,{value:f,onValueChange:g,disabled:v||L,children:[p.jsx($i,{id:"target",children:p.jsx(bo,{placeholder:L?"Loading tags...":I.length===0?"No tags in this nest":"Select a tag"})}),p.jsx(Vi,{children:I.map(U=>p.jsxs(Kt,{value:U,children:["#",U]},U))})]}):p.jsxs(yo,{value:f,onValueChange:g,disabled:v||L,children:[p.jsx($i,{id:"target",children:p.jsx(bo,{placeholder:L?"Loading documents...":A.length===0?"No documents in this nest":"Select a document"})}),p.jsx(Vi,{children:A.map(U=>p.jsx(Kt,{value:U.id,children:p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{children:U.title}),p.jsx("span",{className:"text-xs text-muted-foreground",children:U.id})]})},U.id))})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:d==="tag"?"Steward approves any document with this tag.":"Steward governs this specific document."})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(Vt,{children:"Role"}),p.jsxs(yo,{value:x,onValueChange:U=>y(U),disabled:v,children:[p.jsx($i,{children:p.jsx(bo,{})}),p.jsxs(Vi,{children:[p.jsx(Kt,{value:"editor",children:"Editor — can edit but not approve"}),p.jsx(Kt,{value:"reviewer",children:"Reviewer — can approve/reject"}),p.jsx(Kt,{value:"viewer",children:"Viewer — read-only access"})]})]})]})]}),p.jsxs(cr,{className:"sm:justify-between",children:[o&&!s?p.jsxs(be,{variant:"ghost",size:"sm",onClick:K,disabled:B,title:"Re-import steward rows from the nest's stewards.yaml",children:[C?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(ec,{className:"h-4 w-4 mr-2"}),"Sync stewards.yaml"]}):p.jsx("span",{}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(be,{variant:"outline",onClick:t,disabled:B,children:"Cancel"}),p.jsxs(be,{onClick:G,disabled:B||!s&&!l.trim(),children:[v?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):s?null:p.jsx(tl,{className:"h-4 w-4 mr-2"}),s?"Save":"Assign Steward"]})]})]})]})})}const zz={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 Bz(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 $z({requests:e,loading:t=!1,error:n=null,className:r,showHeader:i=!0,onRefresh:o,onSelect:s}){return t?p.jsxs(Qt,{className:r,children:[i&&p.jsx(yn,{className:"pb-3",children:p.jsx(bn,{className:"text-lg",children:"Review Queue"})}),p.jsx(Zt,{children:p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(dt,{className:"h-6 w-6 animate-spin text-muted-foreground"})})})]}):n?p.jsxs(Qt,{className:r,children:[i&&p.jsx(yn,{className:"pb-3",children:p.jsx(bn,{className:"text-lg",children:"Review Queue"})}),p.jsx(Zt,{children:p.jsxs("div",{className:"text-center py-4 text-sm text-destructive",children:[n,o&&p.jsx(be,{variant:"ghost",size:"sm",onClick:o,className:"ml-2",children:p.jsx(ec,{className:"h-4 w-4"})})]})})]}):p.jsxs(Qt,{className:r,children:[i&&p.jsx(yn,{className:"pb-3",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx(bn,{className:"text-lg",children:"Review Queue"}),p.jsx(Fr,{children:"Documents awaiting your approval"})]}),o&&p.jsx(be,{variant:"ghost",size:"icon",onClick:o,className:"h-8 w-8",children:p.jsx(ec,{className:"h-4 w-4"})})]})}),p.jsx(Zt,{children:e.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[p.jsx(qi,{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 u=zz[l.priority],d=u.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(ps,{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.title||l.nodeId}),p.jsxs(lr,{variant:"secondary",className:Ie("text-[10px] px-1.5 py-0",u.className),children:[d&&p.jsx(d,{className:"h-3 w-3 mr-1"}),u.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(ys,{className:"h-4 w-4",children:p.jsx(bs,{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(Bf,{className:"h-3 w-3"}),p.jsx("span",{children:Bz(l.requestedAt)})]}),l.requestNote&&p.jsxs("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:["“",l.requestNote,"”"]})]}),p.jsx(i3,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]},l.id)})})})]})}const vp=k.forwardRef(({className:e,...t},n)=>p.jsx("textarea",{className:Ie("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}));vp.displayName="Textarea";function kT({documentTitle:e,version:t,onApprove:n,onReject:r,className:i}){const[o,s]=k.useState(null),[l,u]=k.useState(""),[d,h]=k.useState(!1),[f,g]=k.useState(null),x=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),y()}catch(v){g(v instanceof Error?v.message:`Failed to ${o} document`)}finally{h(!1)}}},y=()=>{d||(s(null),u(""),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(be,{variant:"outline",className:"border-green-200 text-green-700 hover:bg-green-50 hover:text-green-800",onClick:()=>s("approve"),children:[p.jsx(qi,{className:"h-4 w-4 mr-2"})," Approve"]}),p.jsxs(be,{variant:"outline",className:"border-red-200 text-red-700 hover:bg-red-50 hover:text-red-800",onClick:()=>s("reject"),children:[p.jsx(o1,{className:"h-4 w-4 mr-2"})," Request Changes"]})]})}),p.jsx(vn,{open:!!o,onOpenChange:y,children:p.jsxs(an,{className:"sm:max-w-[425px]",children:[p.jsxs(un,{children:[p.jsx(cn,{children:o==="approve"?"Approve Document":"Request Changes"}),p.jsx(Qn,{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(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:f})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(Vt,{htmlFor:"review-note",children:[p.jsx(qR,{className:"h-4 w-4 inline mr-2"}),o==="approve"?"Note (optional)":"Feedback (required)"]}),p.jsx(vp,{id:"review-note",placeholder:o==="approve"?"Add any notes for the author...":"Explain what changes are needed...",value:l,onChange:v=>u(v.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(cr,{children:[p.jsx(be,{variant:"outline",onClick:y,disabled:d,children:"Cancel"}),p.jsxs(be,{onClick:x,disabled:d,className:o==="approve"?"bg-green-600 hover:bg-green-700":"bg-red-600 hover:bg-red-700",children:[d?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):o==="approve"?p.jsx(qi,{className:"h-4 w-4 mr-2"}):p.jsx(o1,{className:"h-4 w-4 mr-2"}),o==="approve"?"Approve":"Request Changes"]})]})]})})]})}function ST({isOpen:e,onClose:t,documentTitle:n,currentVersion:r,onSubmit:i}){const[o,s]=k.useState(""),[l,u]=k.useState("normal"),[d,h]=k.useState(!1),[f,g]=k.useState(null),x=async()=>{h(!0),g(null);try{await i(o,l),y()}catch(v){g(v instanceof Error?v.message:"Failed to submit for review")}finally{h(!1)}},y=()=>{d||(s(""),u("normal"),g(null),t())};return p.jsx(vn,{open:e,onOpenChange:y,children:p.jsxs(an,{className:"sm:max-w-[425px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{children:["Publish “",n,"” (requires approval)"]}),p.jsxs(Qn,{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(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:f})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(Vt,{htmlFor:"priority",children:"Priority"}),p.jsxs(yo,{value:l,onValueChange:v=>u(v),disabled:d,children:[p.jsx($i,{id:"priority",children:p.jsx(bo,{placeholder:"Select priority"})}),p.jsxs(Vi,{children:[p.jsx(Kt,{value:"low",children:"Low"}),p.jsx(Kt,{value:"normal",children:"Normal"}),p.jsx(Kt,{value:"high",children:"High"}),p.jsx(Kt,{value:"urgent",children:"Urgent"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(Vt,{htmlFor:"note",children:"Note for Reviewer (optional)"}),p.jsx(vp,{id:"note",placeholder:"Add context or specific areas to review...",value:o,onChange:v=>s(v.target.value),disabled:d,className:"min-h-[100px]"})]})]}),p.jsxs(cr,{children:[p.jsx(be,{variant:"outline",onClick:y,disabled:d,children:"Cancel"}),p.jsxs(be,{onClick:x,disabled:d,children:[d?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(Sx,{className:"h-4 w-4 mr-2"}),"Submit for approval"]})]})]})})}function Vz(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var ay="ScrollArea",[CT]=Ci(ay),[Hz,ai]=CT(ay),ET=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[l,u]=k.useState(null),[d,h]=k.useState(null),[f,g]=k.useState(null),[x,y]=k.useState(null),[v,w]=k.useState(null),[C,N]=k.useState(0),[T,D]=k.useState(0),[A,_]=k.useState(!1),[I,P]=k.useState(!1),L=it(t,V=>u(V)),R=jc(i);return p.jsx(Hz,{scope:n,type:r,dir:R,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:h,content:f,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:A,onScrollbarXEnabledChange:_,scrollbarY:v,onScrollbarYChange:w,scrollbarYEnabled:I,onScrollbarYEnabledChange:P,onCornerWidthChange:N,onCornerHeightChange:D,children:p.jsx(Ye.div,{dir:R,...s,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});ET.displayName=ay;var NT="ScrollAreaViewport",TT=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=ai(NT,n),l=k.useRef(null),u=it(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(Ye.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,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})})]})});TT.displayName=NT;var Ji="ScrollAreaScrollbar",uy=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ai(Ji,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,l=e.orientation==="horizontal";return k.useEffect(()=>(l?o(!0):s(!0),()=>{l?o(!1):s(!1)}),[l,o,s]),i.type==="hover"?p.jsx(Uz,{...r,ref:t,forceMount:n}):i.type==="scroll"?p.jsx(Wz,{...r,ref:t,forceMount:n}):i.type==="auto"?p.jsx(AT,{...r,ref:t,forceMount:n}):i.type==="always"?p.jsx(cy,{...r,ref:t}):null});uy.displayName=Ji;var Uz=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ai(Ji,e.__scopeScrollArea),[o,s]=k.useState(!1);return k.useEffect(()=>{const l=i.scrollArea;let u=0;if(l){const d=()=>{window.clearTimeout(u),s(!0)},h=()=>{u=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),p.jsx(hr,{present:n||o,children:p.jsx(AT,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Wz=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ai(Ji,e.__scopeScrollArea),o=e.orientation==="horizontal",s=kp(()=>u("SCROLL_END"),100),[l,u]=Vz("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 k.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,i.scrollHideDelay,u]),k.useEffect(()=>{const d=i.viewport,h=o?"scrollLeft":"scrollTop";if(d){let f=d[h];const g=()=>{const x=d[h];f!==x&&(u("SCROLL"),s()),f=x};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[i.viewport,o,u,s]),p.jsx(hr,{present:n||l!=="hidden",children:p.jsx(cy,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ve(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:ve(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),AT=k.forwardRef((e,t)=>{const n=ai(Ji,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=k.useState(!1),l=e.orientation==="horizontal",u=kp(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?d:h)}},10);return ba(n.viewport,u),ba(n.content,u),p.jsx(hr,{present:r||o,children:p.jsx(cy,{"data-state":o?"visible":"hidden",...i,ref:t})})}),cy=k.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ai(Ji,e.__scopeScrollArea),o=k.useRef(null),s=k.useRef(0),[l,u]=k.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=RT(l.viewport,l.content),h={...r,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function f(g,x){return Xz(g,s.current,l,x)}return n==="horizontal"?p.jsx(qz,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollLeft,x=t2(g,l,i.dir);o.current.style.transform=`translate3d(${x}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(Kz,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollTop,x=t2(g,l);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=f(g))}}):null}),qz=k.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ai(Ji,e.__scopeScrollArea),[s,l]=k.useState(),u=k.useRef(null),d=it(t,u,o.onScrollbarXChange);return k.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),p.jsx(MT,{"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":wp(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),IT(g,f)&&h.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:th(s.paddingLeft),paddingEnd:th(s.paddingRight)}})}})}),Kz=k.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ai(Ji,e.__scopeScrollArea),[s,l]=k.useState(),u=k.useRef(null),d=it(t,u,o.onScrollbarYChange);return k.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),p.jsx(MT,{"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":wp(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),IT(g,f)&&h.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:th(s.paddingTop),paddingEnd:th(s.paddingBottom)}})}})}),[Gz,_T]=CT(Ji),MT=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:h,onResize:f,...g}=e,x=ai(Ji,n),[y,v]=k.useState(null),w=it(t,L=>v(L)),C=k.useRef(null),N=k.useRef(""),T=x.viewport,D=r.content-r.viewport,A=Tn(h),_=Tn(u),I=kp(f,10);function P(L){if(C.current){const R=L.clientX-C.current.left,V=L.clientY-C.current.top;d({x:R,y:V})}}return k.useEffect(()=>{const L=R=>{const V=R.target;(y==null?void 0:y.contains(V))&&A(R,D)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[T,y,D,A]),k.useEffect(_,[r,_]),ba(y,I),ba(x.content,I),p.jsx(Gz,{scope:n,scrollbar:y,hasThumb:i,onThumbChange:Tn(o),onThumbPointerUp:Tn(s),onThumbPositionChange:_,onThumbPointerDown:Tn(l),children:p.jsx(Ye.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:ve(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),C.current=y.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),P(L))}),onPointerMove:ve(e.onPointerMove,P),onPointerUp:ve(e.onPointerUp,L=>{const R=L.target;R.hasPointerCapture(L.pointerId)&&R.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=N.current,x.viewport&&(x.viewport.style.scrollBehavior=""),C.current=null})})})}),eh="ScrollAreaThumb",jT=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_T(eh,e.__scopeScrollArea);return p.jsx(hr,{present:n||i.hasThumb,children:p.jsx(Yz,{ref:t,...r})})}),Yz=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=ai(eh,n),s=_T(eh,n),{onThumbPositionChange:l}=s,u=it(t,f=>s.onThumbChange(f)),d=k.useRef(void 0),h=kp(()=>{d.current&&(d.current(),d.current=void 0)},100);return k.useEffect(()=>{const f=o.viewport;if(f){const g=()=>{if(h(),!d.current){const x=Qz(f,l);d.current=x,l()}};return l(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[o.viewport,h,l]),p.jsx(Ye.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ve(e.onPointerDownCapture,f=>{const x=f.target.getBoundingClientRect(),y=f.clientX-x.left,v=f.clientY-x.top;s.onThumbPointerDown({x:y,y:v})}),onPointerUp:ve(e.onPointerUp,s.onThumbPointerUp)})});jT.displayName=eh;var dy="ScrollAreaCorner",DT=k.forwardRef((e,t)=>{const n=ai(dy,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.jsx(Jz,{...e,ref:t}):null});DT.displayName=dy;var Jz=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ai(dy,n),[o,s]=k.useState(0),[l,u]=k.useState(0),d=!!(o&&l);return ba(i.scrollbarX,()=>{var f;const h=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(h),u(h)}),ba(i.scrollbarY,()=>{var f;const h=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(h),s(h)}),d?p.jsx(Ye.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 th(e){return e?parseInt(e,10):0}function RT(e,t){const n=e/t;return isNaN(n)?0:n}function wp(e){const t=RT(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Xz(e,t,n,r="ltr"){const i=wp(n),o=i/2,s=t||o,l=i-s,u=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 PT([u,d],f)(e)}function t2(e,t,n="ltr"){const r=wp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,l=o-r,u=n==="ltr"?[0,s]:[s*-1,0],d=b1(e,u);return PT([0,s],[0,l])(d)}function PT(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 IT(e,t){return e>0&&e<t}var Qz=(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 kp(e,t){const n=Tn(e),r=k.useRef(0);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),k.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ba(e,t){const n=Tn(t);ln(()=>{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 OT=ET,Zz=TT,eB=DT;const T1=k.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(OT,{ref:r,className:Ie("relative overflow-hidden",e),...n,children:[p.jsx(Zz,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(LT,{}),p.jsx(eB,{})]}));T1.displayName=OT.displayName;const LT=k.forwardRef(({className:e,orientation:t="vertical",...n},r)=>p.jsx(uy,{ref:r,orientation:t,className:Ie("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(jT,{className:"relative flex-1 rounded-full bg-border"})}));LT.displayName=uy.displayName;function n2(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function tB({versions:e,currentVersion:t,approvedVersion:n,loading:r=!1,onRestore:i,className:o}){var v;const[s,l]=k.useState(null),[u,d]=k.useState(null),[h,f]=k.useState(!1),g=async()=>{if(!(!u||!i)){f(!0);try{await i(u),d(null)}finally{f(!1)}}};if(r)return p.jsxs(Qt,{className:o,children:[p.jsx(yn,{className:"pb-3",children:p.jsxs(bn,{className:"text-sm font-medium flex items-center gap-2",children:[p.jsx(l1,{className:"h-4 w-4"}),"Version History"]})}),p.jsx(Zt,{children:p.jsx("div",{className:"flex items-center justify-center py-4",children:p.jsx(dt,{className:"h-5 w-5 animate-spin text-muted-foreground"})})})]});const x=(v=e.find(w=>w.version===t))==null?void 0:v.status,y=x==="approved"?"bg-green-100 text-green-800 border-green-200":x==="rejected"?"bg-red-100 text-red-800 border-red-200":x==="pending_review"?"bg-amber-100 text-amber-800 border-amber-200":"bg-muted text-muted-foreground";return p.jsxs(Qt,{className:o,children:[p.jsx(yn,{className:"pb-3",children:p.jsxs(bn,{className:"text-sm font-medium flex items-center gap-2",children:[p.jsx(l1,{className:"h-4 w-4"}),"Version History",x&&p.jsx(lr,{variant:"outline",className:`text-[10px] ${y}`,children:x.replace("_"," ")}),p.jsxs(lr,{variant:"secondary",className:"text-[10px] ml-auto",children:["v",t]})]})}),p.jsx(Zt,{children:e.length===0?p.jsx("div",{className:"text-center py-4 text-sm text-muted-foreground",children:"No version history"}):p.jsx(T1,{className:"h-[60vh] max-h-[480px] pr-2",children:p.jsx("div",{className:"space-y-1",children:e.map(w=>{const C=w.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 ",w.version,C&&p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-green-700",children:[p.jsx(qi,{className:"h-3 w-3"})," AI-active"]})]}),p.jsxs("div",{className:"text-xs text-muted-foreground break-words",children:[n2(w.editedAt)," · ",w.editedBy,w.changeNote&&` · ${w.changeNote}`]}),w.resolvedBy&&p.jsxs("div",{className:"text-xs text-muted-foreground break-words",children:[w.resolutionStatus==="rejected"?"Rejected by":"Approved by"," ",p.jsx("span",{className:"font-medium",children:w.resolvedBy})]})]}),p.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[w.content&&p.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>l(w),children:p.jsx(Tc,{className:"h-3.5 w-3.5"})}),i&&w.version!==t&&p.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>d(w.version),children:p.jsx(dk,{className:"h-3.5 w-3.5"})})]})]},w.version)})})})}),p.jsx(vn,{open:!!s,onOpenChange:()=>l(null),children:p.jsxs(an,{className:"max-w-2xl max-h-[80vh]",children:[p.jsxs(un,{children:[p.jsxs(cn,{children:["Version ",s==null?void 0:s.version," Preview"]}),p.jsxs(Qn,{children:[s&&n2(s.editedAt),(s==null?void 0:s.changeNote)&&` · ${s.changeNote}`]})]}),p.jsx(T1,{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(cr,{children:[p.jsx(be,{variant:"outline",onClick:()=>l(null),children:"Close"}),i&&s&&s.version!==t&&p.jsxs(be,{onClick:()=>{d(s.version),l(null)},children:[p.jsx(dk,{className:"h-4 w-4 mr-2"}),"Restore This Version"]})]})]})}),p.jsx(vn,{open:!!u,onOpenChange:()=>d(null),children:p.jsxs(an,{children:[p.jsxs(un,{children:[p.jsxs(cn,{children:["Restore Version ",u,"?"]}),p.jsxs(Qn,{children:["This will create a new version with the content from version ",u,". Your current content will be saved in the version history."]})]}),p.jsxs(cr,{children:[p.jsx(be,{variant:"outline",onClick:()=>d(null),disabled:h,children:"Cancel"}),p.jsx(be,{onClick:g,disabled:h,children:h?"Restoring...":"Restore"})]})]})})]})}const r2={draft:{label:"Draft",icon:gR,className:"bg-gray-100 text-gray-700 border-gray-200"},pending_review:{label:"Pending Review",icon:Bf,className:"bg-amber-100 text-amber-700 border-amber-200"},approved:{label:"Approved",icon:qi,className:"bg-green-100 text-green-700 border-green-200"},published:{label:"Published",icon:qi,className:"bg-green-100 text-green-700 border-green-200"},rejected:{label:"Rejected",icon:o1,className:"bg-red-100 text-red-700 border-red-200"},external_edit_pending:{label:"External Edit",icon:$f,className:"bg-orange-100 text-orange-700 border-orange-200"}};function nB({status:e,approvedVersion:t,currentVersion:n,showIcon:r=!0,size:i="default",className:o}){const s=r2[e]||r2.draft,l=s.icon,u=(e==="approved"||e==="published")&&t&&n&&t<n;return p.jsxs(lr,{variant:"outline",className:Ie("!rounded-sm",s.className,i==="sm"&&"text-[10px] px-1.5 py-0",o),children:[r&&p.jsx(l,{className:Ie("mr-1",i==="sm"?"h-3 w-3":"h-3.5 w-3.5")}),s.label,u&&p.jsxs("span",{className:"ml-1 text-[10px] opacity-75",children:["(v",t,")"]})]})}function rB({patch:e,className:t}){const n=e.split(/\r?\n/);return p.jsx("pre",{className:Ie("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:iB(r),children:p.jsx("code",{className:"block px-3 whitespace-pre",children:r||" "})},i))})}function iB(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 oB({nestId:e,nodeId:t,pending:n,onResolved:r}){const[i,o]=k.useState(null),[s,l]=k.useState(!1),[u,d]=k.useState(""),[h,f]=k.useState(null),[g,x]=k.useState(null),y=async()=>{o("approve"),x(null);try{await l8(e,t,n.suggestion_id),r()}catch(C){x(C.message||"Approval failed")}finally{o(null)}},v=async()=>{if(!u.trim()){x("Rejection reason is required");return}o("reject"),x(null);try{await a8(e,t,n.suggestion_id,u.trim()),r()}catch(C){x(C.message||"Rejection failed")}finally{o(null)}},w=async()=>{if(h){f(null);return}o("view"),x(null);try{const{entry:C}=await s8(e,t,n.suggestion_id);f(C)}catch(C){x(C.message||"Failed to load diff")}finally{o(null)}};return p.jsxs(Yn,{className:"border-orange-300 bg-orange-50 dark:bg-orange-950/30",children:[p.jsx($f,{className:"h-4 w-4 text-orange-700 dark:text-orange-400"}),p.jsxs(Jn,{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(be,{size:"sm",onClick:y,disabled:i!==null,"data-testid":"external-edit-approve",children:[i==="approve"?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Approve change"]}),p.jsx(be,{size:"sm",variant:"outline",onClick:()=>l(C=>!C),disabled:i!==null,"data-testid":"external-edit-reject-toggle",children:"Reject"}),p.jsxs(be,{size:"sm",variant:"ghost",onClick:w,disabled:i!==null,"data-testid":"external-edit-view-diff",children:[i==="view"?p.jsx(dt,{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(vp,{value:u,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(be,{size:"sm",variant:"destructive",onClick:v,disabled:i!==null||!u.trim(),"data-testid":"external-edit-reject-confirm",children:[i==="reject"?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Confirm reject"]}),p.jsx(be,{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(rB,{patch:h.patch})})]})]})}function Fn(e){this.content=e}Fn.prototype={constructor:Fn,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 Fn(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 Fn(n)},addToStart:function(e,t){return new Fn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Fn(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 Fn(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=Fn.from(e),e.size?new Fn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Fn.from(e),e.size?new Fn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Fn.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}};Fn.from=function(e){if(e instanceof Fn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Fn(t)};function FT(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=FT(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function zT(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),u=s.nodeSize;if(s==l){n-=u,r-=u;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=zT(s.content,l.content,n-1,r-1);if(d)return d}n-=u,r-=u}}class se{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 u=this.content[s],d=l+u.nodeSize;if(d>t&&r(u,i+l,o||null,s)!==!1&&u.content.size){let h=l+1;u.nodesBetween(Math.max(0,t-h),Math.min(u.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,u)=>{let d=l.isText?l.text.slice(Math.max(t,u)-u,n-u):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 se(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],u=s+l.nodeSize;u>t&&((s<t||u>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=u}return new se(r,i)}cutByIndex(t,n){return t==n?se.empty:t==0&&n==this.content.length?this:new se(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 se(i,o)}addToStart(t){return new se([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new se(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 FT(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return zT(this,t,n,r)}findIndex(t){if(t==0)return cf(0,t);if(t==this.size)return cf(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?cf(n+1,o):cf(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 se.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new se(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return se.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 se(n||t,r)}static from(t){if(!t)return se.empty;if(t instanceof se)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new se([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}se.empty=new se([],0);const Z0={index:0,offset:0};function cf(e,t){return Z0.index=e,Z0.offset=t,Z0}function nh(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(!nh(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!nh(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let pt=class A1{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&&nh(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 A1.none;if(t instanceof A1)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};pt.none=[];class rh extends Error{}class Se{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=$T(this.content,t+this.openStart,n);return r&&new Se(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Se(BT(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 Se.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 Se(se.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 Se(t,r,i)}}Se.empty=new Se(se.empty,0,0);function BT(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(BT(o.content,t-i-1,n-i-1)))}function $T(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=$T(s.content,t-o-1,n,s);return l&&e.replaceChild(i,s.copy(l))}function sB(e,t,n){if(n.openStart>e.depth)throw new rh("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new rh("Inconsistent open depths");return VT(e,t,n,0)}function VT(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=VT(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 rl(s,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}else{let{start:s,end:l}=lB(n,e);return rl(o,UT(e,s,l,t,r))}else return rl(o,ih(e,t,r))}function HT(e,t){if(!t.type.compatibleContent(e.type))throw new rh("Cannot join "+t.type.name+" onto "+e.type.name)}function _1(e,t,n){let r=e.node(n);return HT(r,t.node(n)),r}function nl(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 Bu(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&&(nl(e.nodeAfter,r),o++));for(let l=o;l<s;l++)nl(i.child(l),r);t&&t.depth==n&&t.textOffset&&nl(t.nodeBefore,r)}function rl(e,t){return e.type.checkContent(t),e.copy(t)}function UT(e,t,n,r,i){let o=e.depth>i&&_1(e,t,i+1),s=r.depth>i&&_1(n,r,i+1),l=[];return Bu(null,e,i,l),o&&s&&t.index(i)==n.index(i)?(HT(o,s),nl(rl(o,UT(e,t,n,r,i+1)),l)):(o&&nl(rl(o,ih(e,t,i+1)),l),Bu(t,n,i,l),s&&nl(rl(s,ih(n,r,i+1)),l)),Bu(r,null,i,l),new se(l)}function ih(e,t,n){let r=[];if(Bu(null,e,n,r),e.depth>n){let i=_1(e,t,n+1);nl(rl(i,ih(e,t,n+1)),r)}return Bu(t,null,n,r),new se(r)}function lB(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(se.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 pt.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 oh(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:u}=s.content.findIndex(o),d=o-u;if(r.push(s,l,i+u),!d||(s=s.child(l),s.isText))break;o=d-1,i+=u+1}return new sc(n,r,o)}static resolveCached(t,n){let r=i2.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 i2.set(t,r=new aB);let i=r.elts[r.i]=sc.resolve(t,n);return r.i=(r.i+1)%uB,i}}class aB{constructor(){this.elts=[],this.i=0}}const uB=12,i2=new WeakMap;class oh{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 cB=Object.create(null);let cs=class M1{constructor(t,n,r,i=pt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||se.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&&nh(this.attrs,n||t.defaultAttrs||cB)&&pt.sameSet(this.marks,r||pt.none)}copy(t=null){return t==this.content?this:new M1(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new M1(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 Se.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 Se(d,i.depth-s,o.depth-s)}replace(t,n,r){return sB(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()+")"),WT(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=se.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 u=i;u<o;u++)if(!this.type.allowsMarks(r.child(u).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=pt.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(!pt.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=se.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};cs.prototype.text=void 0;class sh extends cs{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):WT(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 sh(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new sh(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 WT(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class fl{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new dB(t,n);if(r.next==null)return fl.empty;let i=qT(r);r.next&&r.err("Unexpected trailing text");let o=yB(xB(i));return bB(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 u=s.matchFragment(t,r);if(u&&(!n||u.validEnd))return se.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:u}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||u.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(`
|
|
463
|
+
`)}}fl.empty=new fl(!0);class dB{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 qT(e){let t=[];do t.push(fB(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function fB(e){let t=[];do t.push(hB(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function hB(e){let t=gB(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=pB(e,t);else break;return t}function o2(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function pB(e,t){let n=o2(e),r=n;return e.eat(",")&&(e.next!="}"?r=o2(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function mB(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 gB(e){if(e.eat("(")){let t=qT(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=mB(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 xB(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,l,u){let d={term:u,to:l};return t[s].push(d),d}function i(s,l){s.forEach(u=>u.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((u,d)=>u.concat(o(d,l)),[]);if(s.type=="seq")for(let u=0;;u++){let d=o(s.exprs[u],l);if(u==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let u=n();return r(l,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,l),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let u=l;for(let d=0;d<s.min;d++){let h=n();i(o(s.expr,u),h),u=h}if(s.max==-1)i(o(s.expr,u),u);else for(let d=s.min;d<s.max;d++){let h=n();r(u,h),i(o(s.expr,u),h),u=h}return[r(u)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function KT(e,t){return t-e}function s2(e,t){let n=[];return r(t),n.sort(KT);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:u}=o[s];!l&&n.indexOf(u)==-1&&r(u)}}}function yB(e){let t=Object.create(null);return n(s2(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let h=0;h<i.length;h++)i[h][0]==l&&(d=i[h][1]);s2(e,u).forEach(h=>{d||i.push([l,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let o=t[r.join(",")]=new fl(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(KT);o.next.push({type:i[s][0],next:t[l.join(",")]||n(l)})}return o}}function bB(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:u,next:d}=i.next[l];s.push(u.name),o&&!(u.isText||u.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 GT(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 YT(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 JT(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 XT(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new wB(e,r,t[r]);return n}let l2=class QT{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=XT(t,r.attrs),this.defaultAttrs=GT(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==fl.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:YT(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new cs(this,this.computeAttrs(t),se.from(n),pt.setFrom(r))}createChecked(t=null,n,r){return n=se.from(n),this.checkContent(n),new cs(this,this.computeAttrs(t),n,pt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=se.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(se.empty,!0);return o?new cs(this,t,n.append(o),pt.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){JT(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:pt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,s)=>r[o]=new QT(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 vB(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 wB{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?vB(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Sp{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=XT(t,i.attrs),this.excluded=null;let o=GT(this.attrs);this.instance=o?new pt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new pt(this,YT(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new Sp(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){JT(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}let fy=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=Fn.from(t.nodes),n.marks=Fn.from(t.marks||{}),this.nodes=l2.compile(this.spec.nodes,this),this.marks=Sp.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]=fl.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?a2(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==""?[]:a2(this,s.split(" "))}this.nodeFromJSON=i=>cs.fromJSON(this,i),this.markFromJSON=i=>pt.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 l2){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 sh(r,r.defaultAttrs,t,pt.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 a2(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 u=e.marks[l];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function kB(e){return e.tag!=null}function SB(e){return e.style!=null}let ca=class j1{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(kB(i))this.tags.push(i);else if(SB(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 c2(this,n,!1);return r.addAll(t,pt.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new c2(this,n,!0);return r.addAll(t,pt.none,n.from,n.to),Se.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(NB(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 u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||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=d2(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=d2(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new j1(t,j1.schemaRules(t)))}};const ZT={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},CB={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},eA={ol:!0,ul:!0},lc=1,D1=2,$u=4;function u2(e,t,n){return t!=null?(t?lc:0)|(t==="full"?D1:0):e&&e.whitespace=="pre"?lc|D1:n&~$u}class df{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=pt.none,this.match=o||(s&$u?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(se.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&lc)){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=se.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(se.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&&!ZT.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class c2{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=u2(null,n.preserveWhitespace,0)|(r?$u:0);i?o=new df(i.type,i.attrs,pt.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new df(null,null,pt.none,!0,null,s):o=new df(t.schema.topNodeType,null,pt.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&D1?"full":this.localPreserveWS||(i.options&lc)>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,`
|
|
464
|
+
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let u=0;u<l.length;u++)u&&this.insertNode(s.linebreakReplacement.create(),n,!0),l[u]&&this.insertNode(s.text(l[u]),n,!/\S/.test(l[u]));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],u=t.previousSibling;(!l||u&&u.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;eA.hasOwnProperty(s)&&this.parser.normalizeLists&&EB(t);let u=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(l=this.parser.matchTag(t,this,r));e:if(u?u.ignore:CB.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(t=u.skip);let d,h=this.needsBlock;if(ZT.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=u&&u.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,u,d,u.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(`
|
|
465
|
+
`),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 u=this.parser.matchStyle(o,s,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;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 u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.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(u=>this.insertNode(u,r,!1));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u,r),this.findAround(t,u,!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 u=this.nodes[s],d=u.findWrapping(t);if(d&&(!i||i.length>d.length+l)&&(i=d,o=u,!d.length))break;if(u.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=pt.none;for(let l of i.concat(t.marks))(o.type?o.type.allowsMarkType(l.type):f2(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=u2(t,o,s.options);s.options&$u&&s.content.length==0&&(l|=$u);let u=pt.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):f2(d.type,t))?(u=d.addToSet(u),!1):!0),this.nodes.push(new df(t,n,u,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|=lc)}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,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let h=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!h||h.name!=d&&!h.isInGroup(d))return!1;u--}}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 EB(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&eA.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function NB(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function d2(e){let t={};for(let n in e)t[n]=e[n];return t}function f2(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 u=0;u<l.edgeCount;u++){let{type:d,next:h}=l.edge(u);if(d==t||o.indexOf(h)<0&&s(h))return!0}};if(s(i.contentMatch))return!0}}class kl{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=eg(n).createDocumentFragment());let i=r,o=[];return t.forEach(s=>{if(o.length||s.marks.length){let l=0,u=0;for(;l<o.length&&u<s.marks.length;){let d=s.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,u++}for(;l<o.length;)i=o.pop()[1];for(;u<s.marks.length;){let d=s.marks[u++],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}=Pf(eg(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&&Pf(eg(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Pf(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new kl(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=h2(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return h2(t.marks)}}function h2(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function eg(e){return e.document||window.document}const p2=new WeakMap;function TB(e){let t=p2.get(e);return t===void 0&&p2.set(e,t=AB(e)),t}function AB(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 Pf(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=TB(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,u=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?u.setAttributeNS(f.slice(0,g),f.slice(g+1),d[f]):f=="style"&&u.style?u.style.cssText=d[f]:u.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:u,contentDOM:u}}else{let{dom:x,contentDOM:y}=Pf(e,g,n,r);if(u.appendChild(x),y){if(l)throw new RangeError("Multiple content holes");l=y}}}return{dom:u,contentDOM:l}}const tA=65535,nA=Math.pow(2,16);function _B(e,t){return e+t*nA}function m2(e){return e&tA}function MB(e){return(e-(e&tA))/nA}const rA=1,iA=2,If=4,oA=8;class R1{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&oA)>0}get deletedBefore(){return(this.delInfo&(rA|If))>0}get deletedAfter(){return(this.delInfo&(iA|If))>0}get deletedAcross(){return(this.delInfo&If)>0}}class Br{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Br.empty)return Br.empty}recover(t){let n=0,r=m2(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+MB(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 u=this.ranges[l]-(this.inverted?i:0);if(u>t)break;let d=this.ranges[l+o],h=this.ranges[l+s],f=u+d;if(t<=f){let g=d?t==u?-1:t==f?1:n:n,x=u+i+(g<0?0:h);if(r)return x;let y=t==(n<0?u:f)?null:_B(l/3,t-u),v=t==u?iA:t==f?rA:If;return(n<0?t!=u:t!=f)&&(v|=oA),new R1(x,v,y)}i+=h-d}return r?t+i:new R1(t+i,0,null)}touches(t,n){let r=0,i=m2(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>t)break;let d=this.ranges[l+o],h=u+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),u=s+(this.inverted?0:o),d=this.ranges[i+n],h=this.ranges[i+r];t(l,l+d,u,u+h),o+=h-d}}invert(){return new Br(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Br.empty:new Br(t<0?[0,-t,0]:[0,0,t])}}Br.empty=new Br([]);class ac{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 ac(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 ac;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 u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this._maps[u].recover(l.recover);continue}}i|=l.delInfo,t=l.pos}return r?t:new R1(t,i,null)}}const tg=Object.create(null);class er{getMap(){return Br.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=tg[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 tg)throw new RangeError("Duplicate use of step JSON ID "+t);return tg[t]=n,n.prototype.jsonID=t,n}}class on{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new on(t,null)}static fail(t){return new on(null,t)}static fromReplace(t,n,r,i){try{return on.ok(t.replace(n,r,i))}catch(o){if(o instanceof rh)return on.fail(o.message);throw o}}}function hy(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(hy(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return se.fromArray(r)}class ss extends er{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 Se(hy(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 on.fromReplace(t,this.from,this.to,o)}invert(){return new bi(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 ss(n.pos,r.pos,this.mark)}merge(t){return t instanceof ss&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ss(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 ss(n.from,n.to,t.markFromJSON(n.mark))}}er.jsonID("addMark",ss);class bi extends er{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 Se(hy(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return on.fromReplace(t,this.from,this.to,r)}invert(){return new ss(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 bi(n.pos,r.pos,this.mark)}merge(t){return t instanceof bi&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new bi(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 bi(n.from,n.to,t.markFromJSON(n.mark))}}er.jsonID("removeMark",bi);class ls extends er{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return on.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return on.fromReplace(t,this.pos,this.pos+1,new Se(se.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 ls(this.pos,n.marks[i]);return new ls(this.pos,this.mark)}}return new hl(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ls(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 ls(n.pos,t.markFromJSON(n.mark))}}er.jsonID("addNodeMark",ls);class hl extends er{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return on.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return on.fromReplace(t,this.pos,this.pos+1,new Se(se.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ls(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new hl(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 hl(n.pos,t.markFromJSON(n.mark))}}er.jsonID("removeNodeMark",hl);class rn extends er{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&P1(t,this.from,this.to)?on.fail("Structure replace would overwrite content"):on.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Br([this.from,this.to-this.from,this.slice.size])}invert(t){return new rn(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&&rn.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new rn(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof rn)||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?Se.empty:new Se(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new rn(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?Se.empty:new Se(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new rn(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 rn(n.from,n.to,Se.fromJSON(t,n.slice),!!n.structure)}}rn.MAP_BIAS=1;er.jsonID("replace",rn);class _n extends er{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&&(P1(t,this.from,this.gapFrom)||P1(t,this.gapTo,this.to)))return on.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return on.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?on.fromReplace(t,this.from,this.to,r):on.fail("Content does not fit in gap")}getMap(){return new Br([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 _n(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 _n(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 _n(n.from,n.to,n.gapFrom,n.gapTo,Se.fromJSON(t,n.slice),n.insert,!!n.structure)}}er.jsonID("replaceAround",_n);function P1(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 jB(e,t,n,r){let i=[],o=[],s,l;e.doc.nodesBetween(t,n,(u,d,h)=>{if(!u.isInline)return;let f=u.marks;if(!r.isInSet(f)&&h.type.allowsMarkType(r.type)){let g=Math.max(d,t),x=Math.min(d+u.nodeSize,n),y=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(y)||(s&&s.to==g&&s.mark.eq(f[v])?s.to=x:i.push(s=new bi(g,x,f[v])));l&&l.to==g?l.to=x:o.push(l=new ss(g,x,r))}}),i.forEach(u=>e.step(u)),o.forEach(u=>e.step(u))}function DB(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Sp){let d=s.marks,h;for(;h=r.isInSet(d);)(u||(u=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let d=Math.min(l+s.nodeSize,n);for(let h=0;h<u.length;h++){let f=u[h],g;for(let x=0;x<i.length;x++){let y=i[x];y.step==o-1&&f.eq(i[x].style)&&(g=y)}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 bi(s.from,s.to,s.style)))}function py(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],l=t+1;for(let u=0;u<o.childCount;u++){let d=o.child(u),h=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new rn(l,h,Se.empty));else{r=f;for(let g=0;g<d.marks.length;g++)n.allowsMarkType(d.marks[g].type)||e.step(new bi(l,h,d.marks[g]));if(i&&d.isText&&n.whitespace!="pre"){let g,x=/\r?\n|\r/g,y;for(;g=x.exec(d.text);)y||(y=new Se(se.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new rn(l+g.index,l+g.index+g[0].length,y))}}l=h}if(!r.validEnd){let u=r.fillBefore(se.empty,!0);e.replace(l,l,new Se(u,0,0))}for(let u=s.length-1;u>=0;u--)e.step(s[u])}function RB(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Oa(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,u=e.$to.indexAfter(r)-o;if(r<e.depth&&s.canReplace(l,u,n))return r;if(r==0||s.type.spec.isolating||!RB(s,l,u))break;l&&(i=1),u<s.childCount&&(o=1)}return null}function PB(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),l=i.after(o+1),u=s,d=l,h=se.empty,f=0;for(let y=o,v=!1;y>n;y--)v||r.index(y)>0?(v=!0,h=se.from(r.node(y).copy(h)),f++):u--;let g=se.empty,x=0;for(let y=o,v=!1;y>n;y--)v||i.after(y+1)<i.end(y)?(v=!0,g=se.from(i.node(y).copy(g)),x++):d++;e.step(new _n(u,d,s,l,new Se(h.append(g),f,x),h.size-f,!0))}function my(e,t,n=null,r=e){let i=IB(e,t),o=i&&OB(r,t);return o?i.map(g2).concat({type:t,attrs:n}).concat(o.map(g2)):null}function g2(e){return{type:e,attrs:null}}function IB(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 OB(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 u=(s.length?s[s.length-1]:t).contentMatch;for(let d=r;u&&d<i;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:s}function LB(e,t,n){let r=se.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=se.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new _n(i,o,i,o,new Se(r,0,0),n.length,!0))}function FB(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 u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&zB(e.doc,e.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let x=r.whitespace=="pre",y=!!r.contentMatch.matchType(r.schema.linebreakReplacement);x&&!y?d=!1:!x&&y&&(d=!0)}d===!1&&lA(e,s,l,o),py(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 _n(f,g,f+1,g-1,new Se(se.from(r.create(u,null,s.marks)),0,0),1,!0)),d===!0&&sA(e,s,l,o),!1}})}function sA(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 u=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(u,u+1,t.type.schema.linebreakReplacement.create())}}})}function lA(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(`
|
|
466
|
+
`))}})}function zB(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function BB(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 _n(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Se(se.from(s),0,0),1,!0))}function wo(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 x=f.content.cutByIndex(g,f.childCount),y=r&&r[h+1];y&&(x=x.replaceChild(0,y.type.create(y.attrs)));let v=r&&r[h]||f;if(!f.canReplace(g+1,f.childCount)||!v.type.validContent(x))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function $B(e,t,n=1,r){let i=e.doc.resolve(t),o=se.empty,s=se.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=se.from(i.node(l).copy(o));let h=r&&r[d];s=se.from(h?h.type.create(h.attrs,s):i.node(l).copy(s))}e.step(new rn(t,t,new Se(o.append(s),n,n),!0))}function Ts(e,t){let n=e.resolve(t),r=n.index();return aA(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function VB(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 aA(e,t){return!!(e&&t&&!e.isLeaf&&VB(e,t))}function Cp(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&&aA(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 HB(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);lA(e,h.node(),h.before(),l)}s.inlineContent&&py(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let u=e.mapping.slice(l),d=u.map(t-n);if(e.step(new rn(d,u.map(t+n,-1),Se.empty,!0)),r===!0){let h=e.doc.resolve(d);sA(e,h.node(),h.before(),e.steps.length)}return e}function UB(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 uA(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,u=r.index(s)+(l>0?1:0),d=r.node(s),h=!1;if(o==1)h=d.canReplace(u,u,i);else{let f=d.contentMatchAt(u).findWrapping(i.firstChild.type);h=f&&d.canReplaceWith(u,u,f[0])}if(h)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Ep(e,t,n=t,r=Se.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return cA(i,o,r)?new rn(t,n,r):new WB(i,o,r).fit()}function cA(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class WB{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=se.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=se.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 u=new Se(o,s,l);return t>-1?new _n(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new rn(r.pos,i.pos,u):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=ng(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:u,match:d}=this.frontier[l],h,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(se.from(s),!1)):o&&u.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=ng(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Se(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=ng(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Se(Iu(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Se(Iu(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 v=0;v<o.length;v++)this.openFrontierNode(o[v]);let s=this.unplaced,l=r?r.content:s.content,u=s.openStart-t,d=0,h=[],{match:f,type:g}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)h.push(i.child(v));f=f.matchFragment(i)}let x=l.size+t-(s.content.size-s.openEnd);for(;d<l.childCount;){let v=l.child(d),w=f.matchType(v.type);if(!w)break;d++,(d>1||u==0||v.content.size)&&(f=w,h.push(dA(v.mark(g.allowedMarks(v.marks)),d==1?u:0,d==l.childCount?x:-1)))}let y=d==l.childCount;y||(x=-1),this.placed=Ou(this.placed,n,se.from(h)),this.frontier[n].match=f,y&&x<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,w=l;v<x;v++){let C=w.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),w=C.content}this.unplaced=y?t==0?Se.empty:new Se(Iu(s.content,t-1,1),t-1,x<0?s.openEnd:t-1):new Se(Iu(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||!rg(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=rg(t,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:u,type:d}=this.frontier[l],h=rg(t,l,d,u,!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=Ou(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=Ou(this.placed,this.depth,se.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(se.empty,!0);n.childCount&&(this.placed=Ou(this.placed,this.frontier.length,n))}}function Iu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Iu(e.firstChild.content,t-1,n)))}function Ou(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ou(e.lastChild.content,t-1,n)))}function ng(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function dA(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,dA(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(se.empty,!0)))),e.copy(r)}function rg(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&&!qB(n,o.content,s)?l:null}function qB(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function KB(e){return e.spec.defining||e.spec.definingForContent}function GB(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(cA(i,o,r))return e.step(new rn(t,n,r));let s=hA(i,o);s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let g=i.depth,x=i.pos-1;g>0;g--,x--){let y=i.node(g).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;s.indexOf(g)>-1?l=g:i.before(g)==x&&s.splice(1,0,-g)}let u=s.indexOf(l),d=[],h=r.openStart;for(let g=r.content,x=0;;x++){let y=g.firstChild;if(d.push(y),x==r.openStart)break;g=y.content}for(let g=h-1;g>=0;g--){let x=d[g],y=KB(x.type);if(y&&!x.sameMarkup(i.node(Math.abs(l)-1)))h=g;else if(y||!x.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let x=(g+h+1)%(r.openStart+1),y=d[x];if(y)for(let v=0;v<s.length;v++){let w=s[(v+u)%s.length],C=!0;w<0&&(C=!1,w=-w);let N=i.node(w-1),T=i.index(w-1);if(N.canReplaceWith(T,T,y.type,y.marks))return e.replace(i.before(w),C?o.after(w):n,new Se(fA(r.content,0,r.openStart,x),x,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 x=s[g];x<0||(t=i.before(x),n=o.after(x))}}function fA(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(fA(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(se.empty,!0))}return e}function YB(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=UB(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new Se(se.from(r),0,0))}function JB(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 u=r.depth;u>s;u--)r.node(u).type.spec.isolating&&(l=!0);for(let u=i.depth;u>s;u--)i.node(u).type.spec.isolating&&(l=!0);if(!l){for(let u=r.depth;u>0&&t==r.start(u);u--)t=r.before(u);for(let u=i.depth;u>0&&n==i.start(u);u--)n=i.before(u);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=hA(r,i);for(let s=0;s<o.length;s++){let l=o[s],u=s==o.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return e.delete(r.start(l),i.end(l));if(l>0&&(u||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 hA(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 da extends er{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 on.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 on.fromReplace(t,this.pos,this.pos+1,new Se(se.from(i),0,n.isLeaf?0:1))}getMap(){return Br.empty}invert(t){return new da(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 da(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 da(n.pos,n.attr,n.value)}}er.jsonID("attr",da);class uc extends er{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 on.ok(r)}getMap(){return Br.empty}invert(t){return new uc(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 uc(n.attr,n.value)}}er.jsonID("docAttr",uc);let va=class extends Error{};va=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};va.prototype=Object.create(Error.prototype);va.prototype.constructor=va;va.prototype.name="TransformError";class pA{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ac}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new va(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,u)=>{t=Math.min(t,l),n=Math.max(n,u)})}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=Se.empty){let i=Ep(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Se(se.from(r),0,0))}delete(t,n){return this.replace(t,n,Se.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return GB(this,t,n,r),this}replaceRangeWith(t,n,r){return YB(this,t,n,r),this}deleteRange(t,n){return JB(this,t,n),this}lift(t,n){return PB(this,t,n),this}join(t,n=1){return HB(this,t,n),this}wrap(t,n){return LB(this,t,n),this}setBlockType(t,n=t,r,i=null){return FB(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return BB(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new da(t,n,r)),this}setDocAttribute(t,n){return this.step(new uc(t,n)),this}addNodeMark(t,n){return this.step(new ls(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 pt)n.isInSet(r.marks)&&this.step(new hl(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new hl(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 $B(this,t,n,r),this}addMark(t,n,r){return jB(this,t,n,r),this}removeMark(t,n,r){return DB(this,t,n,r),this}clearIncompatible(t,n,r){return py(this,t,n,r),this}}const ig=Object.create(null);class Qe{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new XB(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=Se.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:u,$to:d}=s[l],h=t.mapping.slice(o);t.replaceRange(h.map(u.pos),h.map(d.pos),l?Se.empty:n),l==0&&b2(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],u=t.mapping.slice(r),d=u.map(s.pos),h=u.map(l.pos);o?t.deleteRange(d,h):(t.replaceRangeWith(d,h,n),b2(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Ge(t):na(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?na(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):na(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 Vr(t.node(0))}static atStart(t){return na(t,t,0,0,1)||new Vr(t)}static atEnd(t){return na(t,t,t.content.size,t.childCount,-1)||new Vr(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ig[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 ig)throw new RangeError("Duplicate use of selection JSON ID "+t);return ig[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ge.between(this.$anchor,this.$head).getBookmark()}}Qe.prototype.visible=!0;class XB{constructor(t,n){this.$from=t,this.$to=n}}let x2=!1;function y2(e){!x2&&!e.parent.inlineContent&&(x2=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ge extends Qe{constructor(t,n=t){y2(t),y2(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 Qe.near(r);let i=t.resolve(n.map(this.anchor));return new Ge(i.parent.inlineContent?i:r,r)}replace(t,n=Se.empty){if(super.replace(t,n),n==Se.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ge&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Np(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 Ge(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=Qe.findFrom(n,r,!0)||Qe.findFrom(n,-r,!0);if(o)n=o.$head;else return Qe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Qe.findFrom(t,-r,!0)||Qe.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Ge(t,n)}}Qe.jsonID("text",Ge);class Np{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Np(t.map(this.anchor),t.map(this.head))}resolve(t){return Ge.between(t.resolve(this.anchor),t.resolve(this.head))}}class ze extends Qe{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?Qe.near(o):new ze(o)}content(){return new Se(se.from(this.node),0,0)}eq(t){return t instanceof ze&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new gy(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ze(t.resolve(n.anchor))}static create(t,n){return new ze(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ze.prototype.visible=!1;Qe.jsonID("node",ze);class gy{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Np(r,r):new gy(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ze.isSelectable(r)?new ze(n):Qe.near(n)}}class Vr extends Qe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Se.empty){if(n==Se.empty){t.delete(0,t.doc.content.size);let r=Qe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Vr(t)}map(t){return new Vr(t)}eq(t){return t instanceof Vr}getBookmark(){return QB}}Qe.jsonID("all",Vr);const QB={map(){return this},resolve(e){return new Vr(e)}};function na(e,t,n,r,i,o=!1){if(t.inlineContent)return Ge.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&&ze.isSelectable(l))return ze.create(e,n-(i<0?l.nodeSize:0))}else{let u=na(e,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function b2(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof rn||i instanceof _n))return;let o=e.mapping.maps[r],s;o.forEach((l,u,d,h)=>{s==null&&(s=h)}),e.setSelection(Qe.near(e.doc.resolve(s),n))}const v2=1,ff=2,w2=4;class ZB extends pA{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|v2)&~ff,this.storedMarks=null,this}get selectionSet(){return(this.updated&v2)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ff,this}ensureMarks(t){return pt.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&ff)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ff,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)||pt.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(Qe.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|=w2,this}get scrolledIntoView(){return(this.updated&w2)>0}}function k2(e,t){return!t||!e?e:e.bind(t)}class Lu{constructor(t,n,r){this.name=t,this.init=k2(n.init,r),this.apply=k2(n.apply,r)}}const e$=[new Lu("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Lu("selection",{init(e,t){return e.selection||Qe.atStart(t.doc)},apply(e){return e.selection}}),new Lu("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Lu("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class og{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=e$.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 Lu(r.key,r.spec.state,r))})}}class sa{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 u=i?i[s].n:0,d=i?i[s].state:this,h=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):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 sa(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 ZB(this)}static create(t){let n=new og(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new sa(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 og(this.schema,t.plugins),r=n.fields,i=new sa(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 og(t.schema,t.plugins),o=new sa(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=cs.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=Qe.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 u=r[l],d=u.spec.state;if(u.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(u,t,n[l],o);return}}o[s.name]=s.init(t,o)}}),o}}function mA(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=mA(i,t,{})),n[r]=i}return n}class vt{constructor(t){this.spec=t,this.props={},t.props&&mA(t.props,this,this.props),this.key=t.key?t.key.key:gA("plugin")}getState(t){return t[this.key]}}const sg=Object.create(null);function gA(e){return e in sg?e+"$"+ ++sg[e]:(sg[e]=0,e+"$")}class Ht{constructor(t="key"){this.key=gA(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const xy=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function xA(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const yA=(e,t,n)=>{let r=xA(e,n);if(!r)return!1;let i=yy(r);if(!i){let s=r.blockRange(),l=s&&Oa(s);return l==null?!1:(t&&t(e.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(TA(e,i,t,-1))return!0;if(r.parent.content.size==0&&(wa(o,"end")||ze.isSelectable(o)))for(let s=r.depth;;s--){let l=Ep(e.doc,r.before(s),r.after(s),Se.empty);if(l&&l.slice.size<l.to-l.from){if(t){let u=e.tr.step(l);u.setSelection(wa(o,"end")?Qe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ze.create(u.doc,i.pos-o.nodeSize)),t(u.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},t$=(e,t,n)=>{let r=xA(e,n);if(!r)return!1;let i=yy(r);return i?bA(e,i,t):!1},n$=(e,t,n)=>{let r=wA(e,n);if(!r)return!1;let i=by(r);return i?bA(e,i,t):!1};function bA(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,u=t.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let h=l.firstChild;if(!h)return!1;l=h}let d=Ep(e.doc,o,u,Se.empty);if(!d||d.from!=o||d instanceof rn&&d.slice.size>=u-o)return!1;if(n){let h=e.tr.step(d);h.setSelection(Ge.create(h.doc,o)),n(h.scrollIntoView())}return!0}function wa(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 vA=(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=yy(r)}let s=o&&o.nodeBefore;return!s||!ze.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ze.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function yy(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 wA(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const kA=(e,t,n)=>{let r=wA(e,n);if(!r)return!1;let i=by(r);if(!i)return!1;let o=i.nodeAfter;if(TA(e,i,t,1))return!0;if(r.parent.content.size==0&&(wa(o,"start")||ze.isSelectable(o))){let s=Ep(e.doc,r.before(),r.after(),Se.empty);if(s&&s.slice.size<s.to-s.from){if(t){let l=e.tr.step(s);l.setSelection(wa(o,"start")?Qe.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):ze.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},SA=(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=by(r)}let s=o&&o.nodeAfter;return!s||!ze.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ze.create(e.doc,o.pos)).scrollIntoView()),!0)};function by(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 r$=(e,t)=>{let n=e.selection,r=n instanceof ze,i;if(r){if(n.node.isTextblock||!Ts(e.doc,n.from))return!1;i=n.from}else if(i=Cp(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(ze.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},i$=(e,t)=>{let n=e.selection,r;if(n instanceof ze){if(n.node.isTextblock||!Ts(e.doc,n.to))return!1;r=n.to}else if(r=Cp(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},o$=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Oa(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},CA=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
467
|
+
`).scrollIntoView()),!0)};function vy(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 s$=(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=vy(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let l=n.after(),u=e.tr.replaceWith(l,l,s.createAndFill());u.setSelection(Qe.near(u.doc.resolve(l),1)),t(u.scrollIntoView())}return!0},EA=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Vr||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=vy(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(Ge.create(l.doc,s+1)),t(l.scrollIntoView())}return!0},NA=(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(wo(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Oa(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function l$(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof ze&&t.selection.node.isBlock)return!r.parentOffset||!wo(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,u=!1,d=!1;for(let x=r.depth;;x--)if(r.node(x).isBlock){u=r.end(x)==r.pos+(r.depth-x),d=r.start(x)==r.pos-(r.depth-x),l=vy(r.node(x-1).contentMatchAt(r.indexAfter(x-1))),o.unshift(u&&l?{type:l}:null),s=x;break}else{if(x==1)return!1;o.unshift(null)}let h=t.tr;(t.selection instanceof Ge||t.selection instanceof Vr)&&h.deleteSelection();let f=h.mapping.map(r.pos),g=wo(h.doc,f,o.length,o);if(g||(o[0]=l?{type:l}:null,g=wo(h.doc,f,o.length,o)),!g)return!1;if(h.split(f,o.length,o),!u&&d&&r.node(s).type!=l){let x=h.mapping.map(r.before(s)),y=h.doc.resolve(x);l&&r.node(s-1).canReplaceWith(y.index(),y.index()+1,l)&&h.setNodeMarkup(h.mapping.map(r.before(s)),l)}return n&&n(h.scrollIntoView()),!0}}const a$=l$(),u$=(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(ze.create(e.doc,i))),!0)};function c$(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||Ts(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function TA(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,l,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&c$(e,t,n))return!0;let d=!u&&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 x=t.pos+o.nodeSize,y=se.empty;for(let C=s.length-1;C>=0;C--)y=se.from(s[C].create(null,y));y=se.from(i.copy(y));let v=e.tr.step(new _n(t.pos-1,x,t.pos,x,new Se(y,1,0),s.length,!0)),w=v.doc.resolve(x+2*s.length);w.nodeAfter&&w.nodeAfter.type==i.type&&Ts(v.doc,w.pos)&&v.join(w.pos),n(v.scrollIntoView())}return!0}let h=o.type.spec.isolating||r>0&&u?null:Qe.findFrom(t,1),f=h&&h.$from.blockRange(h.$to),g=f&&Oa(f);if(g!=null&&g>=t.depth)return n&&n(e.tr.lift(f,g).scrollIntoView()),!0;if(d&&wa(o,"start",!0)&&wa(i,"end")){let x=i,y=[];for(;y.push(x),!x.isTextblock;)x=x.lastChild;let v=o,w=1;for(;!v.isTextblock;v=v.firstChild)w++;if(x.canReplace(x.childCount,x.childCount,v.content)){if(n){let C=se.empty;for(let T=y.length-1;T>=0;T--)C=se.from(y[T].copy(C));let N=e.tr.step(new _n(t.pos-y.length,t.pos+o.nodeSize,t.pos+w,t.pos+o.nodeSize-w,new Se(C,y.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function AA(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(Ge.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const d$=AA(-1),f$=AA(1);function h$(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&my(s,e,t);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function S2(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,(u,d)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.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:u}}=n.selection.ranges[s];o.setBlockType(l,u,e,t)}r(o.scrollIntoView())}return!0}}function wy(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}wy(xy,yA,vA);wy(xy,kA,SA);wy(CA,EA,NA,a$);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function p$(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 m$(l,s,e,t)?(r&&r(l.scrollIntoView()),!0):!1}}function m$(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 u=s.resolve(t.start-2);o=new oh(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new oh(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let l=my(o,n,r,t);return l?(e&&g$(e,t,l,i,n),!0):!1}function g$(e,t,n,r,i){let o=se.empty;for(let h=n.length-1;h>=0;h--)o=se.from(n[h].type.create(n[h].attrs,o));e.step(new _n(t.start-(r?2:0),t.end,t.start,t.end,new Se(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,u=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&&wo(e.doc,u,l)&&(e.split(u,l),u+=2*l),u+=d.child(h).nodeSize;return e}function x$(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?y$(t,n,e,o):b$(t,n,o):!0:!1}}function y$(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new _n(o-1,s,o,s,new Se(se.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new oh(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=Oa(r);if(l==null)return!1;i.lift(r,l);let u=i.doc.resolve(i.mapping.map(o,-1)-1);return Ts(i.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&i.join(u.pos),t(i.scrollIntoView()),!0}function b$(e,t,n){let r=e.tr,i=n.parent;for(let x=n.end,y=n.endIndex-1,v=n.startIndex;y>v;y--)x-=i.child(y).nodeSize,r.delete(x-1,x+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,u=n.endIndex==i.childCount,d=o.node(-1),h=o.index(-1);if(!d.canReplace(h+(l?0:1),h+1,s.content.append(u?se.empty:se.from(i))))return!1;let f=o.pos,g=f+s.nodeSize;return r.step(new _n(f-(l?1:0),g+(u?1:0),f+1,g-1,new Se((l?se.empty:se.from(i.copy(se.empty))).append(u?se.empty:se.from(i.copy(se.empty))),l?0:1,u?0:1),l?0:1)),t(r.scrollIntoView()),!0}function v$(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,u=l.child(s-1);if(u.type!=e)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,h=se.from(d?e.create():null),f=new Se(se.from(e.create(null,se.from(l.type.create(null,h)))),d?3:1,0),g=o.start,x=o.end;n(t.tr.step(new _n(g-(d?3:1),x,g,x,f,1,!0)).scrollIntoView())}return!0}}const zn=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},ka=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let I1=null;const go=function(e,t,n){let r=I1||(I1=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},w$=function(){I1=null},pl=function(e,t,n,r){return n&&(C2(e,t,n,r,-1)||C2(e,t,n,r,1))},k$=/^(img|br|input|textarea|hr)$/i;function C2(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ii(e))){let s=e.parentNode;if(!s||s.nodeType!=1||Lc(e)||k$.test(e.nodeName)||e.contentEditable=="false")return!1;t=zn(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?ii(e):0}else return!1}}function ii(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function S$(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=ii(e)}else if(e.parentNode&&!Lc(e))t=zn(e),e=e.parentNode;else return null}}function C$(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&&!Lc(e))t=zn(e)+1,e=e.parentNode;else return null}}function E$(e,t,n){for(let r=t==0,i=t==ii(e);r||i;){if(e==n)return!0;let o=zn(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==ii(e)}}function Lc(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 Tp=function(e){return e.focusNode&&pl(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 N$(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function T$(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ii(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ii(r.startContainer),r.startOffset)}}}const Ki=typeof navigator<"u"?navigator:null,E2=typeof document<"u"?document:null,As=Ki&&Ki.userAgent||"",O1=/Edge\/(\d+)/.exec(As),_A=/MSIE \d/.exec(As),L1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(As),_r=!!(_A||L1||O1),ds=_A?document.documentMode:L1?+L1[1]:O1?+O1[1]:0,si=!_r&&/gecko\/(\d+)/i.test(As);si&&+(/Firefox\/(\d+)/.exec(As)||[0,0])[1];const F1=!_r&&/Chrome\/(\d+)/.exec(As),$n=!!F1,MA=F1?+F1[1]:0,Zn=!_r&&!!Ki&&/Apple Computer/.test(Ki.vendor),Sa=Zn&&(/Mobile\/\w+/.test(As)||!!Ki&&Ki.maxTouchPoints>2),ni=Sa||(Ki?/Mac/.test(Ki.platform):!1),jA=Ki?/Win/.test(Ki.platform):!1,vo=/Android \d/.test(As),Fc=!!E2&&"webkitFontSmoothing"in E2.documentElement.style,A$=Fc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _$(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 co(e,t){return typeof e=="number"?e:e[t]}function M$(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 N2(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=ka(s);continue}let l=s,u=l==o.body,d=u?_$(o):M$(l),h=0,f=0;if(t.top<d.top+co(r,"top")?f=-(d.top-t.top+co(i,"top")):t.bottom>d.bottom-co(r,"bottom")&&(f=t.bottom-t.top>d.bottom-d.top?t.top+co(i,"top")-d.top:t.bottom-d.bottom+co(i,"bottom")),t.left<d.left+co(r,"left")?h=-(d.left-t.left+co(i,"left")):t.right>d.right-co(r,"right")&&(h=t.right-d.right+co(i,"right")),h||f)if(u)o.defaultView.scrollBy(h,f);else{let x=l.scrollLeft,y=l.scrollTop;f&&(l.scrollTop+=f),h&&(l.scrollLeft+=h);let v=l.scrollLeft-x,w=l.scrollTop-y;t={left:t.left-v,top:t.top-w,right:t.right-v,bottom:t.bottom-w}}let g=u?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(g))break;s=g=="absolute"?s.offsetParent:ka(s)}}function j$(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 u=l.getBoundingClientRect();if(u.top>=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:DA(e.dom)}}function DA(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=ka(r));return t}function D$({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;RA(n,r==0?0:r-t)}function RA(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 Ql=null;function R$(e){if(e.setActive)return e.setActive();if(Ql)return e.focus(Ql);let t=DA(e);e.focus(Ql==null?{get preventScroll(){return Ql={preventScroll:!0},!0}}:void 0),Ql||(Ql=!1,RA(t,0))}function PA(e,t){let n,r=2e8,i,o=0,s=t.top,l=t.top,u,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=go(h).getClientRects();else continue;for(let x=0;x<g.length;x++){let y=g[x];if(y.top<=s&&y.bottom>=l){s=Math.max(y.bottom,s),l=Math.min(y.top,l);let v=y.left>t.left?y.left-t.left:y.right<t.left?t.left-y.right:0;if(v<r){n=h,r=v,i=v&&n.nodeType==3?{left:y.right<t.left?y.right:y.left,top:t.top}:t,h.nodeType==1&&v&&(o=f+(t.left>=(y.left+y.right)/2?1:0));continue}}else y.top>t.top&&!u&&y.left<=t.left&&y.right>=t.left&&(u=h,d={left:Math.max(y.left,Math.min(y.right,t.left)),top:y.top});!n&&(t.left>=y.right&&t.top>=y.top||t.left>=y.left&&t.top>=y.bottom)&&(o=f+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?P$(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:PA(n,i)}function P$(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=Zo(r,1);if(s.top!=s.bottom&&ky(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 ky(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function I$(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function O$(e,t,n){let{node:r,offset:i}=PA(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 L$(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let l=e.docView.nearestDesc(o,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!s&&u.left>r.left||u.top>r.top?i=l.posBefore:(!s&&u.right<r.left||u.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter;o=l.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function IA(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 u=0;u<l.length;u++){let d=l[u];if(ky(t,d))return IA(s,t,d)}}if((o=(o+1)%r)==i)break}return e}function F$(e,t){let n=e.dom.ownerDocument,r,i=0,o=T$(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(!ky(t,d)||(s=IA(e.dom,t,d),!s))return null}if(Zn)for(let d=s;r&&d;d=ka(d))d.draggable&&(r=void 0);if(s=I$(s,t),r){if(si&&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;Fc&&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=L$(e,r,i,t))}l==null&&(l=O$(e,s,t));let u=e.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function T2(e){return e.top<e.bottom||e.left<e.right}function Zo(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(T2(r))return r}return Array.prototype.find.call(n,T2)||e.getBoundingClientRect()}const z$=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function OA(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=Fc||si;if(r.nodeType==3)if(s&&(z$.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=Zo(go(r,i,i),n);if(si&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Zo(go(r,i-1,i-1),-1);if(d.top==u.top){let h=Zo(go(r,i,i+1),-1);if(h.top!=u.top)return ku(h,h.left<d.left)}}return u}else{let u=i,d=i,h=n<0?1:-1;return n<0&&!i?(d++,h=-1):n>=0&&i==r.nodeValue.length?(u--,h=1):n<0?u--:d++,ku(Zo(go(r,u,d),h),h<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==ii(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return lg(u.getBoundingClientRect(),!1)}if(o==null&&i<ii(r)){let u=r.childNodes[i];if(u.nodeType==1)return lg(u.getBoundingClientRect(),!0)}return lg(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==ii(r))){let u=r.childNodes[i-1],d=u.nodeType==3?go(u,ii(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return ku(Zo(d,1),!1)}if(o==null&&i<ii(r)){let u=r.childNodes[i];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?go(u,0,s?0:1):u.nodeType==1?u:null:null;if(d)return ku(Zo(d,-1),!0)}return ku(Zo(r.nodeType==3?go(r):r,-n),n>=0)}function ku(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 lg(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 LA(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 B$(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return LA(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=OA(e,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=go(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let h=u[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 $$=/[\u0590-\u08ac]/;function V$(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?!$$.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:LA(e,t,()=>{let{focusNode:u,focusOffset:d,anchorNode:h,anchorOffset:f}=e.domSelectionRange(),g=l.caretBidiLevel;l.modify("move",n,"character");let x=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:y,focusOffset:v}=e.domSelectionRange(),w=y&&!x.contains(y.nodeType==1?y:y.parentNode)||u==y&&d==v;try{l.collapse(h,f),u&&(u!=h||d!=f)&&l.extend&&l.extend(u,d)}catch{}return g!=null&&(l.caretBidiLevel=g),w}):r.pos==r.start()||r.pos==r.end()}let A2=null,_2=null,M2=!1;function H$(e,t,n){return A2==t&&_2==n?M2:(A2=t,_2=n,M2=n=="up"||n=="down"?B$(e,t,n):V$(e,t,n))}const li=0,j2=1,Js=2,Gi=3;class zc{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=li,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>zn(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 zA){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 FA&&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?zn(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?zn(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 u=this.children[l],d=s+u.size;if(i==-1&&t<=d){let h=s+u.border;if(t>=h&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.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=zn(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=zn(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 x=0,y=0;x<this.children.length;x++){let v=this.children[x],w=y+v.size;if(o>y&&s<w)return v.setSelection(t-y-v.border,n-y-v.border,r,i);y=w}let l=this.domFromPos(t,t?-1:1),u=n==t?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),h=r.domSelectionRange(),f=!1;if((si||Zn)&&t==n){let{node:x,offset:y}=l;if(x.nodeType==3){if(f=!!(y&&x.nodeValue[y-1]==`
|
|
468
|
+
`),f&&y==x.nodeValue.length)for(let v=x,w;v;v=v.parentNode){if(w=v.nextSibling){w.nodeName=="BR"&&(l=u={node:w.parentNode,offset:zn(w)+1});break}let C=v.pmViewDesc;if(C&&C.node&&C.node.isBlock)break}}else{let v=x.childNodes[y-1];f=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(si&&h.focusNode&&h.focusNode!=u.node&&h.focusNode.nodeType==1){let x=h.focusNode.childNodes[h.focusOffset];x&&x.contentEditable=="false"&&(i=!0)}if(!(i||f&&Zn)&&pl(l.node,l.offset,h.anchorNode,h.anchorOffset)&&pl(u.node,u.offset,h.focusNode,h.focusOffset))return;let g=!1;if((d.extend||t==n)&&!(f&&si)){d.collapse(l.node,l.offset);try{t!=n&&d.extend(u.node,u.offset),g=!0}catch{}}if(!g){if(t>n){let y=l;l=u,u=y}let x=document.createRange();x.setEnd(u.node,u.offset),x.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(x)}}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,u=s-o.border;if(t>=l&&n<=u){this.dirty=t==r||n==s?Js:j2,t==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Gi:o.markDirty(t-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Js:Gi}r=s}this.dirty=Js}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Js:j2;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class FA extends zc{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==li&&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 U$ extends zc{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 ml extends zc{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=kl.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ml(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Gi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Gi&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=li){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=li}}slice(t,n,r){let i=ml.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=B1(o,n,s,r)),t>0&&(o=B1(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 fs extends zc{constructor(t,n,r,i,o,s,l,u,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],u,d=l&&l(n,o,()=>{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},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}=kl.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=VA(h,r,n),d?u=new W$(t,n,r,i,h,f||null,g,d,o,s+1):n.isText?new Ap(t,n,r,i,h,g,o):new fs(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=()=>se.empty)}return t}matchesNode(t,n,r){return this.dirty==li&&t.eq(this.node)&&lh(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,u=new K$(this,s&&s.node,t);J$(this.node,this.innerDeco,(d,h,f)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,t,h):d.type.side>=0&&!f&&u.syncToMarks(h==this.node.childCount?pt.none:this.node.child(h).marks,r,t,h),u.placeWidget(d,t,i)},(d,h,f,g)=>{u.syncToMarks(d.marks,r,t,g);let x;u.findNodeMatch(d,h,f,g)||l&&t.state.selection.from>i&&t.state.selection.to<i+d.nodeSize&&(x=u.findIndexWithChild(o.node))>-1&&u.updateNodeAt(d,h,f,x,t)||u.updateNextNode(d,h,f,t,g,i)||u.addNode(d,h,f,t,i),i+=d.nodeSize}),u.syncToMarks([],r,t,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Js)&&(s&&this.protectLocalComposition(t,s),BA(this.contentDOM,this.children,t),Sa&&X$(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Ge)||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=Q$(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 U$(this,o,n,i);t.input.compositionNodes.push(s),this.children=B1(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==Gi||!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=li}updateOuterDeco(t){if(lh(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=$A(this.dom,this.nodeDOM,z1(this.outerDeco,this.node,n),z1(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 D2(e,t,n,r,i){VA(r,t,e);let o=new fs(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Ap extends fs{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==Gi||this.dirty!=li&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=li||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=li,!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 Ap(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=Gi)}get domAtom(){return!1}isText(t){return this.node.text==t}}class zA extends zc{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==li&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class W$ extends fs{constructor(t,n,r,i,o,s,l,u,d,h){super(t,n,r,i,o,s,l,d,h),this.spec=u}update(t,n,r,i){if(this.dirty==Gi)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 BA(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=R2(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(l,r);if(s instanceof ml){let u=r?r.previousSibling:e.lastChild;BA(s.contentDOM,s.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=R2(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Vu=function(e){e&&(this.nodeName=e)};Vu.prototype=Object.create(null);const Xs=[new Vu];function z1(e,t,n){if(e.length==0)return Xs;let r=n?Xs[0]:new Vu,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Vu(s.nodeName));for(let l in s){let u=s[l];u!=null&&(n&&i.length==1&&i.push(r=new Vu(t.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+u:l=="style"?r.style=(r.style?r.style+";":"")+u:l!="nodeName"&&(r[l]=u))}}}return i}function $A(e,t,n,r){if(n==Xs&&r==Xs)return t;let i=t;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let u;l&&l.nodeName==s.nodeName&&i!=e&&(u=i.parentNode)&&u.nodeName.toLowerCase()==s.nodeName||(u=document.createElement(s.nodeName),u.pmIsDeco=!0,u.appendChild(i),l=Xs[0]),i=u}q$(i,l||Xs[0],s)}return i}function q$(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 VA(e,t,n){return $A(e,e,Xs,z1(t,n,e.nodeType!=1))}function lh(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 R2(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class K${constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=G$(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=li,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let u=-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)){u=h;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let h=ml.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,u=Math.min(this.top.children.length,l+5);l<u;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==Gi&&s.dom==s.contentDOM&&(s.dirty=Js),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 u=this.top.children[l];if(u instanceof fs){let d=this.preMatch.matched.get(u);if(d!=null&&d!=o)return!1;let h=u.dom,f,g=this.isLocked(h)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=Gi&&lh(n,u.outerDeco));if(!g&&u.update(t,n,r,i))return this.destroyBetween(this.index,l),u.dom!=h&&(this.changed=!0),this.index++,!0;if(!g&&(f=this.recreateWrapper(u,t,n,r,i,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Js,f.updateChildren(i,s+1),f.dirty=li),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)||!lh(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let l=fs.create(this.top,n,r,i,o,s);if(l.contentDOM){l.children=t.children,t.children=[];for(let u of l.children)u.parent=l}return t.destroy(),l}addNode(t,n,r,i,o){let s=fs.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 FA(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 ml;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Ap)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Zn||$n)&&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 zA(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 G$(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 ml)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 u=l.node;if(u){if(u!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function Y$(e,t){return e.type.side-t.type.side}function J$(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=[],u=null;for(let d=0;;){let h,f;for(;s<i.length&&i[s].to==o;){let w=i[s++];w.widget&&(h?(f||(f=[h])).push(w):h=w)}if(h)if(f){f.sort(Y$);for(let w=0;w<f.length;w++)n(f[w],d,!!u)}else n(h,d,!!u);let g,x;if(u)x=-1,g=u,u=null;else if(d<e.childCount)x=d,g=e.child(d++);else break;for(let w=0;w<l.length;w++)l[w].to<=o&&l.splice(w--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let y=o+g.nodeSize;if(g.isText){let w=y;s<i.length&&i[s].from<w&&(w=i[s].from);for(let C=0;C<l.length;C++)l[C].to<w&&(w=l[C].to);w<y&&(u=g.cut(w-o),g=g.cut(0,w-o),y=w,x=-1)}else for(;s<i.length&&i[s].to<y;)s++;let v=g.isInline&&!g.isLeaf?l.filter(w=>!w.inline):l.slice();r(g,v,t.forChild(o,g),x),o=y}}function X$(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 Q$(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 u=s.text;for(;i<e.childCount;){let d=e.child(i++);if(o+=d.nodeSize,!d.isText)break;u+=d.text}if(o>=n){if(o>=r&&u.slice(r-t.length-l,r-l)==t)return r-t.length;let d=l<r?u.lastIndexOf(t,r-l-1):-1;if(d>=0&&d+t.length+l>=n)return l+d;if(n==r&&u.length>=r+t.length-l&&u.slice(r-l,r-l+t.length)==t)return r}}return-1}function B1(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let u=e[s],d=l,h=l+=u.size;d>=n||h<=t?o.push(u):(d<t&&o.push(u.slice(0,t-d,r)),i&&(o.push(i),i=void 0),h>n&&o.push(u.slice(n-d,u.size,r)))}return o}function Sy(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),u,d;if(Tp(n)){for(u=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&ze.isSelectable(f)&&i.parent&&!(f.isInline&&E$(n.focusNode,n.focusOffset,i.dom))){let g=i.posBefore;d=new ze(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 x=0;x<n.rangeCount;x++){let y=n.getRangeAt(x);f=Math.min(f,e.docView.posFromDOM(y.startContainer,y.startOffset,1)),g=Math.max(g,e.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(f<0)return null;[u,s]=g==e.state.selection.anchor?[g,f]:[f,g],l=r.resolve(s)}else u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let h=r.resolve(u);if(!d){let f=t=="pointer"||e.state.selection.head<l.pos&&!o?1:-1;d=Cy(e,h,l,f)}return d}function HA(e){return e.editable?e.hasFocus():WA(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ko(e,t=!1){let n=e.state.selection;if(UA(e,n),!!HA(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&$n){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&pl(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)eV(e);else{let{anchor:r,head:i}=n,o,s;P2&&!(n instanceof Ge)&&(n.$from.parent.inlineContent||(o=I2(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=I2(e,n.to))),e.docView.setSelection(r,i,e,t),P2&&(o&&O2(o),s&&O2(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Z$(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const P2=Zn||$n&&MA<63;function I2(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(Zn&&i&&i.contentEditable=="false")return ag(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return ag(i);if(o)return ag(o)}}function ag(e){return e.contentEditable="true",Zn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function O2(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Z$(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(()=>{(!HA(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function eV(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,zn(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&_r&&ds<=11&&(n.disabled=!0,n.disabled=!1)}function UA(e,t){if(t instanceof ze){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(L2(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else L2(e)}function L2(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Cy(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Ge.between(t,n,r)}function F2(e){return e.editable&&!e.hasFocus()?!1:WA(e)}function WA(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 tV(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return pl(t.node,t.offset,n.anchorNode,n.anchorOffset)}function $1(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&&Qe.findFrom(o,t)}function es(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function z2(e,t,n){let r=e.state.selection;if(r instanceof Ge)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 es(e,new Ge(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=$1(e.state,t);return i&&i instanceof ze?es(e,i):!1}else if(!(ni&&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?ze.isSelectable(o)?es(e,new ze(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Fc?es(e,new Ge(e.state.doc.resolve(t<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ze&&r.node.isInline)return es(e,new Ge(t>0?r.$to:r.$from));{let i=$1(e.state,t);return i?es(e,i):!1}}}function ah(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Hu(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Zl(e,t){return t<0?nV(e):rV(e)}function nV(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(si&&n.nodeType==1&&r<ah(n)&&Hu(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Hu(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(qA(n))break;{let l=n.previousSibling;for(;l&&Hu(l,-1);)i=n.parentNode,o=zn(l),l=l.previousSibling;if(l)n=l,r=ah(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?V1(e,n,r):i&&V1(e,i,o)}function rV(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=ah(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Hu(l,1))o=n,s=++r;else break}else{if(qA(n))break;{let l=n.nextSibling;for(;l&&Hu(l,1);)o=l.parentNode,s=zn(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=ah(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&V1(e,o,s)}function qA(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function iV(e,t){for(;e&&t==e.childNodes.length&&!Lc(e);)t=zn(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 oV(e,t){for(;e&&!t&&!Lc(e);)t=zn(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 V1(e,t,n){if(t.nodeType!=3){let o,s;(s=iV(t,n))?(t=s,n=0):(o=oV(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Tp(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&&ko(e)},50)}function B2(e,t){let n=e.state.doc.resolve(t);if(!($n||jA)&&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 $2(e,t,n){let r=e.state.selection;if(r instanceof Ge&&!r.empty||n.indexOf("s")>-1||ni&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=$1(e.state,t);if(s&&s instanceof ze)return es(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,l=r instanceof Vr?Qe.near(s,t):Qe.findFrom(s,t);return l?es(e,l):!1}return!1}function V2(e,t){if(!(e.state.selection instanceof Ge))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 H2(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function sV(e){if(!Zn||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;H2(e,r,"true"),setTimeout(()=>H2(e,r,"false"),20)}return!1}function lV(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function aV(e,t){let n=t.keyCode,r=lV(t);if(n==8||ni&&n==72&&r=="c")return V2(e,-1)||Zl(e,-1);if(n==46&&!t.shiftKey||ni&&n==68&&r=="c")return V2(e,1)||Zl(e,1);if(n==13||n==27)return!0;if(n==37||ni&&n==66&&r=="c"){let i=n==37?B2(e,e.state.selection.from)=="ltr"?-1:1:-1;return z2(e,i,r)||Zl(e,i)}else if(n==39||ni&&n==70&&r=="c"){let i=n==39?B2(e,e.state.selection.from)=="ltr"?1:-1:1;return z2(e,i,r)||Zl(e,i)}else{if(n==38||ni&&n==80&&r=="c")return $2(e,-1,r)||Zl(e,-1);if(n==40||ni&&n==78&&r=="c")return sV(e)||$2(e,1,r)||Zl(e,1);if(r==(ni?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ey(e,t){e.someProp("transformCopied",x=>{t=x(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 x=r.firstChild;n.push(x.type.name,x.attrs!=x.type.defaultAttrs?x.attrs:null),r=x.content}let s=e.someProp("clipboardSerializer")||kl.fromSchema(e.state.schema),l=QA(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,h,f=0;for(;d&&d.nodeType==1&&(h=XA[d.nodeName.toLowerCase()]);){for(let x=h.length-1;x>=0;x--){let y=l.createElement(h[x]);for(;u.firstChild;)y.appendChild(u.firstChild);u.appendChild(y),f++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let g=e.someProp("clipboardTextSerializer",x=>x(t,e))||t.content.textBetween(0,t.content.size,`
|
|
469
|
+
|
|
470
|
+
`);return{dom:u,text:g,slice:t}}function KA(e,t,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!t)return null;let u=!!t&&(r||o||!n);if(u){if(e.someProp("transformPastedText",g=>{t=g(t,o||r,e)}),o)return l=new Se(se.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
471
|
+
`))),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:x}=e.state,y=kl.fromSchema(x);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let w=s.appendChild(document.createElement("p"));v&&w.appendChild(y.serializeNode(x.text(v,g)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=fV(n),Fc&&hV(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")||ca.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||h),context:i,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!uV.test(g.parentNode.nodeName)?{ignore:!0}:null}})),h)l=pV(U2(l,+h[1],+h[2]),h[4]);else if(l=Se.maxOpen(cV(l.content,i),!0),l.openStart||l.openEnd){let f=0,g=0;for(let x=l.content.firstChild;f<l.openStart&&!x.type.spec.isolating;f++,x=x.firstChild);for(let x=l.content.lastChild;g<l.openEnd&&!x.type.spec.isolating;g++,x=x.lastChild);l=U2(l,f,g)}return e.someProp("transformPasted",f=>{l=f(l,e,u)}),l}const uV=/^(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 cV(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 u=i.findWrapping(l.type),d;if(!u)return s=null;if(d=s.length&&o.length&&YA(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=JA(s[s.length-1],o.length));let h=GA(l,u);s.push(h),i=i.matchType(h.type),o=u}}),s)return se.from(s)}return e}function GA(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,se.from(e));return e}function YA(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=YA(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(se.from(GA(n,e,i+1))))}}function JA(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,JA(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(se.empty,!0);return e.copy(n.append(r))}function H1(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=H1(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(se.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function U2(e,t,n){return t<e.openStart&&(e=new Se(H1(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Se(H1(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const XA={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 W2=null;function QA(){return W2||(W2=document.implementation.createHTMLDocument("title"))}let ug=null;function dV(e){let t=window.trustedTypes;return t?(ug||(ug=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),ug.createHTML(e)):e}function fV(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=QA().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&XA[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=dV(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function hV(e){let t=e.querySelectorAll($n?"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 pV(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 u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=se.from(u.create(r[l+1],i)),o++,s++}return new Se(i,o,s)}const dr={},fr={},mV={touchstart:!0,touchmove:!0};class gV{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 xV(e){for(let t in dr){let n=dr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{bV(e,r)&&!Ny(e,r)&&(e.editable||!(r.type in fr))&&n(e,r)},mV[t]?{passive:!0}:void 0)}Zn&&e.dom.addEventListener("input",()=>null),U1(e)}function as(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function yV(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 U1(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>Ny(e,r))})}function Ny(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function bV(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 vV(e,t){!Ny(e,t)&&dr[t.type]&&(e.editable||!(t.type in fr))&&dr[t.type](e,t)}fr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!e6(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(vo&&$n&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Sa&&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))||aV(e,n)?n.preventDefault():as(e,"key")};fr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};fr.keypress=(e,t)=>{let n=t;if(e6(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ni&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ge)||!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 _p(e){return{left:e.clientX,top:e.clientY}}function wV(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Ty(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 fa(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 kV(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ze.isSelectable(r)?(fa(e,new ze(n)),!0):!1}function SV(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ze&&(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(ze.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?(fa(e,ze.create(e.state.doc,i)),!0):!1}function CV(e,t,n,r,i){return Ty(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?SV(e,n):kV(e,n))}function EV(e,t,n,r){return Ty(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function NV(e,t,n,r){return Ty(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||TV(e,n,r)}function TV(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(fa(e,Ge.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)fa(e,Ge.create(r,l+1,l+1+s.content.size));else if(ze.isSelectable(s))fa(e,ze.create(r,l));else continue;return!0}}function Ay(e){return uh(e)}const ZA=ni?"metaKey":"ctrlKey";dr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Ay(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&wV(n,e.input.lastClick)&&!n[ZA]&&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(_p(n));s&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new AV(e,s,n,!!r)):(o=="doubleClick"?EV:NV)(e,s.pos,s.inside,n)?n.preventDefault():as(e,"pointer"))};class AV{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[ZA],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,u=l?t.docView.nearestDesc(l,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:d}=t.state;r.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof ze&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&si&&!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)),as(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(()=>ko(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(_p(t))),this.updateAllowDefault(t),this.allowDefault||!n?as(this.view,"pointer"):CV(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Zn&&this.mightDrag&&!this.mightDrag.node.isAtom||$n&&!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)?(fa(this.view,Qe.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):as(this.view,"pointer")}move(t){this.updateAllowDefault(t),as(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)}}dr.touchstart=e=>{e.input.lastTouch=Date.now(),Ay(e),as(e,"pointer")};dr.touchmove=e=>{e.input.lastTouch=Date.now(),as(e,"pointer")};dr.contextmenu=e=>Ay(e);function e6(e,t){return e.composing?!0:Zn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const _V=vo?5e3:-1;fr.compositionstart=fr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Ge&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||$n&&jA&&MV(e)))e.markCursor=e.state.storedMarks||n.marks(),uh(e,!0),e.markCursor=null;else if(uh(e,!t.selection.empty),si&&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}t6(e,_V)};function MV(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"}fr.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++,t6(e,20))};function t6(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>uh(e),t))}function n6(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=DV());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function jV(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=S$(t.focusNode,t.focusOffset),r=C$(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 DV(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function uh(e,t=!1){if(!(vo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),n6(e),t||e.docView&&e.docView.dirty){let n=Sy(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 RV(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 cc=_r&&ds<15||Sa&&A$<604;dr.copy=fr.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=cc?null:n.clipboardData,s=r.content(),{dom:l,text:u}=Ey(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):RV(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function PV(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function IV(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?dc(e,r.value,null,i,t):dc(e,r.textContent,r.innerHTML,i,t)},50)}function dc(e,t,n,r,i){let o=KA(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,i,o||Se.empty)))return!0;if(!o)return!1;let s=PV(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 r6(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," "):""}fr.paste=(e,t)=>{let n=t;if(e.composing&&!vo)return;let r=cc?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&dc(e,r6(r),r.getData("text/html"),i,n)?n.preventDefault():IV(e,n)};class i6{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const OV=ni?"altKey":"ctrlKey";function o6(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[OV]}dr.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(_p(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ze?i.to-1:i.to))){if(r&&r.mightDrag)s=ze.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=ze.create(e.state.doc,f.posBefore))}}let l=(s||e.state.selection).content(),{dom:u,text:d,slice:h}=Ey(e,l);(!n.dataTransfer.files.length||!$n||MA>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(cc?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",cc||n.dataTransfer.setData("text/plain",d),e.dragging=new i6(h,o6(e,n),s)};dr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};fr.dragover=fr.dragenter=(e,t)=>t.preventDefault();fr.drop=(e,t)=>{try{LV(e,t,e.dragging)}finally{e.dragging=null}};function LV(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(_p(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",x=>{o=x(o,e,!1)}):o=KA(e,r6(t.dataTransfer),cc?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&o6(e,t));if(e.someProp("handleDrop",x=>x(e,t,o||Se.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let l=o?uA(e.state.doc,i.pos,o):i.pos;l==null&&(l=i.pos);let u=e.state.tr;if(s){let{node:x}=n;x?x.replace(u):u.deleteSelection()}let d=u.mapping.map(l),h=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=u.doc;if(h?u.replaceRangeWith(d,d,o.content.firstChild):u.replaceRange(d,d,o),u.doc.eq(f))return;let g=u.doc.resolve(d);if(h&&ze.isSelectable(o.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new ze(g));else{let x=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((y,v,w,C)=>x=C),u.setSelection(Cy(e,g,u.doc.resolve(x)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}dr.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())&&ko(e)},20))};dr.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)};dr.beforeinput=(e,t)=>{if($n&&vo&&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 fr)dr[e]=fr[e];function fc(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 ch{constructor(t,n){this.toDOM=t,this.spec=n||il,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 sn(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof ch&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&fc(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class hs{constructor(t,n){this.attrs=t,this.spec=n||il}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 sn(o,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof hs&&fc(this.attrs,t.attrs)&&fc(this.spec,t.spec)}static is(t){return t.type instanceof hs}destroy(){}}class _y{constructor(t,n){this.attrs=t,this.spec=n||il}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 sn(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 _y&&fc(this.attrs,t.attrs)&&fc(this.spec,t.spec)}destroy(){}}class sn{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new sn(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 sn(t,t,new ch(n,r))}static inline(t,n,r,i){return new sn(t,n,new hs(r,i))}static node(t,n,r,i){return new sn(t,n,new _y(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof hs}get widget(){return this.type instanceof ch}}const ra=[],il={};class Et{constructor(t,n){this.local=t.length?t:ra,this.children=n.length?n:ra}static create(t,n){return n.length?dh(n,t,0,il):Kn}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==Kn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||il)}mapInner(t,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let u=this.local[l].map(t,r,i);u&&u.type.valid(n,u)?(s||(s=[])).push(u):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?FV(this.children,s||[],t,n,r,i,o):s?new Et(s.sort(ol),ra):Kn}add(t,n){return n.length?this==Kn?Et.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((l,u)=>{let d=u+r,h;if(h=l6(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<u;)o+=3;i[o]==u?i[o+2]=i[o+2].addInner(l,h,d+1):i.splice(o,0,u,u+l.nodeSize,dh(h,l,d+1,il)),o+=3}});let s=s6(o?a6(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(t,s[l])||s.splice(l--,1);return new Et(s.length?this.local.concat(s).sort(ol):this.local,i||this.children)}remove(t){return t.length==0||this==Kn?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,u=r[o+1]+n;for(let h=0,f;h<t.length;h++)(f=t[h])&&f.from>l&&f.to<u&&(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!=Kn?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 Et(i,r):Kn}forChild(t,n){if(this==Kn)return this;if(n.isLeaf)return Et.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 u=this.local[l];if(u.from<s&&u.to>o&&u.type instanceof hs){let d=Math.max(o,u.from)-o,h=Math.min(s,u.to)-o;d<h&&(i||(i=[])).push(u.copy(d,h))}}if(i){let l=new Et(i.sort(ol),ra);return r?new is([l,r]):l}return r||Kn}eq(t){if(this==t)return!0;if(!(t instanceof Et)||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 My(this.localsInner(t))}localsInner(t){if(this==Kn)return ra;if(t.inlineContent||!this.local.some(hs.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof hs||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Et.empty=new Et([],[]);Et.removeOverlap=My;const Kn=Et.empty;class is{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,il));return is.from(r)}forChild(t,n){if(n.isLeaf)return Et.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Kn&&(o instanceof is?r=r.concat(o.members):r.push(o))}return is.from(r)}eq(t){if(!(t instanceof is)||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?My(r?n:n.sort(ol)):ra}static from(t){switch(t.length){case 0:return Kn;case 1:return t[0];default:return new is(t.every(n=>n instanceof Et)?t:t.reduce((n,r)=>n.concat(r instanceof Et?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function FV(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,x,y,v)=>{let w=v-y-(x-g);for(let C=0;C<l.length;C+=3){let N=l[C+1];if(N<0||g>N+h-f)continue;let T=l[C]+h-f;x>=T?l[C+1]=g<=T?-2:-1:g>=h&&w&&(l[C]+=w,l[C+1]+=w)}f+=w}),h=n.maps[d].map(h,-1)}let u=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){u=!0,l[d+1]=-1;continue}let h=n.map(e[d]+o),f=h-i;if(f<0||f>=r.content.size){u=!0;continue}let g=n.map(e[d+1]+o,-1),x=g-i,{index:y,offset:v}=r.content.findIndex(f),w=r.maybeChild(y);if(w&&v==f&&v+w.nodeSize==x){let C=l[d+2].mapInner(n,w,h+1,e[d]+o+1,s);C!=Kn?(l[d]=f,l[d+1]=x,l[d+2]=C):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=zV(l,e,t,n,i,o,s),h=dh(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 x=h.children[f];for(;g<l.length&&l[g]<x;)g+=3;l.splice(g,0,h.children[f],h.children[f+1],h.children[f+2])}}return new Et(t.sort(ol),l)}function s6(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 sn(i.from+t,i.to+t,i.type))}return n}function zV(e,t,n,r,i,o,s){function l(u,d){for(let h=0;h<u.local.length;h++){let f=u.local[h].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(u.local[h].spec)}for(let h=0;h<u.children.length;h+=3)l(u.children[h+2],u.children[h]+d+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&l(e[u+2],t[u]+o+1);return n}function l6(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 a6(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function dh(e,t,n,r){let i=[],o=!1;t.forEach((l,u)=>{let d=l6(e,l,u+n);if(d){o=!0;let h=dh(d,l,n+u+1,r);h!=Kn&&i.push(u,u+l.nodeSize,h)}});let s=s6(o?a6(e):e,-n).sort(ol);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 Et(s,i):Kn}function ol(e,t){return e.from-t.from||e.to-t.to}function My(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),q2(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),q2(t,i,r.copy(o.from,r.to)));break}}}return t}function q2(e,t,n){for(;t<e.length&&ol(n,e[t])>0;)t++;e.splice(t,0,n)}function cg(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Kn&&t.push(r)}),e.cursorWrapper&&t.push(Et.create(e.state.doc,[e.cursorWrapper.deco])),is.from(t)}const BV={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},$V=_r&&ds<=11;class VV{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 HV{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new VV,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]);_r&&ds<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Zn&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),$V&&(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,BV)),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(F2(this.view)){if(this.suppressingSelectionUpdates)return ko(this.view);if(_r&&ds<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&pl(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=ka(o))n.add(o);for(let o=t.anchorNode;o;o=ka(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)&&F2(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(t.editable)for(let h=0;h<n.length;h++){let f=this.registerMutation(n[h],u);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(u.some(h=>h.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let h of u)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(si&&u.length){let h=u.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 x=g.parentNode;x&&x.nodeName=="LI"&&(!f||qV(t,f)!=x)&&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&&Tp(r)&&(d=Sy(t))&&d.eq(Qe.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ko(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),UV(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,KV(t,u)),this.handleDOMChange(o,s,l,u),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ko(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(_r&&ds<=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?zn(i)+1:0,l=r.localPosFromDOM(t.target,s,-1),u=o&&o.parentNode==t.target?zn(o):t.target.childNodes.length,d=r.localPosFromDOM(t.target,u,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 K2=new WeakMap,G2=!1;function UV(e){if(!K2.has(e)&&(K2.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=si,G2)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."),G2=!0}}function Y2(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return pl(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function WV(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return Y2(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?Y2(e,n):null}function qV(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 KV(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 u=l.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;l=u}l.insertBefore(o,l.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function GV(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=e.docView.parseRange(t,n),u=e.domSelectionRange(),d,h=u.anchorNode;if(h&&e.dom.contains(h.nodeType==1?h:h.parentNode)&&(d=[{node:h,offset:u.anchorOffset}],Tp(u)||d.push({node:u.focusNode,offset:u.focusOffset})),$n&&e.input.lastKeyCode===8)for(let w=o;w>i;w--){let C=r.childNodes[w-1],N=C.pmViewDesc;if(C.nodeName=="BR"&&!N){o=w;break}if(!N||N.size)break}let f=e.state.doc,g=e.someProp("domParser")||ca.fromSchema(e.state.schema),x=f.resolve(s),y=null,v=g.parse(r,{topNode:x.parent,topMatch:x.parent.contentMatchAt(x.index()),topOpen:!0,from:i,to:o,preserveWhitespace:x.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:YV,context:x});if(d&&d[0].pos!=null){let w=d[0].pos,C=d[1]&&d[1].pos;C==null&&(C=w),y={anchor:w+s,head:C+s}}return{doc:v,sel:y,from:s,to:l}}function YV(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Zn&&/^(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||Zn&&/^(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 JV=/^(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 XV(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let I=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,P=Sy(e,I);if(P&&!e.state.selection.eq(P)){if($n&&vo&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",R=>R(e,Ys(13,"Enter"))))return;let L=e.state.tr.setSelection(P);I=="pointer"?L.setMeta("pointer",!0):I=="key"&&L.scrollIntoView(),o&&L.setMeta("composition",o),e.dispatch(L)}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 u=e.state.selection,d=GV(e,t,n),h=e.state.doc,f=h.slice(d.from,d.to),g,x;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(g=e.state.selection.to,x="end"):(g=e.state.selection.from,x="start"),e.input.lastKeyCode=null;let y=eH(f.content,d.doc.content,d.from,g,x);if(y&&e.input.domChangeCount++,(Sa&&e.input.lastIOSEnter>Date.now()-225||vo)&&i.some(I=>I.nodeType==1&&!JV.test(I.nodeName))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",I=>I(e,Ys(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!y)if(r&&u instanceof Ge&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let I=J2(e,e.state.doc,d.sel);if(I&&!I.eq(e.state.selection)){let P=e.state.tr.setSelection(I);o&&P.setMeta("composition",o),e.dispatch(P)}}return}e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof Ge&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),_r&&ds<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)==" "&&(y.start--,y.endA--,y.endB--);let v=d.doc.resolveNoCache(y.start-d.from),w=d.doc.resolveNoCache(y.endB-d.from),C=h.resolve(y.start),N=v.sameParent(w)&&v.parent.inlineContent&&C.end()>=y.endA;if((Sa&&e.input.lastIOSEnter>Date.now()-225&&(!N||i.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!N&&v.pos<d.doc.content.size&&(!v.sameParent(w)||!v.parent.inlineContent)&&v.pos<w.pos&&!/\S/.test(d.doc.textBetween(v.pos,w.pos,"","")))&&e.someProp("handleKeyDown",I=>I(e,Ys(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>y.start&&ZV(h,y.start,y.endA,v,w)&&e.someProp("handleKeyDown",I=>I(e,Ys(8,"Backspace")))){vo&&$n&&e.domObserver.suppressSelectionUpdates();return}$n&&y.endB==y.start&&(e.input.lastChromeDelete=Date.now()),vo&&!N&&v.start()!=w.start()&&w.parentOffset==0&&v.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,w=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(I){return I(e,Ys(13,"Enter"))})},20));let T=y.start,D=y.endA,A=I=>{let P=I||e.state.tr.replace(T,D,d.doc.slice(y.start-d.from,y.endB-d.from));if(d.sel){let L=J2(e,P.doc,d.sel);L&&!($n&&e.composing&&L.empty&&(y.start!=y.endB||e.input.lastChromeDelete<Date.now()-100)&&(L.head==T||L.head==P.mapping.map(D)-1)||_r&&L.empty&&L.head==T)&&P.setSelection(L)}return o&&P.setMeta("composition",o),P.scrollIntoView()},_;if(N)if(v.pos==w.pos){_r&&ds<=11&&v.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ko(e),20));let I=A(e.state.tr.delete(T,D)),P=h.resolve(y.start).marksAcross(h.resolve(y.endA));P&&I.ensureMarks(P),e.dispatch(I)}else if(y.endA==y.endB&&(_=QV(v.parent.content.cut(v.parentOffset,w.parentOffset),C.parent.content.cut(C.parentOffset,y.endA-C.start())))){let I=A(e.state.tr);_.type=="add"?I.addMark(T,D,_.mark):I.removeMark(T,D,_.mark),e.dispatch(I)}else if(v.parent.child(v.index()).isText&&v.index()==w.index()-(w.textOffset?0:1)){let I=v.parent.textBetween(v.parentOffset,w.parentOffset),P=()=>A(e.state.tr.insertText(I,T,D));e.someProp("handleTextInput",L=>L(e,T,D,I,P))||e.dispatch(P())}else e.dispatch(A());else e.dispatch(A())}function J2(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Cy(e,t.resolve(n.anchor),t.resolve(n.head))}function QV(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,l,u;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",u=h=>h.mark(l.addToSet(h.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=h=>h.mark(l.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<t.childCount;h++)d.push(u(t.child(h)));if(se.from(d).eq(e))return{mark:l,type:s}}function ZV(e,t,n,r,i){if(n-t<=i.pos-r.pos||dg(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(dg(o,!0,!0));return!s.parent.isTextblock||s.pos>n||dg(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function dg(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 eH(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 u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s<o&&e.size<t.size){let u=r<=o&&r>=s?o-r:0;o-=u,o&&o<t.size&&X2(t.textBetween(o-1,o+1))&&(o+=u?1:-1),l=o+(l-s),s=o}else if(l<o){let u=r<=o&&r>=l?o-r:0;o-=u,o&&o<e.size&&X2(e.textBetween(o-1,o+1))&&(o+=u?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function X2(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 u6{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 gV,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(nS),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=eS(this),Z2(this),this.nodeViews=tS(this),this.docView=D2(this.state.doc,Q2(this),cg(this),this.dom,this),this.domObserver=new HV(this,(r,i,o,s)=>XV(this,r,i,o,s)),this.domObserver.start(),xV(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&&U1(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(nS),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&&(n6(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 x=tS(this);nH(x,this.nodeViews)&&(this.nodeViews=x,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&U1(this),this.editable=eS(this),Z2(this);let u=cg(this),d=Q2(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,u);(f||!t.selection.eq(i.selection))&&(s=!0);let g=h=="preserve"&&s&&this.dom.style.overflowAnchor==null&&j$(this);if(s){this.domObserver.stop();let x=f&&(_r||$n)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&tH(i.selection,t.selection);if(f){let y=$n?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=jV(this)),(o||!this.docView.update(t.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=D2(t.doc,d,u,this.dom,this)),y&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(x=!0)}x||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&tV(this))?ko(this,x):(UA(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&&D$(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 ze){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&N2(this,n.getBoundingClientRect(),t)}else N2(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 i6(t.slice,t.move,i<0?void 0:ze.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(_r){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&&R$(this.dom),ko(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 F$(this,t)}coordsAtPos(t,n=1){return OA(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 H$(this,n||this.state,t)}pasteHTML(t,n){return dc(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return dc(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return Ey(this,t)}destroy(){this.docView&&(yV(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],cg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,w$())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return vV(this,t)}domSelectionRange(){let t=this.domSelection();return t?Zn&&this.root.nodeType===11&&N$(this.dom.ownerDocument)==this.dom&&WV(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}u6.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Q2(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"),[sn.node(0,e.state.doc.content.size,t)]}function Z2(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:sn.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function eS(e){return!e.someProp("editable",t=>t(e.state)===!1)}function tH(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 tS(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 nH(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 nS(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 vs={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:"'"},fh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},rH=typeof navigator<"u"&&/Mac/.test(navigator.platform),iH=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Bn=0;Bn<10;Bn++)vs[48+Bn]=vs[96+Bn]=String(Bn);for(var Bn=1;Bn<=24;Bn++)vs[Bn+111]="F"+Bn;for(var Bn=65;Bn<=90;Bn++)vs[Bn]=String.fromCharCode(Bn+32),fh[Bn]=String.fromCharCode(Bn);for(var fg in vs)fh.hasOwnProperty(fg)||(fh[fg]=vs[fg]);function oH(e){var t=rH&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||iH&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?fh:vs)[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 sH=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),lH=typeof navigator<"u"&&/Win/.test(navigator.platform);function aH(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 u=t[l];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))sH?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function uH(e){let t=Object.create(null);for(let n in e)t[aH(n)]=e[n];return t}function hg(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 cH(e){return new vt({props:{handleKeyDown:c6(e)}})}function c6(e){let t=uH(e);return function(n,r){let i=oH(r),o,s=t[hg(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=t[hg(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(lH&&r.ctrlKey&&r.altKey)&&(o=vs[r.keyCode])&&o!=i){let l=t[hg(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var dH=Object.defineProperty,jy=(e,t)=>{for(var n in t)dH(e,n,{get:t[n],enumerable:!0})};function Mp(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 jp=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,u=e||i.tr,d=()=>(!l&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),s.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(n).map(([f,g])=>[f,(...y)=>{const v=this.buildProps(u,t),w=g(...y)(v);return s.push(w),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,u])=>[l,(...d)=>u(...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:Mp({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,u])=>[l,(...d)=>u(...d)(s)]))}};return s}},d6={};jy(d6,{blur:()=>fH,clearContent:()=>hH,clearNodes:()=>pH,command:()=>mH,createParagraphNear:()=>gH,cut:()=>xH,deleteCurrentNode:()=>yH,deleteNode:()=>bH,deleteRange:()=>vH,deleteSelection:()=>wH,enter:()=>kH,exitCode:()=>SH,extendMarkRange:()=>CH,first:()=>EH,focus:()=>TH,forEach:()=>AH,insertContent:()=>_H,insertContentAt:()=>DH,joinBackward:()=>IH,joinDown:()=>PH,joinForward:()=>OH,joinItemBackward:()=>LH,joinItemForward:()=>FH,joinTextblockBackward:()=>zH,joinTextblockForward:()=>BH,joinUp:()=>RH,keyboardShortcut:()=>VH,lift:()=>HH,liftEmptyBlock:()=>UH,liftListItem:()=>WH,newlineInCode:()=>qH,resetAttributes:()=>KH,scrollIntoView:()=>GH,selectAll:()=>YH,selectNodeBackward:()=>JH,selectNodeForward:()=>XH,selectParentNode:()=>QH,selectTextblockEnd:()=>ZH,selectTextblockStart:()=>eU,setContent:()=>tU,setMark:()=>kU,setMeta:()=>SU,setNode:()=>CU,setNodeSelection:()=>EU,setTextDirection:()=>NU,setTextSelection:()=>TU,sinkListItem:()=>AU,splitBlock:()=>_U,splitListItem:()=>MU,toggleList:()=>DU,toggleMark:()=>RU,toggleNode:()=>PU,toggleWrap:()=>IU,undoInputRule:()=>OU,unsetAllMarks:()=>LU,unsetMark:()=>FU,unsetTextDirection:()=>zU,updateAttributes:()=>BU,wrapIn:()=>$U,wrapInList:()=>VU});var fH=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),hH=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),pH=()=>({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,u)=>{if(l.type.isText)return;const{doc:d,mapping:h}=t,f=d.resolve(h.map(u)),g=d.resolve(h.map(u+l.nodeSize)),x=f.blockRange(g);if(!x)return;const y=Oa(x);if(l.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(x.start,v)}(y||y===0)&&t.lift(x,y)})}),!0},mH=e=>t=>e(t),gH=()=>({state:e,dispatch:t})=>EA(e,t),xH=(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 Ge(r.doc.resolve(Math.max(s-1,0)))),!0},yH=()=>({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),u=i.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1};function dn(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 bH=e=>({tr:t,state:n,dispatch:r})=>{const i=dn(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 u=o.before(s),d=o.after(s);t.delete(u,d).scrollIntoView()}return!0}return!1},vH=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},wH=()=>({state:e,dispatch:t})=>xy(e,t),kH=()=>({commands:e})=>e.keyboardShortcut("Enter"),SH=()=>({state:e,dispatch:t})=>s$(e,t);function Dy(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function hh(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:Dy(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function f6(e,t,n={}){return e.find(r=>r.type===t&&hh(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function rS(e,t,n={}){return!!f6(e,t,n)}function Ry(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(!f6([...r.node.marks],t,n))return;let o=r.index,s=e.start()+r.offset,l=o+1,u=s+r.node.nodeSize;for(;o>0&&rS([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;l<e.parent.childCount&&rS([...e.parent.child(l).marks],t,n);)u+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:u}}function To(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 CH=(e,t)=>({tr:n,state:r,dispatch:i})=>{const o=To(e,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:h}=l;if(i){const f=Ry(u,o,t);if(f&&f.from<=d&&f.to>=h){const g=Ge.create(s,f.from,f.to);n.setSelection(g)}}return!0},EH=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 h6(e){return e instanceof Ge}function Qs(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function p6(e,t=null){if(!t)return null;const n=Qe.atStart(e),r=Qe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ge.create(e,Qs(0,i,o),Qs(e.content.size,i,o)):Ge.create(e,Qs(t,i,o),Qs(t,i,o))}function iS(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function ph(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function NH(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var TH=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{(ph()||iS())&&r.dom.focus(),NH()&&!ph()&&!iS()&&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&&!h6(n.state.selection))return s(),!0;const l=p6(i.doc,e)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},AH=(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),m6=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&&m6(r)}return e};function hf(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 m6(n)}function hc(e,t,n){if(e instanceof cs||e instanceof se)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 se.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),hc("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const u=new fy({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?ca.fromSchema(u).parseSlice(hf(e),n.parseOptions):ca.fromSchema(u).parse(hf(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=ca.fromSchema(t);return n.slice?o.parseSlice(hf(e),n.parseOptions).content:o.parse(hf(e),n.parseOptions)}return hc("",t,n)}function MH(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof rn||i instanceof _n))return;const o=e.mapping.maps[r];let s=0;o.forEach((l,u,d,h)=>{s===0&&(s=h)}),e.setSelection(Qe.near(e.doc.resolve(s),n))}var jH=e=>!("type"in e),DH=(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 u=w=>{o.emit("contentError",{editor:o,error:w,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{hc(t,o.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(w){u(w)}try{l=hc(t,o.schema,{parseOptions:d,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(w){return u(w),!1}let{from:h,to:f}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},g=!0,x=!0;if((jH(l)?l:[l]).forEach(w=>{w.check(),g=g?w.isText&&w.marks.length===0:!1,x=x?w.isBlock:!1}),h===f&&x){const{parent:w}=r.doc.resolve(h);w.isTextblock&&!w.type.spec.code&&!w.childCount&&(h-=1,f+=1)}let v;if(g){if(Array.isArray(t))v=t.map(w=>w.text||"").join("");else if(t instanceof se){let w="";t.forEach(C=>{C.text&&(w+=C.text)}),v=w}else typeof t=="object"&&t&&t.text?v=t.text:v=t;r.insertText(v,h,f)}else{v=l;const w=r.doc.resolve(h),C=w.node(),N=w.parentOffset===0,T=C.isText||C.isTextblock,D=C.content.size>0;N&&T&&D&&x&&(h=Math.max(0,h-1)),r.replaceWith(h,f,v)}n.updateSelection&&MH(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:v}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:v})}return!0},RH=()=>({state:e,dispatch:t})=>r$(e,t),PH=()=>({state:e,dispatch:t})=>i$(e,t),IH=()=>({state:e,dispatch:t})=>yA(e,t),OH=()=>({state:e,dispatch:t})=>kA(e,t),LH=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Cp(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},FH=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Cp(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},zH=()=>({state:e,dispatch:t})=>t$(e,t),BH=()=>({state:e,dispatch:t})=>n$(e,t);function g6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function $H(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 u=t[l];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))ph()||g6()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}var VH=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=$H(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}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u==null||u.steps.forEach(d=>{const h=d.map(r.mapping);h&&i&&r.maybeStep(h)}),!0};function ws(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?dn(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(f,g)=>{if(f.isText)return;const x=Math.max(r,g),y=Math.min(i,g+f.nodeSize);l.push({node:f,from:x,to:y})});const u=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>hh(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,g)=>f+g.to-g.from,0)>=u}var HH=(e,t={})=>({state:n,dispatch:r})=>{const i=dn(e,n.schema);return ws(n,i,t)?o$(n,r):!1},UH=()=>({state:e,dispatch:t})=>NA(e,t),WH=e=>({state:t,dispatch:n})=>{const r=dn(e,t.schema);return x$(r)(t,n)},qH=()=>({state:e,dispatch:t})=>CA(e,t);function Dp(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function oS(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 KH=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Dp(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(o=dn(e,r.schema)),l==="mark"&&(s=To(e,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(h,f)=>{o&&o===h.type&&(u=!0,i&&n.setNodeMarkup(f,void 0,oS(h.attrs,t))),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&(u=!0,i&&n.addMark(f,f+h.nodeSize,s.create(oS(g.attrs,t))))})})}),u},GH=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),YH=()=>({tr:e,dispatch:t})=>{if(t){const n=new Vr(e.doc);e.setSelection(n)}return!0},JH=()=>({state:e,dispatch:t})=>vA(e,t),XH=()=>({state:e,dispatch:t})=>SA(e,t),QH=()=>({state:e,dispatch:t})=>u$(e,t),ZH=()=>({state:e,dispatch:t})=>f$(e,t),eU=()=>({state:e,dispatch:t})=>d$(e,t);function W1(e,t,n={},r={}){return hc(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var tU=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{const{doc:u}=o;if(r.preserveWhitespace!=="full"){const d=W1(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:u.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function x6(e,t){const n=To(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,u=>{s.push(...u.marks)});const l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function y6(e,t){const n=new pA(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function nU(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 rU(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function iU(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 Rp(e){return t=>iU(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 Py(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Oe(t,"addExtensions",n);return r?[t,...Py(r())]:t}).flat(10)}function Bc(e,t){const n=kl.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function b6(e){return typeof e=="function"}function gt(e,t=void 0,...n){return b6(e)?t?e.bind(t)(...n):e(...n):e}function oU(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Ca(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 v6(e){const t=[],{nodeExtensions:n,markExtensions:r}=Ca(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),u=[...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(x=>{let y;Array.isArray(x.types)?y=x.types:x.types==="*"?y=u:x.types==="nodes"?y=s:x.types==="marks"?y=l:y=[],y.forEach(v=>{Object.entries(x.attributes).forEach(([w,C])=>{t.push({type:v,name:w,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(([x,y])=>{const v={...o,...y};typeof(v==null?void 0:v.default)=="function"&&(v.default=v.default()),v!=null&&v.isRequired&&(v==null?void 0:v.default)===void 0&&delete v.default,t.push({type:d.name,name:x,attribute:v})})}),t}function sU(e){const t=[];let n="",r=!1,i=!1,o=0;const s=e.length;for(let l=0;l<s;l+=1){const u=e[l];if(u==="'"&&!i){r=!r,n+=u;continue}if(u==='"'&&!r){i=!i,n+=u;continue}if(!r&&!i){if(u==="("){o+=1,n+=u;continue}if(u===")"&&o>0){o-=1,n+=u;continue}if(u===";"&&o===0){t.push(n),n="";continue}}n+=u}return n&&t.push(n),t}function sS(e){const t=[],n=sU(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(),u=o.slice(s+1).trim();l&&u&&t.push([l,u])}return t}function fn(...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(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(h=>!u.includes(h));r[i]=[...u,...d].join(" ")}else if(i==="style"){const l=new Map([...sS(r[i]),...sS(o)]);r[i]=Array.from(l.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[i]=o}),r},{})}function pc(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)=>fn(n,r),{})}function lU(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function lS(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):lU(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function aS(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&oU(n)?!1:n!=null))}function uS(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 aU(e,t){var n;const r=v6(e),{nodeExtensions:i,markExtensions:o}=Ca(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,N)=>{const T=Oe(N,"extendNodeSchema",f);return{...C,...T?T(d):{}}},{}),x=aS({...g,content:gt(Oe(d,"content",f)),marks:gt(Oe(d,"marks",f)),group:gt(Oe(d,"group",f)),inline:gt(Oe(d,"inline",f)),atom:gt(Oe(d,"atom",f)),selectable:gt(Oe(d,"selectable",f)),draggable:gt(Oe(d,"draggable",f)),code:gt(Oe(d,"code",f)),whitespace:gt(Oe(d,"whitespace",f)),linebreakReplacement:gt(Oe(d,"linebreakReplacement",f)),defining:gt(Oe(d,"defining",f)),isolating:gt(Oe(d,"isolating",f)),attrs:Object.fromEntries(h.map(uS))}),y=gt(Oe(d,"parseHTML",f));y&&(x.parseDOM=y.map(C=>lS(C,h)));const v=Oe(d,"renderHTML",f);v&&(x.toDOM=C=>v({node:C,HTMLAttributes:pc(C,h)}));const w=Oe(d,"renderText",f);return w&&(x.toText=w),[d.name,x]})),u=Object.fromEntries(o.map(d=>{const h=r.filter(w=>w.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:t},g=e.reduce((w,C)=>{const N=Oe(C,"extendMarkSchema",f);return{...w,...N?N(d):{}}},{}),x=aS({...g,inclusive:gt(Oe(d,"inclusive",f)),excludes:gt(Oe(d,"excludes",f)),group:gt(Oe(d,"group",f)),spanning:gt(Oe(d,"spanning",f)),code:gt(Oe(d,"code",f)),attrs:Object.fromEntries(h.map(uS))}),y=gt(Oe(d,"parseHTML",f));y&&(x.parseDOM=y.map(w=>lS(w,h)));const v=Oe(d,"renderHTML",f);return v&&(x.toDOM=w=>v({mark:w,HTMLAttributes:pc(w,h)})),[d.name,x]}));return new fy({topNode:s,nodes:l,marks:u})}function uU(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function Uu(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 w6(e){const t=Uu(Py(e)),n=uU(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 k6(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
|
|
472
|
+
|
|
473
|
+
`,textSerializers:s={}}=n||{};let l="";return e.nodesBetween(r,i,(u,d,h,f)=>{var g;u.isBlock&&d>r&&(l+=o);const x=s==null?void 0:s[u.type.name];if(x)return h&&(l+=x({node:u,pos:d,parent:h,index:f,range:t})),!1;u.isText&&(l+=(g=u==null?void 0:u.text)==null?void 0:g.slice(Math.max(r,d)-d,i-d))}),l}function cU(e,t){const n={from:0,to:e.content.size};return k6(e,n,t)}function S6(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function dU(e,t){const n=dn(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 C6(e,t){const n=Dp(typeof t=="string"?t:t.name,e.schema);return n==="node"?dU(e,t):n==="mark"?x6(e,t):{}}function fU(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 hU(e){const t=fU(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 E6(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{const{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{const d=t.slice(o).map(l,-1),h=t.slice(o).map(u),f=t.invert().map(d,-1),g=t.invert().map(h);r.push({oldRange:{from:f,to:g},newRange:{from:d,to:h}})})}),hU(r)}function Iy(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),s=Ry(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 pU=(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 Su(e,t){return t.nodes[e]||t.marks[e]||null}function Of(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 mU=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,l)=>{var u,d;const h=((d=(u=i.type.spec).toText)==null?void 0:d.call(u,{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 q1(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?To(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>hh(f.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:f,$to:g})=>{const x=f.pos,y=g.pos;e.doc.nodesBetween(x,y,(v,w)=>{if(o&&v.inlineContent&&!v.type.allowsMarkType(o))return!1;if(!v.isText&&!v.marks.length)return;const C=Math.max(x,w),N=Math.min(y,w+v.nodeSize),T=N-C;s+=T,l.push(...v.marks.map(D=>({mark:D,from:C,to:N})))})}),s===0)return!1;const u=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>hh(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(u>0?u+d:u)>=s}function gU(e,t,n={}){if(!t)return ws(e,null,n)||q1(e,null,n);const r=Dp(t,e.schema);return r==="node"?ws(e,t,n):r==="mark"?q1(e,t,n):!1}var xU=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=Rp(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)},yU=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function cS(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function pg(e,t){const{nodeExtensions:n}=Ca(t),r=n.find(s=>s.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=gt(Oe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Pp(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&&(Pp(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function N6(e){return e instanceof ze}var T6=class A6{constructor(t){this.position=t}static fromJSON(t){return new A6(t.position)}toJSON(){return{position:this.position}}};function bU(e,t){const n=t.mapping.mapResult(e.position);return{position:new T6(n.pos),mapResult:n}}function vU(e){return new T6(e)}function wU(e,t,n){var r;const{selection:i}=t;let o=null;if(h6(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:u})=>{let d=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,u.pos,(h,f,g)=>{if(d)return!1;if(h.isInline){const x=!g||g.type.allowsMarkType(n),y=!!n.isInSet(h.marks)||!h.marks.some(v=>v.type.excludes(n));d=x&&y}return!d}),d})}var kU=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,u=To(e,r.schema);if(i)if(s){const d=x6(r,u);n.addStoredMark(u.create({...d,...t}))}else l.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(h,f,(g,x)=>{const y=Math.max(x,h),v=Math.min(x+g.nodeSize,f);g.marks.find(C=>C.type===u)?g.marks.forEach(C=>{u===C.type&&n.addMark(y,v,u.create({...C.attrs,...t}))}):n.addMark(y,v,u.create(t))})});return wU(r,n,u)},SU=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),CU=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=dn(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})=>S2(o,{...s,...t})(n)?!0:l.clearNodes()).command(({state:l})=>S2(o,{...s,...t})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},EU=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Qs(e,0,r.content.size),o=ze.create(r,i);t.setSelection(o)}return!0},NU=(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,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:e})}),!0},TU=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=Ge.atStart(r).from,l=Ge.atEnd(r).to,u=Qs(i,s,l),d=Qs(o,s,l),h=Ge.create(r,u,d);t.setSelection(h)}return!0},AU=e=>({state:t,dispatch:n})=>{const r=dn(e,t.schema);return v$(r)(t,n)};function dS(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 _U=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:l,$to:u}=o,d=i.extensionManager.attributes,h=Of(d,l.node().type.name,l.node().attrs);if(o instanceof ze&&o.node.isBlock)return!l.parentOffset||!wo(s,l.pos)?!1:(r&&(e&&dS(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const f=u.parentOffset===u.parent.content.size,g=l.depth===0?void 0:nU(l.node(-1).contentMatchAt(l.indexAfter(-1)));let x=f&&g?[{type:g,attrs:h}]:void 0,y=wo(t.doc,t.mapping.map(l.pos),1,x);if(!x&&!y&&wo(t.doc,t.mapping.map(l.pos),1,g?[{type:g}]:void 0)&&(y=!0,x=g?[{type:g,attrs:h}]:void 0),r){if(y&&(o instanceof Ge&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,x),g&&!f&&!l.parentOffset&&l.parent.type!==g)){const v=t.mapping.map(l.before()),w=t.doc.resolve(v);l.node(-1).canReplaceWith(w.index(),w.index()+1,g)&&t.setNodeMarkup(t.mapping.map(l.before()),g)}e&&dS(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return y},MU=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=dn(e,r.schema),{$from:u,$to:d}=r.selection,h=r.selection.node;if(h&&h.isBlock||u.depth<2||!u.sameParent(d))return!1;const f=u.node(-1);if(f.type!==l)return!1;const g=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let C=se.empty;const N=u.index(-1)?1:u.index(-2)?2:3;for(let P=u.depth-N;P>=u.depth-3;P-=1)C=se.from(u.node(P).copy(C));const T=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,D={...Of(g,u.node().type.name,u.node().attrs),...t},A=((s=l.contentMatch.defaultType)==null?void 0:s.createAndFill(D))||void 0;C=C.append(se.from(l.createAndFill(null,A)||void 0));const _=u.before(u.depth-(N-1));n.replace(_,u.after(-T),new Se(C,4-N,0));let I=-1;n.doc.nodesBetween(_,n.doc.content.size,(P,L)=>{if(I>-1)return!1;P.isTextblock&&P.content.size===0&&(I=L+1)}),I>-1&&n.setSelection(Ge.near(n.doc.resolve(I))),n.scrollIntoView()}return!0}const x=d.pos===u.end()?f.contentMatchAt(0).defaultType:null,y={...Of(g,f.type.name,f.attrs),...t},v={...Of(g,u.node().type.name,u.node().attrs),...t};n.delete(u.pos,d.pos);const w=x?[{type:l,attrs:y},{type:x,attrs:v}]:[{type:l,attrs:y}];if(!wo(n.doc,u.pos,2))return!1;if(i){const{selection:C,storedMarks:N}=r,{splittableMarks:T}=o.extensionManager,D=N||C.$to.parentOffset&&C.$from.marks();if(n.split(u.pos,2,w).scrollIntoView(),!D||!i)return!0;const A=D.filter(_=>T.includes(_.type.name));n.ensureMarks(A)}return!0},mg=(e,t)=>{const n=Rp(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)&&Ts(e.doc,n.pos)&&e.join(n.pos),!0},gg=(e,t)=>{const n=Rp(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)&&Ts(e.doc,r)&&e.join(r),!0};function jU(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Ge.between(r,i)}var DU=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:d,can:h})=>{const{extensions:f,splittableMarks:g}=i.extensionManager,x=dn(e,s.schema),y=dn(t,s.schema),{selection:v,storedMarks:w}=s,{$from:C,$to:N}=v,T=C.blockRange(N),D=w||v.$to.parentOffset&&v.$from.marks();if(!T)return!1;const A=Rp(G=>pg(G.type.name,f))(v),_=v.from===0&&v.to===s.doc.content.size,I=s.doc.content.content,P=I.length===1?I[0]:null,L=_&&P&&pg(P.type.name,f)?{node:P,pos:0}:null,R=A??L,V=!!A&&T.depth>=1&&T.depth-A.depth<=1,K=!!L;if((V||K)&&R){if(R.node.type===x)return _&&K?u().command(({tr:G,dispatch:B})=>{const W=jU(G);return W?(G.setSelection(W),B&&B(G),!0):!1}).liftListItem(y).run():d.liftListItem(y);if(pg(R.node.type.name,f)&&x.validContent(R.node.content))return u().command(()=>(o.setNodeMarkup(R.pos,x),!0)).command(()=>mg(o,x)).command(()=>gg(o,x)).run()}return!n||!D||!l?u().command(()=>h().wrapInList(x,r)?!0:d.clearNodes()).wrapInList(x,r).command(()=>mg(o,x)).command(()=>gg(o,x)).run():u().command(()=>{const G=h().wrapInList(x,r),B=D.filter(W=>g.includes(W.type.name));return o.ensureMarks(B),G?!0:d.clearNodes()}).wrapInList(x,r).command(()=>mg(o,x)).command(()=>gg(o,x)).run()},RU=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=To(e,r.schema);return q1(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},PU=(e,t,n={})=>({state:r,commands:i})=>{const o=dn(e,r.schema),s=dn(t,r.schema),l=ws(r,o,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?i.setNode(s,u):i.setNode(o,{...u,...n})},IU=(e,t={})=>({state:n,commands:r})=>{const i=dn(e,n.schema);return ws(n,i,t)?r.lift(i):r.wrapIn(i,t)},OU=()=>({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 u=l.steps.length-1;u>=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){const u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},LU=()=>({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},FU=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,u=To(e,r.schema),{$from:d,empty:h,ranges:f}=l;if(!i)return!0;if(h&&s){let{from:g,to:x}=l;const y=(o=d.marks().find(w=>w.type===u))==null?void 0:o.attrs,v=Ry(d,u,y);v&&(g=v.from,x=v.to),n.removeMark(g,x,u)}else f.forEach(g=>{n.removeMark(g.$from.pos,g.$to.pos,u)});return n.removeStoredMark(u),!0},zU=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,u)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,t.setNodeMarkup(u,void 0,d)}),!0},BU=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Dp(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(o=dn(e,r.schema)),l==="mark"&&(s=To(e,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;let g,x,y,v;n.selection.empty?r.doc.nodesBetween(h,f,(w,C)=>{o&&o===w.type&&(u=!0,y=Math.max(C,h),v=Math.min(C+w.nodeSize,f),g=C,x=w)}):r.doc.nodesBetween(h,f,(w,C)=>{C<h&&o&&o===w.type&&(u=!0,y=Math.max(C,h),v=Math.min(C+w.nodeSize,f),g=C,x=w),C>=h&&C<=f&&(o&&o===w.type&&(u=!0,i&&n.setNodeMarkup(C,void 0,{...w.attrs,...t})),s&&w.marks.length&&w.marks.forEach(N=>{if(s===N.type&&(u=!0,i)){const T=Math.max(C,h),D=Math.min(C+w.nodeSize,f);n.addMark(T,D,s.create({...N.attrs,...t}))}}))}),x&&(g!==void 0&&i&&n.setNodeMarkup(g,void 0,{...x.attrs,...t}),s&&x.marks.length&&x.marks.forEach(w=>{s===w.type&&i&&n.addMark(y,v,s.create({...w.attrs,...t}))}))}),u},$U=(e,t={})=>({state:n,dispatch:r})=>{const i=dn(e,n.schema);return h$(i,t)(n,r)},VU=(e,t={})=>({state:n,dispatch:r})=>{const i=dn(e,n.schema);return p$(i,t)(n,r)},HU=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={}}},Ip=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},UU=(e,t)=>{if(Dy(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 pf(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:u}=n;if(u.composing)return!1;const d=u.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=mU(d)+o;return s.forEach(g=>{if(h)return;const x=UU(f,g.find);if(!x)return;const y=u.state.tr,v=Mp({state:u.state,transaction:y}),w={from:r-(x[0].length-o.length),to:i},{commands:C,chain:N,can:T}=new jp({editor:n,state:v});g.handler({state:v,range:w,match:x,commands:C,chain:N,can:T})===null||!y.steps.length||(g.undoable&&y.setMeta(l,{transform:y,from:r,to:i,text:o}),u.dispatch(y),h=!0)}),h}function WU(e){const{editor:t,rules:n}=e,r=new vt({state:{init(){return null},apply(i,o,s){const l=i.getMeta(r);if(l)return l;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:h}=u;typeof h=="string"?h=h:h=Bc(se.from(h),s.schema);const{from:f}=u,g=f+h.length;pf({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 pf({editor:t,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&pf({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?pf({editor:t,from:s.pos,to:s.pos,text:`
|
|
474
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function qU(e){return Object.prototype.toString.call(e).slice(8,-1)}function mf(e){return qU(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function _6(e,t){const n={...e};return mf(e)&&mf(t)&&Object.keys(t).forEach(r=>{mf(t[r])&&mf(e[r])?n[r]=_6(e[r],t[r]):n[r]=t[r]}),n}var Oy=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{...gt(Oe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...gt(Oe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>_6(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}},Wr=class M6 extends Oy{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new M6(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 u=s.find(d=>(d==null?void 0:d.type.name)===n.name);return u&&r.removeStoredMark(u),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 KU(e){return typeof e=="number"}var GU=class{constructor(e){this.find=e.find,this.handler=e.handler}},YU=(e,t,n)=>{if(Dy(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 JU(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:u,chain:d,can:h}=new jp({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(x,y)=>{var v,w,C,N,T;if((w=(v=x.type)==null?void 0:v.spec)!=null&&w.code||!(x.isText||x.isTextblock||x.isInline))return;const D=(T=(N=(C=x.content)==null?void 0:C.size)!=null?N:x.nodeSize)!=null?T:0,A=Math.max(r,y),_=Math.min(i,y+D);if(A>=_)return;const I=x.isText?x.text||"":x.textBetween(A-y,_-y,void 0,"");YU(I,o.find,s).forEach(L=>{if(L.index===void 0)return;const R=A+L.index+1,V=R+L[0].length,K={from:n.tr.mapping.map(R),to:n.tr.mapping.map(V)},G=o.handler({state:n,range:K,match:L,commands:u,chain:d,can:h,pasteEvent:s,dropEvent:l});f.push(G)})}),f.every(x=>x!==null)}var gf=null,XU=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function QU(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 u=({state:h,from:f,to:g,rule:x,pasteEvt:y})=>{const v=h.tr,w=Mp({state:h,transaction:v});if(!(!JU({editor:t,state:w,from:Math.max(f-1,0),to:g.b-1,rule:x,pasteEvent:y,dropEvent:l})||!v.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return n.map(h=>new vt({view(f){const g=y=>{var v;r=(v=f.dom.parentElement)!=null&&v.contains(y.target)?f.dom.parentElement:null,r&&(gf=t)},x=()=>{gf&&(gf=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",x),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",x)}}},props:{handleDOMEvents:{drop:(f,g)=>{if(o=r===f.dom.parentElement,l=g,!o){const x=gf;x!=null&&x.isEditable&&setTimeout(()=>{const y=x.state.selection;y&&x.commands.deleteRange({from:y.from,to:y.to})},10)}return!1},paste:(f,g)=>{var x;const y=(x=g.clipboardData)==null?void 0:x.getData("text/html");return s=g,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(f,g,x)=>{const y=f[0],v=y.getMeta("uiEvent")==="paste"&&!i,w=y.getMeta("uiEvent")==="drop"&&!o,C=y.getMeta("applyPasteRules"),N=!!C;if(!v&&!w&&!N)return;if(N){let{text:A}=C;typeof A=="string"?A=A:A=Bc(se.from(A),x.schema);const{from:_}=C,I=_+A.length,P=XU(A);return u({rule:h,state:x,from:_,to:{b:I},pasteEvt:P})}const T=g.doc.content.findDiffStart(x.doc.content),D=g.doc.content.findDiffEnd(x.doc.content);if(!(!KU(T)||!D||T===D.b))return u({rule:h,state:x,from:T,to:D,pasteEvt:s})}}))}var Op=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=w6(e),this.schema=aU(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:Su(t.name,this.schema)},r=Oe(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return Uu([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Su(r.name,this.schema)},o=[],s=Oe(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&Oe(r,"exitable",i)&&(l.ArrowRight=()=>Wr.handleExit({editor:e,mark:r})),s){const g=Object.fromEntries(Object.entries(s()).map(([x,y])=>[x,()=>y({editor:e})]));l={...l,...g}}const u=cH(l);o.push(u);const d=Oe(r,"addInputRules",i);if(cS(r,e.options.enableInputRules)&&d){const g=d();if(g&&g.length){const x=WU({editor:e,rules:g}),y=Array.isArray(x)?x:[x];o.push(...y)}}const h=Oe(r,"addPasteRules",i);if(cS(r,e.options.enablePasteRules)&&h){const g=h();if(g&&g.length){const x=QU({editor:e,rules:g});o.push(...x)}}const f=Oe(r,"addProseMirrorPlugins",i);if(f){const g=f();o.push(...g)}return o})}get attributes(){return v6(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ca(this.extensions);return Object.fromEntries(t.filter(n=>!!Oe(n,"addNodeView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:dn(n.name,this.schema)},o=Oe(n,"addNodeView",i);if(!o)return[];const s=o();if(!s)return[];const l=(u,d,h,f,g)=>{const x=pc(u,r);return s({node:u,view:d,getPos:h,decorations:f,innerDecorations:g,editor:e,extension:n,HTMLAttributes:x})};return[n.name,l]}))}dispatchTransaction(e){const{editor:t}=this;return Uu([...this.extensions].reverse()).reduceRight((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Su(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 Uu([...this.extensions]).reduce((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Su(i.name,this.schema)},s=Oe(i,"transformPastedHTML",o);return s?(l,u)=>{const d=r(l,u);return s.call(o,d)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=Ca(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:To(n.name,this.schema)},o=Oe(n,"addMarkView",i);if(!o)return[];const s=(l,u,d)=>{const h=pc(l,r);return o()({mark:l,view:u,inline:d,editor:e,extension:n,HTMLAttributes:h,updateAttributes:f=>{dW(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:Su(t.name,this.schema)};t.type==="mark"&&((n=gt(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),u=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),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),f&&this.editor.on("destroy",f)})}};Op.resolve=w6;Op.sort=Uu;Op.flatten=Py;var j6={};jy(j6,{ClipboardTextSerializer:()=>R6,Commands:()=>P6,Delete:()=>I6,Drop:()=>O6,Editable:()=>L6,FocusEvents:()=>z6,Keymap:()=>B6,Paste:()=>$6,Tabindex:()=>V6,TextDirection:()=>H6,focusEventsPluginKey:()=>F6});var wt=class D6 extends Oy{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new D6(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},R6=wt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new vt({key:new Ht("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)),u=S6(n);return k6(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),P6=wt.create({name:"commands",addCommands(){return{...d6}}}),I6=wt.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const o=()=>{var s,l,u,d;if((d=(u=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:u.call(l,e))!=null?d:e.getMeta("y-sync$"))return;const h=y6(e.before,[e,...t]);E6(h).forEach(x=>{h.mapping.mapResult(x.oldRange.from).deletedAfter&&h.mapping.mapResult(x.oldRange.to).deletedBefore&&h.before.nodesBetween(x.oldRange.from,x.oldRange.to,(y,v)=>{const w=v+y.nodeSize-2,C=x.oldRange.from<=v&&w<=x.oldRange.to;this.editor.emit("delete",{type:"node",node:y,from:v,to:w,newFrom:h.mapping.map(v),newTo:h.mapping.map(w),deletedRange:x.oldRange,newRange:x.newRange,partial:!C,editor:this.editor,transaction:e,combinedTransform:h})})});const g=h.mapping;h.steps.forEach((x,y)=>{var v,w;if(x instanceof bi){const C=g.slice(y).map(x.from,-1),N=g.slice(y).map(x.to),T=g.invert().map(C,-1),D=g.invert().map(N),A=C>0?(v=h.doc.nodeAt(C-1))==null?void 0:v.marks.some(I=>I.eq(x.mark)):!1,_=(w=h.doc.nodeAt(N))==null?void 0:w.marks.some(I=>I.eq(x.mark));this.editor.emit("delete",{type:"mark",mark:x.mark,from:x.from,to:x.to,deletedRange:{from:T,to:D},newRange:{from:C,to:N},partial:!!(_||A),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()}}),O6=wt.create({name:"drop",addProseMirrorPlugins(){return[new vt({key:new Ht("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),L6=wt.create({name:"editable",addProseMirrorPlugins(){return[new vt({key:new Ht("editable"),props:{editable:()=>this.editor.options.editable}})]}}),F6=new Ht("focusEvents"),z6=wt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new vt({key:F6,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}}}})]}}),B6=wt.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:u,doc:d}=l,{empty:h,$anchor:f}=u,{pos:g,parent:x}=f,y=f.parent.isTextblock&&g>0?l.doc.resolve(g-1):f,v=y.parent.type.spec.isolating,w=f.pos-f.parentOffset,C=v&&y.parent.childCount===1?w===f.pos:Qe.atStart(d).from===g;return!h||!x.type.isTextblock||x.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 ph()||g6()?o:i},addProseMirrorPlugins(){return[new vt({key:new Ht("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(v=>v.getMeta("composition")))return;const r=e.some(v=>v.docChanged)&&!t.doc.eq(n.doc),i=e.some(v=>v.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=t.selection,u=Qe.atStart(t.doc).from,d=Qe.atEnd(t.doc).to;if(o||!(s===u&&l===d)||!Pp(n.doc))return;const g=n.tr,x=Mp({state:n,transaction:g}),{commands:y}=new jp({editor:this.editor,state:x});if(y.clearNodes(),!!g.steps.length)return g}})]}}),$6=wt.create({name:"paste",addProseMirrorPlugins(){return[new vt({key:new Ht("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),V6=wt.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new vt({key:new Ht("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!=null?e:"0"}}}})]}}),H6=wt.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Ca(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 vt({key:new Ht("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),ZU=class Fu{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 Fu(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 Fu(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 Fu(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 u=this.resolvedPos.doc.resolve(l);if(!i&&!s&&u.depth<=this.depth)return;const d=new Fu(u,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 u=s[l];if(o[u]!==n[u])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(u=>n[u]===s.node.attrs[u])&&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)}},eW=`.ProseMirror {
|
|
475
|
+
position: relative;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.ProseMirror {
|
|
479
|
+
word-wrap: break-word;
|
|
480
|
+
white-space: pre-wrap;
|
|
481
|
+
white-space: break-spaces;
|
|
482
|
+
-webkit-font-variant-ligatures: none;
|
|
483
|
+
font-variant-ligatures: none;
|
|
484
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.ProseMirror [contenteditable="false"] {
|
|
488
|
+
white-space: normal;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
492
|
+
white-space: pre-wrap;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.ProseMirror pre {
|
|
496
|
+
white-space: pre-wrap;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
img.ProseMirror-separator {
|
|
500
|
+
display: inline !important;
|
|
501
|
+
border: none !important;
|
|
502
|
+
margin: 0 !important;
|
|
503
|
+
width: 0 !important;
|
|
504
|
+
height: 0 !important;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.ProseMirror-gapcursor {
|
|
508
|
+
display: none;
|
|
509
|
+
pointer-events: none;
|
|
510
|
+
position: absolute;
|
|
511
|
+
margin: 0;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.ProseMirror-gapcursor:after {
|
|
515
|
+
content: "";
|
|
516
|
+
display: block;
|
|
517
|
+
position: absolute;
|
|
518
|
+
top: -2px;
|
|
519
|
+
width: 20px;
|
|
520
|
+
border-top: 1px solid black;
|
|
521
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
@keyframes ProseMirror-cursor-blink {
|
|
525
|
+
to {
|
|
526
|
+
visibility: hidden;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.ProseMirror-hideselection *::selection {
|
|
531
|
+
background: transparent;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
535
|
+
background: transparent;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.ProseMirror-hideselection * {
|
|
539
|
+
caret-color: transparent;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
543
|
+
display: block;
|
|
544
|
+
}`;function tW(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 nW=class extends HU{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:bU,createMappablePosition:vU},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=p6(t,this.options.autofocus);this.editorState=sa.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=tW(eW,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=b6(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?[L6,R6.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),P6,z6,B6,V6.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),O6,$6,I6,H6.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 Op(o,this)}createCommandManager(){this.commandManager=new jp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=W1(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=W1(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 u6(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 u=this.view.dom;u.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"),u=s==null?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),u&&this.emit("blur",{editor:this,event:u.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 C6(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return gU(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Bc(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
|
|
545
|
+
|
|
546
|
+
`,textSerializers:n={}}=e||{};return cU(this.state.doc,{blockSeparator:t,textSerializers:{...S6(this.schema),...n}})}get isEmpty(){return Pp(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 ZU(t,this)}get $doc(){return this.$pos(0)}};function Ea(e){return new Ip({find:e.find,handler:({state:t,range:n,match:r})=>{const i=gt(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 u=l.search(/\S/),d=n.from+l.indexOf(s),h=d+s.length;if(Iy(n.from,n.to,t.doc).filter(x=>x.mark.type.excluded.find(v=>v===e.type&&v!==x.mark.type)).filter(x=>x.to>d).length)return null;h<n.to&&o.delete(h,n.to),d>n.from&&o.delete(n.from+u,d);const g=n.from+u+s.length;o.addMark(n.from+u,g,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function rW(e){return new Ip({find:e.find,handler:({state:t,range:n,match:r})=>{const i=gt(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let l=n.to;const u=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,u)}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 K1(e){return new Ip({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=gt(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 Na(e){return new Ip({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=gt(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&my(u,e.type,o);if(!d)return null;if(s.wrap(u,d),e.keepMarks&&e.editor){const{selection:f,storedMarks:g}=t,{splittableMarks:x}=e.editor.extensionManager,y=g||f.$to.parentOffset&&f.$from.marks();if(y){const v=y.filter(w=>x.includes(w.type.name));s.ensureMarks(v)}}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&&Ts(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,h))&&s.join(n.from-1)},undoable:e.undoable})}function iW(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof ze){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 oW={};jy(oW,{createAtomBlockMarkdownSpec:()=>sW,createBlockMarkdownSpec:()=>lW,createInlineMarkdownSpec:()=>cW,parseAttributes:()=>Ly,parseIndentedBlocks:()=>G1,renderNestedMarkdownContent:()=>zy,serializeAttributes:()=>Fy});function Ly(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),x=n[g];x&&(t[d]=x.slice(1,-1))});const u=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 u&&u.split(/\s+/).filter(Boolean).forEach(h=>{h.match(/^[a-zA-Z][\w-]*$/)&&(t[h]=!0)}),t}function Fy(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 sW(e){const{nodeName:t,name:n,parseAttributes:r=Ly,serializeAttributes:i=Fy,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:l}=e,u=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(`^:::${u}(?:\\s|$)`,"m"),x=(f=h.match(g))==null?void 0:f.index;return x!==void 0?x:-1},tokenize(h,f,g){const x=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),y=h.match(x);if(!y)return;const v=y[1]||"",w=r(v);if(!s.find(N=>!(N in w)))return{type:t,raw:y[0],attributes:w}}},renderMarkdown:h=>{const f=d(h.attrs||{}),g=i(f),x=g?` {${g}}`:"";return`:::${u}${x} :::`}}}function lW(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=Ly,serializeAttributes:o=Fy,defaultAttributes:s={},content:l="block",allowedAttributes:u}=e,d=n||t,h=f=>{if(!u)return f;const g={};return u.forEach(x=>{x in f&&(g[x]=f[x])}),g};return{parseMarkdown:(f,g)=>{let x;if(r){const v=r(f);x=typeof v=="string"?[{type:"text",text:v}]:v}else l==="block"?x=g.parseChildren(f.tokens||[]):x=g.parseInline(f.tokens||[]);const y={...s,...f.attributes};return g.createNode(t,y,x)},markdownTokenizer:{name:t,level:"block",start(f){var g;const x=new RegExp(`^:::${d}`,"m"),y=(g=f.match(x))==null?void 0:g.index;return y!==void 0?y:-1},tokenize(f,g,x){var y;const v=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),w=f.match(v);if(!w)return;const[C,N=""]=w,T=i(N);let D=1;const A=C.length;let _="";const I=/^:::([\w-]*)(\s.*)?/gm,P=f.slice(A);for(I.lastIndex=0;;){const L=I.exec(P);if(L===null)break;const R=L.index,V=L[1];if(!((y=L[2])!=null&&y.endsWith(":::"))){if(V)D+=1;else if(D-=1,D===0){const K=P.slice(0,R);_=K.trim();const G=f.slice(0,A+R+L[0].length);let B=[];if(_)if(l==="block")for(B=x.blockTokens(K),B.forEach(W=>{W.text&&(!W.tokens||W.tokens.length===0)&&(W.tokens=x.inlineTokens(W.text))});B.length>0;){const W=B[B.length-1];if(W.type==="paragraph"&&(!W.text||W.text.trim()===""))B.pop();else break}else B=x.inlineTokens(_);return{type:t,raw:G,attributes:T,content:_,tokens:B}}}}}},renderMarkdown:(f,g)=>{const x=h(f.attrs||{}),y=o(x),v=y?` {${y}}`:"",w=g.renderChildren(f.content||[],`
|
|
547
|
+
|
|
548
|
+
`);return`:::${d}${v}
|
|
549
|
+
|
|
550
|
+
${w}
|
|
551
|
+
|
|
552
|
+
:::`}}}function aW(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 uW(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function cW(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=aW,serializeAttributes:o=uW,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:u}=e,d=n||t,h=g=>{if(!u)return g;const x={};return u.forEach(y=>{const v=typeof y=="string"?y:y.name,w=typeof y=="string"?void 0:y.skipIfDefault;if(v in g){const C=g[v];if(w!==void 0&&C===w)return;x[v]=C}}),x},f=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(g,x)=>{const y={...s,...g.attributes};if(l)return x.createNode(t,y);const v=r?r(g):g.content||"";return v?x.createNode(t,y,[x.createTextNode(v)]):x.createNode(t,y,[])},markdownTokenizer:{name:t,level:"inline",start(g){const x=l?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),y=g.match(x),v=y==null?void 0:y.index;return v!==void 0?v:-1},tokenize(g,x,y){const v=l?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),w=g.match(v);if(!w)return;let C="",N="";if(l){const[,D]=w;N=D}else{const[,D,A]=w;N=D,C=A||""}const T=i(N.trim());return{type:t,raw:w[0],content:C.trim(),attributes:T}}},renderMarkdown:g=>{let x="";r?x=r(g):g.content&&g.content.length>0&&(x=g.content.filter(C=>C.type==="text").map(C=>C.text).join(""));const y=h(g.attrs||{}),v=o(y),w=v?` ${v}`:"";return l?`[${d}${w}]`:`[${d}${w}]${x}[/${d}]`}}}function G1(e,t,n){var r,i,o,s;const l=e.split(`
|
|
553
|
+
`),u=[];let d="",h=0;const f=t.baseIndentSize||2;for(;h<l.length;){const g=l[h],x=g.match(t.itemPattern);if(!x){if(u.length>0)break;if(g.trim()===""){h+=1,d=`${d}${g}
|
|
554
|
+
`;continue}else return}const y=t.extractItemData(x),{indentLevel:v,mainContent:w}=y;d=`${d}${g}
|
|
555
|
+
`;const C=[w];for(h+=1;h<l.length;){const A=l[h];if(A.trim()===""){const I=l.slice(h+1).findIndex(R=>R.trim()!=="");if(I===-1)break;if((((i=(r=l[h+1+I].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>v){C.push(A),d=`${d}${A}
|
|
556
|
+
`,h+=1;continue}else break}if((((s=(o=A.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>v)C.push(A),d=`${d}${A}
|
|
557
|
+
`,h+=1;else break}let N;const T=C.slice(1);if(T.length>0){const A=T.map(_=>_.slice(v+f)).join(`
|
|
558
|
+
`);A.trim()&&(t.customNestedParser?N=t.customNestedParser(A):N=n.blockTokens(A))}const D=t.createToken(y,N);u.push(D)}if(u.length!==0)return{items:u,raw:d}}function zy(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 u=`${i}${l}`;return s&&s.length>0&&s.forEach((d,h)=>{var f,g;const x=(g=(f=t.renderChild)==null?void 0:f.call(t,d,h+1))!=null?g:t.renderChildren([d]);if(x!=null){const y=x.split(`
|
|
559
|
+
`).map(v=>v?t.indent(v):t.indent("")).join(`
|
|
560
|
+
`);u+=d.type==="paragraph"?`
|
|
561
|
+
|
|
562
|
+
${y}`:`
|
|
563
|
+
${y}`}}),u}function dW(e,t,n={}){const{state:r}=t,{doc:i,tr:o}=r,s=e;i.descendants((l,u)=>{const d=o.mapping.map(u),h=o.mapping.map(u)+l.nodeSize;let f=null;if(l.marks.forEach(x=>{if(x!==s)return!1;f=x}),!f)return;let g=!1;if(Object.keys(n).forEach(x=>{n[x]!==f.attrs[x]&&(g=!0)}),g){const x=e.type.create({...e.attrs,...n});o.removeMark(d,h,e.type),o.addMark(d,h,x)}}),o.docChanged&&t.view.dispatch(o)}var yt=class U6 extends Oy{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new U6(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function gl(e){return new GU({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=gt(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=t,l=r[r.length-1],u=r[0];let d=n.to;if(l){const h=u.search(/\S/),f=n.from+u.indexOf(l),g=f+l.length;if(Iy(n.from,n.to,t.doc).filter(v=>v.mark.type.excluded.find(C=>C===e.type&&C!==v.mark.type)).filter(v=>v.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:fW,getOwnPropertySymbols:hW}=Object,{hasOwnProperty:pW}=Object.prototype;function xg(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function xf(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 u=e(n,r,i);return o.delete(n),o.delete(r),u}}function mW(e){return e!=null?e[Symbol.toStringTag]:void 0}function fS(e){return fW(e).concat(hW(e))}const gW=Object.hasOwn||((e,t)=>pW.call(e,t));function Sl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const xW="__v",yW="__o",bW="_owner",{getOwnPropertyDescriptor:hS,keys:pS}=Object;function vW(e,t){return e.byteLength===t.byteLength&&mh(new Uint8Array(e),new Uint8Array(t))}function wW(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 kW(e,t){return e.byteLength===t.byteLength&&mh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function SW(e,t){return Sl(e.getTime(),t.getTime())}function CW(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function EW(e,t){return e===t}function mS(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,u=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,x=l.value;if(n.equals(g[0],x[0],u,f,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){h=i[f]=!0;break}f++}if(!h)return!1;u++}return!0}const NW=Sl;function TW(e,t,n){const r=pS(e);let i=r.length;if(pS(t).length!==i)return!1;for(;i-- >0;)if(!W6(e,t,n,r[i]))return!1;return!0}function Cu(e,t,n){const r=fS(e);let i=r.length;if(fS(t).length!==i)return!1;let o,s,l;for(;i-- >0;)if(o=r[i],!W6(e,t,n,o)||(s=hS(e,o),l=hS(t,o),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function AW(e,t){return Sl(e.valueOf(),t.valueOf())}function _W(e,t){return e.source===t.source&&e.flags===t.flags}function gS(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 u=t.values();let d=!1,h=0;for(;(l=u.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 mh(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 MW(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 W6(e,t,n,r){return(r===bW||r===yW||r===xW)&&(e.$$typeof||t.$$typeof)?!0:gW(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const jW="[object ArrayBuffer]",DW="[object Arguments]",RW="[object Boolean]",PW="[object DataView]",IW="[object Date]",OW="[object Error]",LW="[object Map]",FW="[object Number]",zW="[object Object]",BW="[object RegExp]",$W="[object Set]",VW="[object String]",HW={"[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},UW="[object URL]",WW=Object.prototype.toString;function qW({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:f,areTypedArraysEqual:g,areUrlsEqual:x,unknownTagComparators:y}){return function(w,C,N){if(w===C)return!0;if(w==null||C==null)return!1;const T=typeof w;if(T!==typeof C)return!1;if(T!=="object")return T==="number"?l(w,C,N):T==="function"?o(w,C,N):!1;const D=w.constructor;if(D!==C.constructor)return!1;if(D===Object)return u(w,C,N);if(Array.isArray(w))return t(w,C,N);if(D===Date)return r(w,C,N);if(D===RegExp)return h(w,C,N);if(D===Map)return s(w,C,N);if(D===Set)return f(w,C,N);const A=WW.call(w);if(A===IW)return r(w,C,N);if(A===BW)return h(w,C,N);if(A===LW)return s(w,C,N);if(A===$W)return f(w,C,N);if(A===zW)return typeof w.then!="function"&&typeof C.then!="function"&&u(w,C,N);if(A===UW)return x(w,C,N);if(A===OW)return i(w,C,N);if(A===DW)return u(w,C,N);if(HW[A])return g(w,C,N);if(A===jW)return e(w,C,N);if(A===PW)return n(w,C,N);if(A===RW||A===FW||A===VW)return d(w,C,N);if(y){let _=y[A];if(!_){const I=mW(w);I&&(_=y[I])}if(_)return _(w,C,N)}return!1}}function KW({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:vW,areArraysEqual:n?Cu:wW,areDataViewsEqual:kW,areDatesEqual:SW,areErrorsEqual:CW,areFunctionsEqual:EW,areMapsEqual:n?xg(mS,Cu):mS,areNumbersEqual:NW,areObjectsEqual:n?Cu:TW,arePrimitiveWrappersEqual:AW,areRegExpsEqual:_W,areSetsEqual:n?xg(gS,Cu):gS,areTypedArraysEqual:n?xg(mh,Cu):mh,areUrlsEqual:MW,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=xf(r.areArraysEqual),o=xf(r.areMapsEqual),s=xf(r.areObjectsEqual),l=xf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return r}function GW(e){return function(t,n,r,i,o,s,l){return e(t,n,l)}}function YW({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(l,u){const{cache:d=e?new WeakMap:void 0,meta:h}=n();return t(l,u,{cache:d,equals:r,meta:h,strict:i})};if(e)return function(l,u){return t(l,u,{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,u){return t(l,u,o)}}const JW=_s();_s({strict:!0});_s({circular:!0});_s({circular:!0,strict:!0});_s({createInternalComparator:()=>Sl});_s({strict:!0,createInternalComparator:()=>Sl});_s({circular:!0,createInternalComparator:()=>Sl});_s({circular:!0,createInternalComparator:()=>Sl,strict:!0});function _s(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=KW(e),s=qW(o),l=n?n(s):GW(s);return YW({circular:t,comparator:s,createState:r,equals:l,strict:i})}var yg={exports:{}},bg={};/**
|
|
564
|
+
* @license React
|
|
565
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
566
|
+
*
|
|
567
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
568
|
+
*
|
|
569
|
+
* This source code is licensed under the MIT license found in the
|
|
570
|
+
* LICENSE file in the root directory of this source tree.
|
|
571
|
+
*/var xS;function XW(){if(xS)return bg;xS=1;var e=Cc(),t=x4();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,u=e.useDebugValue;return bg.useSyncExternalStoreWithSelector=function(d,h,f,g,x){var y=o(null);if(y.current===null){var v={hasValue:!1,value:null};y.current=v}else v=y.current;y=l(function(){function C(_){if(!N){if(N=!0,T=_,_=g(_),x!==void 0&&v.hasValue){var I=v.value;if(x(I,_))return D=I}return D=_}if(I=D,r(T,_))return I;var P=g(_);return x!==void 0&&x(I,P)?(T=_,I):(T=_,D=P)}var N=!1,T,D,A=f===void 0?null:f;return[function(){return C(h())},A===null?void 0:function(){return C(A())}]},[h,f,g,x]);var w=i(d,y[0],y[1]);return s(function(){v.hasValue=!0,v.value=w},[w]),u(w),w},bg}var yS;function QW(){return yS||(yS=1,yg.exports=XW()),yg.exports}var ZW=QW(),eq=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},tq=({contentComponent:e})=>{const t=Qx.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return p.jsx(p.Fragment,{children:Object.values(t)})};function nq(){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]:bx.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 rq=class extends de.Component{constructor(e){super(e),this.editorContentRef=de.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=nq(),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:eq(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&p.jsx(tq,{contentComponent:e.contentComponent})]})}},iq=k.forwardRef((e,t)=>{const n=de.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return de.createElement(rq,{key:n,innerRef:t,...e})}),q6=de.memo(iq),oq=typeof window<"u"?k.useLayoutEffect:k.useEffect,sq=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 lq(e){var t;const[n]=k.useState(()=>new sq(e.editor)),r=ZW.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:JW);return oq(()=>n.watch(e.editor),[e.editor,n]),k.useDebugValue(r),r}var K6=typeof window>"u",aq=K6||!!(typeof window<"u"&&window.next),uq=class G6{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&&(K6||aq)&&(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 nW(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?G6.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 cq(e={},t=[]){const n=k.useRef(e);n.current=e;const[r]=k.useState(()=>new uq(n)),i=Qx.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return k.useDebugValue(i),k.useEffect(r.onRender(t)),lq({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&o===0?0:o+1}),i}var Y6=k.createContext({editor:null});Y6.Consumer;var dq=k.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),fq=()=>k.useContext(dq);de.forwardRef((e,t)=>{const{onDragStart:n}=fq(),r=e.as||"div";return p.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});de.createContext({markViewContentRef:()=>{}});var By=k.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});By.displayName="TiptapContext";var hq=()=>k.useContext(By);function J6({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=k.useMemo(()=>({editor:r}),[r]),o=k.useMemo(()=>({editor:r}),[r]);return p.jsx(Y6.Provider,{value:o,children:p.jsx(By.Provider,{value:i,children:n})})}J6.displayName="Tiptap";function X6({...e}){const{editor:t}=hq();return p.jsx(q6,{editor:t,...e})}X6.displayName="Tiptap.Content";Object.assign(J6,{Content:X6});var gh=(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]},pq=/^\s*>\s$/,mq=yt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return gh("blockquote",{...fn(this.options.HTMLAttributes,e),children:gh("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(`
|
|
572
|
+
`).map(f=>f.trim()===""?n:`${n} ${f}`);r.push(h.join(`
|
|
573
|
+
`))}),r.join(`
|
|
574
|
+
${n}
|
|
575
|
+
`)},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[Na({find:pq,type:this.type})]}}),gq=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xq=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,yq=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,bq=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vq=Wr.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 gh("strong",{...fn(this.options.HTMLAttributes,e),children:gh("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[Ea({find:gq,type:this.type}),Ea({find:yq,type:this.type})]},addPasteRules(){return[gl({find:xq,type:this.type}),gl({find:bq,type:this.type})]}}),wq=/(^|[^`])`([^`]+)`(?!`)$/,kq=/(^|[^`])`([^`]+)`(?!`)/g,Sq=Wr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",fn(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[Ea({find:wq,type:this.type})]},addPasteRules(){return[gl({find:kq,type:this.type})]}}),vg=4,Cq=/^```([a-z]+)?[\s\n]$/,Eq=/^~~~([a-z]+)?[\s\n]$/,Nq=yt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:vg,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",fn(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(`
|
|
576
|
+
`):r=`\`\`\`${i}
|
|
577
|
+
|
|
578
|
+
\`\`\``,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:vg,{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:u})=>{const{from:d,to:h}=i,x=r.doc.textBetween(d,h,`
|
|
579
|
+
`,`
|
|
580
|
+
`).split(`
|
|
581
|
+
`).map(y=>l+y).join(`
|
|
582
|
+
`);return u.replaceWith(d,h,r.schema.text(x)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:vg,{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 u;const{pos:d}=o,h=o.start(),f=o.end(),x=r.doc.textBetween(h,f,`
|
|
583
|
+
`,`
|
|
584
|
+
`).split(`
|
|
585
|
+
`);let y=0,v=0;const w=d-h;for(let _=0;_<x.length;_+=1){if(v+x[_].length>=w){y=_;break}v+=x[_].length+1}const N=((u=x[y].match(/^ */))==null?void 0:u[0])||"",T=Math.min(N.length,n);if(T===0)return!0;let D=h;for(let _=0;_<y;_+=1)D+=x[_].length+1;return l.delete(D,D+T),d-D<=T&&l.setSelection(Ge.create(l.doc,D)),!0}):e.commands.command(({tr:l})=>{const{from:u,to:d}=i,g=r.doc.textBetween(u,d,`
|
|
586
|
+
`,`
|
|
587
|
+
`).split(`
|
|
588
|
+
`).map(x=>{var y;const v=((y=x.match(/^ */))==null?void 0:y[0])||"",w=Math.min(v.length,n);return x.slice(w)}).join(`
|
|
589
|
+
`);return l.replaceWith(u,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(`
|
|
590
|
+
|
|
591
|
+
`);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(Qe.near(r.resolve(l))),!0)):e.commands.exitCode()}}},addInputRules(){return[K1({find:Cq,type:this.type,getAttributes:e=>({language:e[1]})}),K1({find:Eq,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new vt({key:new Ht("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,u=l.text(n.replace(/\r\n?/g,`
|
|
592
|
+
`));return s.replaceSelectionWith(this.type.create({language:o},u)),s.selection.$from.parent.type!==this.type&&s.setSelection(Ge.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),Tq=yt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
593
|
+
|
|
594
|
+
`):""}),Aq=yt.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",fn(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
595
|
+
`},renderMarkdown:()=>`
|
|
596
|
+
`,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,u=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&u&&s){const f=u.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()}}}),_q=yt.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]}`,fn(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=>K1({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Mq=yt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",fn(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!iW(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return N6(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:u}=s.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?s.setSelection(Ge.create(s.doc,u.pos+1)):u.nodeAfter.isBlock?s.setSelection(ze.create(s.doc,u.pos)):s.setSelection(Ge.create(s.doc,u.pos));else{const h=o.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,f=h==null?void 0:h.create();f&&(s.insert(d,f),s.setSelection(Ge.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[rW({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),jq=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Dq=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Rq=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Pq=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Iq=Wr.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",fn(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[Ea({find:jq,type:this.type}),Ea({find:Rq,type:this.type})]},addPasteRules(){return[gl({find:Dq,type:this.type}),gl({find:Pq,type:this.type})]}});const Oq="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Lq="ελ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",Y1="numeric",J1="ascii",X1="alpha",Wu="asciinumeric",zu="alphanumeric",Q1="domain",Q6="emoji",Fq="scheme",zq="slashscheme",wg="whitespace";function Bq(e,t){return e in t||(t[e]=[]),t[e]}function Zs(e,t,n){t[Y1]&&(t[Wu]=!0,t[zu]=!0),t[J1]&&(t[Wu]=!0,t[X1]=!0),t[Wu]&&(t[zu]=!0),t[X1]&&(t[zu]=!0),t[zu]&&(t[Q1]=!0),t[Q6]&&(t[Q1]=!0);for(const r in t){const i=Bq(r,n);i.indexOf(e)<0&&i.push(e)}}function $q(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Tr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Tr.groups={};Tr.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||Tr.groups;let i;return t&&t.j?i=t:(i=new Tr(t),n&&r&&Zs(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||Tr.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 Tr,Object.assign(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new Tr,o){if(r)if(s.t&&typeof s.t=="string"){const u=Object.assign($q(s.t,r),n);Zs(o,u,r)}else n&&Zs(o,n,r);s.t=o}return i.j[e]=s,s}};const Ze=(e,t,n,r,i)=>e.ta(t,n,r,i),qt=(e,t,n,r,i)=>e.tr(t,n,r,i),bS=(e,t,n,r,i)=>e.ts(t,n,r,i),me=(e,t,n,r,i)=>e.tt(t,n,r,i),mo="WORD",Z1="UWORD",Z6="ASCIINUMERICAL",e_="ALPHANUMERICAL",mc="LOCALHOST",ex="TLD",tx="UTLD",Lf="SCHEME",ia="SLASH_SCHEME",$y="NUM",nx="WS",Vy="NL",qu="OPENBRACE",Ku="CLOSEBRACE",xh="OPENBRACKET",yh="CLOSEBRACKET",bh="OPENPAREN",vh="CLOSEPAREN",wh="OPENANGLEBRACKET",kh="CLOSEANGLEBRACKET",Sh="FULLWIDTHLEFTPAREN",Ch="FULLWIDTHRIGHTPAREN",Eh="LEFTCORNERBRACKET",Nh="RIGHTCORNERBRACKET",Th="LEFTWHITECORNERBRACKET",Ah="RIGHTWHITECORNERBRACKET",_h="FULLWIDTHLESSTHAN",Mh="FULLWIDTHGREATERTHAN",jh="AMPERSAND",Dh="APOSTROPHE",Rh="ASTERISK",ts="AT",Ph="BACKSLASH",Ih="BACKTICK",Oh="CARET",el="COLON",Hy="COMMA",Lh="DOLLAR",Ri="DOT",Fh="EQUALS",Uy="EXCLAMATION",ti="HYPHEN",Gu="PERCENT",zh="PIPE",Bh="PLUS",$h="POUND",Yu="QUERY",Wy="QUOTE",t_="FULLWIDTHMIDDLEDOT",qy="SEMI",Pi="SLASH",Ju="TILDE",Vh="UNDERSCORE",n_="EMOJI",Hh="SYM";var r_=Object.freeze({__proto__:null,ALPHANUMERICAL:e_,AMPERSAND:jh,APOSTROPHE:Dh,ASCIINUMERICAL:Z6,ASTERISK:Rh,AT:ts,BACKSLASH:Ph,BACKTICK:Ih,CARET:Oh,CLOSEANGLEBRACKET:kh,CLOSEBRACE:Ku,CLOSEBRACKET:yh,CLOSEPAREN:vh,COLON:el,COMMA:Hy,DOLLAR:Lh,DOT:Ri,EMOJI:n_,EQUALS:Fh,EXCLAMATION:Uy,FULLWIDTHGREATERTHAN:Mh,FULLWIDTHLEFTPAREN:Sh,FULLWIDTHLESSTHAN:_h,FULLWIDTHMIDDLEDOT:t_,FULLWIDTHRIGHTPAREN:Ch,HYPHEN:ti,LEFTCORNERBRACKET:Eh,LEFTWHITECORNERBRACKET:Th,LOCALHOST:mc,NL:Vy,NUM:$y,OPENANGLEBRACKET:wh,OPENBRACE:qu,OPENBRACKET:xh,OPENPAREN:bh,PERCENT:Gu,PIPE:zh,PLUS:Bh,POUND:$h,QUERY:Yu,QUOTE:Wy,RIGHTCORNERBRACKET:Nh,RIGHTWHITECORNERBRACKET:Ah,SCHEME:Lf,SEMI:qy,SLASH:Pi,SLASH_SCHEME:ia,SYM:Hh,TILDE:Ju,TLD:ex,UNDERSCORE:Vh,UTLD:tx,UWORD:Z1,WORD:mo,WS:nx});const fo=/[a-z]/,Eu=new RegExp("\\p{L}","u"),kg=new RegExp("\\p{Emoji}","u"),ho=/\d/,Sg=/\s/,vS="\r",Cg=`
|
|
597
|
+
`,Vq="️",Hq="",Eg="";let yf=null,bf=null;function Uq(e=[]){const t={};Tr.groups=t;const n=new Tr;yf==null&&(yf=wS(Oq)),bf==null&&(bf=wS(Lq)),me(n,"'",Dh),me(n,"{",qu),me(n,"}",Ku),me(n,"[",xh),me(n,"]",yh),me(n,"(",bh),me(n,")",vh),me(n,"<",wh),me(n,">",kh),me(n,"(",Sh),me(n,")",Ch),me(n,"「",Eh),me(n,"」",Nh),me(n,"『",Th),me(n,"』",Ah),me(n,"<",_h),me(n,">",Mh),me(n,"&",jh),me(n,"*",Rh),me(n,"@",ts),me(n,"`",Ih),me(n,"^",Oh),me(n,":",el),me(n,",",Hy),me(n,"$",Lh),me(n,".",Ri),me(n,"=",Fh),me(n,"!",Uy),me(n,"-",ti),me(n,"%",Gu),me(n,"|",zh),me(n,"+",Bh),me(n,"#",$h),me(n,"?",Yu),me(n,'"',Wy),me(n,"/",Pi),me(n,";",qy),me(n,"~",Ju),me(n,"_",Vh),me(n,"\\",Ph),me(n,"・",t_);const r=qt(n,ho,$y,{[Y1]:!0});qt(r,ho,r);const i=qt(r,fo,Z6,{[Wu]:!0}),o=qt(r,Eu,e_,{[zu]:!0}),s=qt(n,fo,mo,{[J1]:!0});qt(s,ho,i),qt(s,fo,s),qt(i,ho,i),qt(i,fo,i);const l=qt(n,Eu,Z1,{[X1]:!0});qt(l,fo),qt(l,ho,o),qt(l,Eu,l),qt(o,ho,o),qt(o,fo),qt(o,Eu,o);const u=me(n,Cg,Vy,{[wg]:!0}),d=me(n,vS,nx,{[wg]:!0}),h=qt(n,Sg,nx,{[wg]:!0});me(n,Eg,h),me(d,Cg,u),me(d,Eg,h),qt(d,Sg,h),me(h,vS),me(h,Cg),qt(h,Sg,h),me(h,Eg,h);const f=qt(n,kg,n_,{[Q6]:!0});me(f,"#"),qt(f,kg,f),me(f,Vq,f);const g=me(f,Hq);me(g,"#"),qt(g,kg,f);const x=[[fo,s],[ho,i]],y=[[fo,null],[Eu,l],[ho,o]];for(let v=0;v<yf.length;v++)Jo(n,yf[v],ex,mo,x);for(let v=0;v<bf.length;v++)Jo(n,bf[v],tx,Z1,y);Zs(ex,{tld:!0,ascii:!0},t),Zs(tx,{utld:!0,alpha:!0},t),Jo(n,"file",Lf,mo,x),Jo(n,"mailto",Lf,mo,x),Jo(n,"http",ia,mo,x),Jo(n,"https",ia,mo,x),Jo(n,"ftp",ia,mo,x),Jo(n,"ftps",ia,mo,x),Zs(Lf,{scheme:!0,ascii:!0},t),Zs(ia,{slashscheme:!0,ascii:!0},t),e=e.sort((v,w)=>v[0]>w[0]?1:-1);for(let v=0;v<e.length;v++){const w=e[v][0],N=e[v][1]?{[Fq]:!0}:{[zq]:!0};w.indexOf("-")>=0?N[Q1]=!0:fo.test(w)?ho.test(w)?N[Wu]=!0:N[J1]=!0:N[Y1]=!0,bS(n,w,w,N)}return bS(n,"localhost",mc,{ascii:!0}),n.jd=new Tr(Hh),{start:n,tokens:Object.assign({groups:t},r_)}}function i_(e,t){const n=Wq(t.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let l=e,u=null,d=0,h=null,f=-1,g=-1;for(;s<r&&(u=l.go(n[s]));)l=u,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 Wq(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 Jo(e,t,n,r,i){let o;const s=t.length;for(let l=0;l<s-1;l++){const u=t[l];e.j[u]?o=e.j[u]:(o=new Tr(r),o.jr=i.slice(),e.j[u]=o),e=o}return o=new Tr(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function wS(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 gc={defaultProtocol:"http",events:null,format:kS,formatHref:kS,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ky(e,t=null){let n=Object.assign({},gc);e&&(n=Object.assign(n,e instanceof Ky?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}Ky.prototype={o:gc,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]:gc[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 kS(e){return e}function o_(e,t){this.t="token",this.v=e,this.tk=t}o_.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=gc.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),u=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),u&&(s.target=u),d&&(s.rel=d),h&&Object.assign(s,h),{tagName:i,attributes:s,content:o,eventListeners:f}}};function Lp(e,t){class n extends o_{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 qq=Lp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),SS=Lp("text"),Kq=Lp("nl"),vf=Lp("url",{isLink:!0,toHref(e=gc.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==mc&&e[1].t===el}}),ei=e=>new Tr(e);function Gq({groups:e}){const t=e.domain.concat([jh,Rh,ts,Ph,Ih,Oh,Lh,Fh,ti,$y,Gu,zh,Bh,$h,Pi,Hh,Ju,Vh]),n=[Dh,el,Hy,Ri,Uy,Gu,Yu,Wy,qy,wh,kh,qu,Ku,yh,xh,bh,vh,Sh,Ch,Eh,Nh,Th,Ah,_h,Mh],r=[jh,Dh,Rh,Ph,Ih,Oh,Lh,Fh,ti,qu,Ku,Gu,zh,Bh,$h,Yu,Pi,Hh,Ju,Vh],i=ei(),o=me(i,Ju);Ze(o,r,o),Ze(o,e.domain,o);const s=ei(),l=ei(),u=ei();Ze(i,e.domain,s),Ze(i,e.scheme,l),Ze(i,e.slashscheme,u),Ze(s,r,o),Ze(s,e.domain,s);const d=me(s,ts);me(o,ts,d),me(l,ts,d),me(u,ts,d);const h=me(o,Ri);Ze(h,r,o),Ze(h,e.domain,o);const f=ei();Ze(d,e.domain,f),Ze(f,e.domain,f);const g=me(f,Ri);Ze(g,e.domain,f);const x=ei(qq);Ze(g,e.tld,x),Ze(g,e.utld,x),me(d,mc,x);const y=me(f,ti);me(y,ti,y),Ze(y,e.domain,f),Ze(x,e.domain,f),me(x,Ri,g),me(x,ti,y);const v=me(s,ti),w=me(s,Ri);me(v,ti,v),Ze(v,e.domain,s),Ze(w,r,o),Ze(w,e.domain,s);const C=ei(vf);Ze(w,e.tld,C),Ze(w,e.utld,C),Ze(C,e.domain,s),Ze(C,r,o),me(C,Ri,w),me(C,ti,v),me(C,ts,d);const N=me(C,el),T=ei(vf);Ze(N,e.numeric,T);const D=ei(vf),A=ei();Ze(D,t,D),Ze(D,n,A),Ze(A,t,D),Ze(A,n,A),me(C,Pi,D),me(T,Pi,D);const _=me(l,el),I=me(u,el),P=me(I,Pi),L=me(P,Pi);Ze(l,e.domain,s),me(l,Ri,w),me(l,ti,v),Ze(u,e.domain,s),me(u,Ri,w),me(u,ti,v),Ze(_,e.domain,D),me(_,Pi,D),me(_,Yu,D),Ze(L,e.domain,D),Ze(L,t,D),me(L,Pi,D);const R=[[qu,Ku],[xh,yh],[bh,vh],[wh,kh],[Sh,Ch],[Eh,Nh],[Th,Ah],[_h,Mh]];for(let V=0;V<R.length;V++){const[K,G]=R[V],B=me(D,K);me(A,K,B);const W=ei(vf);Ze(B,t,W);const U=ei();Ze(B,n,U),me(B,G,D),Ze(W,t,W),Ze(W,n,U),Ze(U,t,W),Ze(U,n,U),me(W,G,D),me(U,G,D)}return me(i,mc,C),me(i,Vy,Kq),{start:i,tokens:r_}}function Yq(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=e,u=null,d=null,h=0,f=null,g=-1;for(;i<r&&!(u=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(d=u||l.go(n[i].t));)u=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(Ng(SS,t,s)),s=[]),i-=g,h-=g;const x=f.t,y=n.slice(i-h,i);o.push(Ng(x,t,y))}}return s.length>0&&o.push(Ng(SS,t,s)),o}function Ng(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 Jq=typeof console<"u"&&console&&console.warn||(()=>{}),Xq="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Rt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Qq(){return Tr.groups={},Rt.scanner=null,Rt.parser=null,Rt.tokenQueue=[],Rt.pluginQueue=[],Rt.customSchemes=[],Rt.initialized=!1,Rt}function CS(e,t=!1){if(Rt.initialized&&Jq(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Xq}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|
|
598
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
599
|
+
2. Cannot start or end with "-"
|
|
600
|
+
3. "-" cannot repeat`);Rt.customSchemes.push([e,t])}function Zq(){Rt.scanner=Uq(Rt.customSchemes);for(let e=0;e<Rt.tokenQueue.length;e++)Rt.tokenQueue[e][1]({scanner:Rt.scanner});Rt.parser=Gq(Rt.scanner.tokens);for(let e=0;e<Rt.pluginQueue.length;e++)Rt.pluginQueue[e][1]({scanner:Rt.scanner,parser:Rt.parser});return Rt.initialized=!0,Rt}function Gy(e){return Rt.initialized||Zq(),Yq(Rt.parser.start,e,i_(Rt.scanner.start,e))}Gy.scan=i_;function s_(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 Ky(n),i=Gy(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 Yy="[\0- -\u2029 ]",eK=new RegExp(Yy),tK=new RegExp(`${Yy}$`),nK=new RegExp(Yy,"g");function rK(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function iK(e){return new vt({key:new Ht("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=y6(n.doc,[...t]);if(E6(l).forEach(({newRange:d})=>{const h=rU(r.doc,d,x=>x.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 x=r.doc.textBetween(d.from,d.to," "," ");if(!tK.test(x))return;f=h[0],g=r.doc.textBetween(f.pos,d.to,void 0," ")}if(f&&g){const x=g.split(eK).filter(Boolean);if(x.length<=0)return!1;const y=x[x.length-1],v=f.pos+g.lastIndexOf(y);if(!y)return!1;const w=Gy(y).map(C=>C.toObject(e.defaultProtocol));if(!rK(w))return!1;w.filter(C=>C.isLink).map(C=>({...C,from:v+C.start+1,to:v+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=>{Iy(C.from,C.to,r.doc).some(N=>N.mark.type===e.type)||s.addMark(C.from,C.to,e.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function oK(e){return new vt({key:new Ht("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 u=r.target;if(!u)return!1;const d=e.editor.view.dom;s=u.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 u=C6(t.state,e.type.name),d=(i=s.href)!=null?i:u.href,h=(o=s.target)!=null?o:u.target;d&&(window.open(d,h),l=!0)}return l}}})}function sK(e){return new vt({key:new Ht("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:o}=t,{selection:s}=o,{empty:l}=s;if(l)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const d=s_(u,{defaultProtocol:e.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!d||i!==void 0&&!i(d.value)?!1:e.editor.commands.setMark(e.type,{href:d.href})}}})}function qs(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(nK,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var l_=Wr.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"){CS(e);return}CS(e.scheme,e.optionalSlashes)})},onDestroy(){Qq()},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)=>!!qs(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=>!!qs(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=>!!qs(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",fn(this.options.HTMLAttributes,e),0]:["a",fn(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:"",u=t.renderChildren(e);return l?`[${u}](${s} "${l}")`:`[${u}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!qs(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=>!!qs(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[gl({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=s_(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!qs(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(iK({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!qs(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(oK({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(sK({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),lK=l_,aK=Object.defineProperty,uK=(e,t)=>{for(var n in t)aK(e,n,{get:t[n],enumerable:!0})},cK="listItem",ES="textStyle",NS=/^\s*([-+*])\s$/,a_=yt.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",fn(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,`
|
|
601
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cK,this.editor.getAttributes(ES)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Na({find:NS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Na({find:NS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ES),editor:this.editor})),[e]}});function dK(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 fK(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var u_=yt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",fn(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(dK(e))return{type:"listItem",content:[{type:"paragraph",content:fK(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 u=e.tokens.slice(1),d=r(u);i.push(...d)}}else i=r(e.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(e,t,n)=>zy(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)}}}),hK={};uK(hK,{findListItemPos:()=>$c,getNextListDepth:()=>Jy,handleBackspace:()=>rx,handleDelete:()=>ix,hasListBefore:()=>c_,hasListItemAfter:()=>pK,hasListItemBefore:()=>d_,listItemHasSubList:()=>f_,nextListIsDeeper:()=>h_,nextListIsHigher:()=>p_});var $c=(e,t)=>{const{$from:n}=t.selection,r=dn(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}},Jy=(e,t)=>{const n=$c(e,t);if(!n)return!1;const[,r]=pU(t,e,n.$pos.pos+4);return r},c_=(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))},d_=(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)},f_=(e,t,n)=>{if(!n)return!1;const r=dn(e,t.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},rx=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!ws(e.state,t)&&c_(e.state,t,n)){const{$anchor:l}=e.state.selection,u=e.state.doc.resolve(l.before()-1),d=[];u.node().descendants((g,x)=>{g.type.name===t&&d.push({node:g,pos:x})});const h=d.at(-1);if(!h)return!1;const f=e.state.doc.resolve(u.start()+h.pos+1);return e.chain().cut({from:l.start()-1,to:l.end()+1},f.end()).joinForward().run()}if(!ws(e.state,t)||!yU(e.state))return!1;const r=$c(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=f_(t,e.state,o);return d_(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},h_=(e,t)=>{const n=Jy(e,t),r=$c(e,t);return!r||!n?!1:n>r.depth},p_=(e,t)=>{const n=Jy(e,t),r=$c(e,t);return!r||!n?!1:n<r.depth},ix=(e,t)=>{if(!ws(e.state,t)||!xU(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:h_(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():p_(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},pK=(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)},m_=wt.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&&ix(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&&ix(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&&rx(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&&rx(e,n,r)&&(t=!0)}),t}}}}),TS=/^(\s*)(\d+)\.\s+(.*)$/,mK=/^\s/;function gK(e){const t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function xK(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&&gK(i)){r=!0,n.push(i);return}t.push(i)}),{paragraphLines:t,blockLines:n}}function yK(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,u]=o,d=s.length,h=[u];let f=n+1;const g=[i];let x=!1;for(;f<e.length;){const y=e[f];if(y.match(TS))break;if(y.trim()==="")g.push(y),h.push(""),x=!0,f+=1;else if(y.match(mK))g.push(y),h.push(y.slice(d+2)),f+=1;else{if(x)break;g.push(y),h.push(y),f+=1}}t.push({indent:d,number:parseInt(l,10),content:h.join(`
|
|
602
|
+
`).trim(),contentLines:h,raw:g.join(`
|
|
603
|
+
`)}),r=f,n=f}return[t,r]}function g_(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}=xK(o.contentLines),u=s.join(`
|
|
604
|
+
`).trim(),d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const h=l.join(`
|
|
605
|
+
`).trim();if(h){const x=n.blockTokens(h);d.push(...x)}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 x=Math.min(...g.map(v=>v.indent)),y=g_(g,x,n);d.push({type:"list",ordered:!0,start:g[0].number,items:y,raw:g.map(v=>v.raw).join(`
|
|
606
|
+
`)})}r.push({type:"list_item",raw:o.raw,tokens:d}),i=f}else i+=1}return r}function bK(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 vK="listItem",AS="textStyle",_S=/^(\d+)\.\s$/,x_=yt.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",fn(this.options.HTMLAttributes,n),0]:["ol",fn(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?bK(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,`
|
|
607
|
+
`):"",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(`
|
|
608
|
+
`),[o,s]=yK(i);if(o.length===0)return;const l=g_(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(`
|
|
609
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(vK,this.editor.getAttributes(AS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Na({find:_S,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=Na({find:_S,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(AS)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),wK=/^\s*(\[([( |x])?\])\s$/,y_=yt.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",fn(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 zy(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"),u=document.createElement("div"),d=f=>{var g,x;l.ariaLabel=((x=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:x.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:x})=>{const y=n();if(typeof y!="number")return!1;const v=x.doc.nodeAt(y);return x.setNodeMarkup(y,void 0,{...v==null?void 0:v.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,u),Object.entries(t).forEach(([f,g])=>{i.setAttribute(f,g)});let h=new Set(Object.keys(t));return{dom:i,contentDOM:u,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,x=pc(f,g),y=new Set(Object.keys(x)),v=this.options.HTMLAttributes;return h.forEach(w=>{y.has(w)||(w in v?i.setAttribute(w,v[w]):i.removeAttribute(w))}),Object.entries(x).forEach(([w,C])=>{C==null?w in v?i.setAttribute(w,v[w]):i.removeAttribute(w):i.setAttribute(w,C)}),h=y,!0}}}},addInputRules(){return[Na({find:wK,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),b_=yt.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",fn(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,`
|
|
610
|
+
`):"",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=G1(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(o)},i=G1(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()}}});wt.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(a_.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(u_.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(m_.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(x_.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(y_.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(b_.configure(this.options.taskList)),e}});var wf=" ",Tg=" ",kK=yt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",fn(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===wf||n[0].text===wf||n[0].raw===Tg||n[0].text===Tg)&&r.length===1&&r[0].type==="text"&&(r[0].text===wf||r[0].text===Tg)?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?wf:""}return t.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),SK=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,CK=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,EK=Wr.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",fn(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[Ea({find:SK,type:this.type})]},addPasteRules(){return[gl({find:CK,type:this.type})]}}),NK=yt.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),TK=Wr.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",fn(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 AK(e={}){return new vt({view(t){return new _K(t,e)}})}class _K{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 x=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(x){let y=x.getBoundingClientRect(),v=f?y.bottom:y.top;f&&g&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let w=this.width/2*l;r={left:y.left,right:y.right,top:v-w,bottom:v+w}}}}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 u=this.editorView.dom.offsetParent;this.element||(this.element=u.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(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,h=-pageYOffset;else{let f=u.getBoundingClientRect(),g=f.width/u.offsetWidth,x=f.height/u.offsetHeight;d=f.left-u.scrollLeft*g,h=f.top-u.scrollTop*x}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=uA(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 Gt extends Qe{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Gt.valid(r)?new Gt(r):Qe.near(r)}content(){return Se.empty}eq(t){return t instanceof Gt&&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 Gt(t.resolve(n.pos))}getBookmark(){return new Xy(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!MK(t)||!jK(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&&Gt.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 u=t.doc.resolve(i);if(Gt.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!ze.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(Gt.valid(l))return l}return null}}}Gt.prototype.visible=!1;Gt.findFrom=Gt.findGapCursorFrom;Qe.jsonID("gapcursor",Gt);class Xy{constructor(t){this.pos=t}map(t){return new Xy(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Gt.valid(n)?new Gt(n):Qe.near(n)}}function v_(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function MK(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||v_(i.type))return!0;if(i.inlineContent)return!1}}return!0}function jK(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||v_(i.type))return!0;if(i.inlineContent)return!1}}return!0}function DK(){return new vt({props:{decorations:OK,createSelectionBetween(e,t,n){return t.pos==n.pos&&Gt.valid(n)?new Gt(n):null},handleClick:PK,handleKeyDown:RK,handleDOMEvents:{beforeinput:IK}}})}const RK=c6({ArrowLeft:kf("horiz",-1),ArrowRight:kf("horiz",1),ArrowUp:kf("vert",-1),ArrowDown:kf("vert",1)});function kf(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,u=s.empty;if(s instanceof Ge){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(t>0?l.after():l.before())}let d=Gt.findGapCursorFrom(l,t,u);return d?(i&&i(r.tr.setSelection(new Gt(d))),!0):!1}}function PK(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Gt.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ze.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Gt(r))),!0)}function IK(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Gt))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=se.empty;for(let s=r.length-1;s>=0;s--)i=se.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new Se(i,0,0));return o.setSelection(Ge.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function OK(e){if(!(e.selection instanceof Gt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Et.create(e.doc,[sn.widget(e.selection.head,t,{key:"gapcursor"})])}var Uh=200,Mn=function(){};Mn.prototype.append=function(t){return t.length?(t=Mn.from(t),!this.length&&t||t.length<Uh&&this.leafAppend(t)||this.length<Uh&&t.leafPrepend(this)||this.appendInner(t)):this};Mn.prototype.prepend=function(t){return t.length?Mn.from(t).append(this):this};Mn.prototype.appendInner=function(t){return new LK(this,t)};Mn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Mn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Mn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Mn.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)};Mn.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};Mn.from=function(t){return t instanceof Mn?t:t&&t.length?new w_(t):Mn.empty};var w_=(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 u=o;u<s;u++)if(i(this.values[u],l+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,l){for(var u=o-1;u>=s;u--)if(i(this.values[u],l+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=Uh)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=Uh)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})(Mn);Mn.empty=new w_([]);var LK=(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})(Mn);const FK=500;class yi{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,u,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 Ii(f.map));let x=f.step.map(i.slice(o)),y;x&&s.maybeStep(x).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],d.push(new Ii(y,void 0,void 0,d.length+h.length))),o--,y&&i.appendMap(y,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,u=new yi(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(t,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!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 Ii(t.mapping.maps[h],f,n),x;(x=u&&u.merge(g))&&(g=x,h?o.pop():l=l.slice(0,l.length-1)),o.push(g),n&&(s++,n=void 0),i||(u=g)}let d=s-r.depth;return d>BK&&(l=zK(l,d),s-=d),new yi(l.append(o),s)}remapping(t,n){let r=new ac;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 yi(this.items.append(t.map(n=>new Ii(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 u=n;this.items.forEach(g=>{let x=o.getMirror(--u);if(x==null)return;s=Math.min(s,x);let y=o.maps[x];if(g.step){let v=t.steps[x].invert(t.docs[x]),w=g.selection&&g.selection.map(o.slice(u+1,x));w&&l++,r.push(new Ii(y,v,w))}else r.push(new Ii(y))},i);let d=[];for(let g=n;g<s;g++)d.push(new Ii(o.maps[g]));let h=this.items.slice(0,i).append(d).append(r),f=new yi(h,l);return f.emptyItemCount()>FK&&(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 u=s.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let h=s.selection&&s.selection.map(n.slice(r));h&&o++;let f=new Ii(d.invert(),u,h),g,x=i.length-1;(g=i.length&&i[x].merge(f))?i[x]=g:i.push(f)}}else s.map&&r--},this.items.length,0),new yi(Mn.from(i.reverse()),o)}}yi.empty=new yi(Mn.empty,0);function zK(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Ii{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 Ii(n.getMap().invert(),n,this.selection)}}}class ns{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const BK=20;function $K(e,t,n,r){let i=n.getMeta(sl),o;if(i)return i.historyState;n.getMeta(UK)&&(e=new ns(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(sl))return s.getMeta(sl).redo?new ns(e.done.addTransform(n,void 0,r,Ff(t)),e.undone,MS(n.mapping.maps),e.prevTime,e.prevComposition):new ns(e.done,e.undone.addTransform(n,void 0,r,Ff(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=e.prevTime==0||!s&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-r.newGroupDelay||!VK(n,e.prevRanges)),d=s?Ag(e.prevRanges,n.mapping):MS(n.mapping.maps);return new ns(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,Ff(t)),yi.empty,d,n.time,l??e.prevComposition)}else return(o=n.getMeta("rebased"))?new ns(e.done.rebased(n,o),e.undone.rebased(n,o),Ag(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new ns(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Ag(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function VK(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 MS(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 Ag(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 HK(e,t,n){let r=Ff(t),i=sl.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),u=new ns(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(sl,{redo:n,historyState:u})}let _g=!1,jS=null;function Ff(e){let t=e.plugins;if(jS!=t){_g=!1,jS=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){_g=!0;break}}return _g}const sl=new Ht("history"),UK=new Ht("closeHistory");function WK(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new vt({key:sl,state:{init(){return new ns(yi.empty,yi.empty,null,0,-1)},apply(t,n,r){return $K(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?S_:r=="historyRedo"?C_:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function k_(e,t){return(n,r)=>{let i=sl.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=HK(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const S_=k_(!1,!0),C_=k_(!0,!0);wt.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 vt({key:new Ht("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,u=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,u);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,u=o-r,d=l-u,h=l;return t.deleteRange(d,h),!(this.storage.characters({node:t.doc})>r)}})]}});var qK=wt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[AK(this.options)]}});wt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new vt({key:new Ht("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return Et.create(e,[]);let s=0;this.options.mode==="deepest"&&e.descendants((u,d)=>{if(u.isText)return;if(!(i>=d&&i<=d+u.nodeSize-1))return!1;s+=1});let l=0;return e.descendants((u,d)=>{if(u.isText||!(i>=d&&i<=d+u.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(sn.node(d,d+u.nodeSize,{class:this.options.className}))}),Et.create(e,o)}}})]}});var KK=wt.create({name:"gapCursor",addProseMirrorPlugins(){return[DK()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=gt(Oe(e,"allowGapCursor",n)))!=null?t:null}}}),DS="placeholder";function GK(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var YK=wt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:DS,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${GK(this.options.dataAttribute)}`:`data-${DS}`;return[new vt({key:new Ht("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,u)=>{const d=i>=u&&i<=u+l.nodeSize,h=!l.isLeaf&&Pp(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=sn.node(u,u+l.nodeSize,{class:f.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:u,hasAnchor:d}):this.options.placeholder});o.push(g)}return this.options.includeChildren}),Et.create(t,o)}}})]}});wt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new vt({key:new Ht("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||N6(n.selection)||e.view.dragging?null:Et.create(n.doc,[sn.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});var JK="skipTrailingNode";function RS({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var XK=wt.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Ht(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 vt({key:t,appendTransaction:(i,o,s)=>{const{doc:l,tr:u,schema:d}=s,h=t.getState(s),f=l.content.size,g=d.nodes[n];if(!i.some(x=>x.getMeta(JK))&&h)return u.insert(f,g.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!RS({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!RS({node:s,types:r})}}})]}}),QK=wt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>S_(e,t),redo:()=>({state:e,dispatch:t})=>C_(e,t)}},addProseMirrorPlugins(){return[WK(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()}}}),ZK=wt.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(vq.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(mq.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(a_.configure(this.options.bulletList)),this.options.code!==!1&&i.push(Sq.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Nq.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(Tq.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(qK.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(KK.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Aq.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(_q.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(QK.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(Mq.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(Iq.configure(this.options.italic)),this.options.listItem!==!1&&i.push(u_.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(m_.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(l_.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(x_.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(kK.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(EK.configure(this.options.strike)),this.options.text!==!1&&i.push(NK.configure(this.options.text)),this.options.underline!==!1&&i.push(TK.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(XK.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),eG=ZK,tG=YK,nG=b_,rG=y_;const PS={};function iG(e){let t=PS[e];if(t)return t;t=PS[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function Ta(e,t){typeof t!="string"&&(t=Ta.defaultChars);const n=iG(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,s=r.length;o<s;o+=3){const l=parseInt(r.slice(o+1,o+3),16);if(l<128){i+=n[l];continue}if((l&224)===192&&o+3<s){const u=parseInt(r.slice(o+4,o+6),16);if((u&192)===128){const d=l<<6&1984|u&63;d<128?i+="��":i+=String.fromCharCode(d),o+=3;continue}}if((l&240)===224&&o+6<s){const u=parseInt(r.slice(o+4,o+6),16),d=parseInt(r.slice(o+7,o+9),16);if((u&192)===128&&(d&192)===128){const h=l<<12&61440|u<<6&4032|d&63;h<2048||h>=55296&&h<=57343?i+="���":i+=String.fromCharCode(h),o+=6;continue}}if((l&248)===240&&o+9<s){const u=parseInt(r.slice(o+4,o+6),16),d=parseInt(r.slice(o+7,o+9),16),h=parseInt(r.slice(o+10,o+12),16);if((u&192)===128&&(d&192)===128&&(h&192)===128){let f=l<<18&1835008|u<<12&258048|d<<6&4032|h&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}Ta.defaultChars=";/?:@&=+$,#";Ta.componentChars="";const IS={};function oG(e){let t=IS[e];if(t)return t;t=IS[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Vc(e,t,n){typeof t!="string"&&(n=t,t=Vc.defaultChars),typeof n>"u"&&(n=!0);const r=oG(t);let i="";for(let o=0,s=e.length;o<s;o++){const l=e.charCodeAt(o);if(n&&l===37&&o+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){i+=e.slice(o,o+3),o+=2;continue}if(l<128){i+=r[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&o+1<s){const u=e.charCodeAt(o+1);if(u>=56320&&u<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[o])}return i}Vc.defaultChars=";/?:@&=+$,-_.!~*'()#";Vc.componentChars="-_.!~*'()";function Qy(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Wh(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const sG=/^([a-z0-9.+-]+:)/i,lG=/:[0-9]*$/,aG=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,uG=["<",">",'"',"`"," ","\r",`
|
|
611
|
+
`," "],cG=["{","}","|","\\","^","`"].concat(uG),dG=["'"].concat(cG),OS=["%","/","?",";","#"].concat(dG),LS=["/","?","#"],fG=255,FS=/^[+a-z0-9A-Z_-]{0,63}$/,hG=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,zS={javascript:!0,"javascript:":!0},BS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Zy(e,t){if(e&&e instanceof Wh)return e;const n=new Wh;return n.parse(e,t),n}Wh.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const d=aG.exec(o);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let s=sG.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&zS[s])&&(o=o.substr(2),this.slashes=!0)),!zS[s]&&(i||s&&!BS[s])){let d=-1;for(let y=0;y<LS.length;y++)r=o.indexOf(LS[y]),r!==-1&&(d===-1||r<d)&&(d=r);let h,f;d===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",d),f!==-1&&(h=o.slice(0,f),o=o.slice(f+1),this.auth=h),d=-1;for(let y=0;y<OS.length;y++)r=o.indexOf(OS[y]),r!==-1&&(d===-1||r<d)&&(d=r);d===-1&&(d=o.length),o[d-1]===":"&&d--;const g=o.slice(0,d);o=o.slice(d),this.parseHost(g),this.hostname=this.hostname||"";const x=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!x){const y=this.hostname.split(/\./);for(let v=0,w=y.length;v<w;v++){const C=y[v];if(C&&!C.match(FS)){let N="";for(let T=0,D=C.length;T<D;T++)C.charCodeAt(T)>127?N+="x":N+=C[T];if(!N.match(FS)){const T=y.slice(0,v),D=y.slice(v+1),A=C.match(hG);A&&(T.push(A[1]),D.unshift(A[2])),D.length&&(o=D.join(".")+o),this.hostname=T.join(".");break}}}}this.hostname.length>fG&&(this.hostname=""),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=o.indexOf("#");l!==-1&&(this.hash=o.substr(l),o=o.slice(0,l));const u=o.indexOf("?");return u!==-1&&(this.search=o.substr(u),o=o.slice(0,u)),o&&(this.pathname=o),BS[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Wh.prototype.parseHost=function(e){let t=lG.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const pG=Object.freeze(Object.defineProperty({__proto__:null,decode:Ta,encode:Vc,format:Qy,parse:Zy},Symbol.toStringTag,{value:"Module"})),E_=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,N_=/[\0-\x1F\x7F-\x9F]/,mG=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,eb=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,T_=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,A_=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,gG=Object.freeze(Object.defineProperty({__proto__:null,Any:E_,Cc:N_,Cf:mG,P:eb,S:T_,Z:A_},Symbol.toStringTag,{value:"Module"})),xG=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),yG=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Mg;const bG=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),vG=(Mg=String.fromCodePoint)!==null&&Mg!==void 0?Mg:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function wG(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=bG.get(e))!==null&&t!==void 0?t:e}var An;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(An||(An={}));const kG=32;var us;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(us||(us={}));function ox(e){return e>=An.ZERO&&e<=An.NINE}function SG(e){return e>=An.UPPER_A&&e<=An.UPPER_F||e>=An.LOWER_A&&e<=An.LOWER_F}function CG(e){return e>=An.UPPER_A&&e<=An.UPPER_Z||e>=An.LOWER_A&&e<=An.LOWER_Z||ox(e)}function EG(e){return e===An.EQUALS||CG(e)}var Nn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Nn||(Nn={}));var xo;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(xo||(xo={}));class NG{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Nn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xo.Strict}startEntity(t){this.decodeMode=t,this.state=Nn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Nn.EntityStart:return t.charCodeAt(n)===An.NUM?(this.state=Nn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Nn.NamedEntity,this.stateNamedEntity(t,n));case Nn.NumericStart:return this.stateNumericStart(t,n);case Nn.NumericDecimal:return this.stateNumericDecimal(t,n);case Nn.NumericHex:return this.stateNumericHex(t,n);case Nn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|kG)===An.LOWER_X?(this.state=Nn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Nn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(t.substr(n,o),i),this.consumed+=o}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ox(i)||SG(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ox(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===An.SEMI)this.consumed+=1;else if(this.decodeMode===xo.Strict)return 0;return this.emitCodePoint(wG(this.result),this.consumed),this.errors&&(t!==An.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&us.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=TG(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===xo.Attribute&&(o===0||EG(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&us.VALUE_LENGTH)>>14,o!==0){if(s===An.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==xo.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&us.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~us.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Nn.NamedEntity:return this.result!==0&&(this.decodeMode!==xo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Nn.NumericDecimal:return this.emitNumericEntity(0,2);case Nn.NumericHex:return this.emitNumericEntity(0,3);case Nn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Nn.EntityStart:return 0}}}function __(e){let t="";const n=new NG(e,r=>t+=vG(r));return function(i,o){let s=0,l=0;for(;(l=i.indexOf("&",l))>=0;){t+=i.slice(s,l),n.startEntity(o);const d=n.write(i,l+1);if(d<0){s=l+n.end();break}s=l+d,l=d===0?s+1:s}const u=t+i.slice(s);return t="",u}}function TG(e,t,n,r){const i=(t&us.BRANCH_LENGTH)>>7,o=t&us.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const u=r-o;return u<0||u>=i?-1:e[n+u]-1}let s=n,l=s+i-1;for(;s<=l;){const u=s+l>>>1,d=e[u];if(d<r)s=u+1;else if(d>r)l=u-1;else return e[u+i]}return-1}const M_=__(xG);__(yG);function AG(e,t=xo.Legacy){return M_(e,t)}function _G(e){return M_(e,xo.Strict)}function MG(e){return Object.prototype.toString.call(e)}function tb(e){return MG(e)==="[object String]"}const jG=Object.prototype.hasOwnProperty;function DG(e,t){return jG.call(e,t)}function Fp(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){e[r]=n[r]})}}),e}function j_(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function nb(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function xc(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const D_=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,RG=/&([a-z#][a-z0-9]{1,31});/gi,PG=new RegExp(D_.source+"|"+RG.source,"gi"),IG=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function OG(e,t){if(t.charCodeAt(0)===35&&IG.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return nb(r)?xc(r):e}const n=AG(e);return n!==e?n:e}function LG(e){return e.indexOf("\\")<0?e:e.replace(D_,"$1")}function Aa(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(PG,function(t,n,r){return n||OG(t,r)})}const FG=/[&<>"]/,zG=/[&<>"]/g,BG={"&":"&","<":"<",">":">",'"':"""};function $G(e){return BG[e]}function ks(e){return FG.test(e)?e.replace(zG,$G):e}const VG=/[.?*+^$[\]\\(){}|-]/g;function HG(e){return e.replace(VG,"\\$&")}function Nt(e){switch(e){case 9:case 32:return!0}return!1}function yc(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function R_(e){return eb.test(e)||T_.test(e)}function bc(e){return R_(xc(e))}function vc(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function zp(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function $S(e){return e===32||e===9||e===10||e===13}function Bp(e){let t=0;for(;t<e.length&&$S(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&$S(e.charCodeAt(n));n--);return e.slice(t,n+1)}const UG={mdurl:pG,ucmicro:gG},WG=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:j_,asciiTrim:Bp,assign:Fp,escapeHtml:ks,escapeRE:HG,fromCodePoint:xc,has:DG,isMdAsciiPunct:vc,isPunctChar:R_,isPunctCharCode:bc,isSpace:Nt,isString:tb,isValidEntityCode:nb,isWhiteSpace:yc,lib:UG,normalizeReference:zp,unescapeAll:Aa,unescapeMd:LG},Symbol.toStringTag,{value:"Module"}));function qG(e,t,n){let r,i,o,s;const l=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos<l;){if(o=e.src.charCodeAt(e.pos),o===93&&(r--,r===0)){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),o===91){if(s===e.pos-1)r++;else if(n)return e.pos=u,-1}}let d=-1;return i&&(d=e.pos),e.pos=u,d}function KG(e,t,n){let r,i=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=Aa(e.slice(t+1,i)),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let s=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(s++,s>32))return o;if(r===41){if(s===0)break;s--}i++}return t===i||s!==0||(o.str=Aa(e.slice(t,i)),o.pos=i,o.ok=!0),o}function GG(e,t,n,r){let i,o=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let l=e.charCodeAt(o);if(l!==34&&l!==39&&l!==40)return s;t++,o++,l===40&&(l=41),s.marker=l}for(;o<n;){if(i=e.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=Aa(e.slice(t,o)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=Aa(e.slice(t,o)),s}const YG=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:KG,parseLinkLabel:qG,parseLinkTitle:GG},Symbol.toStringTag,{value:"Module"})),Xi={};Xi.code_inline=function(e,t,n,r,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+ks(o.content)+"</code>"};Xi.code_block=function(e,t,n,r,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+ks(e[t].content)+`</code></pre>
|
|
612
|
+
`};Xi.fence=function(e,t,n,r,i){const o=e[t],s=o.info?Aa(o.info).trim():"";let l="",u="";if(s){const h=s.split(/(\s+)/g);l=h[0],u=h.slice(2).join("")}let d;if(n.highlight?d=n.highlight(o.content,l,u)||ks(o.content):d=ks(o.content),d.indexOf("<pre")===0)return d+`
|
|
613
|
+
`;if(s){const h=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];h<0?f.push(["class",n.langPrefix+l]):(f[h]=f[h].slice(),f[h][1]+=" "+n.langPrefix+l);const g={attrs:f};return`<pre><code${i.renderAttrs(g)}>${d}</code></pre>
|
|
614
|
+
`}return`<pre><code${i.renderAttrs(o)}>${d}</code></pre>
|
|
615
|
+
`};Xi.image=function(e,t,n,r,i){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)};Xi.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
616
|
+
`:`<br>
|
|
617
|
+
`};Xi.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
618
|
+
`:`<br>
|
|
619
|
+
`:`
|
|
620
|
+
`};Xi.text=function(e,t){return ks(e[t].content)};Xi.html_block=function(e,t){return e[t].content};Xi.html_inline=function(e,t){return e[t].content};function La(){this.rules=Fp({},Xi)}La.prototype.renderAttrs=function(t){let n,r,i;if(!t.attrs)return"";for(i="",n=0,r=t.attrs.length;n<r;n++)i+=" "+ks(t.attrs[n][0])+'="'+ks(t.attrs[n][1])+'"';return i};La.prototype.renderToken=function(t,n,r){const i=t[n];let o="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&t[n-1].hidden&&(o+=`
|
|
621
|
+
`),o+=(i.nesting===-1?"</":"<")+i.tag,o+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(o+=" /");let s=!1;if(i.block&&(s=!0,i.nesting===1&&n+1<t.length)){const l=t[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===i.tag)&&(s=!1)}return o+=s?`>
|
|
622
|
+
`:">",o};La.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const l=e[o].type;typeof i[l]<"u"?r+=i[l](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r};La.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,o=e.length;i<o;i++)switch(e[i].type){case"text":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"html_inline":case"html_block":r+=e[i].content;break;case"softbreak":case"hardbreak":r+=`
|
|
623
|
+
`;break}return r};La.prototype.render=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const l=e[o].type;l==="inline"?r+=this.renderInline(e[o].children,t,n):typeof i[l]<"u"?r+=i[l](e,o,t,n,this):r+=this.renderToken(e,o,t,n)}return r};function Mr(){this.__rules__=[],this.__cache__=null}Mr.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Mr.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){t.indexOf(r)<0&&t.push(r)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||e.__cache__[n].push(r.fn))})})};Mr.prototype.at=function(e,t,n){const r=this.__find__(e),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Mr.prototype.before=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Mr.prototype.after=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Mr.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null};Mr.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Mr.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};Mr.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Mr.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Ni(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ni.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===t)return r;return-1};Ni.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Ni.prototype.attrSet=function(t,n){const r=this.attrIndex(t),i=[t,n];r<0?this.attrPush(i):this.attrs[r]=i};Ni.prototype.attrGet=function(t){const n=this.attrIndex(t);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Ni.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function P_(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}P_.prototype.Token=Ni;const JG=/\r\n?|\n/g,XG=/\0/g;function QG(e){let t;t=e.src.replace(JG,`
|
|
624
|
+
`),t=t.replace(XG,"�"),e.src=t}function ZG(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function eY(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const i=t[n];i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}}function tY(e){return/^<a[>\s]/i.test(e)}function nY(e){return/^<\/a\s*>/i.test(e)}function rY(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let i=t[n].children,o=0;for(let s=i.length-1;s>=0;s--){const l=i[s];if(l.type==="link_close"){for(s--;i[s].level!==l.level&&i[s].type!=="link_open";)s--;continue}if(l.type==="html_inline"&&(tY(l.content)&&o>0&&o--,nY(l.content)&&o++),!(o>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const u=l.content;let d=e.md.linkify.match(u);const h=[];let f=l.level,g=0;d.length>0&&d[0].index===0&&s>0&&i[s-1].type==="text_special"&&(d=d.slice(1));for(let x=0;x<d.length;x++){const y=d[x].url,v=e.md.normalizeLink(y);if(!e.md.validateLink(v))continue;let w=d[x].text;d[x].schema?d[x].schema==="mailto:"&&!/^mailto:/i.test(w)?w=e.md.normalizeLinkText("mailto:"+w).replace(/^mailto:/,""):w=e.md.normalizeLinkText(w):w=e.md.normalizeLinkText("http://"+w).replace(/^http:\/\//,"");const C=d[x].index;if(C>g){const A=new e.Token("text","",0);A.content=u.slice(g,C),A.level=f,h.push(A)}const N=new e.Token("link_open","a",1);N.attrs=[["href",v]],N.level=f++,N.markup="linkify",N.info="auto",h.push(N);const T=new e.Token("text","",0);T.content=w,T.level=f,h.push(T);const D=new e.Token("link_close","a",-1);D.level=--f,D.markup="linkify",D.info="auto",h.push(D),g=d[x].lastIndex}if(g<u.length){const x=new e.Token("text","",0);x.content=u.slice(g),x.level=f,h.push(x)}t[n].children=i=j_(i,s,h)}}}}const I_=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,iY=/\((c|tm|r)\)/i,oY=/\((c|tm|r)\)/ig,sY={c:"©",r:"®",tm:"™"};function lY(e,t){return sY[t.toLowerCase()]}function aY(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(oY,lY)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function uY(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&I_.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function cY(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(iY.test(e.tokens[t].content)&&aY(e.tokens[t].children),I_.test(e.tokens[t].content)&&uY(e.tokens[t].children))}const dY=/['"]/,VS=/['"]/g,HS="’";function Sf(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function fY(e,t){let n="",r=0;t.sort((i,o)=>i.pos-o.pos);for(let i=0;i<t.length;i++){const o=t[i];n+=e.slice(r,o.pos)+o.ch,r=o.pos+1}return n+e.slice(r)}function hY(e,t){let n;const r=[],i={};for(let o=0;o<e.length;o++){const s=e[o],l=e[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=l);n--);if(r.length=n+1,s.type!=="text")continue;const u=s.content;let d=0;const h=u.length;e:for(;d<h;){VS.lastIndex=d;const f=VS.exec(u);if(!f)break;let g=!0,x=!0;d=f.index+1;const y=f[0]==="'";let v=32;if(f.index-1>=0)v=u.charCodeAt(f.index-1);else for(n=o-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){v=e[n].content.charCodeAt(e[n].content.length-1);break}let w=32;if(d<h)w=u.charCodeAt(d);else for(n=o+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){w=e[n].content.charCodeAt(0);break}const C=vc(v)||bc(v),N=vc(w)||bc(w),T=yc(v),D=yc(w);if(D?g=!1:N&&(T||C||(g=!1)),T?x=!1:C&&(D||N||(x=!1)),w===34&&f[0]==='"'&&v>=48&&v<=57&&(x=g=!1),g&&x&&(g=C,x=N),!g&&!x){y&&Sf(i,o,f.index,HS);continue}if(x)for(n=r.length-1;n>=0;n--){let A=r[n];if(r[n].level<l)break;if(A.single===y&&r[n].level===l){A=r[n];let _,I;y?(_=t.md.options.quotes[2],I=t.md.options.quotes[3]):(_=t.md.options.quotes[0],I=t.md.options.quotes[1]),Sf(i,o,f.index,I),Sf(i,A.token,A.pos,_),r.length=n;continue e}}g?r.push({token:o,pos:f.index,single:y,level:l}):x&&y&&Sf(i,o,f.index,HS)}}Object.keys(i).forEach(function(o){e[o].content=fY(e[o].content,i[o])})}function pY(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!dY.test(e.tokens[t].content)||hY(e.tokens[t].children,e)}function mY(e){let t,n;const r=e.tokens,i=r.length;for(let o=0;o<i;o++){if(r[o].type!=="inline")continue;const s=r[o].children,l=s.length;for(t=0;t<l;t++)s[t].type==="text_special"&&(s[t].type="text");for(t=n=0;t<l;t++)s[t].type==="text"&&t+1<l&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==n&&(s[n]=s[t]),n++);t!==n&&(s.length=n)}}const jg=[["normalize",QG],["block",ZG],["inline",eY],["linkify",rY],["replacements",cY],["smartquotes",pY],["text_join",mY]];function rb(){this.ruler=new Mr;for(let e=0;e<jg.length;e++)this.ruler.push(jg[e][0],jg[e][1])}rb.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)};rb.prototype.State=P_;function Qi(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let o=0,s=0,l=0,u=0,d=i.length,h=!1;s<d;s++){const f=i.charCodeAt(s);if(!h)if(Nt(f)){l++,f===9?u+=4-u%4:u++;continue}else h=!0;(f===10||s===d-1)&&(f!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),h=!1,l=0,u=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Qi.prototype.push=function(e,t,n){const r=new Ni(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};Qi.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Qi.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};Qi.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const r=this.src.charCodeAt(t);if(!Nt(r))break}return t};Qi.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Nt(this.src.charCodeAt(--t)))return t+1;return t};Qi.prototype.skipChars=function(t,n){for(let r=this.src.length;t<r&&this.src.charCodeAt(t)===n;t++);return t};Qi.prototype.skipCharsBack=function(t,n,r){if(t<=r)return t;for(;t>r;)if(n!==this.src.charCodeAt(--t))return t+1;return t};Qi.prototype.getLines=function(t,n,r,i){if(t>=n)return"";const o=new Array(n-t);for(let s=0,l=t;l<n;l++,s++){let u=0;const d=this.bMarks[l];let h=d,f;for(l+1<n||i?f=this.eMarks[l]+1:f=this.eMarks[l];h<f&&u<r;){const g=this.src.charCodeAt(h);if(Nt(g))g===9?u+=4-(u+this.bsCount[l])%4:u++;else if(h-d<this.tShift[l])u++;else break;h++}u>r?o[s]=new Array(u-r+1).join(" ")+this.src.slice(h,f):o[s]=this.src.slice(h,f)}return o.join("")};Qi.prototype.Token=Ni;const gY=65536;function Dg(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function US(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,s=0,l="";for(;r<n;)i===124&&(o?(l+=e.substring(s,r-1),s=r):(t.push(l+e.substring(s,r)),l="",s=r+1)),o=i===92,r++,i=e.charCodeAt(r);return t.push(l+e.substring(s)),t}function xY(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=e.eMarks[i])return!1;const l=e.src.charCodeAt(o++);if(l!==124&&l!==45&&l!==58&&!Nt(l)||s===45&&Nt(l))return!1;for(;o<e.eMarks[i];){const D=e.src.charCodeAt(o);if(D!==124&&D!==45&&D!==58&&!Nt(D))return!1;o++}let u=Dg(e,t+1),d=u.split("|");const h=[];for(let D=0;D<d.length;D++){const A=d[D].trim();if(!A){if(D===0||D===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?h.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?h.push("left"):h.push("")}if(u=Dg(e,t).trim(),u.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;d=US(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const f=d.length;if(f===0||f!==h.length)return!1;if(r)return!0;const g=e.parentType;e.parentType="table";const x=e.md.block.ruler.getRules("blockquote"),y=e.push("table_open","table",1),v=[t,0];y.map=v;const w=e.push("thead_open","thead",1);w.map=[t,t+1];const C=e.push("tr_open","tr",1);C.map=[t,t+1];for(let D=0;D<d.length;D++){const A=e.push("th_open","th",1);h[D]&&(A.attrs=[["style","text-align:"+h[D]]]);const _=e.push("inline","",0);_.content=d[D].trim(),_.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let N,T=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let D=!1;for(let _=0,I=x.length;_<I;_++)if(x[_](e,i,n,!0)){D=!0;break}if(D||(u=Dg(e,i).trim(),!u)||e.sCount[i]-e.blkIndent>=4||(d=US(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),T+=f-d.length,T>gY))break;if(i===t+2){const _=e.push("tbody_open","tbody",1);_.map=N=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[i,i+1];for(let _=0;_<f;_++){const I=e.push("td_open","td",1);h[_]&&(I.attrs=[["style","text-align:"+h[_]]]);const P=e.push("inline","",0);P.content=d[_]?d[_].trim():"",P.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return N&&(e.push("tbody_close","tbody",-1),N[1]=i),e.push("table_close","table",-1),v[1]=i,e.parentType=g,e.line=i,!0}function yY(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+`
|
|
625
|
+
`,o.map=[t,e.line],!0}function bY(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const s=e.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let l=i;i=e.skipChars(i,s);let u=i-l;if(u<3)return!1;const d=e.src.slice(l,i),h=e.src.slice(i,o);if(s===96&&h.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=t,g=!1;for(;f++,!(f>=n||(i=l=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],i<o&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(i)===s&&!(e.sCount[f]-e.blkIndent>=4)&&(i=e.skipChars(i,s),!(i-l<u)&&(i=e.skipSpaces(i),!(i<o)))){g=!0;break}u=e.sCount[t],e.line=f+(g?1:0);const x=e.push("fence","code",0);return x.info=h,x.content=e.getLines(t+1,f,u,!0),x.markup=d,x.map=[t,e.line],!0}function vY(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const l=[],u=[],d=[],h=[],f=e.md.block.ruler.getRules("blockquote"),g=e.parentType;e.parentType="blockquote";let x=!1,y;for(y=t;y<n;y++){const T=e.sCount[y]<e.blkIndent;if(i=e.bMarks[y]+e.tShift[y],o=e.eMarks[y],i>=o)break;if(e.src.charCodeAt(i++)===62&&!T){let A=e.sCount[y]+1,_,I;e.src.charCodeAt(i)===32?(i++,A++,I=!1,_=!0):e.src.charCodeAt(i)===9?(_=!0,(e.bsCount[y]+A)%4===3?(i++,A++,I=!1):I=!0):_=!1;let P=A;for(l.push(e.bMarks[y]),e.bMarks[y]=i;i<o;){const L=e.src.charCodeAt(i);if(Nt(L))L===9?P+=4-(P+e.bsCount[y]+(I?1:0))%4:P++;else break;i++}x=i>=o,u.push(e.bsCount[y]),e.bsCount[y]=e.sCount[y]+1+(_?1:0),d.push(e.sCount[y]),e.sCount[y]=P-A,h.push(e.tShift[y]),e.tShift[y]=i-e.bMarks[y];continue}if(x)break;let D=!1;for(let A=0,_=f.length;A<_;A++)if(f[A](e,y,n,!0)){D=!0;break}if(D){e.lineMax=y,e.blkIndent!==0&&(l.push(e.bMarks[y]),u.push(e.bsCount[y]),h.push(e.tShift[y]),d.push(e.sCount[y]),e.sCount[y]-=e.blkIndent);break}l.push(e.bMarks[y]),u.push(e.bsCount[y]),h.push(e.tShift[y]),d.push(e.sCount[y]),e.sCount[y]=-1}const v=e.blkIndent;e.blkIndent=0;const w=e.push("blockquote_open","blockquote",1);w.markup=">";const C=[t,0];w.map=C,e.md.block.tokenize(e,t,y);const N=e.push("blockquote_close","blockquote",-1);N.markup=">",e.lineMax=s,e.parentType=g,C[1]=e.line;for(let T=0;T<h.length;T++)e.bMarks[T+t]=l[T],e.tShift[T+t]=h[T],e.sCount[T+t]=d[T],e.bsCount[T+t]=u[T];return e.blkIndent=v,!0}function wY(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let l=1;for(;o<i;){const d=e.src.charCodeAt(o++);if(d!==s&&!Nt(d))return!1;d===s&&l++}if(l<3)return!1;if(r)return!0;e.line=t+1;const u=e.push("hr","hr",0);return u.map=[t,e.line],u.markup=Array(l+1).join(String.fromCharCode(s)),!0}function WS(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const o=e.src.charCodeAt(r);if(!Nt(o))return-1}return r}function qS(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let i=n;if(i+1>=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i<r&&(o=e.src.charCodeAt(i),!Nt(o))?-1:i}function kY(e,t){const n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function SY(e,t,n,r){let i,o,s,l,u=t,d=!0;if(e.sCount[u]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]<e.blkIndent)return!1;let h=!1;r&&e.parentType==="paragraph"&&e.sCount[u]>=e.blkIndent&&(h=!0);let f,g,x;if((x=qS(e,u))>=0){if(f=!0,s=e.bMarks[u]+e.tShift[u],g=Number(e.src.slice(s,x-1)),h&&g!==1)return!1}else if((x=WS(e,u))>=0)f=!1;else return!1;if(h&&e.skipSpaces(x)>=e.eMarks[u])return!1;if(r)return!0;const y=e.src.charCodeAt(x-1),v=e.tokens.length;f?(l=e.push("ordered_list_open","ol",1),g!==1&&(l.attrs=[["start",g]])):l=e.push("bullet_list_open","ul",1);const w=[u,0];l.map=w,l.markup=String.fromCharCode(y);let C=!1;const N=e.md.block.ruler.getRules("list"),T=e.parentType;for(e.parentType="list";u<n;){o=x,i=e.eMarks[u];const D=e.sCount[u]+x-(e.bMarks[u]+e.tShift[u]);let A=D;for(;o<i;){const W=e.src.charCodeAt(o);if(W===9)A+=4-(A+e.bsCount[u])%4;else if(W===32)A++;else break;o++}const _=o;let I;_>=i?I=1:I=A-D,I>4&&(I=1);const P=D+I;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(y);const L=[u,0];l.map=L,f&&(l.info=e.src.slice(s,x-1));const R=e.tight,V=e.tShift[u],K=e.sCount[u],G=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=P,e.tight=!0,e.tShift[u]=_-e.bMarks[u],e.sCount[u]=A,_>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||C)&&(d=!1),C=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=G,e.tShift[u]=V,e.sCount[u]=K,e.tight=R,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(y),u=e.line,L[1]=u,u>=n||e.sCount[u]<e.blkIndent||e.sCount[u]-e.blkIndent>=4)break;let B=!1;for(let W=0,U=N.length;W<U;W++)if(N[W](e,u,n,!0)){B=!0;break}if(B)break;if(f){if(x=qS(e,u),x<0)break;s=e.bMarks[u]+e.tShift[u]}else if(x=WS(e,u),x<0)break;if(y!==e.src.charCodeAt(x-1))break}return f?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(y),w[1]=u,e.line=u,e.parentType=T,d&&kY(e,v),!0}function CY(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function l(N){const T=e.lineMax;if(N>=T||e.isEmpty(N))return null;let D=!1;if(e.sCount[N]-e.blkIndent>3&&(D=!0),e.sCount[N]<0&&(D=!0),!D){const I=e.md.block.ruler.getRules("reference"),P=e.parentType;e.parentType="reference";let L=!1;for(let R=0,V=I.length;R<V;R++)if(I[R](e,N,T,!0)){L=!0;break}if(e.parentType=P,L)return null}const A=e.bMarks[N]+e.tShift[N],_=e.eMarks[N];return e.src.slice(A,_+1)}let u=e.src.slice(i,o+1);o=u.length;let d=-1;for(i=1;i<o;i++){const N=u.charCodeAt(i);if(N===91)return!1;if(N===93){d=i;break}else if(N===10){const T=l(s);T!==null&&(u+=T,o=u.length,s++)}else if(N===92&&(i++,i<o&&u.charCodeAt(i)===10)){const T=l(s);T!==null&&(u+=T,o=u.length,s++)}}if(d<0||u.charCodeAt(d+1)!==58)return!1;for(i=d+2;i<o;i++){const N=u.charCodeAt(i);if(N===10){const T=l(s);T!==null&&(u+=T,o=u.length,s++)}else if(!Nt(N))break}const h=e.md.helpers.parseLinkDestination(u,i,o);if(!h.ok)return!1;const f=e.md.normalizeLink(h.str);if(!e.md.validateLink(f))return!1;i=h.pos;const g=i,x=s,y=i;for(;i<o;i++){const N=u.charCodeAt(i);if(N===10){const T=l(s);T!==null&&(u+=T,o=u.length,s++)}else if(!Nt(N))break}let v=e.md.helpers.parseLinkTitle(u,i,o);for(;v.can_continue;){const N=l(s);if(N===null)break;u+=N,i=o,o=u.length,s++,v=e.md.helpers.parseLinkTitle(u,i,o,v)}let w;for(i<o&&y!==i&&v.ok?(w=v.str,i=v.pos):(w="",i=g,s=x);i<o;){const N=u.charCodeAt(i);if(!Nt(N))break;i++}if(i<o&&u.charCodeAt(i)!==10&&w)for(w="",i=g,s=x;i<o;){const N=u.charCodeAt(i);if(!Nt(N))break;i++}if(i<o&&u.charCodeAt(i)!==10)return!1;const C=zp(u.slice(1,d));return C?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[C]>"u"&&(e.env.references[C]={title:w,href:f}),e.line=s),!0):!1}const EY=["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"],NY="[a-zA-Z_:][a-zA-Z0-9:._-]*",TY="[^\"'=<>`\\x00-\\x20]+",AY="'[^']*'",_Y='"[^"]*"',MY="(?:"+TY+"|"+AY+"|"+_Y+")",jY="(?:\\s+"+NY+"(?:\\s*=\\s*"+MY+")?)",O_="<[A-Za-z][A-Za-z0-9\\-]*"+jY+"*\\s*\\/?>",L_="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",DY="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",RY="<[?][\\s\\S]*?[?]>",PY="<![A-Za-z][^>]*>",IY="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",OY=new RegExp("^(?:"+O_+"|"+L_+"|"+DY+"|"+RY+"|"+PY+"|"+IY+")"),LY=new RegExp("^(?:"+O_+"|"+L_+")"),Ks=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+EY.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(LY.source+"\\s*$"),/^$/,!1]];function FY(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let s=e.src.slice(i,o),l=0;for(;l<Ks.length&&!Ks[l][0].test(s);l++);if(l===Ks.length)return!1;if(r)return Ks[l][2];let u=t+1;const d=Ks[l][1].test("");if(!Ks[l][1].test(s)){for(;u<n&&!(e.sCount[u]<e.blkIndent&&(d||!e.isEmpty(u)));u++)if(i=e.bMarks[u]+e.tShift[u],o=e.eMarks[u],s=e.src.slice(i,o),Ks[l][1].test(s)){s.length!==0&&u++;break}}e.line=u;const h=e.push("html_block","",0);return h.map=[t,u],h.content=e.getLines(t,u,e.blkIndent,!0),!0}function zY(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(s!==35||i>=o)return!1;let l=1;for(s=e.src.charCodeAt(++i);s===35&&i<o&&l<=6;)l++,s=e.src.charCodeAt(++i);if(l>6||i<o&&!Nt(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);const u=e.skipCharsBack(o,35,i);u>i&&Nt(e.src.charCodeAt(u-1))&&(o=u),e.line=t+1;const d=e.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[t,e.line];const h=e.push("inline","",0);h.content=Bp(e.src.slice(i,o)),h.map=[t,e.line],h.children=[];const f=e.push("heading_close","h"+String(l),-1);return f.markup="########".slice(0,l),!0}function BY(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,s,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let x=e.bMarks[l]+e.tShift[l];const y=e.eMarks[l];if(x<y&&(s=e.src.charCodeAt(x),(s===45||s===61)&&(x=e.skipChars(x,s),x=e.skipSpaces(x),x>=y))){o=s===61?1:2;break}}if(e.sCount[l]<0)continue;let g=!1;for(let x=0,y=r.length;x<y;x++)if(r[x](e,l,n,!0)){g=!0;break}if(g)break}if(!o)return e.parentType=i,!1;const u=Bp(e.getLines(t,l,e.blkIndent,!1));e.line=l+1;const d=e.push("heading_open","h"+String(o),1);d.markup=String.fromCharCode(s),d.map=[t,e.line];const h=e.push("inline","",0);h.content=u,h.map=[t,e.line-1],h.children=[];const f=e.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(s),e.parentType=i,!0}function $Y(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let d=!1;for(let h=0,f=r.length;h<f;h++)if(r[h](e,o,n,!0)){d=!0;break}if(d)break}const s=Bp(e.getLines(t,o,e.blkIndent,!1));e.line=o;const l=e.push("paragraph_open","p",1);l.map=[t,e.line];const u=e.push("inline","",0);return u.content=s,u.map=[t,e.line],u.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}const Cf=[["table",xY,["paragraph","reference"]],["code",yY],["fence",bY,["paragraph","reference","blockquote","list"]],["blockquote",vY,["paragraph","reference","blockquote","list"]],["hr",wY,["paragraph","reference","blockquote","list"]],["list",SY,["paragraph","reference","blockquote"]],["reference",CY],["html_block",FY,["paragraph","reference","blockquote"]],["heading",zY,["paragraph","reference","blockquote"]],["lheading",BY],["paragraph",$Y]];function $p(){this.ruler=new Mr;for(let e=0;e<Cf.length;e++)this.ruler.push(Cf[e][0],Cf[e][1],{alt:(Cf[e][2]||[]).slice()})}$p.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),i=r.length,o=e.md.options.maxNesting;let s=t,l=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}const u=e.line;let d=!1;for(let h=0;h<i;h++)if(d=r[h](e,s,n,!1),d){if(u>=e.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),s=e.line,s<n&&e.isEmpty(s)&&(l=!0,s++,e.line=s)}};$p.prototype.parse=function(e,t,n,r){if(!e)return;const i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)};$p.prototype.State=Qi;function Hc(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Hc.prototype.pushPending=function(){const e=new Ni("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Hc.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new Ni(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};Hc.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)===55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)===56320){const w=this.src.charCodeAt(e-2);i=(w&64512)===55296?65536+(w-55296<<10)+(i-56320):65533}else(i&64512)===55296&&(i=65533);let o=e;for(;o<n&&this.src.charCodeAt(o)===r;)o++;const s=o-e;let l=o<n?this.src.charCodeAt(o):32;if((l&64512)===55296){const w=this.src.charCodeAt(o+1);l=(w&64512)===56320?65536+(l-55296<<10)+(w-56320):65533}else(l&64512)===56320&&(l=65533);const u=vc(i)||bc(i),d=vc(l)||bc(l),h=yc(i),f=yc(l),g=!f&&(!d||h||u),x=!h&&(!u||f||d);return{can_open:g&&(t||!x||u),can_close:x&&(t||!g||d),length:s}};Hc.prototype.Token=Ni;function VY(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function HY(e,t){let n=e.pos;for(;n<e.posMax&&!VY(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const UY=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function WY(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(UY);if(!i)return!1;const o=i[1],s=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!s)return!1;let l=s.url;if(l.length<=o.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));const d=e.md.normalizeLink(l);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const h=e.push("link_open","a",1);h.attrs=[["href",d]],h.markup="linkify",h.info="auto";const f=e.push("text","",0);f.content=e.md.normalizeLinkText(l);const g=e.push("link_close","a",-1);g.markup="linkify",g.info="auto"}return e.pos+=l.length-o.length,!0}function qY(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&Nt(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const ib=[];for(let e=0;e<256;e++)ib.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){ib[e.charCodeAt(0)]=1});function KY(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(i=e.src.charCodeAt(n),!!Nt(i));)n++;return e.pos=n,!0}let o=e.src[n];if(i>=55296&&i<=56319&&n+1<r){const l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(o+=e.src[n+1],n++)}const s="\\"+o;if(!t){const l=e.push("text_special","",0);i<256&&ib[i]!==0?l.content=o:l.content=s,l.markup=s,l.info="escape"}return e.pos=n+1,!0}function GY(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(i,n),l=s.length;if(e.backticksScanned&&(e.backticks[l]||0)<=i)return t||(e.pending+=s),e.pos+=l,!0;let u=n,d;for(;(d=e.src.indexOf("`",u))!==-1;){for(u=d+1;u<o&&e.src.charCodeAt(u)===96;)u++;const h=u-d;if(h===l){if(!t){const f=e.push("code_inline","code",0);f.markup=s,f.content=e.src.slice(n,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=u,!0}e.backticks[h]=d}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=l,!0}function YY(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let l;o%2&&(l=e.push("text","",0),l.content=s,o--);for(let u=0;u<o;u+=2)l=e.push("text","",0),l.content=s+s,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function KS(e,t){let n;const r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];if(s.marker!==126||s.end===-1)continue;const l=t[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&r.push(l.token-1)}for(;r.length;){const o=r.pop();let s=o+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,o!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[o],e.tokens[o]=n)}}function JY(e){const t=e.tokens_meta,n=e.tokens_meta.length;KS(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&KS(e,t[r].delimiters)}const F_={tokenize:YY,postProcess:JY};function XY(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const i=e.scanDelims(e.pos,r===42);for(let o=0;o<i.length;o++){const s=e.push("text","",0);s.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function GS(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],s=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,l=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=s?"strong_open":"em_open",u.tag=s?"strong":"em",u.nesting=1,u.markup=s?l+l:l,u.content="";const d=e.tokens[o.token];d.type=s?"strong_close":"em_close",d.tag=s?"strong":"em",d.nesting=-1,d.markup=s?l+l:l,d.content="",s&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function QY(e){const t=e.tokens_meta,n=e.tokens_meta.length;GS(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&GS(e,t[r].delimiters)}const z_={tokenize:XY,postProcess:QY};function ZY(e,t){let n,r,i,o,s="",l="",u=e.pos,d=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const h=e.pos,f=e.posMax,g=e.pos+1,x=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(x<0)return!1;let y=x+1;if(y<f&&e.src.charCodeAt(y)===40){for(d=!1,y++;y<f&&(n=e.src.charCodeAt(y),!(!Nt(n)&&n!==10));y++);if(y>=f)return!1;if(u=y,i=e.md.helpers.parseLinkDestination(e.src,y,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?y=i.pos:s="",u=y;y<f&&(n=e.src.charCodeAt(y),!(!Nt(n)&&n!==10));y++);if(i=e.md.helpers.parseLinkTitle(e.src,y,e.posMax),y<f&&u!==y&&i.ok)for(l=i.str,y=i.pos;y<f&&(n=e.src.charCodeAt(y),!(!Nt(n)&&n!==10));y++);}(y>=f||e.src.charCodeAt(y)!==41)&&(d=!0),y++}if(d){if(typeof e.env.references>"u")return!1;if(y<f&&e.src.charCodeAt(y)===91?(u=y+1,y=e.md.helpers.parseLinkLabel(e,y),y>=0?r=e.src.slice(u,y++):y=x+1):y=x+1,r||(r=e.src.slice(g,x)),o=e.env.references[zp(r)],!o)return e.pos=h,!1;s=o.href,l=o.title}if(!t){e.pos=g,e.posMax=x;const v=e.push("link_open","a",1),w=[["href",s]];v.attrs=w,l&&w.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=y,e.posMax=f,!0}function eJ(e,t){let n,r,i,o,s,l,u,d,h="";const f=e.pos,g=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const x=e.pos+2,y=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(y<0)return!1;if(o=y+1,o<g&&e.src.charCodeAt(o)===40){for(o++;o<g&&(n=e.src.charCodeAt(o),!(!Nt(n)&&n!==10));o++);if(o>=g)return!1;for(d=o,l=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),l.ok&&(h=e.md.normalizeLink(l.str),e.md.validateLink(h)?o=l.pos:h=""),d=o;o<g&&(n=e.src.charCodeAt(o),!(!Nt(n)&&n!==10));o++);if(l=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<g&&d!==o&&l.ok)for(u=l.str,o=l.pos;o<g&&(n=e.src.charCodeAt(o),!(!Nt(n)&&n!==10));o++);else u="";if(o>=g||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<g&&e.src.charCodeAt(o)===91?(d=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?i=e.src.slice(d,o++):o=y+1):o=y+1,i||(i=e.src.slice(x,y)),s=e.env.references[zp(i)],!s)return e.pos=f,!1;h=s.href,u=s.title}if(!t){r=e.src.slice(x,y);const v=[];e.md.inline.parse(r,e.md,e.env,v);const w=e.push("image","img",0),C=[["src",h],["alt",""]];w.attrs=C,w.children=v,w.content=r,u&&C.push(["title",u])}return e.pos=o,e.posMax=g,!0}const tJ=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,nJ=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function rJ(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=e.src.slice(r+1,n);if(nJ.test(o)){const s=e.md.normalizeLink(o);if(!e.md.validateLink(s))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",s]],l.markup="autolink",l.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}if(tJ.test(o)){const s=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(s))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",s]],l.markup="autolink",l.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}return!1}function iJ(e){return/^<a[>\s]/i.test(e)}function oJ(e){return/^<\/a\s*>/i.test(e)}function sJ(e){const t=e|32;return t>=97&&t<=122}function lJ(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!sJ(i))return!1;const o=e.src.slice(r).match(OY);if(!o)return!1;if(!t){const s=e.push("html_inline","",0);s.content=o[0],iJ(s.content)&&e.linkLevel++,oJ(s.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const aJ=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,uJ=/^&([a-z][a-z0-9]{1,31});/i;function cJ(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(aJ);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),l=e.push("text_special","",0);l.content=nb(s)?xc(s):xc(65533),l.markup=o[0],l.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(uJ);if(o){const s=_G(o[0]);if(s!==o[0]){if(!t){const l=e.push("text_special","",0);l.content=s,l.markup=o[0],l.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function YS(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;s<n;s++){const l=e[s];if(o.push(0),(e[r].marker!==l.marker||i!==l.token-1)&&(r=s),i=l.token,l.length=l.length||0,!l.close)continue;t.hasOwnProperty(l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const u=t[l.marker][(l.open?3:0)+l.length%3];let d=r-o[r]-1,h=d;for(;d>u;d-=o[d]+1){const f=e[d];if(f.marker===l.marker&&f.open&&f.end<0){let g=!1;if((f.close||l.open)&&(f.length+l.length)%3===0&&(f.length%3!==0||l.length%3!==0)&&(g=!0),!g){const x=d>0&&!e[d-1].open?o[d-1]+1:0;o[s]=s-d+x,o[d]=x,l.open=!1,f.end=s,f.close=!1,h=-1,i=-2;break}}}h!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=h)}}function dJ(e){const t=e.tokens_meta,n=e.tokens_meta.length;YS(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&YS(t[r].delimiters)}function fJ(e){let t,n,r=0;const i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type==="text"&&t+1<o&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}const Rg=[["text",HY],["linkify",WY],["newline",qY],["escape",KY],["backticks",GY],["strikethrough",F_.tokenize],["emphasis",z_.tokenize],["link",ZY],["image",eJ],["autolink",rJ],["html_inline",lJ],["entity",cJ]],Pg=[["balance_pairs",dJ],["strikethrough",F_.postProcess],["emphasis",z_.postProcess],["fragments_join",fJ]];function Uc(){this.ruler=new Mr;for(let e=0;e<Rg.length;e++)this.ruler.push(Rg[e][0],Rg[e][1]);this.ruler2=new Mr;for(let e=0;e<Pg.length;e++)this.ruler2.push(Pg[e][0],Pg[e][1])}Uc.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let s=!1;if(e.level<i){for(let l=0;l<r;l++)if(e.level++,s=n[l](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos};Uc.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){const o=e.pos;let s=!1;if(e.level<i){for(let l=0;l<n;l++)if(s=t[l](e,!1),s){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Uc.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let l=0;l<s;l++)o[l](i)};Uc.prototype.State=Hc;function hJ(e){const t={};e=e||{},t.src_Any=E_.source,t.src_Cc=N_.source,t.src_Z=A_.source,t.src_P=eb.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function sx(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function Vp(e){return Object.prototype.toString.call(e)}function pJ(e){return Vp(e)==="[object String]"}function mJ(e){return Vp(e)==="[object Object]"}function gJ(e){return Vp(e)==="[object RegExp]"}function JS(e){return Vp(e)==="[object Function]"}function xJ(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const B_={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function yJ(e){return Object.keys(e||{}).reduce(function(t,n){return t||B_.hasOwnProperty(n)},!1)}const bJ={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},vJ="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",wJ="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function kJ(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function XS(){return function(e,t){t.normalize(e)}}function qh(e){const t=e.re=hJ(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(vJ),n.push(t.src_xn),t.src_tlds=n.join("|");function r(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(l,u){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+u)}Object.keys(e.__schemas__).forEach(function(l){const u=e.__schemas__[l];if(u===null)return;const d={validate:null,link:null};if(e.__compiled__[l]=d,mJ(u)){gJ(u.validate)?d.validate=kJ(u.validate):JS(u.validate)?d.validate=u.validate:o(l,u),JS(u.normalize)?d.normalize=u.normalize:u.normalize?o(l,u):d.normalize=XS();return}if(pJ(u)){i.push(l);return}o(l,u)}),i.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:XS()};const s=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(xJ).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function $_(e,t,n,r){const i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Ur(e,t){if(!(this instanceof Ur))return new Ur(e,t);t||yJ(e)&&(t=e,e={}),this.__opts__=sx({},B_,t),this.__schemas__=sx({},bJ,e),this.__compiled__={},this.__tlds__=wJ,this.__tlds_replaced__=!1,this.re={},qh(this)}Ur.prototype.add=function(t,n){return this.__schemas__[t]=n,qh(this),this};Ur.prototype.set=function(t){return this.__opts__=sx(this.__opts__,t),this};Ur.prototype.test=function(t){if(!t.length)return!1;let n,r;if(this.re.schema_test.test(t)){for(r=this.re.schema_search,r.lastIndex=0;(n=r.exec(t))!==null;)if(this.testSchemaAt(t,n[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Ur.prototype.pretest=function(t){return this.re.pretest.test(t)};Ur.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};Ur.prototype.match=function(t){const n=[],r=[],i=[],o=[];let s,l,u;function d(g,x){return g?x?g.index!==x.index?g.index<x.index?g:x:g.lastIndex>=x.lastIndex?g:x:g:x}if(!t.length)return null;if(this.re.schema_test.test(t))for(u=this.re.schema_search,u.lastIndex=0;(s=u.exec(t))!==null;)l=this.testSchemaAt(t,s[2],u.lastIndex),l&&r.push({schema:s[2],index:s.index+s[1].length,lastIndex:s.index+s[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(s=u.exec(t))!==null;)i.push({schema:"",index:s.index+s[1].length,lastIndex:s.index+s[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(s=u.exec(t))!==null;)o.push({schema:"mailto:",index:s.index+s[1].length,lastIndex:s.index+s[0].length});const h=[0,0,0];let f=0;for(;;){const g=[r[h[0]],o[h[1]],i[h[2]]],x=d(d(g[0],g[1]),g[2]);if(!x)break;if(x===g[0]?h[0]++:x===g[1]?h[1]++:h[2]++,x.index<f)continue;const y=new $_(t,x.schema,x.index,x.lastIndex);this.__compiled__[y.schema].normalize(y,this),n.push(y),f=x.lastIndex}return n.length?n:null};Ur.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);if(!r)return null;const i=new $_(t,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[i.schema].normalize(i,this),i};Ur.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),qh(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,qh(this),this)};Ur.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Ur.prototype.onCompile=function(){};const ha=2147483647,Hi=36,ob=1,wc=26,SJ=38,CJ=700,V_=72,H_=128,U_="-",EJ=/^xn--/,NJ=/[^\0-\x7F]/,TJ=/[\x2E\u3002\uFF0E\uFF61]/g,AJ={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ig=Hi-ob,Ui=Math.floor,Og=String.fromCharCode;function rs(e){throw new RangeError(AJ[e])}function _J(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function W_(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(TJ,".");const i=e.split("."),o=_J(i,t).join(".");return r+o}function q_(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const o=e.charCodeAt(n++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}const MJ=e=>String.fromCodePoint(...e),jJ=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Hi},QS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},K_=function(e,t,n){let r=0;for(e=n?Ui(e/CJ):e>>1,e+=Ui(e/t);e>Ig*wc>>1;r+=Hi)e=Ui(e/Ig);return Ui(r+(Ig+1)*e/(e+SJ))},G_=function(e){const t=[],n=e.length;let r=0,i=H_,o=V_,s=e.lastIndexOf(U_);s<0&&(s=0);for(let l=0;l<s;++l)e.charCodeAt(l)>=128&&rs("not-basic"),t.push(e.charCodeAt(l));for(let l=s>0?s+1:0;l<n;){const u=r;for(let h=1,f=Hi;;f+=Hi){l>=n&&rs("invalid-input");const g=jJ(e.charCodeAt(l++));g>=Hi&&rs("invalid-input"),g>Ui((ha-r)/h)&&rs("overflow"),r+=g*h;const x=f<=o?ob:f>=o+wc?wc:f-o;if(g<x)break;const y=Hi-x;h>Ui(ha/y)&&rs("overflow"),h*=y}const d=t.length+1;o=K_(r-u,d,u==0),Ui(r/d)>ha-i&&rs("overflow"),i+=Ui(r/d),r%=d,t.splice(r++,0,i)}return String.fromCodePoint(...t)},Y_=function(e){const t=[];e=q_(e);const n=e.length;let r=H_,i=0,o=V_;for(const u of e)u<128&&t.push(Og(u));const s=t.length;let l=s;for(s&&t.push(U_);l<n;){let u=ha;for(const h of e)h>=r&&h<u&&(u=h);const d=l+1;u-r>Ui((ha-i)/d)&&rs("overflow"),i+=(u-r)*d,r=u;for(const h of e)if(h<r&&++i>ha&&rs("overflow"),h===r){let f=i;for(let g=Hi;;g+=Hi){const x=g<=o?ob:g>=o+wc?wc:g-o;if(f<x)break;const y=f-x,v=Hi-x;t.push(Og(QS(x+y%v,0))),f=Ui(y/v)}t.push(Og(QS(f,0))),o=K_(i,d,l===s),i=0,++l}++i,++r}return t.join("")},DJ=function(e){return W_(e,function(t){return EJ.test(t)?G_(t.slice(4).toLowerCase()):t})},RJ=function(e){return W_(e,function(t){return NJ.test(t)?"xn--"+Y_(t):t})},J_={version:"2.3.1",ucs2:{decode:q_,encode:MJ},decode:G_,encode:Y_,toASCII:RJ,toUnicode:DJ},PJ={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},IJ={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},OJ={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},LJ={default:PJ,zero:IJ,commonmark:OJ},FJ=/^(vbscript|javascript|file|data):/,zJ=/^data:image\/(gif|png|jpeg|webp);/;function BJ(e){const t=e.trim().toLowerCase();return FJ.test(t)?zJ.test(t):!0}const X_=["http:","https:","mailto:"];function $J(e){const t=Zy(e,!0);if(t.hostname&&(!t.protocol||X_.indexOf(t.protocol)>=0))try{t.hostname=J_.toASCII(t.hostname)}catch{}return Vc(Qy(t))}function VJ(e){const t=Zy(e,!0);if(t.hostname&&(!t.protocol||X_.indexOf(t.protocol)>=0))try{t.hostname=J_.toUnicode(t.hostname)}catch{}return Ta(Qy(t),Ta.defaultChars+"%")}function jr(e,t){if(!(this instanceof jr))return new jr(e,t);t||tb(e)||(t=e||{},e="default"),this.inline=new Uc,this.block=new $p,this.core=new rb,this.renderer=new La,this.linkify=new Ur,this.validateLink=BJ,this.normalizeLink=$J,this.normalizeLinkText=VJ,this.utils=WG,this.helpers=Fp({},YG),this.options={},this.configure(e),t&&this.set(t)}jr.prototype.set=function(e){return Fp(this.options,e),this};jr.prototype.configure=function(e){const t=this;if(tb(e)){const n=e;if(e=LJ[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};jr.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};jr.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};jr.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};jr.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};jr.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};jr.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};jr.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const HJ=new fy({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function UJ(e,t){if(e.isText&&t.isText&&pt.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class WJ{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:pt.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(t,n.marks),s;i&&(s=UJ(i,o))?r[r.length-1]=s:r.push(o)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let r=t[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,t,n)}}addNode(t,n,r){let i=this.top(),o=t.createAndFill(n,r,i?i.marks:[]);return o?(this.push(o),o):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:pt.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function Nu(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function Lg(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function ZS(e){return e[e.length-1]==`
|
|
626
|
+
`?e.slice(0,e.length-1):e}function Fg(){}function qJ(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let o=e.nodeType(i.block);Lg(i,r)?n[r]=(s,l,u,d)=>{s.openNode(o,Nu(i,l,u,d)),s.addText(ZS(l.content)),s.closeNode()}:(n[r+"_open"]=(s,l,u,d)=>s.openNode(o,Nu(i,l,u,d)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=e.nodeType(i.node);n[r]=(s,l,u,d)=>s.addNode(o,Nu(i,l,u,d))}else if(i.mark){let o=e.marks[i.mark];Lg(i,r)?n[r]=(s,l,u,d)=>{s.openMark(o.create(Nu(i,l,u,d))),s.addText(ZS(l.content)),s.closeMark(o)}:(n[r+"_open"]=(s,l,u,d)=>s.openMark(o.create(Nu(i,l,u,d))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)Lg(i,r)?n[r]=Fg:(n[r+"_open"]=Fg,n[r+"_close"]=Fg);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let KJ=class{constructor(t,n,r){this.schema=t,this.tokenizer=n,this.tokens=r,this.tokenHandlers=qJ(t,r)}parse(t,n={}){let r=new WJ(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(t,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function eC(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new KJ(HJ,jr("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:eC(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:eC(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const GJ={open:"",close:"",mixable:!0};let YJ=class{constructor(t,n,r={}){this.nodes=t,this.marks=n,this.options=r}serialize(t,n={}){n=Object.assign({},this.options,n);let r=new Q_(this.nodes,this.marks,n);return r.renderContent(t),r.out}};const Zi=new YJ({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||"")+`
|
|
627
|
+
`),e.text(t.textContent,!1),e.write(`
|
|
628
|
+
`),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(" ",r+2);e.renderList(t,i,o=>{let s=String(n+o);return e.repeat(" ",r-s.length)+s+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(`\\
|
|
629
|
+
`);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,r){return e.inAutolink=JJ(t,n,r),e.inAutolink?"<":"["},close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,r){return tC(n.child(r),-1)},close(e,t,n,r){return tC(n.child(r-1),1)},escape:!1}});function tC(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let o=i>0&&t>0?" `":"`";for(let s=0;s<i;s++)o+="`";return i>0&&t<0&&(o+=" "),o}function JJ(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!r.isText||r.text!=e.attrs.href||r.marks[r.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let Q_=class{constructor(t,n,r){this.nodes=t,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
|
|
630
|
+
`),t>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<t;i++)this.out+=n+`
|
|
631
|
+
`}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=GJ}return n}wrapBlock(t,n,r,i){let o=this.delim;this.write(n??t),this.delim+=t,i(),this.delim=o,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
|
|
632
|
+
`)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let r=t.split(`
|
|
633
|
+
`);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
|
|
634
|
+
`)}render(t,n,r){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,r,i)=>this.render(n,t,i))}renderInline(t,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,l,u)=>{let d=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(d=d.filter(v=>{if(u+1==t.childCount)return!1;let w=t.child(u+1);return v.isInSet(w.marks)&&(!w.isText||/\S/.test(w.text))}));let h=i;if(i="",s&&s.isText&&d.some(v=>{let w=this.getMark(v.type.name);return w&&w.expelEnclosingWhitespace&&!v.isInSet(r)})){let[v,w,C]=/^(\s*)(.*)$/m.exec(s.text);w&&(h+=w,s=C?s.withText(C):null,s||(d=r))}if(s&&s.isText&&d.some(v=>{let w=this.getMark(v.type.name);return w&&w.expelEnclosingWhitespace&&!this.isMarkAhead(t,u+1,v)})){let[v,w,C]=/^(.*?)(\s*)$/m.exec(s.text);C&&(i=C,s=w?s.withText(w):null,s||(d=r))}let f=d.length?d[d.length-1]:null,g=f&&this.getMark(f.type.name).escape===!1,x=d.length-(g?1:0);e:for(let v=0;v<x;v++){let w=d[v];if(!this.getMark(w.type.name).mixable)break;for(let C=0;C<r.length;C++){let N=r[C];if(!this.getMark(N.type.name).mixable)break;if(w.eq(N)){v>C?d=d.slice(0,C).concat(w).concat(d.slice(C,v)).concat(d.slice(v+1,x)):C>v&&(d=d.slice(0,v).concat(d.slice(v+1,C)).concat(w).concat(d.slice(C,x)));continue e}}}let y=0;for(;y<Math.min(r.length,x)&&d[y].eq(r[y]);)++y;for(;y<r.length;)this.text(this.markString(r.pop(),!1,t,u),!1);if(h&&this.text(h),s){for(;r.length<x;){let v=d[r.length];r.push(v),this.text(this.markString(v,!0,t,u),!1),this.atBlockStart=!1}g&&s.isText?this.text(this.markString(f,!0,t,u)+s.text+this.markString(f,!1,t,u+1),!1):this.render(s,t,u),this.atBlockStart=!1}s!=null&&s.isText&&s.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(o),o(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,r){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,t.forEach((s,l,u)=>{u&&i&&this.flushClose(1),this.wrapBlock(n,r(u),t,()=>this.render(s,t,u))}),this.inTightList=o}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<t.length&&t[i-1].match(/\w/)&&t[i+1].match(/\w/)?r:"\\"+r),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let r="";for(let i=0;i<n;i++)r+=t;return r}markString(t,n,r,i){let o=this.getMark(t.type.name),s=n?o.open:o.close;return typeof s=="string"?s:s(this,t,r,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,r){for(;;n++){if(n>=t.childCount)return!1;let i=t.child(n);if(i.type.name!=this.options.hardBreakNodeName)return r.isInSet(i.marks);n++}}};var zg,nC;function XJ(){if(nC)return zg;nC=1;var e=!0,t=!1,n=!1;zg=function(v,w){w&&(e=!w.enabled,t=!!w.label,n=!!w.labelAfter),v.core.ruler.after("inline","github-task-lists",function(C){for(var N=C.tokens,T=2;T<N.length;T++)o(N,T)&&(s(N[T],C.Token),r(N[T-2],"class","task-list-item"+(e?"":" enabled")),r(N[i(N,T-2)],"class","contains-task-list"))})};function r(v,w,C){var N=v.attrIndex(w),T=[w,C];N<0?v.attrPush(T):v.attrs[N]=T}function i(v,w){for(var C=v[w].level-1,N=w-1;N>=0;N--)if(v[N].level===C)return N;return-1}function o(v,w){return f(v[w])&&g(v[w-1])&&x(v[w-2])&&y(v[w])}function s(v,w){if(v.children.unshift(l(v,w)),v.children[1].content=v.children[1].content.slice(3),v.content=v.content.slice(3),t)if(n){v.children.pop();var C="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);v.children[0].content=v.children[0].content.slice(0,-1)+' id="'+C+'">',v.children.push(h(v.content,C,w))}else v.children.unshift(u(w)),v.children.push(d(w))}function l(v,w){var C=new w("html_inline","",0),N=e?' disabled="" ':"";return v.content.indexOf("[ ] ")===0?C.content='<input class="task-list-item-checkbox"'+N+'type="checkbox">':(v.content.indexOf("[x] ")===0||v.content.indexOf("[X] ")===0)&&(C.content='<input class="task-list-item-checkbox" checked=""'+N+'type="checkbox">'),C}function u(v){var w=new v("html_inline","",0);return w.content="<label>",w}function d(v){var w=new v("html_inline","",0);return w.content="</label>",w}function h(v,w,C){var N=new C("html_inline","",0);return N.content='<label class="task-list-item-label" for="'+w+'">'+v+"</label>",N.attrs=[{for:w}],N}function f(v){return v.type==="inline"}function g(v){return v.type==="paragraph_open"}function x(v){return v.type==="list_item_open"}function y(v){return v.content.indexOf("[ ] ")===0||v.content.indexOf("[x] ")===0||v.content.indexOf("[X] ")===0}return zg}var QJ=XJ();const ZJ=Ma(QJ);var eX=Object.defineProperty,tX=(e,t,n)=>t in e?eX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kh=(e,t,n)=>(tX(e,typeof t!="symbol"?t+"":t,n),n);const nX=wt.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function o(s){if(!r.isActive(s))return!1;const l=r.getAttributes(s);return i.updateAttributes(s,{tight:t??!(l!=null&&l.tight)})}return e.options.listTypes.some(s=>o(s))}}}}}),rC=jr();function Z_(e,t){return rC.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new rC.inline.State(e,null,null,[]).scanDelims(t,!0)}function eM(e,t,n,r){let i=e.substring(0,n)+e.substring(n+t.length);return i=i.substring(0,n+r)+t+i.substring(n+r),i}function rX(e,t,n,r){let i=n,o=e;for(;i<r&&!Z_(o,i).can_open;)o=eM(o,t,i,1),i++;return{text:o,from:i,to:r}}function iX(e,t,n,r){let i=r,o=e;for(;i>n&&!Z_(o,i).can_close;)o=eM(o,t,i,-1),i--;return{text:o,from:n,to:i}}function oX(e,t,n,r){let i={text:e,from:n,to:r};return i=rX(i.text,t,i.from,i.to),i=iX(i.text,t,i.from,i.to),i.to-i.from<t.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+t.length)),i.text}class sX extends Q_{constructor(t,n,r){super(t,n,r??{}),Kh(this,"inTable",!1),this.inlines=[]}render(t,n,r){super.render(t,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:o,start:s,end:l}=this.normalizeInline(i);this.out=oX(this.out,o,s,l),this.inlines.pop()}}markString(t,n,r,i){const o=this.marks[t.type.name];if(o.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:o.open});else{const s=this.inlines.pop();this.inlines.push({...s,end:this.out.length})}return super.markString(t,n,r,i)}normalizeInline(t){let{start:n,end:r}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const tM=Wr.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,r;return this.editor.storage.markdown.options.html?(n=(r=iC(t))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=iC(t))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function iC(e){const t=e.type.schema,n=t.text(" ",[e]),i=Bc(se.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function sb(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function lX(e){return e==null?void 0:e.replace(/</g,"<").replace(/>/g,">")}function aX(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function uX(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const Hp=yt.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(cX(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function cX(e,t){const n=e.type.schema,r=Bc(se.from(e),n);return e.isBlock&&(t instanceof se||t.type.name===n.topNodeType.name)?dX(r):r}function dX(e){const n=sb(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
|
|
635
|
+
${n.innerHTML}
|
|
636
|
+
`:`
|
|
637
|
+
`,n.outerHTML}const fX=yt.create({name:"blockquote"}),hX=fX.extend({addStorage(){return{markdown:{serialize:Zi.nodes.blockquote,parse:{}}}}}),pX=yt.create({name:"bulletList"}),nM=pX.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),mX=yt.create({name:"codeBlock"}),gX=mX.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
|
|
638
|
+
`),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),xX=yt.create({name:"hardBreak"}),rM=xX.extend({addStorage(){return{markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(e.inTable?Hp.storage.markdown.serialize.call(this,e,t,n):`\\
|
|
639
|
+
`);return}},parse:{}}}}}),yX=yt.create({name:"heading"}),bX=yX.extend({addStorage(){return{markdown:{serialize:Zi.nodes.heading,parse:{}}}}}),vX=yt.create({name:"horizontalRule"}),wX=vX.extend({addStorage(){return{markdown:{serialize:Zi.nodes.horizontal_rule,parse:{}}}}}),kX=yt.create({name:"image"}),SX=kX.extend({addStorage(){return{markdown:{serialize:Zi.nodes.image,parse:{}}}}}),CX=yt.create({name:"listItem"}),EX=CX.extend({addStorage(){return{markdown:{serialize:Zi.nodes.list_item,parse:{}}}}}),NX=yt.create({name:"orderedList"});function TX(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}const AX=NX.extend({addStorage(){return{markdown:{serialize(e,t,n,r){const i=t.attrs.start||1,o=String(i+t.childCount-1).length,s=e.repeat(" ",o+2),u=TX(t,n,r)%2?") ":". ";e.renderList(t,s,d=>{const h=String(i+d);return e.repeat(" ",o-h.length)+h+u})},parse:{}}}}}),_X=yt.create({name:"paragraph"}),MX=_X.extend({addStorage(){return{markdown:{serialize:Zi.nodes.paragraph,parse:{}}}}});function Bg(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const jX=yt.create({name:"table"}),DX=jX.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!RX(t)){Hp.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((r,i,o)=>{if(e.write("| "),r.forEach((s,l,u)=>{u&&e.write(" | ");const d=s.firstChild;d.textContent.trim()&&e.renderInline(d)}),e.write(" |"),e.ensureNewLine(),!o){const s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");e.write(`| ${s} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function oC(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function RX(e){const t=Bg(e),n=t[0],r=t.slice(1);return!(Bg(n).some(i=>i.type.name!=="tableHeader"||oC(i)||i.childCount>1)||r.some(i=>Bg(i).some(o=>o.type.name==="tableHeader"||oC(o)||o.childCount>1)))}const PX=yt.create({name:"taskItem"}),IX=PX.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),OX=yt.create({name:"taskList"}),LX=OX.extend({addStorage(){return{markdown:{serialize:nM.storage.markdown.serialize,parse:{setup(e){e.use(ZJ)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),FX=yt.create({name:"text"}),zX=FX.extend({addStorage(){return{markdown:{serialize(e,t){e.text(lX(t.text))},parse:{}}}}}),BX=Wr.create({name:"bold"}),$X=BX.extend({addStorage(){return{markdown:{serialize:Zi.marks.strong,parse:{}}}}}),VX=Wr.create({name:"code"}),HX=VX.extend({addStorage(){return{markdown:{serialize:Zi.marks.code,parse:{}}}}}),UX=Wr.create({name:"italic"}),WX=UX.extend({addStorage(){return{markdown:{serialize:Zi.marks.em,parse:{}}}}}),qX=Wr.create({name:"link"}),KX=qX.extend({addStorage(){return{markdown:{serialize:Zi.marks.link,parse:{}}}}}),GX=Wr.create({name:"strike"}),YX=GX.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),JX=[hX,nM,gX,rM,bX,wX,Hp,SX,EX,AX,MX,DX,IX,LX,zX,$X,HX,tM,WX,KX,YX];function Gh(e){var t,n;const r=(t=e.storage)===null||t===void 0?void 0:t.markdown,i=(n=JX.find(o=>o.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class XX{constructor(t){Kh(this,"editor",null),this.editor=t}serialize(t){const n=new sX(this.nodes,this.marks,{hardBreakNodeName:rM.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Hp)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(tM)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=Gh(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const r=(n=Gh(t))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:t.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:t.options}):r.close}:null}}class QX{constructor(t,n){Kh(this,"editor",null),Kh(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=t,this.md=this.withPatchedRenderer(jr({html:r,linkify:i,breaks:o}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=Gh(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.setup)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},this.md)});const r=this.md.render(t),i=sb(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=Gh(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.updateDOM)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},i)}),this.normalizeDOM(i,{inline:n,content:t}),i.innerHTML}return t}normalizeDOM(t,n){let{inline:r,content:i}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(o=>{var s;((s=o.nextSibling)===null||s===void 0?void 0:s.nodeType)===Node.TEXT_NODE&&!o.closest("pre")&&(o.nextSibling.textContent=o.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(t,i),t}normalizeBlocks(t){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var o;return(o=i.spec.parseDOM)===null||o===void 0?void 0:o.map(s=>s.tag)}).flat().filter(Boolean).join(",");r&&[...t.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&aX(i)})}normalizeInline(t,n){var r;if((r=t.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,l;const u=t.firstElementChild,{nextElementSibling:d}=u,h=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",f=d?"":(s=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${f}`;return}uX(u),t.innerHTML=`${h}${t.innerHTML}${f}`}}withPatchedRenderer(t){const n=r=>function(){const i=r(...arguments);return i===`
|
|
640
|
+
`?i:i[i.length-1]===`
|
|
641
|
+
`?i.slice(0,-1):i};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const ZX=wt.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new vt({key:new Ht("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ca.fromSchema(this.editor.schema).parseSlice(sb(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),eQ=wt.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=j6.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new QX(this.editor,this.options),serializer:new XX(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[nX.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),ZX.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),sC=/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,Ef=new Map,tQ=wt.create({name:"wikiLink",addOptions(){return{onWikiLinkClick:void 0,checkExists:void 0}},addProseMirrorPlugins(){const{onWikiLinkClick:e,checkExists:t}=this.options;return[new vt({key:new Ht("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 u;for(sC.lastIndex=0;(u=sC.exec(l))!==null;){const h=u[0],f=u[1].trim(),g=u[2]!==void 0,x=((d=u[2])==null?void 0:d.trim())||f,y=s+u.index,v=y+h.length,w=Ef.get(f.toLowerCase()),C=(w==null?void 0:w.exists)??!t,N=w==null?void 0:w.id,T=C?"wiki-link-exists":"wiki-link-broken",D=C?`Open "${x}"`:`"${x}" not found in this nest`,A=g?y+h.lastIndexOf("|")+1:y+2,_=v-2;r.push(sn.inline(y,A,{class:"wiki-bracket-hidden"})),r.push(sn.inline(A,_,{class:`wiki-link ${T}`,"data-wiki-title":f,"data-wiki-id":N||"","data-wiki-display":x,title:D})),r.push(sn.inline(_,v,{class:"wiki-bracket-hidden"})),t&&!Ef.has(f.toLowerCase())&&(Ef.set(f.toLowerCase(),{exists:!1}),t(f).then(I=>{Ef.set(f.toLowerCase(),I)}).catch(()=>{}))}}),Et.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}}})]}}),Nf=/\[([ xX])\]/g,nQ=wt.create({name:"taskCheckbox",addProseMirrorPlugins(){return[new vt({key:new Ht("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(Nf.lastIndex=0;(s=Nf.exec(o))!==null;){const l=s[1]==="x"||s[1]==="X",u=i+s.index,d=u+s[0].length;t.push(sn.inline(u,d,{class:`task-checkbox ${l?"task-checked":"task-unchecked"}`,"data-task-checked":l?"true":"false"}))}}),Et.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((u,d)=>{if(l||!u.isText||!u.text)return;const h=u.text;let f;for(Nf.lastIndex=0;(f=Nf.exec(h))!==null;){const g=d+f.index,x=g+f[0].length;if(t>=g&&t<=x){const y=i?"[ ]":"[x]",v=o.tr.replaceWith(g,x,o.schema.text(y));return e.dispatch(v),l=!0,!1}}}),l}}})]}}),lC=/(?:^|\s)@(?:\(([^)]+)\)|([a-zA-Z0-9._@-]+))/g,rQ=wt.create({name:"mention",addOptions(){return{onMentionClick:void 0}},addProseMirrorPlugins(){const{onMentionClick:e}=this.options;return[new vt({key:new Ht("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(lC.lastIndex=0;(l=lC.exec(s))!==null;){const u=l[0],d=l[1]||l[2],h=u.startsWith(" ")||u.startsWith(`
|
|
642
|
+
`)?1:0,f=o+l.index+h,g=f+u.length-h;n.push(sn.inline(f,g,{class:"mention mention-user","data-mention-name":d}))}}),Et.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}}})]}});function aC(e){return e.storage.markdown.getMarkdown().replace(/\\\[\\\[/g,"[[").replace(/\\\]\\\]/g,"]]")}function pa(e){if(!e)return"";const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function iQ(e){const{state:t}=e,{from:n,to:r}=t.selection;if(n===r||e.isActive("codeBlock")){e.chain().focus().toggleCodeBlock().run();return}const i=t.doc.textBetween(n,r,`
|
|
643
|
+
`,`
|
|
644
|
+
`);e.chain().focus().deleteRange({from:n,to:r}).insertContent(i?{type:"codeBlock",content:[{type:"text",text:i}]}:{type:"codeBlock"}).run()}function uC(e,t){const n=(e||t).trim(),r=(t||e).trim();return n?`[[${n.startsWith("nodes/")?n:`nodes/${n}`}|${r}]] `:""}const iM=k.forwardRef(function({content:t,onChange:n,onSave:r,nestId:i,onRequestDocLink:o,onWikiLinkClick:s,onMentionClick:l,placeholder:u="Start writing...",editable:d=!0,className:h},f){const[g,x]=k.useState(!1),y=d&&!g,[v,w]=k.useState(null),[C,N]=k.useState([]),T=k.useRef(v),D=k.useRef(C);k.useEffect(()=>{T.current=v},[v]),k.useEffect(()=>{D.current=C},[C]);const A=cq({extensions:[eG.configure({heading:{levels:[1,2,3]},link:!1}),tG.configure({placeholder:u}),lK.configure({openOnClick:!1,HTMLAttributes:{target:"_blank"}}),nG,rG.configure({nested:!0}),tQ.configure({onWikiLinkClick:s,checkExists:i?async P=>{try{const{nodes:L}=await ga(i),R=L,V=P.toLowerCase(),K=pa(P).toLowerCase(),G=R.find(B=>B.id.toLowerCase()===V||B.title.toLowerCase()===V||pa(B.id).toLowerCase()===K);return G?{exists:!0,id:G.id}:{exists:!1}}catch{return{exists:!1}}}:void 0}),nQ,rQ.configure({onMentionClick:l}),eQ.configure({html:!0,tightLists:!0,bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!0,transformCopiedText:!0})],content:t,editable:d,immediatelyRender:!1,onUpdate:({editor:P})=>{const L=aC(P),R=P.isEmpty||P.getText().trim().length===0;n(R?"":L)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[300px] px-6 py-4"},handleKeyDown:(P,L)=>{var K;const R=T.current,V=D.current;if(R&&V.length>0){if(L.key==="ArrowDown")return L.preventDefault(),w(G=>G&&{...G,selectedIdx:(G.selectedIdx+1)%V.length}),!0;if(L.key==="ArrowUp")return L.preventDefault(),w(G=>G&&{...G,selectedIdx:(G.selectedIdx-1+V.length)%V.length}),!0;if(L.key==="Enter"||L.key==="Tab"){L.preventDefault();const G=V[R.selectedIdx];return G&&((K=_.current)==null||K.call(_,G)),!0}if(L.key==="Escape")return L.preventDefault(),w(null),!0}return(L.ctrlKey||L.metaKey)&&L.key==="s"?(L.preventDefault(),r==null||r(),!0):!1}}});k.useEffect(()=>{A&&A.isEditable!==y&&A.setEditable(y)},[A,y]);const _=k.useRef(null);k.useEffect(()=>{_.current=P=>{if(!A)return;const L=T.current;if(!L)return;const R=pa(P.id);A.chain().focus().insertContentAt({from:L.from,to:L.to},uC(R,P.title)).run(),w(null)}},[A]),k.useEffect(()=>{if(!A)return;const P=()=>{if(!y){w(null);return}const{state:L,view:R}=A,{selection:V}=L;if(!V.empty){w(null);return}const K=V.$from,G=K.start(),B=L.doc.textBetween(Math.max(G,K.pos-200),K.pos,`
|
|
645
|
+
`,""),W=/\[\[([^\]\n]*)$/.exec(B);if(!W){w(null);return}const U=W[1],Z=K.pos-W[0].length,q=R.coordsAtPos(K.pos);w(Y=>({query:U,from:Z,to:K.pos,coords:{left:q.left,top:q.bottom},selectedIdx:Y&&Y.query===U?Y.selectedIdx:0}))};return A.on("selectionUpdate",P),A.on("update",P),()=>{A.off("selectionUpdate",P),A.off("update",P)}},[A,y]),k.useEffect(()=>{if(!v||!i){N([]);return}let P=!1;const L=v.query.trim();return(async()=>{try{const R=L?await Cx(i,L):await ga(i);if(P)return;const V=(R.nodes||[]).slice(0,8);N(V)}catch{P||N([])}})(),()=>{P=!0}},[v==null?void 0:v.query,i]),k.useEffect(()=>{A&&(A.isFocused||t!==aC(A)&&A.commands.setContent(t,{emitUpdate:!1}))},[t,A]),k.useImperativeHandle(f,()=>({insertWikiLink:(P,L)=>{A&&A.chain().focus().insertContent(uC(P,L)).run()}}),[A]);const I=()=>{if(!A)return;const P=A.getAttributes("link").href??"",L=window.prompt("URL",P);if(L!==null){if(L===""){A.chain().focus().extendMarkRange("link").unsetLink().run();return}A.chain().focus().extendMarkRange("link").setLink({href:L}).run()}};return A?p.jsxs("div",{className:Ie("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(oQ,{editor:A,onLink:I,onRequestDocLink:o,previewing:g,onTogglePreview:()=>x(P=>!P)})}),p.jsx(q6,{editor:A,className:Ie("min-h-[60vh] max-h-[60vh] overflow-y-auto",g&&"bg-muted/20"),"data-testid":"markdown-editor-content"}),v&&C.length>0&&p.jsxs("div",{className:"fixed z-50 w-72 max-h-64 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md",style:{left:v.coords.left,top:v.coords.top+4},onMouseDown:P=>P.preventDefault(),children:[p.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wider text-muted-foreground border-b",children:"Link a document"}),p.jsx("ul",{className:"py-1",children:C.map((P,L)=>p.jsx("li",{children:p.jsxs("button",{type:"button",className:Ie("w-full text-left px-3 py-1.5 text-sm hover:bg-muted",L===v.selectedIdx&&"bg-muted"),onClick:()=>{var R;return(R=_.current)==null?void 0:R.call(_,P)},children:[p.jsx("div",{className:"truncate font-medium",children:P.title}),p.jsx("div",{className:"truncate text-xs text-muted-foreground",children:P.id})]})},P.id))})]})]}):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 oQ({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(Ln,{active:!0,onClick:i,title:"Back to editing",children:p.jsx(Ac,{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(Ln,{active:e.isActive("bold"),onClick:()=>e.chain().focus().toggleBold().run(),title:"Bold (Ctrl+B)",children:p.jsx(UD,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{active:e.isActive("italic"),onClick:()=>e.chain().focus().toggleItalic().run(),title:"Italic (Ctrl+I)",children:p.jsx(_R,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{active:e.isActive("strike"),onClick:()=>e.chain().focus().toggleStrike().run(),title:"Strikethrough",children:p.jsx(pP,{className:"h-3.5 w-3.5"})}),p.jsx(Tu,{}),p.jsx(Ln,{active:e.isActive("heading",{level:1}),onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",children:p.jsx(wR,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{active:e.isActive("heading",{level:2}),onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:p.jsx(SR,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{active:e.isActive("heading",{level:3}),onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:p.jsx(ER,{className:"h-3.5 w-3.5"})}),p.jsx(Tu,{}),p.jsx(Ln,{active:e.isActive("bulletList"),onClick:()=>e.chain().focus().toggleBulletList().run(),title:"Bullet list",children:p.jsx(BR,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{active:e.isActive("orderedList"),onClick:()=>e.chain().focus().toggleOrderedList().run(),title:"Numbered list",children:p.jsx(FR,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{onClick:()=>e.chain().focus().insertContent("[ ] ").run(),title:"Insert task ([ ])",children:p.jsx(fP,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{active:e.isActive("blockquote"),onClick:()=>e.chain().focus().toggleBlockquote().run(),title:"Quote",children:p.jsx(XR,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{active:e.isActive("codeBlock"),onClick:()=>iQ(e),title:"Code block",children:p.jsx(oR,{className:"h-3.5 w-3.5"})}),p.jsx(Tu,{}),p.jsx(Ln,{active:e.isActive("link"),onClick:t,title:"Insert URL link",children:p.jsx(OR,{className:"h-3.5 w-3.5"})}),n&&p.jsx(Ln,{onClick:n,title:"Link to a document in this nest",children:p.jsx(ps,{className:"h-3.5 w-3.5"})}),p.jsx(Tu,{}),p.jsx(Ln,{onClick:()=>e.chain().focus().undo().run(),disabled:!e.can().undo(),title:"Undo (Ctrl+Z)",children:p.jsx(vP,{className:"h-3.5 w-3.5"})}),p.jsx(Ln,{onClick:()=>e.chain().focus().redo().run(),disabled:!e.can().redo(),title:"Redo (Ctrl+Shift+Z)",children:p.jsx(ZR,{className:"h-3.5 w-3.5"})}),p.jsx(Tu,{}),p.jsx(Ln,{onClick:i,title:"Preview — see how it will render",children:p.jsx(Tc,{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 Ln({active:e,onClick:t,disabled:n,title:r,children:i}){return p.jsx(be,{type:"button",variant:"ghost",size:"sm",onMouseDown:o=>o.preventDefault(),onClick:t,disabled:n,title:r,className:Ie("h-7 w-7 p-0",e&&"bg-muted text-foreground"),children:i})}function Tu(){return p.jsx("span",{className:"mx-1 inline-block h-5 w-px bg-border"})}function sQ({nestId:e,nestName:t,isOwner:n,isAnonOwned:r,onBack:i,onOpenDocument:o,initialSearch:s}){var kt,wn;const{isAdmin:l,adminStatus:u,authMode:d}=Ss(),h=n||r&&d!=="open"&&l,f=((wn=(kt=u==null?void 0:u.me)==null?void 0:kt.email)==null?void 0:wn.toLowerCase())??"",[g,x]=k.useState([]),[y,v]=k.useState([]),[w,C]=k.useState([]),[N,T]=k.useState([]),[D,A]=k.useState([]),[_,I]=k.useState(!1),[P,L]=k.useState(!1),[R,V]=k.useState(!1),[K,G]=k.useState("private"),[B,W]=k.useState(!1),[U,Z]=k.useState(null),[q,Y]=k.useState([]),[j,z]=k.useState(!1),[ee,O]=k.useState("all"),[ce,pe]=k.useState("all"),[le,ie]=k.useState(null),[ue,xe]=k.useState(!0),[Te,Le]=k.useState(s??""),[Be,at]=k.useState("all"),[Xe,Ot]=k.useState(null),[ut,Tt]=k.useState(null),[nr,xt]=k.useState(null),[Vn,rr]=k.useState({versions:[],approvedVersion:null,currentVersion:0}),[ft,hn]=k.useState(!1),[mr,ir]=k.useState(!1),[te,he]=k.useState(!1),[De,Fe]=k.useState(!1),Re=k.useCallback(async()=>{var nt;xe(!0);const[ne,we,qe,Pt,re,Ce]=await Promise.all([ga(e).catch(ot=>(console.error("[NestView] listNodes failed",e,ot),{nodes:[]})),XP(e).catch(ot=>(console.error("[NestView] listStewards failed",e,ot),{stewards:[]})),r8(e).catch(ot=>(console.error("[NestView] getReviewQueue failed",e,ot),gi.error((ot==null?void 0:ot.message)||"Failed to load review queue"),{requests:[],total:0})),x3(e).catch(ot=>(console.error("[NestView] getNestSettings failed",e,ot),{stewardship_enabled:!1,allow_self_approve:!1})),pk(e).catch(ot=>(console.error("[NestView] listExternalEdits failed",e,ot),{entries:[],total:0})),Zh(e).catch(ot=>(console.error("[NestView] getNest failed",e,ot),null))]);x(ne.nodes),v(we.stewards),T(qe.requests),L(Pt.stewardship_enabled),V(Pt.allow_self_approve),A(re.entries),(nt=Ce==null?void 0:Ce.nest)!=null&&nt.visibility&&G(Ce.nest.visibility),Ce!=null&&Ce.nest&&W(!!Ce.nest.is_imported),Ce!=null&&Ce.permission&&Z(Ce.permission),Y((Ce==null?void 0:Ce.roles)??[]),C((Ce==null?void 0:Ce.myStewards)??[]),xe(!1)},[e]),At=k.useCallback(async()=>{I(!0);try{await o8(e).catch(we=>(console.error("[NestView] scanExternalEdits failed",e,we),null));const{entries:ne}=await pk(e);A(ne)}finally{I(!1)}},[e]);k.useEffect(()=>{Re()},[Re]);const Yt=g.filter(ne=>{var we;if(Be!=="all"&&ne.status!==Be)return!1;if(Te){const qe=Te.toLowerCase(),Pt=(we=ne.title)==null?void 0:we.toLowerCase().includes(qe),re=Array.isArray(ne.tags)?ne.tags.some(Ce=>Ce.toLowerCase().includes(qe)):!1;if(!Pt&&!re)return!1}return!0}),pn=(()=>{const we=n||l||((...nt)=>q.some(ot=>nt.includes(ot)))("owner","admin"),qe=U==="owner"||U==="admin"||U==="write",Pt=we||w.some(nt=>nt.role==="reviewer"),re=we||qe||w.some(nt=>nt.role==="editor"&&nt.scope==="nest");return{canManage:we,collabCanWrite:qe,canReviewDocs:Pt,canEditDocs:re,isReadOnly:!re&&!Pt&&!we}})(),{canManage:jn,collabCanWrite:gr,canEditDocs:ht,isReadOnly:_t}=pn,Lt=new Map;for(const ne of N)Lt.set(ne.nodeId,ne.requestedBy.toLowerCase());const Dn=(ne,we)=>w.some(qe=>{if(qe.role!==we)return!1;if(qe.scope==="nest")return!0;if(qe.scope==="document")return qe.nodePattern===ne.id;if(qe.scope==="tag"){const Pt=(qe.tagName||"").toLowerCase().replace(/^#+/,"");return(ne.tags||[]).map(re=>re.toLowerCase().replace(/^#+/,"")).includes(Pt)}return!1}),xr=ne=>!ne||_t?!1:l||q.includes("admin")?!0:n?R:!!Dn(ne,"reviewer"),yr=ne=>!ne||_t?!1:jn||gr?!0:w.some(we=>{if(we.role!=="editor")return!1;if(we.scope==="nest")return!0;if(we.scope==="document")return we.nodePattern===ne.id;if(we.scope==="tag"){const qe=(we.tagName||"").toLowerCase().replace(/^#+/,"");return(ne.tags||[]).map(Pt=>Pt.toLowerCase().replace(/^#+/,"")).includes(qe)}return!1}),Rn=N.filter(ne=>{const we=g.find(Pt=>Pt.id===ne.nodeId);return!(!we||!xr(we)||ne.requestedBy.toLowerCase()===f&&!(n&&R))}),Pn={total:g.length,pending:g.filter(ne=>ne.status==="pending_review").length,approved:g.filter(ne=>ne.status==="approved").length,reviewQueue:N.length,reviewable:Rn.length},We=async ne=>{xt(ne);try{const we=await i8(e,ne.id);rr(we)}catch(we){console.error("[NestView] getNodeVersions failed",e,ne==null?void 0:ne.id,we)}},Mt=async ne=>{if(Xe)try{await b3(e,Xe.id,ne),gi.success("Approved"),Ot(null),Re()}catch(we){console.error("[NestView] approveNode failed",e,Xe==null?void 0:Xe.id,we),gi.error((we==null?void 0:we.message)||"Approve failed")}},Ft=async ne=>{if(Xe)try{await v3(e,Xe.id,ne),gi.success("Rejected"),Ot(null),Re()}catch(we){console.error("[NestView] rejectNode failed",e,Xe==null?void 0:Xe.id,we),gi.error((we==null?void 0:we.message)||"Reject failed")}},en=async(ne,we)=>{if(ut)try{await y3(e,ut.id,ne,we),gi.success("Submitted for review"),Tt(null),Re()}catch(qe){console.error("[NestView] submitForReview failed",e,ut==null?void 0:ut.id,qe),gi.error((qe==null?void 0:qe.message)||"Submit failed")}},qr=async ne=>{if(window.confirm("Remove this steward? They will lose approval rights immediately. The user account and any documents stay intact."))try{await e8(e,ne),Re()}catch(qe){console.error("[NestView] removeSteward failed",e,ne,qe),window.alert((qe==null?void 0:qe.message)||"Failed to remove steward")}},zt=async ne=>{const{target:we,...qe}=ne,Pt={...qe};ne.scope==="document"?Pt.nodePattern=we:ne.scope==="tag"&&(Pt.tagName=we),await ZP(e,Pt),Re()},Ut=async ne=>{if(!le)return;const we={role:ne.role,scope:ne.scope};ne.scope==="document"?we.nodePattern=ne.target:ne.scope==="tag"&&(we.tagName=ne.target),await t8(e,le.id,we),gi.success("Steward updated"),Re()},Kr=async ne=>{if(window.confirm(`Delete "${ne.title}"? This cannot be undone.`))try{await YP(e,ne.id),Re()}catch(qe){console.error("[NestView] deleteNode failed",e,ne==null?void 0:ne.id,qe),window.alert((qe==null?void 0:qe.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(be,{variant:"ghost",size:"icon",onClick:i,children:p.jsx(vx,{className:"h-4 w-4"})}),p.jsx("h3",{className:"text-xl font-semibold",children:t}),K==="public"&&p.jsxs(lr,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700",title:"Anyone with the URL can read this nest",children:[p.jsx(kx,{className:"h-3 w-3"}),"Public"]}),B&&p.jsxs(lr,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700",title:"Imported from a folder — its files were copied into the workspace",children:[p.jsx(la,{className:"h-3 w-3"}),"Imported"]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2 w-full sm:w-auto sm:justify-end",children:[p.jsxs(be,{variant:"outline",onClick:()=>ir(!0),children:[p.jsx(PR,{className:"h-4 w-4 mr-2"}),"Connect"]}),jn&&p.jsxs(be,{variant:"outline",onClick:()=>he(!0),children:[p.jsx(ja,{className:"h-4 w-4 mr-2"}),"Share"]}),!_t&&p.jsxs(p.Fragment,{children:[h&&p.jsxs(be,{variant:"outline",onClick:()=>Fe(!0),className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:[p.jsx(ll,{className:"h-4 w-4 mr-2"}),"Delete"]}),l&&p.jsxs(be,{variant:"outline",onClick:()=>z(!0),children:[p.jsx(hk,{className:"h-4 w-4 mr-2"}),"Settings"]}),P&&l&&p.jsxs(be,{variant:"outline",onClick:()=>hn(!0),children:[p.jsx(Ar,{className:"h-4 w-4 mr-2"}),"Assign Steward"]}),ht&&p.jsxs(be,{onClick:()=>o("new"),children:[p.jsx(a1,{className:"h-4 w-4 mr-2"}),"New Document"]})]})]})]}),p.jsxs("div",{className:`grid grid-cols-1 gap-4 mb-6 ${P?"md:grid-cols-4":"md:grid-cols-1 max-w-sm"}`,children:[p.jsxs(Qt,{children:[p.jsxs(yn,{className:"pb-2",children:[p.jsx(Fr,{children:"Total Documents"}),p.jsx(bn,{className:"text-3xl",children:Pn.total})]}),p.jsx(Zt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(ps,{className:"h-4 w-4"}),p.jsx("span",{children:P?"In your context":"Auto-approved, AI-ready"})]})})]}),P&&p.jsxs(p.Fragment,{children:[p.jsxs(Qt,{children:[p.jsxs(yn,{className:"pb-2",children:[p.jsx(Fr,{children:"Pending Review"}),p.jsx(bn,{className:"text-3xl text-amber-600",children:Pn.pending})]}),p.jsx(Zt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(Bf,{className:"h-4 w-4"}),p.jsx("span",{children:"Awaiting approval"})]})})]}),p.jsxs(Qt,{children:[p.jsxs(yn,{className:"pb-2",children:[p.jsx(Fr,{children:"AI Ready"}),p.jsx(bn,{className:"text-3xl text-green-600",children:Pn.approved})]}),p.jsx(Zt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(qi,{className:"h-4 w-4"}),p.jsx("span",{children:"Approved for AI"})]})})]}),p.jsxs(Qt,{children:[p.jsxs(yn,{className:"pb-2",children:[p.jsx(Fr,{children:"Review Queue"}),p.jsx(bn,{className:"text-3xl text-blue-600",children:Pn.reviewable})]}),p.jsx(Zt,{children:p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(Ar,{className:"h-4 w-4"}),p.jsxs("span",{children:["Need your review",Pn.reviewQueue>Pn.reviewable&&p.jsxs("span",{className:"ml-1 text-xs",children:["(",Pn.reviewQueue," pending total,"," ",Pn.reviewQueue-Pn.reviewable," outside your scope)"]})]})]})})]})]})]}),p.jsxs(HE,{defaultValue:"documents",className:"w-full",children:[p.jsxs(Ix,{className:"mb-4",children:[p.jsx(Fi,{value:"documents",children:"Documents"}),P&&!_t&&p.jsxs(Fi,{value:"review",className:"gap-2",children:["Review Queue",Rn.length>0&&p.jsx(lr,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:Rn.length})]}),!_t&&p.jsxs(Fi,{value:"external-edits",className:"gap-2",children:["External Edits",D.length>0&&p.jsx(lr,{variant:"secondary",className:"text-[10px] px-1.5 py-0 bg-orange-100 text-orange-700",children:D.length})]}),P&&l&&p.jsx(Fi,{value:"stewards",children:"Stewards"}),jn&&p.jsx(Fi,{value:"collaborators",children:"Collaborators"})]}),p.jsx(zi,{value:"documents",className:"space-y-4",children:p.jsxs(Qt,{children:[p.jsx(yn,{children:p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx(bn,{className:"text-lg",children:"Documents"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"relative w-48 sm:w-64",children:[p.jsx(u3,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),p.jsx(Xn,{placeholder:"Search documents or tags...",value:Te,onChange:ne=>Le(ne.target.value),className:"pl-9 w-full h-8"})]}),P&&p.jsxs(yo,{value:Be,onValueChange:at,children:[p.jsx($i,{className:"w-[140px] h-8",children:p.jsx(bo,{})}),p.jsxs(Vi,{children:[p.jsx(Kt,{value:"all",children:"All Status"}),p.jsx(Kt,{value:"draft",children:"Draft"}),p.jsx(Kt,{value:"pending_review",children:"Pending"}),p.jsx(Kt,{value:"approved",children:"Approved"}),p.jsx(Kt,{value:"rejected",children:"Rejected"})]})]})]})]})}),p.jsx(Zt,{children:ue?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(dt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):Yt.length===0?p.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:Te||Be!=="all"?"No matching documents":"No documents yet"}):p.jsx("div",{className:"space-y-2",children:Yt.map(ne=>{var we;return p.jsxs("div",{onClick:()=>o(ne.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-${ne.id}`,children:[p.jsx(ps,{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:ne.title}),p.jsx(nB,{status:ne.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",ne.version||1]}),((we=ne.tags)==null?void 0:we.length)>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{children:"·"}),p.jsx("span",{className:"truncate",children:ne.tags.slice(0,3).join(" ")})]})]})]}),p.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",onClick:qe=>qe.stopPropagation(),children:[P&&ne.status==="draft"&&yr(ne)&&p.jsxs(be,{variant:"outline",size:"sm",onClick:()=>Tt(ne),children:[p.jsx(Sx,{className:"h-3.5 w-3.5 mr-1"}),"Submit"]}),P&&ne.status==="pending_review"&&xr(ne)&&(Lt.get(ne.id)!==f||n&&R)&&p.jsx(be,{variant:"outline",size:"sm",onClick:()=>Ot(ne),className:"border-green-200 text-green-700 hover:bg-green-50",children:"Review"}),ne.status!=="pending_review"&&yr(ne)&&p.jsx(be,{variant:"ghost",size:"sm",onClick:()=>o(ne.id),title:"Edit",children:p.jsx(Ac,{className:"h-3.5 w-3.5"})}),p.jsx(be,{variant:"ghost",size:"sm",onClick:()=>We(ne),title:"History",children:p.jsx(l1,{className:"h-3.5 w-3.5"})}),yr(ne)&&p.jsx(be,{variant:"ghost",size:"sm",onClick:()=>Kr(ne),title:"Delete",className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:p.jsx(ll,{className:"h-3.5 w-3.5"})})]})]},ne.id)})})})]})}),P&&p.jsxs(zi,{value:"review",className:"space-y-4",children:[p.jsx($z,{requests:Rn,loading:ue,onRefresh:Re,onSelect:ne=>{const we=g.find(qe=>qe.id===ne.nodeId);if(we){Ot(we);return}gi.error(`Can't open "${ne.title||ne.nodeId}" — document missing or outside your access.`)}}),N.length>0&&Rn.length===0&&p.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[N.length," pending review",N.length===1?"":"s"," in this nest, but none you can act on — outside your steward scope, or submitted by you (authors can't approve their own work)."]})]}),p.jsx(zi,{value:"external-edits",className:"space-y-4",children:p.jsxs(Qt,{children:[p.jsx(yn,{className:"pb-3",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsxs(bn,{className:"text-lg flex items-center gap-2",children:[p.jsx($f,{className:"h-4 w-4 text-orange-600"}),"External Edits"]}),p.jsx(Fr,{children:"Files edited directly on disk, awaiting your approval."})]}),p.jsx(be,{variant:"ghost",size:"icon",onClick:At,disabled:_,className:"h-8 w-8","data-testid":"external-edits-refresh",children:_?p.jsx(dt,{className:"h-4 w-4 animate-spin"}):p.jsx(ec,{className:"h-4 w-4"})})]})}),p.jsx(Zt,{children:D.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[p.jsx(qi,{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:D.map(ne=>p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>o(ne.document_id),"data-testid":`external-edit-row-${ne.suggestion_id}`,children:[p.jsx($f,{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:ne.document_id}),p.jsx(lr,{variant:"secondary",className:"text-[10px] px-1.5 py-0 bg-orange-100 text-orange-700",children:ne.source})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-1",children:[p.jsx(Bf,{className:"h-3 w-3"}),p.jsx("span",{children:new Date(ne.detected_at).toLocaleString()}),p.jsx("span",{children:"•"}),p.jsxs("span",{children:["by ",ne.actor]})]})]})]},ne.suggestion_id))})})]})}),P&&l&&p.jsxs(zi,{value:"stewards",className:"space-y-4",children:[p.jsxs(Qt,{className:"border-blue-200 bg-blue-50/40",children:[p.jsx(yn,{className:"pb-2",children:p.jsxs(bn,{className:"text-sm flex items-center gap-2",children:[p.jsx(Ar,{className:"h-4 w-4 text-blue-700"}),"How stewardship works"]})}),p.jsxs(Zt,{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(Qt,{children:[p.jsx(yn,{className:"pb-3",children:p.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p.jsxs("div",{children:[p.jsx(bn,{className:"text-lg",children:"Stewards"}),p.jsx(Fr,{children:y.length===0?"Nobody's governing content yet":"Who governs what"})]}),y.length>0&&p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[["all","document","tag","nest"].map(ne=>p.jsx("button",{onClick:()=>O(ne),className:`text-xs px-2 py-1 rounded border ${ee===ne?"bg-primary text-primary-foreground border-primary":"bg-background text-muted-foreground border-border hover:bg-secondary"}`,children:ne==="all"?"All":ne.charAt(0).toUpperCase()+ne.slice(1)},ne)),p.jsx("span",{className:"w-px h-4 bg-border"}),p.jsxs(yo,{value:ce,onValueChange:ne=>pe(ne),children:[p.jsx($i,{className:"w-[120px] h-7 text-xs",children:p.jsx(bo,{})}),p.jsxs(Vi,{children:[p.jsx(Kt,{value:"all",children:"All"}),p.jsx(Kt,{value:"editor",children:"Editor"}),p.jsx(Kt,{value:"reviewer",children:"Reviewer"}),p.jsx(Kt,{value:"viewer",children:"Viewer"})]})]})]})]})}),p.jsx(Zt,{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."}),l&&p.jsxs(be,{variant:"outline",size:"sm",className:"w-full",onClick:()=>hn(!0),children:[p.jsx(Ar,{className:"h-3.5 w-3.5 mr-2"}),"Assign your first steward"]})]}):p.jsx(Fz,{stewards:y.filter(ne=>(ee==="all"||ne.scope===ee)&&(ce==="all"||ne.role===ce)),showScope:!0,onAddSteward:l?()=>hn(!0):void 0,onRemove:l?qr:void 0,onEditRole:l?ie:void 0,currentUserEmail:f})})]})]}),jn&&p.jsx(zi,{value:"collaborators",className:"space-y-4",children:p.jsxs(Qt,{children:[p.jsxs(yn,{className:"pb-3",children:[p.jsx(bn,{className:"text-lg",children:"Collaborators"}),p.jsx(Fr,{children:"People with direct access to this nest. Sharing grants plain access (viewer/editor/admin) — it does not make anyone a steward. Manage visibility from the Share dialog."})]}),p.jsx(Zt,{children:p.jsx(m4,{nestId:e,nestName:t,onChanged:Re,currentUserEmail:f})})]})})]}),!P&&!_t&&p.jsxs(Qt,{className:"mt-4",children:[p.jsxs(yn,{className:"pb-3",children:[p.jsxs(bn,{className:"text-base flex items-center gap-2",children:[p.jsx(Ar,{className:"h-4 w-4"}),"Stewardship is off"]}),p.jsx(Fr,{children:"New documents are auto-approved and immediately AI-ready."})]}),p.jsxs(Zt,{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."}),l?p.jsxs(be,{variant:"outline",size:"sm",className:"w-full",onClick:()=>z(!0),children:[p.jsx(hk,{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."})]})]}),mr&&p.jsx(pF,{isOpen:mr,onClose:()=>ir(!1),nestId:e,nestName:t}),te&&p.jsx(g4,{nestId:e,nestName:t,onClose:()=>he(!1),onChanged:Re}),j&&p.jsx(SF,{nestId:e,nestName:t,stewardshipEnabled:P,allowSelfApprove:R,canManageStewardship:l,onClose:()=>z(!1),onChanged:()=>{z(!1),Re()}}),De&&p.jsx(bE,{nestId:e,nestName:t,isImported:B,open:!0,onOpenChange:Fe,onDeleted:()=>{Fe(!1),i()}}),ft&&p.jsx(e2,{isOpen:ft,onClose:()=>hn(!1),nestId:e,onSubmit:zt,onSync:async()=>{await QP(e),await Re()}}),le&&p.jsx(e2,{isOpen:!!le,steward:le,nestId:e,onClose:()=>ie(null),onSubmit:Ut}),ut&&p.jsx(ST,{isOpen:!!ut,onClose:()=>Tt(null),documentTitle:ut.title,currentVersion:ut.version||1,onSubmit:en}),Xe&&p.jsx(lQ,{node:Xe,nestId:e,onApprove:Mt,onReject:Ft,onClose:()=>Ot(null),onOpenDocument:ne=>{Ot(null),o(ne)}}),nr&&p.jsx(vn,{open:!0,onOpenChange:()=>xt(null),children:p.jsxs(an,{className:"sm:max-w-[600px] max-h-[85vh] overflow-hidden flex flex-col",children:[p.jsx(un,{children:p.jsx(cn,{children:nr.title})}),p.jsx(tB,{className:"flex-1 min-h-0 overflow-hidden",versions:Vn.versions,currentVersion:Vn.currentVersion,approvedVersion:Vn.approvedVersion})]})})]})}function lQ({node:e,nestId:t,onApprove:n,onReject:r,onClose:i,onOpenDocument:o}){const[s,l]=k.useState(null),u=async(d,h)=>{if(l(null),h){o(h);return}try{const{nodes:f}=await Cx(t,d),g=f.find(x=>x.title.toLowerCase()===d.toLowerCase());if(g){o(g.id);return}l(`"${d}" doesn't exist in this nest. Reviewers can't create new documents — ask an editor to add it.`)}catch(f){console.error("[NestView] wiki-link lookup failed",t,d,f),l("Couldn't look up that document — try again later.")}};return p.jsx(vn,{open:!0,onOpenChange:i,children:p.jsxs(an,{className:"sm:max-w-[600px] max-h-[80vh] flex flex-col",children:[p.jsx(un,{children:p.jsx(cn,{children:e.title})}),s&&p.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-800 dark:bg-amber-950 dark:text-amber-200",children:s}),p.jsx("div",{className:"flex-1 overflow-y-auto rounded-md",children:e.content?p.jsx(iM,{content:e.content,onChange:()=>{},editable:!1,nestId:t,onWikiLinkClick:u},e.id):p.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"(no content)"})}),p.jsx(cr,{children:p.jsx(kT,{documentTitle:e.title,version:e.version||1,onApprove:n,onReject:r})})]})})}function aQ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const uQ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cQ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dQ={};function cC(e,t){return(dQ.jsx?cQ:uQ).test(e)}const fQ=/[ \t\n\f\r]/g;function hQ(e){return typeof e=="object"?e.type==="text"?dC(e.value):!1:dC(e)}function dC(e){return e.replace(fQ,"")===""}class Wc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Wc.prototype.normal={};Wc.prototype.property={};Wc.prototype.space=void 0;function oM(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Wc(n,r,t)}function lx(e){return e.toLowerCase()}class Dr{constructor(t,n){this.attribute=n,this.property=t}}Dr.prototype.attribute="";Dr.prototype.booleanish=!1;Dr.prototype.boolean=!1;Dr.prototype.commaOrSpaceSeparated=!1;Dr.prototype.commaSeparated=!1;Dr.prototype.defined=!1;Dr.prototype.mustUseProperty=!1;Dr.prototype.number=!1;Dr.prototype.overloadedBoolean=!1;Dr.prototype.property="";Dr.prototype.spaceSeparated=!1;Dr.prototype.space=void 0;let pQ=0;const Je=Cl(),nn=Cl(),ax=Cl(),ge=Cl(),Ct=Cl(),ma=Cl(),Lr=Cl();function Cl(){return 2**++pQ}const ux=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:nn,commaOrSpaceSeparated:Lr,commaSeparated:ma,number:ge,overloadedBoolean:ax,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),$g=Object.keys(ux);class lb extends Dr{constructor(t,n,r,i){let o=-1;if(super(t,n),fC(this,"space",i),typeof r=="number")for(;++o<$g.length;){const s=$g[o];fC(this,$g[o],(r&ux[s])===ux[s])}}}lb.prototype.defined=!0;function fC(e,t,n){n&&(e[t]=n)}function Fa(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new lb(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[lx(r)]=r,n[lx(o.attribute)]=r}return new Wc(t,n,e.space)}const sM=Fa({properties:{ariaActiveDescendant:null,ariaAtomic:nn,ariaAutoComplete:null,ariaBusy:nn,ariaChecked:nn,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:nn,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:nn,ariaFlowTo:Ct,ariaGrabbed:nn,ariaHasPopup:null,ariaHidden:nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:ge,ariaLive:null,ariaModal:nn,ariaMultiLine:nn,ariaMultiSelectable:nn,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:nn,ariaReadOnly:nn,ariaRelevant:null,ariaRequired:nn,ariaRoleDescription:Ct,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:nn,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function lM(e,t){return t in e?e[t]:t}function aM(e,t){return lM(e,t.toLowerCase())}const mQ=Fa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ma,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:Ct,autoFocus:Je,autoPlay:Je,blocking:Ct,capture:null,charSet:null,checked:Je,cite:null,className:Ct,cols:ge,colSpan:null,content:null,contentEditable:nn,controls:Je,controlsList:Ct,coords:ge|ma,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:ax,draggable:nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:Ct,height:ge,hidden:ax,high:ge,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Je,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,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:Je,optimum:ge,pattern:null,ping:Ct,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:Ct,required:Je,reversed:Je,rows:ge,rowSpan:ge,sandbox:Ct,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:nn,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:nn,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Je,disableRemotePlayback:Je,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:aM}),gQ=Fa({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:Lr,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:Ct,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:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,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:ma,g2:ma,glyphName:ma,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:Lr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,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:ge,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:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Lr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Lr,rev:Lr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Lr,requiredFeatures:Lr,requiredFonts:Lr,requiredFormats:Lr,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:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:Lr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Lr,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Lr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lM}),uM=Fa({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()}}),cM=Fa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:aM}),dM=Fa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),xQ={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"},yQ=/[A-Z]/g,hC=/-[a-z]/g,bQ=/^data[-\w.:]+$/i;function vQ(e,t){const n=lx(t);let r=t,i=Dr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&bQ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(hC,kQ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!hC.test(o)){let s=o.replace(yQ,wQ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=lb}return new i(r,t)}function wQ(e){return"-"+e.toLowerCase()}function kQ(e){return e.charAt(1).toUpperCase()}const SQ=oM([sM,mQ,uM,cM,dM],"html"),ab=oM([sM,gQ,uM,cM,dM],"svg");function CQ(e){return e.join(" ").trim()}var ea={},Vg,pC;function EQ(){if(pC)return Vg;pC=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
646
|
+
`,d="/",h="*",f="",g="comment",x="declaration";function y(w,C){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];C=C||{};var N=1,T=1;function D(B){var W=B.match(t);W&&(N+=W.length);var U=B.lastIndexOf(u);T=~U?B.length-U:T+B.length}function A(){var B={line:N,column:T};return function(W){return W.position=new _(B),L(),W}}function _(B){this.start=B,this.end={line:N,column:T},this.source=C.source}_.prototype.content=w;function I(B){var W=new Error(C.source+":"+N+":"+T+": "+B);if(W.reason=B,W.filename=C.source,W.line=N,W.column=T,W.source=w,!C.silent)throw W}function P(B){var W=B.exec(w);if(W){var U=W[0];return D(U),w=w.slice(U.length),W}}function L(){P(n)}function R(B){var W;for(B=B||[];W=V();)W!==!1&&B.push(W);return B}function V(){var B=A();if(!(d!=w.charAt(0)||h!=w.charAt(1))){for(var W=2;f!=w.charAt(W)&&(h!=w.charAt(W)||d!=w.charAt(W+1));)++W;if(W+=2,f===w.charAt(W-1))return I("End of comment missing");var U=w.slice(2,W-2);return T+=2,D(U),w=w.slice(W),T+=2,B({type:g,comment:U})}}function K(){var B=A(),W=P(r);if(W){if(V(),!P(i))return I("property missing ':'");var U=P(o),Z=B({type:x,property:v(W[0].replace(e,f)),value:U?v(U[0].replace(e,f)):f});return P(s),Z}}function G(){var B=[];R(B);for(var W;W=K();)W!==!1&&(B.push(W),R(B));return B}return L(),G()}function v(w){return w?w.replace(l,f):f}return Vg=y,Vg}var mC;function NQ(){if(mC)return ea;mC=1;var e=ea&&ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ea,"__esModule",{value:!0}),ea.default=n;const t=e(EQ());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(u=>{if(u.type!=="declaration")return;const{property:d,value:h}=u;l?i(d,h,u):h&&(o=o||{},o[d]=h)}),o}return ea}var Au={},gC;function TQ(){if(gC)return Au;gC=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.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,"-")},u=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 Au.camelCase=u,Au}var _u,xC;function AQ(){if(xC)return _u;xC=1;var e=_u&&_u.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(NQ()),n=TQ();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(s[(0,n.camelCase)(l,o)]=u)}),s}return r.default=r,_u=r,_u}var _Q=AQ();const MQ=Ma(_Q),fM=hM("end"),ub=hM("start");function hM(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 jQ(e){const t=ub(e),n=fM(e);if(t&&n)return{start:t,end:n}}function Xu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yC(e.position):"start"in e||"end"in e?yC(e):"line"in e||"column"in e?cx(e):""}function cx(e){return bC(e&&e.line)+":"+bC(e&&e.column)}function yC(e){return cx(e&&e.start)+"-"+cx(e&&e.end)}function bC(e){return e&&typeof e=="number"?e:1}class tr 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 u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.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=Xu(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}}tr.prototype.file="";tr.prototype.name="";tr.prototype.reason="";tr.prototype.message="";tr.prototype.stack="";tr.prototype.column=void 0;tr.prototype.line=void 0;tr.prototype.ancestors=void 0;tr.prototype.cause=void 0;tr.prototype.fatal=void 0;tr.prototype.place=void 0;tr.prototype.ruleId=void 0;tr.prototype.source=void 0;const cb={}.hasOwnProperty,DQ=new Map,RQ=/[A-Z]/g,PQ=new Set(["table","tbody","thead","tfoot","tr"]),IQ=new Set(["td","th"]),pM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OQ(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=UQ(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=HQ(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"?ab:SQ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=mM(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function mM(e,t,n){if(t.type==="element")return LQ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return FQ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return BQ(e,t,n);if(t.type==="mdxjsEsm")return zQ(e,t);if(t.type==="root")return $Q(e,t,n);if(t.type==="text")return VQ(e,t)}function LQ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ab,e.schema=i),e.ancestors.push(t);const o=xM(e,t.tagName,!1),s=WQ(e,t);let l=fb(e,t);return PQ.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!hQ(u):!0})),gM(e,s,o,t),db(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function FQ(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)}kc(e,t.position)}function zQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);kc(e,t.position)}function BQ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ab,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:xM(e,t.name,!0),s=qQ(e,t),l=fb(e,t);return gM(e,s,o,t),db(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function $Q(e,t,n){const r={};return db(r,fb(e,t)),e.create(t,e.Fragment,r,n)}function VQ(e,t){return t.value}function gM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function db(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function HQ(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 UQ(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),u=ub(r);return t(i,o,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function WQ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&cb.call(t.properties,i)){const o=KQ(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&IQ.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 qQ(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 kc(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 kc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function fb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:DQ;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const d=i.get(u)||0;s=u+"-"+d,i.set(u,d+1)}}const l=mM(e,o,s);l!==void 0&&n.push(l)}return n}function KQ(e,t,n){const r=vQ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?aQ(n):CQ(n)),r.property==="style"){let i=typeof n=="object"?n:GQ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=YQ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?xQ[r.property]||r.property:r.attribute,n]}}function GQ(e,t){try{return MQ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new tr("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=pM+"#cannot-parse-style-attribute",i}}function xM(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=cC(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=cC(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return cb.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);kc(e)}function kc(e,t){const n=new tr("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=pM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function YQ(e){const t={};let n;for(n in e)cb.call(e,n)&&(t[JQ(n)]=e[n]);return t}function JQ(e){let t=e.replace(RQ,XQ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function XQ(e){return"-"+e.toLowerCase()}const Hg={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"]},QQ={};function hb(e,t){const n=QQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return yM(e,r,i)}function yM(e,t,n){if(ZQ(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 vC(e.children,t,n)}return Array.isArray(e)?vC(e,t,n):""}function vC(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=yM(e[i],t,n);return r.join("")}function ZQ(e){return!!(e&&typeof e=="object")}const wC=document.createElement("i");function pb(e){const t="&"+e+";";wC.innerHTML=t;const n=wC.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Hr(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 ri(e,t){return e.length>0?(Hr(e,e.length,0,t),e):t}const kC={}.hasOwnProperty;function bM(e){const t={};let n=-1;for(;++n<e.length;)eZ(t,e[n]);return t}function eZ(e,t){let n;for(n in t){const i=(kC.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){kC.call(i,s)||(i[s]=[]);const l=o[s];tZ(i[s],Array.isArray(l)?l:l?[l]:[])}}}function tZ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Hr(e,0,0,r)}function vM(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 wi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ar=Ms(/[A-Za-z]/),Gn=Ms(/[\dA-Za-z]/),nZ=Ms(/[#-'*+\--9=?A-Z^-~]/);function Yh(e){return e!==null&&(e<32||e===127)}const dx=Ms(/\d/),rZ=Ms(/[\dA-Fa-f]/),iZ=Ms(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const Up=Ms(new RegExp("\\p{P}|\\p{S}","u")),xl=Ms(/\s/);function Ms(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function za(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Gn(e.charCodeAt(n+1))&&Gn(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 st(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return rt(u)?(e.enter(n),l(u)):t(u)}function l(u){return rt(u)&&o++<i?(e.consume(u),l):(e.exit(n),t(u))}}const oZ={tokenize:sZ};function sZ(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"),st(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return He(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),s)}}const lZ={tokenize:aZ},SC={tokenize:uZ};function aZ(e){const t=this,n=[];let r=0,i,o,s;return l;function l(T){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,u,d)(T)}return d(T)}function u(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&N();const D=t.events.length;let A=D,_;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){_=t.events[A][1].end;break}C(r);let I=D;for(;I<t.events.length;)t.events[I][1].end={..._},I++;return Hr(t.events,A+1,0,t.events.slice(D)),t.events.length=I,d(T)}return l(T)}function d(T){if(r===n.length){if(!i)return g(T);if(i.currentConstruct&&i.currentConstruct.concrete)return y(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(SC,h,f)(T)}function h(T){return i&&N(),C(r),g(T)}function f(T){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(T)}function g(T){return t.containerState={},e.attempt(SC,x,y)(T)}function x(T){return r++,n.push([t.currentConstruct,t.containerState]),g(T)}function y(T){if(T===null){i&&N(),C(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),v(T)}function v(T){if(T===null){w(e.exit("chunkFlow"),!0),C(0),e.consume(T);return}return He(T)?(e.consume(T),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(T),v)}function w(T,D){const A=t.sliceStream(T);if(D&&A.push(null),T.previous=o,o&&(o.next=T),o=T,i.defineSkip(T.start),i.write(A),t.parser.lazy[T.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<s&&(!i.events[_][1].end||i.events[_][1].end.offset>s))return;const I=t.events.length;let P=I,L,R;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(L){R=t.events[P][1].end;break}L=!0}for(C(r),_=I;_<t.events.length;)t.events[_][1].end={...R},_++;Hr(t.events,P+1,0,t.events.slice(I)),t.events.length=_}}function C(T){let D=n.length;for(;D-- >T;){const A=n[D];t.containerState=A[1],A[0].exit.call(t,e)}n.length=T}function N(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function uZ(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _a(e){if(e===null||bt(e)||xl(e))return 1;if(Up(e))return 2}function Wp(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 fx={name:"attention",resolveAll:cZ,tokenize:dZ};function cZ(e,t){let n=-1,r,i,o,s,l,u,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;u=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};CC(f,-u),CC(g,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>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=ri(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=ri(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=ri(d,Wp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=ri(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=ri(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Hr(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 dZ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=_a(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===o)return e.consume(u),l;const d=e.exit("attentionSequence"),h=_a(u),f=!h||h===2&&i||n.includes(u),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(u)}}function CC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const fZ={name:"autolink",tokenize:hZ};function hZ(e,t,n){let r=0;return i;function i(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return ar(x)?(e.consume(x),s):x===64?n(x):d(x)}function s(x){return x===43||x===45||x===46||Gn(x)?(r=1,l(x)):d(x)}function l(x){return x===58?(e.consume(x),r=0,u):(x===43||x===45||x===46||Gn(x))&&r++<32?(e.consume(x),l):(r=0,d(x))}function u(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Yh(x)?n(x):(e.consume(x),u)}function d(x){return x===64?(e.consume(x),h):nZ(x)?(e.consume(x),d):n(x)}function h(x){return Gn(x)?f(x):n(x)}function f(x){return x===46?(e.consume(x),r=0,h):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):g(x)}function g(x){if((x===45||Gn(x))&&r++<63){const y=x===45?g:f;return e.consume(x),y}return n(x)}}const qc={partial:!0,tokenize:pZ};function pZ(e,t,n){return r;function r(o){return rt(o)?st(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||He(o)?t(o):n(o)}}const wM={continuation:{tokenize:gZ},exit:xZ,name:"blockQuote",tokenize:mZ};function mZ(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 rt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function gZ(e,t,n){const r=this;return i;function i(s){return rt(s)?st(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(wM,t,n)(s)}}function xZ(e){e.exit("blockQuote")}const kM={name:"characterEscape",tokenize:yZ};function yZ(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 iZ(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const SM={name:"characterReference",tokenize:bZ};function bZ(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"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,s=Gn,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=rZ,h):(e.enter("characterReferenceValue"),o=7,s=dx,h(f))}function h(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===Gn&&!pb(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 EC={partial:!0,tokenize:wZ},NC={concrete:!0,name:"codeFenced",tokenize:vZ};function vZ(e,t,n){const r=this,i={partial:!0,tokenize:A};let o=0,s=0,l;return u;function u(_){return d(_)}function d(_){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,l=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(_)}function h(_){return _===l?(s++,e.consume(_),h):s<3?n(_):(e.exit("codeFencedFenceSequence"),rt(_)?st(e,f,"whitespace")(_):f(_))}function f(_){return _===null||He(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(EC,v,D)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===null||He(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(_)):rt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,x,"whitespace")(_)):_===96&&_===l?n(_):(e.consume(_),g)}function x(_){return _===null||He(_)?f(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===null||He(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(_)):_===96&&_===l?n(_):(e.consume(_),y)}function v(_){return e.attempt(i,D,w)(_)}function w(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),C}function C(_){return o>0&&rt(_)?st(e,N,"linePrefix",o+1)(_):N(_)}function N(_){return _===null||He(_)?e.check(EC,v,D)(_):(e.enter("codeFlowValue"),T(_))}function T(_){return _===null||He(_)?(e.exit("codeFlowValue"),N(_)):(e.consume(_),T)}function D(_){return e.exit("codeFenced"),t(_)}function A(_,I,P){let L=0;return R;function R(W){return _.enter("lineEnding"),_.consume(W),_.exit("lineEnding"),V}function V(W){return _.enter("codeFencedFence"),rt(W)?st(_,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):K(W)}function K(W){return W===l?(_.enter("codeFencedFenceSequence"),G(W)):P(W)}function G(W){return W===l?(L++,_.consume(W),G):L>=s?(_.exit("codeFencedFenceSequence"),rt(W)?st(_,B,"whitespace")(W):B(W)):P(W)}function B(W){return W===null||He(W)?(_.exit("codeFencedFence"),I(W)):P(W)}}}function wZ(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 Ug={name:"codeIndented",tokenize:SZ},kZ={partial:!0,tokenize:CZ};function SZ(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),st(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?u(d):He(d)?e.attempt(kZ,s,u)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||He(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),l)}function u(d){return e.exit("codeIndented"),t(d)}}function CZ(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):He(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):st(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):He(s)?i(s):n(s)}}const EZ={name:"codeText",previous:TZ,resolve:NZ,tokenize:AZ};function NZ(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 TZ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function AZ(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"),u(f))}function u(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(o=e.enter("codeTextSequence"),i=0,h(f)):He(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||He(f)?(e.exit("codeTextData"),u(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 _Z{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&&Mu(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),Mu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Mu(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);Mu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Mu(this.left,n.reverse())}}}function Mu(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 CM(e){const t={};let n=-1,r,i,o,s,l,u,d;const h=new _Z(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"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,MZ(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 Hr(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!d}function MZ(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,u=[],d={};let h,f,g=-1,x=n,y=0,v=0;const w=[v];for(;x;){for(;e.get(++i)[1]!==x;);o.push(i),x._tokenizer||(h=r.sliceStream(x),x.next||h.push(null),f&&s.defineSkip(x.start),x._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),x._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=x,x=x.next}for(x=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&&(v=g+1,w.push(v),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(s.events=[],x?(x._tokenizer=void 0,x.previous=void 0):w.pop(),g=w.length;g--;){const C=l.slice(w[g],w[g+1]),N=o.pop();u.push([N,N+C.length-1]),e.splice(N,2,C)}for(u.reverse(),g=-1;++g<u.length;)d[y+u[g][0]]=y+u[g][1],y+=u[g][1]-u[g][0]-1;return d}const jZ={resolve:RZ,tokenize:PZ},DZ={partial:!0,tokenize:IZ};function RZ(e){return CM(e),e}function PZ(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):He(l)?e.check(DZ,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 IZ(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),st(e,o,"linePrefix")}function o(s){if(s===null||He(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 EM(e,t,n,r,i,o,s,l,u){const d=u||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||Yh(C)?n(C):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(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"}),x(C))}function x(C){return C===62?(e.exit("chunkString"),e.exit(l),g(C)):C===null||C===60||He(C)?n(C):(e.consume(C),C===92?y:x)}function y(C){return C===60||C===62||C===92?(e.consume(C),x):x(C)}function v(C){return!h&&(C===null||C===41||bt(C))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(C)):h<d&&C===40?(e.consume(C),h++,v):C===41?(e.consume(C),h--,v):C===null||C===32||C===40||Yh(C)?n(C):(e.consume(C),C===92?w:v)}function w(C){return C===40||C===41||C===92?(e.consume(C),v):v(C)}}function NM(e,t,n,r,i,o){const s=this;let l=0,u;return d;function d(x){return e.enter(r),e.enter(i),e.consume(x),e.exit(i),e.enter(o),h}function h(x){return l>999||x===null||x===91||x===93&&!u||x===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(x):x===93?(e.exit(o),e.enter(i),e.consume(x),e.exit(i),e.exit(r),t):He(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),f(x))}function f(x){return x===null||x===91||x===93||He(x)||l++>999?(e.exit("chunkString"),h(x)):(e.consume(x),u||(u=!rt(x)),x===92?g:f)}function g(x){return x===91||x===92||x===93?(e.consume(x),l++,f):f(x)}}function TM(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,u):n(g)}function u(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),u(s)):g===null?n(g):He(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),st(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===s||g===null||He(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 Qu(e,t){let n;return r;function r(i){return He(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):rt(i)?st(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const OZ={name:"definition",tokenize:FZ},LZ={partial:!0,tokenize:zZ};function FZ(e,t,n){const r=this;let i;return o;function o(x){return e.enter("definition"),s(x)}function s(x){return NM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function l(x){return i=wi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),u):n(x)}function u(x){return bt(x)?Qu(e,d)(x):d(x)}function d(x){return EM(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return e.attempt(LZ,f,f)(x)}function f(x){return rt(x)?st(e,g,"whitespace")(x):g(x)}function g(x){return x===null||He(x)?(e.exit("definition"),r.parser.defined.push(i),t(x)):n(x)}}function zZ(e,t,n){return r;function r(l){return bt(l)?Qu(e,i)(l):n(l)}function i(l){return TM(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return rt(l)?st(e,s,"whitespace")(l):s(l)}function s(l){return l===null||He(l)?t(l):n(l)}}const BZ={name:"hardBreakEscape",tokenize:$Z};function $Z(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return He(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const VZ={name:"headingAtx",resolve:HZ,tokenize:UZ};function HZ(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"},Hr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function UZ(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||bt(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||He(h)?(e.exit("atxHeading"),t(h)):rt(h)?st(e,l,"whitespace")(h):(e.enter("atxHeadingText"),d(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||bt(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),d)}}const WZ=["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"],TC=["pre","script","style","textarea"],qZ={concrete:!0,name:"htmlFlow",resolveTo:YZ,tokenize:JZ},KZ={partial:!0,tokenize:QZ},GZ={partial:!0,tokenize:XZ};function YZ(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 JZ(e,t,n){const r=this;let i,o,s,l,u;return d;function d(O){return h(O)}function h(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),f}function f(O){return O===33?(e.consume(O),g):O===47?(e.consume(O),o=!0,v):O===63?(e.consume(O),i=3,r.interrupt?t:j):ar(O)?(e.consume(O),s=String.fromCharCode(O),w):n(O)}function g(O){return O===45?(e.consume(O),i=2,x):O===91?(e.consume(O),i=5,l=0,y):ar(O)?(e.consume(O),i=4,r.interrupt?t:j):n(O)}function x(O){return O===45?(e.consume(O),r.interrupt?t:j):n(O)}function y(O){const ce="CDATA[";return O===ce.charCodeAt(l++)?(e.consume(O),l===ce.length?r.interrupt?t:K:y):n(O)}function v(O){return ar(O)?(e.consume(O),s=String.fromCharCode(O),w):n(O)}function w(O){if(O===null||O===47||O===62||bt(O)){const ce=O===47,pe=s.toLowerCase();return!ce&&!o&&TC.includes(pe)?(i=1,r.interrupt?t(O):K(O)):WZ.includes(s.toLowerCase())?(i=6,ce?(e.consume(O),C):r.interrupt?t(O):K(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?N(O):T(O))}return O===45||Gn(O)?(e.consume(O),s+=String.fromCharCode(O),w):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:K):n(O)}function N(O){return rt(O)?(e.consume(O),N):R(O)}function T(O){return O===47?(e.consume(O),R):O===58||O===95||ar(O)?(e.consume(O),D):rt(O)?(e.consume(O),T):R(O)}function D(O){return O===45||O===46||O===58||O===95||Gn(O)?(e.consume(O),D):A(O)}function A(O){return O===61?(e.consume(O),_):rt(O)?(e.consume(O),A):T(O)}function _(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),u=O,I):rt(O)?(e.consume(O),_):P(O)}function I(O){return O===u?(e.consume(O),u=null,L):O===null||He(O)?n(O):(e.consume(O),I)}function P(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||bt(O)?A(O):(e.consume(O),P)}function L(O){return O===47||O===62||rt(O)?T(O):n(O)}function R(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||He(O)?K(O):rt(O)?(e.consume(O),V):n(O)}function K(O){return O===45&&i===2?(e.consume(O),U):O===60&&i===1?(e.consume(O),Z):O===62&&i===4?(e.consume(O),z):O===63&&i===3?(e.consume(O),j):O===93&&i===5?(e.consume(O),Y):He(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(KZ,ee,G)(O)):O===null||He(O)?(e.exit("htmlFlowData"),G(O)):(e.consume(O),K)}function G(O){return e.check(GZ,B,ee)(O)}function B(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),W}function W(O){return O===null||He(O)?G(O):(e.enter("htmlFlowData"),K(O))}function U(O){return O===45?(e.consume(O),j):K(O)}function Z(O){return O===47?(e.consume(O),s="",q):K(O)}function q(O){if(O===62){const ce=s.toLowerCase();return TC.includes(ce)?(e.consume(O),z):K(O)}return ar(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),q):K(O)}function Y(O){return O===93?(e.consume(O),j):K(O)}function j(O){return O===62?(e.consume(O),z):O===45&&i===2?(e.consume(O),j):K(O)}function z(O){return O===null||He(O)?(e.exit("htmlFlowData"),ee(O)):(e.consume(O),z)}function ee(O){return e.exit("htmlFlow"),t(O)}}function XZ(e,t,n){const r=this;return i;function i(s){return He(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 QZ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qc,t,n)}}const ZZ={name:"htmlText",tokenize:eee};function eee(e,t,n){const r=this;let i,o,s;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),u}function u(j){return j===33?(e.consume(j),d):j===47?(e.consume(j),A):j===63?(e.consume(j),T):ar(j)?(e.consume(j),P):n(j)}function d(j){return j===45?(e.consume(j),h):j===91?(e.consume(j),o=0,y):ar(j)?(e.consume(j),N):n(j)}function h(j){return j===45?(e.consume(j),x):n(j)}function f(j){return j===null?n(j):j===45?(e.consume(j),g):He(j)?(s=f,Z(j)):(e.consume(j),f)}function g(j){return j===45?(e.consume(j),x):f(j)}function x(j){return j===62?U(j):j===45?g(j):f(j)}function y(j){const z="CDATA[";return j===z.charCodeAt(o++)?(e.consume(j),o===z.length?v:y):n(j)}function v(j){return j===null?n(j):j===93?(e.consume(j),w):He(j)?(s=v,Z(j)):(e.consume(j),v)}function w(j){return j===93?(e.consume(j),C):v(j)}function C(j){return j===62?U(j):j===93?(e.consume(j),C):v(j)}function N(j){return j===null||j===62?U(j):He(j)?(s=N,Z(j)):(e.consume(j),N)}function T(j){return j===null?n(j):j===63?(e.consume(j),D):He(j)?(s=T,Z(j)):(e.consume(j),T)}function D(j){return j===62?U(j):T(j)}function A(j){return ar(j)?(e.consume(j),_):n(j)}function _(j){return j===45||Gn(j)?(e.consume(j),_):I(j)}function I(j){return He(j)?(s=I,Z(j)):rt(j)?(e.consume(j),I):U(j)}function P(j){return j===45||Gn(j)?(e.consume(j),P):j===47||j===62||bt(j)?L(j):n(j)}function L(j){return j===47?(e.consume(j),U):j===58||j===95||ar(j)?(e.consume(j),R):He(j)?(s=L,Z(j)):rt(j)?(e.consume(j),L):U(j)}function R(j){return j===45||j===46||j===58||j===95||Gn(j)?(e.consume(j),R):V(j)}function V(j){return j===61?(e.consume(j),K):He(j)?(s=V,Z(j)):rt(j)?(e.consume(j),V):L(j)}function K(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),i=j,G):He(j)?(s=K,Z(j)):rt(j)?(e.consume(j),K):(e.consume(j),B)}function G(j){return j===i?(e.consume(j),i=void 0,W):j===null?n(j):He(j)?(s=G,Z(j)):(e.consume(j),G)}function B(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||bt(j)?L(j):(e.consume(j),B)}function W(j){return j===47||j===62||bt(j)?L(j):n(j)}function U(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function Z(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),q}function q(j){return rt(j)?st(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):Y(j)}function Y(j){return e.enter("htmlTextData"),s(j)}}const mb={name:"labelEnd",resolveAll:iee,resolveTo:oee,tokenize:see},tee={tokenize:lee},nee={tokenize:aee},ree={tokenize:uee};function iee(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&&Hr(e,0,e.length,n),e}function oee(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 u={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",u,t],["enter",d,t]],l=ri(l,e.slice(o+1,o+r+3)),l=ri(l,[["enter",h,t]]),l=ri(l,Wp(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),l=ri(l,[["exit",h,t],e[s-2],e[s-1],["exit",d,t]]),l=ri(l,e.slice(s+1)),l=ri(l,[["exit",u,t]]),Hr(e,o,e.length,l),e}function see(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(wi(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),u):n(g)}function u(g){return g===40?e.attempt(tee,h,s?h:f)(g):g===91?e.attempt(nee,h,s?d:f)(g):s?h(g):f(g)}function d(g){return e.attempt(ree,h,f)(g)}function h(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function lee(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 bt(f)?Qu(e,o)(f):o(f)}function o(f){return f===41?h(f):EM(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return bt(f)?Qu(e,u)(f):h(f)}function l(f){return n(f)}function u(f){return f===34||f===39||f===40?TM(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):h(f)}function d(f){return bt(f)?Qu(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 aee(e,t,n){const r=this;return i;function i(l){return NM.call(r,e,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(wi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function uee(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 cee={name:"labelStartImage",resolveAll:mb.resolveAll,tokenize:dee};function dee(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 fee={name:"labelStartLink",resolveAll:mb.resolveAll,tokenize:hee};function hee(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 Wg={name:"lineEnding",tokenize:pee};function pee(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),st(e,t,"linePrefix")}}const zf={name:"thematicBreak",tokenize:mee};function mee(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"),u(d)):r>=3&&(d===null||He(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),rt(d)?st(e,l,"whitespace")(d):l(d))}}const Er={continuation:{tokenize:bee},exit:wee,name:"list",tokenize:yee},gee={partial:!0,tokenize:kee},xee={partial:!0,tokenize:vee};function yee(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(x){const y=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:dx(x)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(zf,n,d)(x):d(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(x)}return n(x)}function u(x){return dx(x)&&++s<10?(e.consume(x),u):(!r.interrupt||s<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),d(x)):n(x)}function d(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(qc,r.interrupt?n:h,e.attempt(gee,g,f))}function h(x){return r.containerState.initialBlankLine=!0,o++,g(x)}function f(x){return rt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function bee(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qc,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,st(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!rt(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(xee,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,st(e,e.attempt(Er,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function vee(e,t,n){const r=this;return st(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 wee(e){e.exit(this.containerState.type)}function kee(e,t,n){const r=this;return st(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!rt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const AC={name:"setextUnderline",resolveTo:See,tokenize:Cee};function See(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 Cee(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"),rt(d)?st(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||He(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Eee={tokenize:Nee};function Nee(e){const t=this,n=e.attempt(qc,r,e.attempt(this.parser.constructs.flowInitial,i,st(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jZ,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 Tee={resolveAll:_M()},Aee=AM("string"),_ee=AM("text");function AM(e){return{resolveAll:_M(e==="text"?Mee: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),u}function u(h){return d(h)?(n.exit("data"),o(h)):(n.consume(h),u)}function d(h){if(h===null)return!0;const f=i[h];let g=-1;if(f)for(;++g<f.length;){const x=f[g];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function _M(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 Mee(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,u;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)u=!0,l++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||u||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 jee={42:Er,43:Er,45:Er,48:Er,49:Er,50:Er,51:Er,52:Er,53:Er,54:Er,55:Er,56:Er,57:Er,62:wM},Dee={91:OZ},Ree={[-2]:Ug,[-1]:Ug,32:Ug},Pee={35:VZ,42:zf,45:[AC,zf],60:qZ,61:AC,95:zf,96:NC,126:NC},Iee={38:SM,92:kM},Oee={[-5]:Wg,[-4]:Wg,[-3]:Wg,33:cee,38:SM,42:fx,60:[fZ,ZZ],91:fee,92:[BZ,kM],93:mb,95:fx,96:EZ},Lee={null:[fx,Tee]},Fee={null:[42,95]},zee={null:[]},Bee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Fee,contentInitial:Dee,disable:zee,document:jee,flow:Pee,flowInitial:Ree,insideSpan:Lee,string:Iee,text:Oee},Symbol.toStringTag,{value:"Module"}));function $ee(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 u={attempt:I(A),check:I(_),consume:N,enter:T,exit:D,interrupt:I(_,{interrupt:!0})},d={code:null,containerState:{},defineSkip:v,events:[],now:y,parser:e,previous:null,sliceSerialize:g,sliceStream:x,write:f};let h=t.tokenize.call(d,u);return t.resolveAll&&o.push(t),d;function f(V){return s=ri(s,V),w(),s[s.length-1]!==null?[]:(P(t,0),d.events=Wp(o,d.events,d),d.events)}function g(V,K){return Hee(x(V),K)}function x(V){return Vee(s,V)}function y(){const{_bufferIndex:V,_index:K,line:G,column:B,offset:W}=r;return{_bufferIndex:V,_index:K,line:G,column:B,offset:W}}function v(V){i[V.line]=V.column,R()}function w(){let V;for(;r._index<s.length;){const K=s[r._index];if(typeof K=="string")for(V=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===V&&r._bufferIndex<K.length;)C(K.charCodeAt(r._bufferIndex));else C(K)}}function C(V){h=h(V)}function N(V){He(V)?(r.line++,r.column=1,r.offset+=V===-3?2:1,R()):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 T(V,K){const G=K||{};return G.type=V,G.start=y(),d.events.push(["enter",G,d]),l.push(G),G}function D(V){const K=l.pop();return K.end=y(),d.events.push(["exit",K,d]),K}function A(V,K){P(V,K.from)}function _(V,K){K.restore()}function I(V,K){return G;function G(B,W,U){let Z,q,Y,j;return Array.isArray(B)?ee(B):"tokenize"in B?ee([B]):z(B);function z(le){return ie;function ie(ue){const xe=ue!==null&&le[ue],Te=ue!==null&&le.null,Le=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return ee(Le)(ue)}}function ee(le){return Z=le,q=0,le.length===0?U:O(le[q])}function O(le){return ie;function ie(ue){return j=L(),Y=le,le.partial||(d.currentConstruct=le),le.name&&d.parser.constructs.disable.null.includes(le.name)?pe():le.tokenize.call(K?Object.assign(Object.create(d),K):d,u,ce,pe)(ue)}}function ce(le){return V(Y,j),W}function pe(le){return j.restore(),++q<Z.length?O(Z[q]):U}}}function P(V,K){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&Hr(d.events,K,d.events.length-K,V.resolve(d.events.slice(K),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function L(){const V=y(),K=d.previous,G=d.currentConstruct,B=d.events.length,W=Array.from(l);return{from:B,restore:U};function U(){r=V,d.previous=K,d.currentConstruct=G,d.events.length=B,l=W,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Vee(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 Hee(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=`
|
|
647
|
+
`;break}case-3:{s=`\r
|
|
648
|
+
`;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 Uee(e){const r={constructs:bM([Bee,...(e||{}).extensions||[]]),content:i(oZ),defined:[],document:i(lZ),flow:i(Eee),lazy:{},string:i(Aee),text:i(_ee)};return r;function i(o){return s;function s(l){return $ee(r,o,l)}}}function Wee(e){for(;!CM(e););return e}const _C=/[\0\t\n\r]/g;function qee(){let e=1,t="",n=!0,r;return i;function i(o,s,l){const u=[];let d,h,f,g,x;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(_C.lastIndex=f,d=_C.exec(o),g=d&&d.index!==void 0?d.index:o.length,x=o.charCodeAt(g),!d){t=o.slice(f);break}if(x===10&&f===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<g&&(u.push(o.slice(f,g)),e+=g-f),x){case 0:{u.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,u.push(-2);e++<h;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Kee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Gee(e){return e.replace(Kee,Yee)}function Yee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return vM(n.slice(o?2:1),o?16:10)}return pb(n)||e}const MM={}.hasOwnProperty;function Jee(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Xee(n)(Wee(Uee(n).document().write(qee()(e,t,!0))))}function Xee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(xt),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(Ot),blockQuote:o(Te),characterEscape:L,characterReference:L,codeFenced:o(Le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Le,s),codeText:o(Be,s),codeTextData:L,data:L,codeFlowValue:L,definition:o(at),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Xe),hardBreakEscape:o(ut),hardBreakTrailing:o(ut),htmlFlow:o(Tt,s),htmlFlowData:L,htmlText:o(Tt,s),htmlTextData:L,image:o(nr),label:s,link:o(xt),listItem:o(rr),listItemValue:g,listOrdered:o(Vn,f),listUnordered:o(Vn),paragraph:o(ft),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ot),strong:o(hn),thematicBreak:o(ir)},exit:{atxHeading:u(),atxHeadingSequence:A,autolink:u(),autolinkEmail:xe,autolinkProtocol:ue,blockQuote:u(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:le,characterReference:ie,codeFenced:u(w),codeFencedFence:v,codeFencedFenceInfo:x,codeFencedFenceMeta:y,codeFlowValue:R,codeIndented:u(C),codeText:u(W),codeTextData:R,data:R,definition:u(),definitionDestinationString:D,definitionLabelString:N,definitionTitleString:T,emphasis:u(),hardBreakEscape:u(K),hardBreakTrailing:u(K),htmlFlow:u(G),htmlFlowData:R,htmlText:u(B),htmlTextData:R,image:u(Z),label:Y,labelText:q,lineEnding:V,link:u(U),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ce,resourceDestinationString:j,resourceTitleString:z,resource:ee,setextHeading:u(P),setextHeadingLineSequence:I,setextHeadingText:_,strong:u(),thematicBreak:u()}};jM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let he={type:"root",children:[]};const De={stack:[he],tokenStack:[],config:t,enter:l,exit:d,buffer:s,resume:h,data:n},Fe=[];let Re=-1;for(;++Re<te.length;)if(te[Re][1].type==="listOrdered"||te[Re][1].type==="listUnordered")if(te[Re][0]==="enter")Fe.push(Re);else{const At=Fe.pop();Re=i(te,At,Re)}for(Re=-1;++Re<te.length;){const At=t[te[Re][0]];MM.call(At,te[Re][1].type)&&At[te[Re][1].type].call(Object.assign({sliceSerialize:te[Re][2].sliceSerialize},De),te[Re][1])}if(De.tokenStack.length>0){const At=De.tokenStack[De.tokenStack.length-1];(At[1]||MC).call(De,void 0,At[0])}for(he.position={start:Xo(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Xo(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)he=t.transforms[Re](he)||he;return he}function i(te,he,De){let Fe=he-1,Re=-1,At=!1,Yt,pn,jn,gr;for(;++Fe<=De;){const ht=te[Fe];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?Re++:Re--,gr=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(Yt&&!gr&&!Re&&!jn&&(jn=Fe),gr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gr=void 0}if(!Re&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||Re===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(Yt){let _t=Fe;for(pn=void 0;_t--;){const Lt=te[_t];if(Lt[1].type==="lineEnding"||Lt[1].type==="lineEndingBlank"){if(Lt[0]==="exit")continue;pn&&(te[pn][1].type="lineEndingBlank",At=!0),Lt[1].type="lineEnding",pn=_t}else if(!(Lt[1].type==="linePrefix"||Lt[1].type==="blockQuotePrefix"||Lt[1].type==="blockQuotePrefixWhitespace"||Lt[1].type==="blockQuoteMarker"||Lt[1].type==="listItemIndent"))break}jn&&(!pn||jn<pn)&&(Yt._spread=!0),Yt.end=Object.assign({},pn?te[pn][1].start:ht[1].end),te.splice(pn||Fe,0,["exit",Yt,ht[2]]),Fe++,De++}if(ht[1].type==="listItemPrefix"){const _t={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};Yt=_t,te.splice(Fe,0,["enter",_t,ht[2]]),Fe++,De++,jn=void 0,gr=!0}}}return te[he][1]._spread=At,De}function o(te,he){return De;function De(Fe){l.call(this,te(Fe),Fe),he&&he.call(this,Fe)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(te,he,De){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([he,De||void 0]),te.position={start:Xo(he.start),end:void 0}}function u(te){return he;function he(De){te&&te.call(this,De),d.call(this,De)}}function d(te,he){const De=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==te.type&&(he?he.call(this,te,Fe[0]):(Fe[1]||MC).call(this,te,Fe[0]));else throw new Error("Cannot close `"+te.type+"` ("+Xu({start:te.start,end:te.end})+"): it’s not open");De.position.end=Xo(te.end)}function h(){return hb(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(te){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function x(){const te=this.resume(),he=this.stack[this.stack.length-1];he.lang=te}function y(){const te=this.resume(),he=this.stack[this.stack.length-1];he.meta=te}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te.replace(/(\r?\n|\r)$/g,"")}function N(te){const he=this.resume(),De=this.stack[this.stack.length-1];De.label=he,De.identifier=wi(this.sliceSerialize(te)).toLowerCase()}function T(){const te=this.resume(),he=this.stack[this.stack.length-1];he.title=te}function D(){const te=this.resume(),he=this.stack[this.stack.length-1];he.url=te}function A(te){const he=this.stack[this.stack.length-1];if(!he.depth){const De=this.sliceSerialize(te).length;he.depth=De}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function I(te){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function L(te){const De=this.stack[this.stack.length-1].children;let Fe=De[De.length-1];(!Fe||Fe.type!=="text")&&(Fe=mr(),Fe.position={start:Xo(te.start),end:void 0},De.push(Fe)),this.stack.push(Fe)}function R(te){const he=this.stack.pop();he.value+=this.sliceSerialize(te),he.position.end=Xo(te.end)}function V(te){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=he.children[he.children.length-1];De.position.end=Xo(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(L.call(this,te),R.call(this,te))}function K(){this.data.atHardBreak=!0}function G(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function B(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function W(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function U(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=he,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function Z(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=he,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function q(te){const he=this.sliceSerialize(te),De=this.stack[this.stack.length-2];De.label=Gee(he),De.identifier=wi(he).toLowerCase()}function Y(){const te=this.stack[this.stack.length-1],he=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Fe=te.children;De.children=Fe}else De.alt=he}function j(){const te=this.resume(),he=this.stack[this.stack.length-1];he.url=te}function z(){const te=this.resume(),he=this.stack[this.stack.length-1];he.title=te}function ee(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ce(te){const he=this.resume(),De=this.stack[this.stack.length-1];De.label=he,De.identifier=wi(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function pe(te){this.data.characterReferenceType=te.type}function le(te){const he=this.sliceSerialize(te),De=this.data.characterReferenceType;let Fe;De?(Fe=vM(he,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=pb(he);const Re=this.stack[this.stack.length-1];Re.value+=Fe}function ie(te){const he=this.stack.pop();he.position.end=Xo(te.end)}function ue(te){R.call(this,te);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(te)}function xe(te){R.call(this,te);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(te)}function Te(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function Be(){return{type:"inlineCode",value:""}}function at(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function Ot(){return{type:"heading",depth:0,children:[]}}function ut(){return{type:"break"}}function Tt(){return{type:"html",value:""}}function nr(){return{type:"image",title:null,url:"",alt:null}}function xt(){return{type:"link",title:null,url:"",children:[]}}function Vn(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function rr(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function ft(){return{type:"paragraph",children:[]}}function hn(){return{type:"strong",children:[]}}function mr(){return{type:"text",value:""}}function ir(){return{type:"thematicBreak"}}}function Xo(e){return{line:e.line,column:e.column,offset:e.offset}}function jM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jM(e,r):Qee(e,r)}}function Qee(e,t){let n;for(n in t)if(MM.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 MC(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Xu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Xu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Xu({start:t.start,end:t.end})+") is still open")}function Zee(e){const t=this;t.parser=n;function n(r){return Jee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ete(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 tte(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
649
|
+
`}]}function nte(e,t){const n=t.value?t.value+`
|
|
650
|
+
`:"",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 rte(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ite(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ote(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=za(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 u={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,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function ste(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 lte(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function DM(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 ate(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DM(e,t);const i={src:za(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 ute(e,t){const n={src:za(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 cte(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 dte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DM(e,t);const i={href:za(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 fte(e,t){const n={href:za(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 hte(e,t,n){const r=e.all(t),i=n?pte(n):RM(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:`
|
|
651
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?s.push(...h.children):s.push(h)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
652
|
+
`});const d={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,d),e.applyData(t,d)}function pte(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=RM(n[r])}return t}function RM(e){const t=e.spread;return t??e.children.length>1}function mte(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 gte(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xte(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function yte(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bte(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=ub(t.children[1]),u=fM(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),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 vte(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 u=-1;const d=[];for(;++u<l;){const f=t.children[u],g={},x=s?s[u]:void 0;x&&(g.align=x);let y={type:"element",tagName:o,properties:g,children:[]};f&&(y.children=e.all(f),e.patch(f,y),y=e.applyData(f,y)),d.push(y)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,h),e.applyData(t,h)}function wte(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const jC=9,DC=32;function kte(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(RC(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(RC(t.slice(i),i>0,!1)),o.join("")}function RC(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===jC||o===DC;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===jC||o===DC;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ste(e,t){const n={type:"text",value:kte(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ete={blockquote:ete,break:tte,code:nte,delete:rte,emphasis:ite,footnoteReference:ote,heading:ste,html:lte,imageReference:ate,image:ute,inlineCode:cte,linkReference:dte,link:fte,listItem:hte,list:mte,paragraph:gte,root:xte,strong:yte,table:bte,tableCell:wte,tableRow:vte,text:Ste,thematicBreak:Cte,toml:Tf,yaml:Tf,definition:Tf,footnoteDefinition:Tf};function Tf(){}const PM=-1,qp=0,Zu=1,Jh=2,gb=3,xb=4,yb=5,bb=6,IM=7,OM=8,Nte=typeof self=="object"?self:globalThis,PC=(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 Nte[e](t)},Tte=(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 qp:case PM:return n(s,i);case Zu:{const l=n([],i);for(const u of s)l.push(r(u));return l}case Jh:{const l=n({},i);for(const[u,d]of s)l[r(u)]=r(d);return l}case gb:return n(new Date(s),i);case xb:{const{source:l,flags:u}=s;return n(new RegExp(l,u),i)}case yb:{const l=n(new Map,i);for(const[u,d]of s)l.set(r(u),r(d));return l}case bb:{const l=n(new Set,i);for(const u of s)l.add(r(u));return l}case IM:{const{name:l,message:u}=s;return n(PC(l,u),i)}case OM: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(PC(o,s),i)};return r},IC=e=>Tte(new Map,e)(0),ta="",{toString:Ate}={},{keys:_te}=Object,ju=e=>{const t=typeof e;if(t!=="object"||!e)return[qp,t];const n=Ate.call(e).slice(8,-1);switch(n){case"Array":return[Zu,ta];case"Object":return[Jh,ta];case"Date":return[gb,ta];case"RegExp":return[xb,ta];case"Map":return[yb,ta];case"Set":return[bb,ta];case"DataView":return[Zu,n]}return n.includes("Array")?[Zu,n]:n.includes("Error")?[IM,n]:[Jh,n]},Af=([e,t])=>e===qp&&(t==="function"||t==="symbol"),Mte=(e,t,n,r)=>{const i=(s,l)=>{const u=r.push(s)-1;return n.set(l,u),u},o=s=>{if(n.has(s))return n.get(s);let[l,u]=ju(s);switch(l){case qp:{let h=s;switch(u){case"bigint":l=OM,h=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([PM],s)}return i([l,h],s)}case Zu:{if(u){let g=s;return u==="DataView"?g=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(s)),i([u,[...g]],s)}const h=[],f=i([l,h],s);for(const g of s)h.push(o(g));return f}case Jh:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const h=[],f=i([l,h],s);for(const g of _te(s))(e||!Af(ju(s[g])))&&h.push([o(g),o(s[g])]);return f}case gb:return i([l,s.toISOString()],s);case xb:{const{source:h,flags:f}=s;return i([l,{source:h,flags:f}],s)}case yb:{const h=[],f=i([l,h],s);for(const[g,x]of s)(e||!(Af(ju(g))||Af(ju(x))))&&h.push([o(g),o(x)]);return f}case bb:{const h=[],f=i([l,h],s);for(const g of s)(e||!Af(ju(g)))&&h.push(o(g));return f}}const{message:d}=s;return i([l,{name:u,message:d}],s)};return o},OC=(e,{json:t,lossy:n}={})=>{const r=[];return Mte(!(t||n),!!t,new Map,r)(e),r},Xh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?IC(OC(e,t)):structuredClone(e):(e,t)=>IC(OC(e,t));function jte(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 Dte(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Rte(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||jte,r=e.options.footnoteBackLabel||Dte,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const h=e.all(d),f=String(d.identifier).toUpperCase(),g=za(f.toLowerCase());let x=0;const y=[],v=e.footnoteCounts.get(f);for(;v!==void 0&&++x<=v;){y.length>0&&y.push({type:"text",value:" "});let N=typeof n=="string"?n:n(u,x);typeof N=="string"&&(N={type:"text",value:N}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const w=h[h.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const N=w.children[w.children.length-1];N&&N.type==="text"?N.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...y)}else h.push(...y);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:{...Xh(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
653
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
654
|
+
`}]}}const Kp=(function(e){if(e==null)return Lte;if(typeof e=="function")return Gp(e);if(typeof e=="object")return Array.isArray(e)?Pte(e):Ite(e);if(typeof e=="string")return Ote(e);throw new Error("Expected function, string, or object as test")});function Pte(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Kp(e[n]);return Gp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Ite(e){const t=e;return Gp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Ote(e){return Gp(t);function t(n){return n&&n.type===e}}function Gp(e){return t;function t(n,r,i){return!!(Fte(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Lte(){return!0}function Fte(e){return e!==null&&typeof e=="object"&&"type"in e}const LM=[],zte=!0,hx=!1,Bte="skip";function FM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Kp(i),s=r?-1:1;l(e,void 0,[])();function l(u,d,h){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const x=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return g;function g(){let x=LM,y,v,w;if((!t||o(u,d,h[h.length-1]||void 0))&&(x=$te(n(u,h)),x[0]===hx))return x;if("children"in u&&u.children){const C=u;if(C.children&&x[0]!==Bte)for(v=(r?C.children.length:-1)+s,w=h.concat(C);v>-1&&v<C.children.length;){const N=C.children[v];if(y=l(N,v,w)(),y[0]===hx)return y;v=typeof y[1]=="number"?y[1]:v+s}}return x}}}function $te(e){return Array.isArray(e)?e:typeof e=="number"?[zte,e]:e==null?LM:[e]}function Yp(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),FM(e,o,l,i);function l(u,d){const h=d[d.length-1],f=h?h.children.indexOf(u):void 0;return s(u,f,h)}}const px={}.hasOwnProperty,Vte={};function Hte(e,t){const n=t||Vte,r=new Map,i=new Map,o=new Map,s={...Ete,...n.handlers},l={all:d,applyData:Wte,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:Ute,wrap:Kte};return Yp(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 u(h,f){const g=h.type,x=l.handlers[g];if(px.call(l.handlers,g)&&x)return x(l,h,f);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in h){const{children:v,...w}=h,C=Xh(w);return C.children=l.all(h),C}return Xh(h)}return(l.options.unknownHandler||qte)(l,h,f)}function d(h){const f=[];if("children"in h){const g=h.children;let x=-1;for(;++x<g.length;){const y=l.one(g[x],h);if(y){if(x&&g[x-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=LC(y.value)),!Array.isArray(y)&&y.type==="element")){const v=y.children[0];v&&v.type==="text"&&(v.value=LC(v.value))}Array.isArray(y)?f.push(...y):f.push(y)}}}return f}}function Ute(e,t){e.position&&(t.position=jQ(e))}function Wte(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,Xh(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function qte(e,t){const n=t.data||{},r="value"in t&&!(px.call(n,"hProperties")||px.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 Kte(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
655
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
656
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
657
|
+
`}),n}function LC(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function FC(e,t){const n=Hte(e,t),r=n.one(e,void 0),i=Rte(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
658
|
+
`},i),o}function Gte(e,t){return e&&"run"in e?async function(n,r){const i=FC(n,{file:r,...t});await e.run(i,r)}:function(n,r){return FC(n,{file:r,...e||t})}}function zC(e){if(e)throw e}var qg,BC;function Yte(){if(BC)return qg;BC=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 qg=function u(){var d,h,f,g,x,y,v=arguments[0],w=1,C=arguments.length,N=!1;for(typeof v=="boolean"&&(N=v,v=arguments[1]||{},w=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});w<C;++w)if(d=arguments[w],d!=null)for(h in d)f=l(v,h),g=l(d,h),v!==g&&(N&&g&&(o(g)||(x=i(g)))?(x?(x=!1,y=f&&i(f)?f:[]):y=f&&o(f)?f:{},s(v,{name:h,newValue:u(N,y,g)})):typeof g<"u"&&s(v,{name:h,newValue:g}));return v},qg}var Jte=Yte();const Kg=Ma(Jte);function mx(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 Xte(){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(u,...d){const h=e[++o];let f=-1;if(u){s(u);return}for(;++f<i.length;)(d[f]===null||d[f]===void 0)&&(d[f]=i[f]);i=d,h?Qte(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 Qte(e,t){let n;return r;function r(...s){const l=e.length>s.length;let u;l&&s.push(i);try{u=e.apply(this,s)}catch(d){const h=d;if(l&&n)throw h;return i(h)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const Oi={basename:Zte,dirname:ene,extname:tne,join:nne,sep:"/"};function Zte(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Kc(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 ene(e){if(Kc(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 tne(e){Kc(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 nne(...e){let t=-1,n;for(;++t<e.length;)Kc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":rne(n)}function rne(e){Kc(e);const t=e.codePointAt(0)===47;let n=ine(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ine(e,t){let n="",r=0,i=-1,o=0,s=-1,l,u;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(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),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 Kc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const one={cwd:sne};function sne(){return"/"}function gx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lne(e){if(typeof e=="string")e=new URL(e);else if(!gx(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 ane(e)}function ane(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 Gg=["history","path","basename","stem","extname","dirname"];class zM{constructor(t){let n;t?gx(t)?n={path:t}:typeof t=="string"||une(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":one.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Gg.length;){const o=Gg[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)Gg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Oi.basename(this.path):void 0}set basename(t){Jg(t,"basename"),Yg(t,"basename"),this.path=Oi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Oi.dirname(this.path):void 0}set dirname(t){$C(this.basename,"dirname"),this.path=Oi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Oi.extname(this.path):void 0}set extname(t){if(Yg(t,"extname"),$C(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=Oi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){gx(t)&&(t=lne(t)),Jg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Oi.basename(this.path,this.extname):void 0}set stem(t){Jg(t,"stem"),Yg(t,"stem"),this.path=Oi.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 tr(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 Yg(e,t){if(e&&e.includes(Oi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Oi.sep+"`")}function Jg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $C(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function une(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cne=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),dne={}.hasOwnProperty;class vb extends cne{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=Xte()}copy(){const t=new vb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Kg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Zg("data",this.frozen),this.namespace[t]=n,this):dne.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=_f(t),r=this.parser||this.Parser;return Xg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Xg("process",this.parser||this.Parser),Qg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const l=_f(t),u=r.parse(l);r.run(u,l,function(h,f,g){if(h||!f||!g)return d(h);const x=f,y=r.stringify(x,g);pne(y)?g.value=y:g.result=y,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(),Xg("processSync",this.parser||this.Parser),Qg("processSync",this.compiler||this.Compiler),this.process(t,i),HC("processSync","process",n),r;function i(o,s){n=!0,zC(o),r=s}}run(t,n,r){VC(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 u=_f(n);i.run(t,u,d);function d(h,f,g){const x=f||t;h?l(h):s?s(x):r(void 0,x,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),HC("runSync","run",r),i;function o(s,l){zC(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=_f(n),i=this.compiler||this.Compiler;return Qg("stringify",i),VC(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")u(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")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[h,...f]=d;u(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=Kg(!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 u(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[x,...y]=h;const v=r[g][1];mx(v)&&mx(x)&&(x=Kg(!0,v,x)),r[g]=[d,x,...y]}}}}const fne=new vb().freeze();function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qg(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 VC(e){if(!mx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function HC(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _f(e){return hne(e)?e:new zM(e)}function hne(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pne(e){return typeof e=="string"||mne(e)}function mne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gne="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UC=[],WC={allowDangerousHtml:!0},xne=/^(https?|ircs?|mailto|xmpp)$/i,yne=[{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 bne(e){const t=vne(e),n=wne(e);return kne(t.runSync(t.parse(n),n),e)}function vne(e){const t=e.rehypePlugins||UC,n=e.remarkPlugins||UC,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...WC}:WC;return fne().use(Zee).use(n).use(Gte,r).use(t)}function wne(e){const t=e.children||"",n=new zM;return typeof t=="string"&&(n.value=t),n}function kne(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Sne;for(const h of yne)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+gne+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Yp(e,d),OQ(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 x;for(x in Hg)if(Object.hasOwn(Hg,x)&&Object.hasOwn(h.properties,x)){const y=h.properties[x],v=Hg[x];(v===null||v.includes(h.tagName))&&(h.properties[x]=u(String(y||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):o?o.includes(h.tagName):!1;if(!x&&r&&typeof f=="number"&&(x=!r(h,f,g)),x&&g&&typeof f=="number")return l&&h.children?g.children.splice(f,1,...h.children):g.children.splice(f,1),f}}}function Sne(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||xne.test(e.slice(0,t))?e:""}function qC(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 Cne(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ene(e,t,n){const i=Kp((n||{}).ignore||[]),o=Nne(t);let s=-1;for(;++s<o.length;)FM(e,"text",l);function l(d,h){let f=-1,g;for(;++f<h.length;){const x=h[f],y=g?g.children:void 0;if(i(x,y?y.indexOf(x):void 0,g))return;g=x}if(g)return u(d,h)}function u(d,h){const f=h[h.length-1],g=o[s][0],x=o[s][1];let y=0;const w=f.children.indexOf(d);let C=!1,N=[];g.lastIndex=0;let T=g.exec(d.value);for(;T;){const D=T.index,A={index:T.index,input:T.input,stack:[...h,d]};let _=x(...T,A);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?g.lastIndex=D+1:(y!==D&&N.push({type:"text",value:d.value.slice(y,D)}),Array.isArray(_)?N.push(..._):_&&N.push(_),y=D+T[0].length,C=!0),!g.global)break;T=g.exec(d.value)}return C?(y<d.value.length&&N.push({type:"text",value:d.value.slice(y)}),f.children.splice(w,1,...N)):N=[d],w+N.length}}function Nne(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([Tne(i[0]),Ane(i[1])])}return t}function Tne(e){return typeof e=="string"?new RegExp(Cne(e),"g"):e}function Ane(e){return typeof e=="function"?e:function(){return e}}const e1="phrasing",t1=["autolink","link","image","label"];function _ne(){return{transforms:[One],enter:{literalAutolink:jne,literalAutolinkEmail:n1,literalAutolinkHttp:n1,literalAutolinkWww:n1},exit:{literalAutolink:Ine,literalAutolinkEmail:Pne,literalAutolinkHttp:Dne,literalAutolinkWww:Rne}}}function Mne(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:e1,notInConstruct:t1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:e1,notInConstruct:t1},{character:":",before:"[ps]",after:"\\/",inConstruct:e1,notInConstruct:t1}]}}function jne(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function n1(e){this.config.enter.autolinkProtocol.call(this,e)}function Dne(e){this.config.exit.autolinkProtocol.call(this,e)}function Rne(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 Pne(e){this.config.exit.autolinkEmail.call(this,e)}function Ine(e){this.exit(e)}function One(e){Ene(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Lne],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Fne]],{ignore:["link","linkReference"]})}function Lne(e,t,n,r,i){let o="";if(!BM(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!zne(n)))return!1;const s=Bne(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 Fne(e,t,n,r){return!BM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zne(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 Bne(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=qC(e,"(");let o=qC(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 BM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xl(n)||Up(n))&&(!t||n!==47)}$M.peek=Yne;function $ne(){this.buffer()}function Vne(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Hne(){this.buffer()}function Une(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Wne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qne(e){this.exit(e)}function Kne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Gne(e){this.exit(e)}function Yne(){return"["}function $M(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 Jne(){return{enter:{gfmFootnoteCallString:$ne,gfmFootnoteCall:Vne,gfmFootnoteDefinitionLabelString:Hne,gfmFootnoteDefinition:Une},exit:{gfmFootnoteCallString:Wne,gfmFootnoteCall:qne,gfmFootnoteDefinitionLabelString:Kne,gfmFootnoteDefinition:Gne}}}function Xne(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$M},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const l=o.createTracker(s);let u=l.move("[^");const d=o.enter("footnoteDefinition"),h=o.enter("label");return u+=l.move(o.safe(o.associationId(r),{before:u,after:"]"})),h(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?`
|
|
659
|
+
`:" ")+o.indentLines(o.containerFlow(r,l.current()),t?VM:Qne))),d(),u}}function Qne(e,t,n){return t===0?e:VM(e,t,n)}function VM(e,t,n){return(n?"":" ")+e}const Zne=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];HM.peek=ire;function ere(){return{canContainEols:["delete"],enter:{strikethrough:nre},exit:{strikethrough:rre}}}function tre(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Zne}],handlers:{delete:HM}}}function nre(e){this.enter({type:"delete",children:[]},e)}function rre(e){this.exit(e)}function HM(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 ire(){return"~"}function ore(e){return e.length}function sre(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ore,o=[],s=[],l=[],u=[];let d=0,h=-1;for(;++h<e.length;){const v=[],w=[];let C=-1;for(e[h].length>d&&(d=e[h].length);++C<e[h].length;){const N=lre(e[h][C]);if(n.alignDelimiters!==!1){const T=i(N);w[C]=T,(u[C]===void 0||T>u[C])&&(u[C]=T)}v.push(N)}s[h]=v,l[h]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<d;)o[f]=KC(r[f]);else{const v=KC(r);for(;++f<d;)o[f]=v}f=-1;const g=[],x=[];for(;++f<d;){const v=o[f];let w="",C="";v===99?(w=":",C=":"):v===108?w=":":v===114&&(C=":");let N=n.alignDelimiters===!1?1:Math.max(1,u[f]-w.length-C.length);const T=w+"-".repeat(N)+C;n.alignDelimiters!==!1&&(N=w.length+N+C.length,N>u[f]&&(u[f]=N),x[f]=N),g[f]=T}s.splice(1,0,g),l.splice(1,0,x),h=-1;const y=[];for(;++h<s.length;){const v=s[h],w=l[h];f=-1;const C=[];for(;++f<d;){const N=v[f]||"";let T="",D="";if(n.alignDelimiters!==!1){const A=u[f]-(w[f]||0),_=o[f];_===114?T=" ".repeat(A):_===99?A%2?(T=" ".repeat(A/2+.5),D=" ".repeat(A/2-.5)):(T=" ".repeat(A/2),D=T):D=" ".repeat(A)}n.delimiterStart!==!1&&!f&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||f)&&C.push(" "),n.alignDelimiters!==!1&&C.push(T),C.push(N),n.alignDelimiters!==!1&&C.push(D),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||f!==d-1)&&C.push("|")}y.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return y.join(`
|
|
660
|
+
`)}function lre(e){return e==null?"":String(e)}function KC(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 are(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()),ure);return i(),s}function ure(e,t,n){return">"+(n?"":" ")+e}function cre(e,t){return GC(e,t.inConstruct,!0)&&!GC(e,t.notInConstruct,!1)}function GC(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 YC(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
661
|
+
`&&cre(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
662
|
+
`}function dre(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 fre(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 hre(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 pre(e,t,n,r){const i=hre(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(fre(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(o,mre);return f(),g}const l=n.createTracker(r),u=i.repeat(Math.max(dre(o,i)+1,3)),d=n.enter("codeFenced");let h=l.move(u);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:`
|
|
663
|
+
`,encode:["`"],...l.current()})),f()}return h+=l.move(`
|
|
664
|
+
`),o&&(h+=l.move(o+`
|
|
665
|
+
`)),h+=l.move(u),d(),h}function mre(e,t,n){return(n?"":" ")+e}function wb(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 gre(e,t,n,r){const i=wb(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
666
|
+
`,...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),s(),d}function xre(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 Sc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Qh(e,t,n){const r=_a(e),i=_a(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}}UM.peek=yre;function UM(e,t,n,r){const i=xre(n),o=n.enter("emphasis"),s=n.createTracker(r),l=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const d=u.charCodeAt(0),h=Qh(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(u=Sc(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=Qh(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Sc(f));const x=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+u+x}function yre(e,t,n){return n.options.emphasis||"*"}function bre(e,t){let n=!1;return Yp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,hx}),!!((!e.depth||e.depth<3)&&hb(e)&&(t.options.setext||n))}function vre(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(bre(e,n)){const h=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...o.current(),before:`
|
|
667
|
+
`,after:`
|
|
668
|
+
`});return f(),h(),g+`
|
|
669
|
+
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
|
|
670
|
+
`))+1))}const s="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
671
|
+
`,...o.current()});return/^[\t ]/.test(d)&&(d=Sc(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),u(),l(),d}WM.peek=wre;function WM(e){return e.value||""}function wre(){return"<"}qM.peek=kre;function qM(e,t,n,r){const i=wb(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),s(),d}function kre(){return"!"}KM.peek=Sre;function KM(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=h,o(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Sre(){return"!"}GM.peek=Cre;function GM(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 u;if(s.atBreak)for(;u=l.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function Cre(){return"`"}function YM(e,t){const n=hb(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))}JM.peek=Ere;function JM(e,t,n,r){const i=wb(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let l,u;if(YM(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"),u=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(u=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=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),u()),d+=s.move(")"),l(),d}function Ere(e,t,n){return YM(e,n)?"<":"["}XM.peek=Nre;function XM(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=h,o(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Nre(){return"["}function kb(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 Tre(e){const t=kb(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 Are(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 QM(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 _re(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?Are(n):kb(n);const l=e.ordered?s==="."?")":".":Tre(n);let u=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&&(u=!0),QM(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"){u=!0;break}}}}u&&(s=l),n.bulletCurrent=s;const d=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),d}function Mre(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 jre(e,t,n,r){const i=Mre(n);let o=n.bulletCurrent||kb(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 u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),h);return u(),d;function h(f,g,x){return g?(x?"":" ".repeat(s))+f:(x?o:o+" ".repeat(s-o.length))+f}}function Dre(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const Rre=Kp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Pre(e,t,n,r){return(e.children.some(function(s){return Rre(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ire(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ZM.peek=Ore;function ZM(e,t,n,r){const i=Ire(n),o=n.enter("strong"),s=n.createTracker(r),l=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const d=u.charCodeAt(0),h=Qh(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(u=Sc(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=Qh(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Sc(f));const x=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+u+x}function Ore(e,t,n){return n.options.strong||"*"}function Lre(e,t,n,r){return n.safe(e.value,r)}function Fre(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 zre(e,t,n){const r=(QM(n)+(n.options.ruleSpaces?" ":"")).repeat(Fre(n));return n.options.ruleSpaces?r.slice(0,-1):r}const e5={blockquote:are,break:YC,code:pre,definition:gre,emphasis:UM,hardBreak:YC,heading:vre,html:WM,image:qM,imageReference:KM,inlineCode:GM,link:JM,linkReference:XM,list:_re,listItem:jre,paragraph:Dre,root:Pre,strong:ZM,text:Lre,thematicBreak:zre};function Bre(){return{enter:{table:$re,tableData:JC,tableHeader:JC,tableRow:Hre},exit:{codeText:Ure,table:Vre,tableData:r1,tableHeader:r1,tableRow:r1}}}function $re(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 Vre(e){this.exit(e),this.data.inTable=void 0}function Hre(e){this.enter({type:"tableRow",children:[]},e)}function r1(e){this.exit(e)}function JC(e){this.enter({type:"tableCell",children:[]},e)}function Ure(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Wre));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Wre(e,t){return t==="|"?t:e}function qre(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
672
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:s,tableCell:u,tableRow:l}};function s(x,y,v,w){return d(h(x,v,w),x.align)}function l(x,y,v,w){const C=f(x,v,w),N=d([C]);return N.slice(0,N.indexOf(`
|
|
673
|
+
`))}function u(x,y,v,w){const C=v.enter("tableCell"),N=v.enter("phrasing"),T=v.containerPhrasing(x,{...w,before:o,after:o});return N(),C(),T}function d(x,y){return sre(x,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function h(x,y,v){const w=x.children;let C=-1;const N=[],T=y.enter("table");for(;++C<w.length;)N[C]=f(w[C],y,v);return T(),N}function f(x,y,v){const w=x.children;let C=-1;const N=[],T=y.enter("tableRow");for(;++C<w.length;)N[C]=u(w[C],x,y,v);return T(),N}function g(x,y,v){let w=e5.inlineCode(x,y,v);return v.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function Kre(){return{exit:{taskListCheckValueChecked:XC,taskListCheckValueUnchecked:XC,paragraph:Yre}}}function Gre(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Jre}}}function XC(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Yre(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 Jre(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 u=e5.listItem(e,t,n,{...r,...l.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(h){return h+s}}function Xre(){return[_ne(),Jne(),ere(),Bre(),Kre()]}function Qre(e){return{extensions:[Mne(),Xne(e),tre(),qre(e),Gre()]}}const Zre={tokenize:oie,partial:!0},t5={tokenize:sie,partial:!0},n5={tokenize:lie,partial:!0},r5={tokenize:aie,partial:!0},eie={tokenize:uie,partial:!0},i5={name:"wwwAutolink",tokenize:rie,previous:s5},o5={name:"protocolAutolink",tokenize:iie,previous:l5},Ao={name:"emailAutolink",tokenize:nie,previous:a5},eo={};function tie(){return{text:eo}}let Gs=48;for(;Gs<123;)eo[Gs]=Ao,Gs++,Gs===58?Gs=65:Gs===91&&(Gs=97);eo[43]=Ao;eo[45]=Ao;eo[46]=Ao;eo[95]=Ao;eo[72]=[Ao,o5];eo[104]=[Ao,o5];eo[87]=[Ao,i5];eo[119]=[Ao,i5];function nie(e,t,n){const r=this;let i,o;return s;function s(f){return!xx(f)||!a5.call(r,r.previous)||Sb(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return xx(f)?(e.consume(f),l):f===64?(e.consume(f),u):n(f)}function u(f){return f===46?e.check(eie,h,d)(f):f===45||f===95||Gn(f)?(o=!0,e.consume(f),u):h(f)}function d(f){return e.consume(f),i=!0,u}function h(f){return o&&i&&ar(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function rie(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!s5.call(r,r.previous)||Sb(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Zre,e.attempt(t5,e.attempt(n5,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function iie(e,t,n){const r=this;let i="",o=!1;return s;function s(f){return(f===72||f===104)&&l5.call(r,r.previous)&&!Sb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(ar(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),u}return n(f)}function u(f){return f===47?(e.consume(f),o?d:(o=!0,u)):n(f)}function d(f){return f===null||Yh(f)||bt(f)||xl(f)||Up(f)?n(f):e.attempt(t5,e.attempt(n5,h),n)(f)}function h(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function oie(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 sie(e,t,n){let r,i,o;return s;function s(d){return d===46||d===95?e.check(r5,u,l)(d):d===null||bt(d)||xl(d)||d!==45&&Up(d)?u(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 u(d){return i||r||!o?n(d):t(d)}}function lie(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(r5,t,o)(s):s===null||bt(s)||xl(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function aie(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||bt(l)||xl(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||bt(l)||xl(l)?t(l):r(l)}function o(l){return ar(l)?s(l):n(l)}function s(l){return l===59?(e.consume(l),r):ar(l)?(e.consume(l),s):n(l)}}function uie(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Gn(o)?n(o):t(o)}}function s5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bt(e)}function l5(e){return!ar(e)}function a5(e){return!(e===47||xx(e))}function xx(e){return e===43||e===45||e===46||e===95||Gn(e)}function Sb(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 cie={tokenize:yie,partial:!0};function die(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:mie,continuation:{tokenize:gie},exit:xie}},text:{91:{name:"gfmFootnoteCall",tokenize:pie},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:fie,resolveTo:hie}}}}function fie(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!s||!s._balanced)return n(u);const d=wi(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function hie(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 pie(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"),u}function u(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||bt(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(wi(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return bt(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 mie(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,l;return u;function u(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(y)}function h(y){if(s>999||y===93&&!l||y===null||y===91||bt(y))return n(y);if(y===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=wi(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return bt(y)||(l=!0),s++,e.consume(y),y===92?f:h}function f(y){return y===91||y===92||y===93?(e.consume(y),s++,h):h(y)}function g(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),i.includes(o)||i.push(o),st(e,x,"gfmFootnoteDefinitionWhitespace")):n(y)}function x(y){return t(y)}}function gie(e,t,n){return e.check(qc,t,e.attempt(cie,t,n))}function xie(e){e.exit("gfmFootnoteDefinition")}function yie(e,t,n){const r=this;return st(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 bie(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 u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let d=u;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[u][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[u][1].start)},g=[["enter",h,l],["enter",s[d][1],l],["exit",s[d][1],l],["enter",f,l]],x=l.parser.constructs.insideSpan.null;x&&Hr(g,g.length,0,Wp(x,s.slice(d+1,u),l)),Hr(g,g.length,0,[["exit",f,l],["enter",s[u][1],l],["exit",s[u][1],l],["exit",h,l]]),Hr(s,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,l,u){const d=this.previous,h=this.events;let f=0;return g;function g(y){return d===126&&h[h.length-1][1].type!=="characterEscape"?u(y):(s.enter("strikethroughSequenceTemporary"),x(y))}function x(y){const v=_a(d);if(y===126)return f>1?u(y):(s.consume(y),f++,x);if(f<2&&!n)return u(y);const w=s.exit("strikethroughSequenceTemporary"),C=_a(y);return w._open=!C||C===2&&!!v,w._close=!v||v===2&&!!C,l(y)}}}class vie{constructor(){this.map=[]}add(t,n,r){wie(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 wie(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 kie(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 Sie(){return{flow:{null:{name:"table",tokenize:Cie,resolveAll:Eie}}}}function Cie(e,t,n){const r=this;let i=0,o=0,s;return l;function l(R){let V=r.events.length-1;for(;V>-1;){const B=r.events[V][1].type;if(B==="lineEnding"||B==="linePrefix")V--;else break}const K=V>-1?r.events[V][1].type:null,G=K==="tableHead"||K==="tableRow"?_:u;return G===_&&r.parser.lazy[r.now().line]?n(R):G(R)}function u(R){return e.enter("tableHead"),e.enter("tableRow"),d(R)}function d(R){return R===124||(s=!0,o+=1),h(R)}function h(R){return R===null?n(R):He(R)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),x):n(R):rt(R)?st(e,h,"whitespace")(R):(o+=1,s&&(s=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),s=!0,h):(e.enter("data"),f(R)))}function f(R){return R===null||R===124||bt(R)?(e.exit("data"),h(R)):(e.consume(R),R===92?g:f)}function g(R){return R===92||R===124?(e.consume(R),f):f(R)}function x(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),s=!1,rt(R)?st(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):y(R))}function y(R){return R===45||R===58?w(R):R===124?(s=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),v):A(R)}function v(R){return rt(R)?st(e,w,"whitespace")(R):w(R)}function w(R){return R===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):R===45?(o+=1,C(R)):R===null||He(R)?D(R):A(R)}function C(R){return R===45?(e.enter("tableDelimiterFiller"),N(R)):A(R)}function N(R){return R===45?(e.consume(R),N):R===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(R))}function T(R){return rt(R)?st(e,D,"whitespace")(R):D(R)}function D(R){return R===124?y(R):R===null||He(R)?!s||i!==o?A(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):A(R)}function A(R){return n(R)}function _(R){return e.enter("tableRow"),I(R)}function I(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),I):R===null||He(R)?(e.exit("tableRow"),t(R)):rt(R)?st(e,I,"whitespace")(R):(e.enter("data"),P(R))}function P(R){return R===null||R===124||bt(R)?(e.exit("data"),I(R)):(e.consume(R),R===92?L:P)}function L(R){return R===92||R===124?(e.consume(R),P):P(R)}}function Eie(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,u=0,d,h,f;const g=new vie;for(;++n<e.length;){const x=e[n],y=x[1];x[0]==="enter"?y.type==="tableHead"?(l=!1,u!==0&&(QC(g,t,u,d,h),h=void 0,u=0),d={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},g.add(n,0,[["enter",d,t]])):y.type==="tableRow"||y.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({},y.start),end:Object.assign({},y.end)},g.add(n,0,[["enter",h,t]])),i=y.type==="tableDelimiterRow"?2:h?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=Mf(g,t,o,i,void 0,f),o=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],f=Mf(g,t,o,i,void 0,f)),o=s,s=[o[1],n,0,0])):y.type==="tableHead"?(l=!0,u=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],f=Mf(g,t,o,i,n,f)):s[1]!==0&&(f=Mf(g,t,s,i,n,f)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&QC(g,t,u,d,h),g.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=kie(t.events,n))}return e}function Mf(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(o.end=Object.assign({},oa(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=oa(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=oa(t.events,n[2]),h=oa(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]],x=t.events[n[3]];if(g[1].end=Object.assign({},x[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,v=n[3]-n[2]-1;e.add(y,v,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},oa(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function QC(e,t,n,r,i){const o=[],s=oa(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 oa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Nie={name:"tasklistCheck",tokenize:Aie};function Tie(){return{text:{91:Nie}}}function Aie(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return bt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return He(u)?t(u):rt(u)?e.check({tokenize:_ie},t,n)(u):n(u)}}function _ie(e,t,n){return st(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Mie(e){return bM([tie(),die(),bie(e),Sie(),Tie()])}const jie={};function Die(e){const t=this,n=e||jie,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Mie(n)),o.push(Xre()),s.push(Qre(n))}const Du=/\[\[([^\]|\n]+)(?:\|([^\]\n]+))?\]\]/g,Rie=()=>e=>{Yp(e,"text",(t,n,r)=>{if(!r||n===null||n===void 0)return;const i=t.value;if(Du.lastIndex=0,!Du.test(i))return;Du.lastIndex=0;const o=[];let s=0,l;for(;(l=Du.exec(i))!==null;){l.index>s&&o.push({type:"text",value:i.slice(s,l.index)});const u=l[1].trim(),d=(l[2]??l[1]).trim();o.push({type:"wikiLink",data:{hName:"wikilink",hProperties:{"data-wiki-target":u,"data-wiki-display":d},hChildren:[{type:"text",value:d}]}}),s=Du.lastIndex}return s<i.length&&o.push({type:"text",value:i.slice(s)}),r.children.splice(n,1,...o),n+o.length})};function Pie({content:e,onWikiLinkClick:t,className:n}){return p.jsx("div",{className:Ie("prose prose-sm dark:prose-invert max-w-none px-6 py-4","min-h-[60vh] max-h-[60vh] overflow-y-auto",n),children:p.jsx(bne,{remarkPlugins:[Die,Rie],components:{wikilink:({children:r,...i})=>{const o=i["data-wiki-target"]??"";return p.jsx("button",{type:"button",className:"wiki-link wiki-link-exists bg-transparent border-0 p-0 m-0 cursor-pointer",title:`Open "${o}"`,onClick:s=>{s.preventDefault(),s.stopPropagation(),t==null||t(o)},children:r})},a:({href:r,children:i,...o})=>p.jsx("a",{href:r,target:"_blank",rel:"noreferrer noopener",onClick:s=>s.stopPropagation(),...o,children:i})},children:e})})}function Iie({isOpen:e,onClose:t,nestId:n,excludeNodeId:r,onSelect:i}){const[o,s]=k.useState([]),[l,u]=k.useState(""),[d,h]=k.useState(!1),[f,g]=k.useState(null);k.useEffect(()=>{if(!e){u(""),g(null);return}let y=!1;return(async()=>{h(!0);try{const{nodes:v}=await ga(n);y||s(v)}catch(v){y||g(v.message)}finally{y||h(!1)}})(),()=>{y=!0}},[e,n]),k.useEffect(()=>{if(!e||!l.trim())return;let y=!1;const v=setTimeout(async()=>{h(!0);try{const{nodes:w}=await Cx(n,l.trim());y||s(w)}catch(w){y||g(w.message)}finally{y||h(!1)}},200);return()=>{y=!0,clearTimeout(v)}},[e,n,l]);const x=k.useMemo(()=>{const y=l.trim().toLowerCase();return o.filter(v=>v.id===r?!1:y?v.title.toLowerCase().includes(y):!0)},[o,l,r]);return p.jsx(vn,{open:e,onOpenChange:t,children:p.jsxs(an,{className:"sm:max-w-[520px] max-h-[80vh] flex flex-col",children:[p.jsxs(un,{children:[p.jsx(cn,{children:"Link to a document"}),p.jsx(Qn,{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(u3,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),p.jsx(Xn,{value:l,onChange:y=>u(y.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(dt,{className:"h-5 w-5 animate-spin mr-2"}),"Loading documents..."]}):x.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:x.map(y=>p.jsxs("button",{type:"button",onClick:()=>{i({id:y.id,title:y.title}),t()},className:"w-full flex items-center gap-2 p-2 rounded hover:bg-muted text-left","data-testid":`document-picker-row-${y.id}`,children:[p.jsx(ps,{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:y.title}),y.tags&&y.tags.length>0&&p.jsx("div",{className:"text-xs text-muted-foreground truncate",children:y.tags.slice(0,4).join(" · ")})]})]},y.id))})]})]})})}function Oie(e){return e?/^\s*</.test(e):!1}function ZC(e){if(!e)return"";if(typeof DOMParser>"u")return e.trim();try{return(new DOMParser().parseFromString(e,"text/html").body.innerHTML||"").replace(/\s+/g," ").trim()}catch{return e.trim()}}function Lie({nestId:e,nestName:t,nodeId:n,isOwner:r=!1,onBack:i,onSaved:o,onNavigateDocument:s,onTagClick:l,onCreateDocument:u,initialTitle:d,breadcrumb:h,onJumpBreadcrumb:f}){var qe,Pt;const g=n==="new",{adminStatus:x,isAdmin:y}=Ss(),v=((Pt=(qe=x==null?void 0:x.me)==null?void 0:qe.email)==null?void 0:Pt.toLowerCase())??"",w=r||y,[C,N]=k.useState(!1),[T,D]=k.useState([]),[A,_]=k.useState([]),[I,P]=k.useState(g&&d?d:""),[L,R]=k.useState(""),[V,K]=k.useState([]),[G,B]=k.useState(""),[W,U]=k.useState(void 0),[Z,q]=k.useState(null),[Y,j]=k.useState(null),[z,ee]=k.useState(null),[O,ce]=k.useState(!1),[pe,le]=k.useState(!1),[ie,ue]=k.useState(null),xe=ie==="read",Te=r||y||ie==="owner"||ie==="admin"||ie==="write"||A.some(re=>re.role==="editor"&&re.scope==="nest"),Le=g?!Te:xe&&T.length===0,[Be,at]=k.useState(!1),[Xe,Ot]=k.useState(!1),[ut,Tt]=k.useState(g?"edit":"view"),nr=k.useRef(null),xt=k.useRef({title:g&&d?d:"",content:"",tags:[]}),[Vn,rr]=k.useState(!g),[ft,hn]=k.useState(!1),[mr,ir]=k.useState(null),[te,he]=k.useState(!1);k.useEffect(()=>{let re=!1;return(async()=>{try{const[Ce,nt]=await Promise.all([x3(e).catch(()=>({stewardship_enabled:!1,allow_self_approve:!1})),Zh(e).catch(()=>null)]);if(re)return;ce(!!Ce.stewardship_enabled),le(!!Ce.allow_self_approve),ue((nt==null?void 0:nt.permission)??null),_((nt==null?void 0:nt.myStewards)??[])}catch{}})(),()=>{re=!0}},[e]),k.useEffect(()=>{if(g||!n||!v){D([]);return}let re=!1;return(async()=>{try{const{stewards:Ce}=await n8(e,n);if(re)return;const nt=Ce.filter(ot=>(ot.email||"").toLowerCase()===v);D(nt.map(ot=>ot.role))}catch{re||D([])}})(),()=>{re=!0}},[g,e,n,v]);const De=k.useCallback(async()=>{if(!g){rr(!0);try{const{node:re}=await qP(e,n),Ce=(re==null?void 0:re.title)==null?"":String(re.title),nt=(re==null?void 0:re.content)==null?"":String(re.content),ot=Array.isArray(re==null?void 0:re.tags)?re.tags.map(kn=>String(kn)):[];P(Ce),R(nt),K(ot),U(re==null?void 0:re.version),q((re==null?void 0:re.status)??null),j((re==null?void 0:re.pendingChange)??null),ee((re==null?void 0:re.pendingReviewBy)??null),xt.current={title:Ce,content:nt,tags:ot},he(!1)}catch(re){ir(re.message)}finally{rr(!1)}}},[g,e,n]);k.useEffect(()=>{g||De()},[g,De]);const Fe=Z==="pending_review",Re=Fe||ut!=="edit",At=k.useMemo(()=>!Fe&&I.trim().length>0&&L.trim().length>0&&!ft,[Fe,I,L,ft]),Yt=k.useMemo(()=>{if(!te)return!1;const re=xt.current;if(I.trim()!==re.title.trim()||ZC(L)!==ZC(re.content)||V.length!==re.tags.length)return!0;for(let Ce=0;Ce<V.length;Ce++)if(V[Ce]!==re.tags[Ce])return!0;return!1},[te,I,L,V]),pn=k.useCallback(()=>{const re=G.split(/[\s,]+/).map(nt=>nt.trim().replace(/^#+/,"")).filter(Boolean);if(re.length===0)return;const Ce=[...V];for(const nt of re)Ce.includes(nt)||Ce.push(nt);K(Ce),B(""),he(!0)},[G,V]),jn=re=>{K(V.filter(Ce=>Ce!==re)),he(!0)},gr=async()=>{var nt,ot;const re={title:I.trim(),content:L,tags:V};let Ce;if(g){const kn=await KP(e,re);Ce=(nt=kn==null?void 0:kn.node)==null?void 0:nt.id}else{const kn=await GP(e,n,re,W),js=(kn==null?void 0:kn.version)??((ot=kn==null?void 0:kn.node)==null?void 0:ot.version);typeof js=="number"&&U(js),Ce=n}return xt.current={title:re.title,content:L,tags:[...V]},he(!1),{ok:!0,savedId:Ce}},[ht,_t]=k.useState(null),Lt=async re=>{if(!At){ir(g?"Add a title and content before saving.":"Current document can't be saved — fix errors before leaving.");return}hn(!0),ir(null);try{const{savedId:Ce}=await gr();re(Ce??"")}catch(Ce){ir(Ce.message)}finally{hn(!1)}},Dn=()=>Lt(re=>o==null?void 0:o(re)),xr=(re,Ce)=>{if(!Yt||Fe||kt){Ce();return}_t({label:re,run:Ce})},yr=()=>Lt(()=>{const re=ht==null?void 0:ht.run;_t(null),re==null||re()}),Rn=()=>{if(!ht)return;const re=ht.run;_t(null),re()},Pn=async(re,Ce)=>{g||(await y3(e,n,re,Ce),at(!1),await De())},We=async re=>{g||(await b3(e,n,re),await De())},Mt=async re=>{g||(await v3(e,n,re),await De())},Ft=T.includes("reviewer"),en=T.includes("editor"),qr=!!z&&!!v&&z.toLowerCase()===v,Ut=y||ie==="admin"||T.includes("admin")||Ft||r&&pe,Kr=!g&&Z==="pending_review"&&Ut&&(!qr||r&&pe),kt=!r&&T.length>0&&!en,wn=!g&&O&&Z==="draft"&&!kt,ne=re=>{var Ce;(Ce=nr.current)==null||Ce.insertWikiLink(pa(re.id),re.title)},we=async(re,Ce)=>{if(Ce){xr(`open "${re}"`,()=>s==null?void 0:s(e,Ce,I));return}try{const{nodes:nt}=await ga(e),ot=nt,kn=re.toLowerCase(),js=pa(re).toLowerCase(),Ba=ot.find(El=>El.id.toLowerCase()===kn||El.title.toLowerCase()===kn||pa(El.id).toLowerCase()===js);if(Ba){xr(`open "${Ba.title}"`,()=>s==null?void 0:s(e,Ba.id,I));return}if(kt||Le){ir(`"${re}" doesn't exist in this nest. You only have view access — ask someone with edit rights to add it.`);return}xr(`create "${re}"`,()=>u==null?void 0:u(e,re))}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(be,{variant:"ghost",size:"icon",onClick:()=>xr("go back",i),"data-testid":"document-editor-back",children:p.jsx(vx,{className:"h-5 w-5"})}),p.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[p.jsx("span",{className:"text-sm text-muted-foreground truncate",children:t}),h==null?void 0:h.map((re,Ce)=>p.jsxs(k.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground shrink-0",children:"›"}),p.jsx("button",{type:"button",onClick:()=>xr(`go to "${re.title}"`,()=>f==null?void 0:f(Ce)),className:"text-sm text-muted-foreground hover:text-foreground hover:underline underline-offset-2 truncate max-w-[160px]",title:re.title,"data-testid":`document-editor-breadcrumb-${Ce}`,children:re.title})]},`${re.nestId}/${re.nodeId}/${Ce}`)),p.jsx("span",{className:"text-muted-foreground shrink-0",children:"›"}),p.jsx("h3",{className:"text-sm font-bold text-foreground truncate mb-0 leading-none","data-testid":"document-editor-header-title",children:I||(g?"New document":"Untitled")}),!g&&Z&&p.jsx(Fie,{status:Z}),!g&&!O&&Z==="published"&&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 off — saving auto-publishes.",children:"Auto-published"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[w&&p.jsxs(be,{variant:"outline",onClick:()=>N(!0),"data-testid":"document-editor-share",title:"Share this nest — visibility and collaborators",children:[p.jsx(ja,{className:"h-4 w-4 mr-2"}),"Share"]}),!Le&&wn&&p.jsxs(be,{variant:"outline",onClick:()=>at(!0),"data-testid":"document-editor-submit",title:'With stewardship on, "publishing" in this nest means submitting for steward approval.',children:[p.jsx(Sx,{className:"h-4 w-4 mr-2"}),"Publish (requires approval)"]}),!Le&&Kr&&p.jsx(kT,{documentTitle:I,version:W??1,onApprove:We,onReject:Mt}),!Le&&!Fe&&!kt&&(ut==="edit"?p.jsxs(be,{onClick:Dn,disabled:!At,"data-testid":"document-editor-save",children:[ft?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(fk,{className:"h-4 w-4 mr-2"}),g?"Create":"Save"]}):p.jsxs(be,{onClick:()=>Tt("edit"),"data-testid":"document-editor-start-edit",children:[p.jsx(Ac,{className:"h-4 w-4 mr-2"}),"Start Editing"]}))]})]}),mr&&p.jsxs(Yn,{variant:"destructive",className:"mb-4",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:mr})]}),Vn?p.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[p.jsx(dt,{className:"h-5 w-5 animate-spin mr-2"}),"Loading document..."]}):p.jsxs("div",{className:"space-y-4",children:[!g&&Y&&p.jsx(oB,{nestId:e,nodeId:n,pending:Y,onResolved:()=>{j(null),De()}}),Fe&&p.jsxs(Yn,{children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:"This document is awaiting steward review. Editing is locked until the review is resolved."})]}),p.jsx("div",{children:ut==="view"&&!g?p.jsx("h1",{className:"text-3xl font-bold leading-tight text-foreground","data-testid":"document-editor-title",children:I||"Untitled"}):p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"block mb-1 text-sm font-medium",children:["Title ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(Xn,{value:I,onChange:re=>{P(re.target.value),he(!0)},placeholder:"Document title",disabled:Re,"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(Xn,{value:G,onChange:re=>B(re.target.value),onKeyDown:re=>{(re.key==="Enter"||re.key===","||re.key===" ")&&(re.preventDefault(),pn())},placeholder:'Press Enter or space. Try "#api #v2" or "api, v2"',disabled:Re,"data-testid":"document-editor-tag-input"}),p.jsx(be,{type:"button",variant:"outline",onClick:pn,disabled:Re||!G.trim(),children:"Add"})]}),V.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:V.map(re=>{const Ce=ut==="view"&&!!l;return p.jsxs("span",{onClick:Ce?nt=>{nt.stopPropagation(),l(re)}:void 0,className:"inline-flex items-center gap-1 rounded bg-secondary px-2 py-0.5 text-xs"+(Ce?" cursor-pointer hover:bg-secondary/80":""),title:Ce?`Filter nest by ${re}`:void 0,children:[re,!Re&&p.jsx("button",{type:"button",onClick:nt=>{nt.stopPropagation(),jn(re)},className:"hover:text-destructive","aria-label":`Remove ${re}`,children:p.jsx(NP,{className:"h-3 w-3"})})]},re)})})]}),p.jsxs("div",{onClick:()=>{Le||ut==="view"&&!Fe&&!kt&&Tt("edit")},children:[p.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Content ",p.jsx("span",{className:"text-destructive",children:"*"})]}),ut==="view"&&!Oie(L)?p.jsx("div",{className:"border rounded-lg bg-background shadow-sm min-h-[300px] cursor-text",children:p.jsx(Pie,{content:L,onWikiLinkClick:re=>we(re,null)})}):p.jsx(iM,{ref:nr,content:L,onChange:re=>{R(re),he(!0)},onSave:Dn,nestId:e,editable:!Fe&&ut==="edit",onRequestDocLink:()=>Ot(!0),onWikiLinkClick:we,placeholder:"Start writing..."})]})]}),!g&&p.jsx(ST,{isOpen:Be,onClose:()=>at(!1),documentTitle:I,currentVersion:W??1,onSubmit:Pn}),p.jsx(Iie,{isOpen:Xe,onClose:()=>Ot(!1),nestId:e,excludeNodeId:g?void 0:n,onSelect:ne}),C&&p.jsx(g4,{nestId:e,nestName:t,onClose:()=>N(!1),onChanged:()=>{}}),ht&&p.jsx(vn,{open:!0,onOpenChange:()=>_t(null),children:p.jsxs(an,{className:"sm:max-w-[460px]",children:[p.jsx(un,{children:p.jsx(cn,{children:"Unsaved changes"})}),p.jsxs("p",{className:"text-sm text-muted-foreground py-2",children:["You have unsaved changes in this document. Save them before you ",ht.label,", or discard to leave without saving."]}),mr&&p.jsxs(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:mr})]}),p.jsxs(cr,{children:[p.jsx(be,{variant:"outline",onClick:()=>_t(null),disabled:ft,children:"Cancel"}),p.jsx(be,{variant:"outline",onClick:Rn,disabled:ft,children:"Discard"}),p.jsxs(be,{onClick:yr,disabled:ft,children:[ft?p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}):p.jsx(fk,{className:"h-4 w-4 mr-2"}),"Save & leave"]})]})]})})]})}function Fie({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 zie({existingAdmin:e,onClose:t}){const{loginSuccess:n}=Ss(),[r,i]=k.useState("promptowl"),[o,s]=k.useState(""),[l,u]=k.useState(""),[d,h]=k.useState(!1),[f,g]=k.useState(null),[x,y]=k.useState(null),[v,w]=k.useState(null),[C,N]=k.useState(!1),[T,D]=k.useState(!1),[A,_]=k.useState(null),I=async()=>{v&&(await navigator.clipboard.writeText(v),N(!0),setTimeout(()=>N(!1),1500))},P=async()=>{g(null),h(!0);try{const R=await p3();y(R.verificationUrl),w(R.deviceCode),window.open(R.verificationUrl,"_blank","noopener,noreferrer");for(let V=0;V<180;V++){await new Promise(B=>setTimeout(B,2e3));const K=await m3(R.deviceCode,R.clientSecret);if(K.status==="approved"&&K.token){const B=await g3(K.token);if(n(B.user?{email:B.user.email,name:B.user.name,is_admin:!!B.user.is_admin}:void 0),B.claim_blocked&&!B.user.is_admin){_({info:B.claim_blocked,attemptedEmail:B.user.email}),y(null),w(null),h(!1);return}t();return}if(K.status==="pending")continue;const G=K.status==="denied"||K.status==="rejected"?"Login request was denied. Please try again to create a new authentication request.":K.status==="expired"?"Login expired. Try again.":K.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${K.status}). Try again.`;g(G),y(null),w(null),h(!1);return}g("Login timed out waiting for approval. Try again."),y(null),w(null),h(!1)}catch(R){g(R.message),y(null),w(null),h(!1)}},L=async R=>{R.preventDefault(),g(null),h(!0);try{const V=await h3(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(vn,{open:!0,onOpenChange:t,children:p.jsxs(an,{className:"sm:max-w-[420px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{className:"flex items-center gap-2",children:[p.jsx(Ar,{className:"h-4 w-4"}),"Login"]}),p.jsx(Qn,{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(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:f})]}),A&&p.jsxs(Yn,{variant:"destructive",children:[p.jsx(s3,{className:"h-4 w-4"}),p.jsx(Jn,{children:A.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(s1,{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:A.info.license_owner_email||"(unknown)"})]}),p.jsxs("p",{className:"text-xs",children:["You logged in as:"," ",p.jsx("code",{className:"font-mono",children:A.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(be,{onClick:P,disabled:d,className:"w-full",children:d&&x?p.jsxs(p.Fragment,{children:[p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}),"Waiting for approval..."]}):"Login with PromptOwl"}),x&&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:x,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary underline",children:["PromptOwl",p.jsx(s1,{className:"h-3 w-3"})]}),". If it asks for a verification code, use this:"]}),v&&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:v}),p.jsx(be,{size:"sm",variant:"outline",onClick:I,children:C?p.jsx(yl,{className:"h-3.5 w-3.5 text-green-600"}):p.jsx(Nc,{className:"h-3.5 w-3.5"})})]})]}),!x&&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(be,{variant:"outline",className:"w-full",onClick:()=>i("password"),children:"Use email + password"})]})]}):p.jsxs("form",{onSubmit:L,className:"space-y-3",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vt,{children:"Email"}),p.jsx(Xn,{type:"email",value:o,onChange:R=>s(R.target.value),required:!0,autoFocus:!0})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vt,{children:"Password"}),p.jsxs("div",{className:"relative",children:[p.jsx(Xn,{type:T?"text":"password",value:l,onChange:R=>u(R.target.value),required:!0,className:"pr-9"}),p.jsx("button",{type:"button",onClick:()=>D(R=>!R),"aria-label":T?"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:T?p.jsx(o3,{className:"h-4 w-4"}):p.jsx(Tc,{className:"h-4 w-4"})})]})]}),p.jsx(be,{type:"submit",disabled:d,className:"w-full",children:d?p.jsx(dt,{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 Bie({onBack:e}){const[t,n]=k.useState([]),[r,i]=k.useState([]),[o,s]=k.useState(!0),[l,u]=k.useState(null),[d,h]=k.useState(!1),[f,g]=k.useState(""),[x,y]=k.useState(null),v=async()=>{s(!0);try{const C=await PP();n(C.teammates),i(C.pending_stewards||[]),u(null)}catch(C){u(C.message)}finally{s(!1)}};k.useEffect(()=>{v()},[]);const w=C=>{if(!C)return"Never";const N=new Date(C),T=Date.now()-N.getTime();return T<6e4?"Just now":T<36e5?`${Math.floor(T/6e4)}m ago`:T<864e5?`${Math.floor(T/36e5)}h ago`:T<6048e5?`${Math.floor(T/864e5)}d ago`:N.toLocaleDateString()};return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[p.jsx(be,{variant:"ghost",size:"icon",onClick:e,children:p.jsx(vx,{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(be,{onClick:()=>h(!0),children:[p.jsx(tl,{className:"h-4 w-4 mr-2"}),"Invite Teammate"]})]}),l&&p.jsxs(Yn,{variant:"destructive",className:"mb-4",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:l})]}),p.jsxs(Qt,{children:[p.jsxs(yn,{children:[p.jsxs(bn,{className:"text-lg flex items-center gap-2",children:[p.jsx(ja,{className:"h-4 w-4"}),"All Users"]}),p.jsx(Fr,{children:"Everyone who has access to this community server"})]}),p.jsx(Zt,{children:o?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(dt,{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(ys,{className:"h-9 w-9",children:p.jsx(bs,{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(lr,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700",children:[p.jsx(Ar,{className:"h-3 w-3"}),"Admin"]}),!!C.is_invited&&p.jsx(lr,{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 ",w(C.last_active)]})]})]})]})]},C.id))})})]}),r.length>0&&p.jsxs(Qt,{className:"mt-4 border-amber-200 bg-amber-50/40",children:[p.jsxs(yn,{children:[p.jsxs(bn,{className:"text-lg flex items-center gap-2",children:[p.jsx(Ar,{className:"h-4 w-4 text-amber-700"}),"Stewards without server access"]}),p.jsx(Fr,{children:"These emails are assigned as stewards on one or more nests, but haven't registered to this server yet — they can't log in or approve anything until they claim an account."})]}),p.jsx(Zt,{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(ys,{className:"h-9 w-9",children:p.jsx(bs,{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 · not registered yet"})]}),p.jsxs(be,{size:"sm",onClick:()=>{g(C),h(!0)},children:[p.jsx(tl,{className:"h-3.5 w-3.5 mr-1"}),"Invite"]})]},C))})})]}),d&&p.jsx($ie,{seedEmail:f,onClose:()=>{h(!1),g("")},onCreated:(C,N)=>{h(!1),g(""),y({email:C,key:N}),v()}}),x&&p.jsx(Vie,{email:x.email,apiKey:x.key,onClose:()=>y(null)})]})}function $ie({seedEmail:e,onClose:t,onCreated:n}){const[r,i]=k.useState(e||""),[o,s]=k.useState(""),[l,u]=k.useState(!1),[d,h]=k.useState(null),f=async g=>{if(g.preventDefault(),!!r.trim()){u(!0),h(null);try{const x=await IP(r,o||void 0);n(r,x.api_key)}catch(x){h(x.message),u(!1)}}};return p.jsx(vn,{open:!0,onOpenChange:t,children:p.jsxs(an,{className:"sm:max-w-[420px]",children:[p.jsxs(un,{children:[p.jsx(cn,{children:"Invite Teammate"}),p.jsx(Qn,{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(Yn,{variant:"destructive",children:[p.jsx(ur,{className:"h-4 w-4"}),p.jsx(Jn,{children:d})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vt,{children:"Email"}),p.jsx(Xn,{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(Vt,{children:"Key label (optional)"}),p.jsx(Xn,{placeholder:"Jane's laptop",value:o,onChange:g=>s(g.target.value)})]}),p.jsxs(cr,{children:[p.jsx(be,{variant:"outline",type:"button",onClick:t,children:"Cancel"}),p.jsx(be,{type:"submit",disabled:l||!r.trim(),children:l?p.jsx(dt,{className:"h-4 w-4 animate-spin"}):"Generate Key"})]})]})]})})}function Vie({email:e,apiKey:t,onClose:n}){const[r,i]=k.useState(!1),o=async()=>{await navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),1500)};return p.jsx(vn,{open:!0,onOpenChange:n,children:p.jsxs(an,{className:"sm:max-w-[520px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{children:["Key created for ",e]}),p.jsxs(Qn,{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(Vt,{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(be,{size:"sm",variant:"outline",onClick:o,children:r?p.jsx(yl,{className:"h-3.5 w-3.5 text-green-600"}):p.jsx(Nc,{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(cr,{children:p.jsx(be,{onClick:n,children:"Done"})})]})})}function Hie({onActivated:e}){const[t,n]=k.useState(""),[r,i]=k.useState(!1),[o,s]=k.useState(null),l=async()=>{const u=t.trim();if(!u.startsWith("pk_")){s("License key must start with pk_");return}s(null),i(!0);try{const d=await RP(u);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(uP,{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(Vt,{htmlFor:"license-key",children:"License key"}),p.jsx(Xn,{id:"license-key","data-testid":"license-setup-key-input",placeholder:"pk_...",value:t,autoFocus:!0,onChange:u=>{n(u.target.value),o&&s(null)},onKeyDown:u=>{u.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(be,{className:"w-full",onClick:l,disabled:r||!t.trim(),"data-testid":"license-setup-submit",children:r?p.jsxs(p.Fragment,{children:[p.jsx(dt,{className:"h-4 w-4 mr-2 animate-spin"}),"Validating..."]}):p.jsxs(p.Fragment,{children:[p.jsx(s3,{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(s1,{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 Uie="/assets/hootie-C2ocYkn4.svg";function Wie(){var K,G;const{authMode:e,logoUrl:t,adminStatus:n,authenticated:r,isAdmin:i,loading:o,error:s,logout:l}=Ss(),[u,d]=k.useState({page:"dashboard"}),[h,f]=k.useState(!1),[g,x]=k.useState(()=>typeof window>"u"?{status:"idle"}:new URLSearchParams(window.location.search).get("nest")?{status:"loading"}:{status:"idle"}),[y,v]=k.useState(null),[w,C]=k.useState(!0),[N,T]=k.useState(!1),[D,A]=k.useState(!1),_=k.useCallback(()=>T(!0),[]),I=k.useCallback(async()=>{A(!0);try{await l(),T(!1),gi.success("Logged out successfully")}finally{A(!1)}},[l]),P=k.useCallback(async()=>{try{const B=await DP();v(B)}catch{v(null)}finally{C(!1)}},[]);k.useEffect(()=>{if(g.status!=="loading")return;const W=new URLSearchParams(window.location.search).get("nest");if(!W){x({status:"missing"});return}(async()=>{try{const{nest:U}=await Zh(W);x({status:"ok",nestId:U.id,nestName:U.name}),d({page:"nest",nestId:U.id,nestName:U.name,isOwner:!1,isAnonOwned:!1})}catch{x({status:"missing"})}})()},[g.status]),k.useEffect(()=>{P();const B=setInterval(P,900*1e3),W=()=>{P()};return window.addEventListener("auth:unauthorized",W),()=>{clearInterval(B),window.removeEventListener("auth:unauthorized",W)}},[P]);const L=((K=n==null?void 0:n.me)==null?void 0:K.email)??null,R=k.useRef(L);if(k.useEffect(()=>{if(R.current===L)return;const B=R.current!==null;R.current=L,B&&d({page:"dashboard"})},[L]),s)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:s}),p.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Check that the community server is running."})]})});if(o||e===null||w||g.status==="loading")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(y&&!y.valid)return p.jsx(Hie,{onActivated:P});const V=p.jsx(p.Fragment,{children:p.jsx(vn,{open:N,onOpenChange:B=>{!B&&!D&&T(!1)},children:p.jsxs(an,{className:"sm:max-w-[400px]",children:[p.jsxs(un,{children:[p.jsxs(cn,{className:"flex items-center gap-2",children:[p.jsx(l3,{className:"h-4 w-4 text-muted-foreground"}),"Log out?"]}),p.jsx(Qn,{children:"You'll be signed out of this browser. Any unsaved edits in other tabs may be lost — save your work first."})]}),p.jsxs(cr,{className:"gap-2",children:[p.jsx(be,{variant:"outline",onClick:()=>T(!1),disabled:D,children:"Cancel"}),p.jsx(be,{variant:"destructive",onClick:I,disabled:D,children:D?"Logging out...":"Log out"})]})]})})});return!r&&e==="key"&&g.status!=="ok"?p.jsxs(p.Fragment,{children:[p.jsx(p8,{}),V]}):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:()=>d({page:"dashboard"}),className:"flex items-center gap-2 hover:opacity-80",children:[p.jsx("img",{src:t??Uie,alt:"ContextNest",className:"h-7 w-7 object-contain"}),p.jsx("span",{className:"font-semibold",children:"ContextNest"}),p.jsx(lr,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:"Community"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[e==="open"&&!(n!=null&&n.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(Vf,{className:"h-3 w-3"}),"Open mode"]}),e==="key"&&!r&&p.jsxs("span",{className:"hidden md:inline-flex items-center gap-1.5 text-xs text-blue-700 bg-blue-50 border border-blue-200 px-2 py-1 rounded",children:[p.jsx(Vf,{className:"h-3 w-3"}),"Public read-only"]}),n!=null&&n.me?p.jsx(qie,{me:n.me,isAdmin:i,onTeammates:()=>d({page:"teammates"}),onLogout:_}):p.jsxs(be,{variant:"outline",size:"sm",onClick:()=>f(!0),children:[p.jsx(Ar,{className:"h-3.5 w-3.5 mr-1"}),"Login"]})]})]})}),p.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-6",children:[u.page==="dashboard"&&p.jsx(aL,{onSelectNest:(B,W,U,Z)=>d({page:"nest",nestId:B,nestName:W,isOwner:U,isAnonOwned:Z})}),u.page==="nest"&&p.jsx(sQ,{nestId:u.nestId,nestName:u.nestName,isOwner:u.isOwner,isAnonOwned:u.isAnonOwned,initialSearch:u.initialSearch,onBack:()=>{if(typeof window<"u"){const B=new URLSearchParams(window.location.search);if(B.has("nest")){B.delete("nest");const W=B.toString();window.history.replaceState({},"",window.location.pathname+(W?`?${W}`:"")+window.location.hash)}}!r&&e==="key"&&x({status:"missing"}),d({page:"dashboard"})},onOpenDocument:B=>d({page:"document",nestId:u.nestId,nestName:u.nestName,nodeId:B,isOwner:u.isOwner,isAnonOwned:u.isAnonOwned})}),u.page==="document"&&(()=>{const B=u,W=Z=>d({page:"document",...Z}),U=Z=>d({page:"nest",nestId:B.nestId,nestName:B.nestName,isOwner:B.isOwner,isAnonOwned:B.isAnonOwned,initialSearch:Z});return p.jsx(Lie,{nestId:B.nestId,nestName:B.nestName,nodeId:B.nodeId,isOwner:B.isOwner,breadcrumb:B.breadcrumb,onBack:()=>{const Z=B.breadcrumb??[];if(Z.length>0){const q=Z[Z.length-1];W({...q,breadcrumb:Z.slice(0,-1)});return}U()},onJumpBreadcrumb:Z=>{const q=B.breadcrumb??[],Y=q[Z];Y&&W({...Y,breadcrumb:q.slice(0,Z)})},onSaved:()=>U(),onNavigateDocument:(Z,q,Y)=>{const j=B.breadcrumb??[],z=Z===B.nestId;if(Z===B.nestId&&q===B.nodeId)return;const ee=j.findIndex(ce=>ce.nestId===Z&&ce.nodeId===q);if(ee!==-1){W({nestId:Z,nestName:z?B.nestName:"Document",nodeId:q,isOwner:z?B.isOwner:!1,isAnonOwned:z?B.isAnonOwned:!1,breadcrumb:j.slice(0,ee)});return}const O=B.nodeId!=="new"?[...j,{nestId:B.nestId,nestName:B.nestName,nodeId:B.nodeId,title:(Y==null?void 0:Y.trim())||"Untitled",isOwner:B.isOwner,isAnonOwned:B.isAnonOwned}]:j;W({nestId:Z,nestName:z?B.nestName:"Document",nodeId:q,isOwner:z?B.isOwner:!1,isAnonOwned:z?B.isAnonOwned:!1,breadcrumb:O})},onTagClick:Z=>U(Z),onCreateDocument:(Z,q)=>W({nestId:Z,nestName:B.nestName,nodeId:"new",isOwner:B.isOwner,isAnonOwned:B.isAnonOwned,initialTitle:q}),initialTitle:B.initialTitle},`${B.nestId}/${B.nodeId}`)})(),u.page==="teammates"&&p.jsx(Bie,{onBack:()=>d({page:"dashboard"})})]}),h&&p.jsx(zie,{existingAdmin:((G=n==null?void 0:n.admin)==null?void 0:G.email)||null,onClose:()=>f(!1)}),V]})}function qie({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(vT,{children:[p.jsx(wT,{asChild:!0,children:p.jsxs(be,{variant:"ghost",size:"sm",className:"group h-9 gap-2 px-2","data-testid":"user-menu-trigger",children:[p.jsx(ys,{className:"h-[1.8rem] w-[1.8rem] rounded-sm shrink-0",children:p.jsx(bs,{className:"rounded-sm",children:o})}),p.jsx("span",{className:"hidden sm:inline max-w-[140px] truncate text-sm font-medium",children:i}),p.jsx(wx,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),p.jsxs(ly,{align:"end",className:"min-w-56",children:[p.jsxs("div",{className:"flex items-center gap-2 p-2",children:[p.jsx(ys,{className:"h-8 w-8 rounded-sm shrink-0",children:p.jsx(bs,{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(lr,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700 text-[10px] px-1.5 py-0",children:[p.jsx(Ar,{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(N1,{}),p.jsxs(oc,{onSelect:n,className:"cursor-pointer",children:[p.jsx(ja,{className:"h-3.5 w-3.5 mr-2"}),"Teammates"]})]}),p.jsx(N1,{}),p.jsxs(oc,{onSelect:r,className:"cursor-pointer text-red-600 focus:text-red-700","data-testid":"user-menu-logout",children:[p.jsx(l3,{className:"h-3.5 w-3.5 mr-2"}),"Logout"]})]})]})}class Kie extends k.Component{constructor(){super(...arguments);Qw(this,"state",{error:null,info:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[ui] render crash:",n,r.componentStack),this.setState({info:r})}render(){const{error:n,info:r}=this.state;return n?p.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:p.jsxs("div",{className:"max-w-2xl w-full space-y-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-lg font-semibold text-destructive",children:"Something broke while rendering this page"}),p.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"The error below was caught by the app instead of leaving a blank screen. Copy it when reporting the problem."})]}),p.jsx("pre",{className:"text-xs bg-muted rounded-md p-3 overflow-auto max-h-40 whitespace-pre-wrap",children:n.message}),(r==null?void 0:r.componentStack)&&p.jsxs("details",{className:"text-xs",children:[p.jsx("summary",{className:"cursor-pointer text-muted-foreground",children:"Component stack"}),p.jsx("pre",{className:"mt-2 bg-muted rounded-md p-3 overflow-auto max-h-60 whitespace-pre-wrap",children:r.componentStack})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("button",{type:"button",onClick:()=>this.setState({error:null,info:null}),className:"px-3 py-1.5 rounded-md border text-sm hover:bg-muted",children:"Try again"}),p.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"px-3 py-1.5 rounded-md border text-sm hover:bg-muted",children:"Reload"})]})]})}):this.props.children}}uD.createRoot(document.getElementById("root")).render(p.jsx(de.StrictMode,{children:p.jsx(Kie,{children:p.jsxs(h8,{children:[p.jsx(Wie,{}),p.jsx(OD,{richColors:!0,position:"bottom-right"})]})})}));
|